Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add known failing learnset cap test #6046

Merged
merged 1 commit into from
Jan 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions include/constants/pokemon.h
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@
#define LEVEL_UP_MOVE_END 0xFFFF

#define MAX_LEVEL_UP_MOVES 20
#define MAX_RELEARNER_MOVES max(MAX_LEVEL_UP_MOVES, 25)

#define MON_MALE 0x00
#define MON_FEMALE 0xFE
Expand Down
2 changes: 0 additions & 2 deletions src/move_relearner.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,6 @@ enum {
#define GFXTAG_UI 5525
#define PALTAG_UI 5526

#define MAX_RELEARNER_MOVES max(MAX_LEVEL_UP_MOVES, 25)

static EWRAM_DATA struct
{
u8 state;
Expand Down
20 changes: 20 additions & 0 deletions test/pokemon.c
Original file line number Diff line number Diff line change
Expand Up @@ -399,3 +399,23 @@ TEST("createmon [simple]")
EXPECT_EQ(GetMonData(&gEnemyParty[1], MON_DATA_SPECIES), SPECIES_WYNAUT);
EXPECT_EQ(GetMonData(&gEnemyParty[1], MON_DATA_LEVEL), 10);
}

TEST("Pokémon level up learnsets fit within MAX_LEVEL_UP_MOVES and MAX_RELEARNER_MOVES")
{
KNOWN_FAILING;

u32 j, count, species = 0;
const struct LevelUpMove *learnset;

for(j = 0; j < SPECIES_EGG; j++)
{
PARAMETRIZE { species = j; }
}

learnset = GetSpeciesLevelUpLearnset(species);
count = 0;
for (j = 0; learnset[j].move != LEVEL_UP_MOVE_END; j++)
count++;
EXPECT_LT(count, MAX_LEVEL_UP_MOVES);
EXPECT_LT(count, MAX_RELEARNER_MOVES - 1); // - 1 because at least one move is already known
}
Loading