Add known failing learnset cap test (#6046)

This commit is contained in:
Bassoonian 2025-01-18 03:04:46 +01:00 committed by GitHub
parent 17e224343f
commit 199760a6d3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 21 additions and 2 deletions

View File

@ -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

View File

@ -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;

View File

@ -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
}