Skip to content

Commit

Permalink
Add trainer class ball test (#4999)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bassoonian authored Jul 19, 2024
1 parent 296bd05 commit f2311b4
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions test/battle/trainer_control.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,3 +144,50 @@ TEST("ModifyPersonalityForNature can set any nature")
ModifyPersonalityForNature(&personality, nature);
EXPECT_EQ(GetNatureFromPersonality(personality), nature);
}

static const struct TrainerMon sTestParty2[] =
{
{
.species = SPECIES_WYNAUT,
.lvl = 5,
},
{
.species = SPECIES_WYNAUT,
.lvl = 5,
},
{
.species = SPECIES_WYNAUT,
.lvl = 5,
},
{
.species = SPECIES_WYNAUT,
.lvl = 5,
},
{
.species = SPECIES_WYNAUT,
.lvl = 5,
},
{
.species = SPECIES_WYNAUT,
.lvl = 5,
},
};

static const struct Trainer sTestTrainer2 =
{
.trainerName = _("Test2"),
.trainerClass = TRAINER_CLASS_BLACK_BELT,
.party = TRAINER_PARTY(sTestParty2),
};

TEST("Trainer Class Balls apply to the entire party")
{
u32 j;
struct Pokemon *testParty = Alloc(6 * sizeof(struct Pokemon));
CreateNPCTrainerPartyFromTrainer(testParty, &sTestTrainer2, TRUE, BATTLE_TYPE_TRAINER);
for(j = 0; j < 6; j++)
{
EXPECT(GetMonData(&testParty[j], MON_DATA_POKEBALL, 0) == gTrainerClasses[sTestTrainer2.trainerClass].ball);
}
Free(testParty);
}

0 comments on commit f2311b4

Please sign in to comment.