Skip to content

Commit

Permalink
Add evolution tracker check tests (#4771)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bassoonian authored Jun 12, 2024
1 parent 000f144 commit 4165192
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions test/species.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,47 @@ TEST("Form change targets have the appropriate species flags")
}
}
}

TEST("No species has two evolutions that use the evolution tracker")
{
u32 i;
u32 species = SPECIES_NONE;
u32 evolutionTrackerEvolutions;
bool32 hasGenderBasedRecoil;
const struct Evolution *evolutions;

for (i = 0; i < NUM_SPECIES; i++)
{
if (GetSpeciesEvolutions(i) != NULL) PARAMETRIZE { species = i; }
}

evolutionTrackerEvolutions = 0;
hasGenderBasedRecoil = FALSE;
evolutions = GetSpeciesEvolutions(species);

for (i = 0; evolutions[i].method != EVOLUTIONS_END; i++)
{
if (evolutions[i].method == EVO_LEVEL_MOVE_TWENTY_TIMES
#ifdef EVO_DEFEAT_WITH_ITEM
|| evolutions[i].method == EVO_DEFEAT_WITH_ITEM
#endif //EVO_DEFEAT_WITH_ITEM
#ifdef EVO_OVERWORLD_STEPS
|| evolutions[i].method == EVO_OVERWORLD_STEPS
#endif //EVO_OVERWORLD_STEPS
)
evolutionTrackerEvolutions++;

if (evolutions[i].method == EVO_LEVEL_RECOIL_DAMAGE_MALE
|| evolutions[i].method == EVO_LEVEL_RECOIL_DAMAGE_FEMALE)
{
// Special handling for these since they can be combined as the evolution tracker field is used for the same purpose
if (!hasGenderBasedRecoil)
{
hasGenderBasedRecoil = TRUE;
evolutionTrackerEvolutions++;
}
}
}

EXPECT(evolutionTrackerEvolutions < 2);
}

0 comments on commit 4165192

Please sign in to comment.