Wrote some missing tests (#7094)

This commit is contained in:
Eduardo Quezada 2025-06-11 03:13:37 -04:00 committed by GitHub
parent 7ef781e9e0
commit 393bed069a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 65 additions and 8 deletions

View File

@ -1,7 +1,7 @@
#include "global.h"
#include "test/battle.h"
TO_DO_BATTLE_TEST("Acupressure increases one of two stats by 2 stages at random");
TO_DO_BATTLE_TEST("Acupressure increases one of its stats by 2 stages at random");
TO_DO_BATTLE_TEST("Acupressure doesn't try to increase a stat that has been maximized");
TO_DO_BATTLE_TEST("Acupressure fails on the user if all of its stats are maximized");
TO_DO_BATTLE_TEST("Acupressure fails on the ally if all of its stats are maximized");

View File

@ -1,4 +0,0 @@
#include "global.h"
#include "test/battle.h"
TO_DO_BATTLE_TEST("Blizzard ignores accuracy check durin Hail and Snow");

View File

@ -1,4 +1,22 @@
#include "global.h"
#include "test/battle.h"
TO_DO_BATTLE_TEST("Bulk Up increases the user's Attack and Defense");
ASSUMPTIONS
{
ASSUME(GetMoveEffect(MOVE_BULK_UP) == EFFECT_BULK_UP);
}
SINGLE_BATTLE_TEST("Bulk Up increases the user's Attack and Defense by 1 stage each")
{
GIVEN {
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(player, MOVE_BULK_UP); }
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_BULK_UP, player);
} THEN {
EXPECT_EQ(player->statStages[STAT_ATK], DEFAULT_STAT_STAGE + 1);
EXPECT_EQ(player->statStages[STAT_DEF], DEFAULT_STAT_STAGE + 1);
}
}

View File

@ -1,4 +1,22 @@
#include "global.h"
#include "test/battle.h"
TO_DO_BATTLE_TEST("Calm Mind increases the user's Sp. Attack and Sp. Defense by 1 stage each");
ASSUMPTIONS
{
ASSUME(GetMoveEffect(MOVE_CALM_MIND) == EFFECT_CALM_MIND);
}
SINGLE_BATTLE_TEST("Calm Mind increases the user's Sp. Attack and Sp. Defense by 1 stage each")
{
GIVEN {
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(player, MOVE_CALM_MIND); }
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_CALM_MIND, player);
} THEN {
EXPECT_EQ(player->statStages[STAT_SPATK], DEFAULT_STAT_STAGE + 1);
EXPECT_EQ(player->statStages[STAT_SPDEF], DEFAULT_STAT_STAGE + 1);
}
}

View File

@ -1,4 +1,28 @@
#include "global.h"
#include "test/battle.h"
TO_DO_BATTLE_TEST("Expanding Force's power increases by 50% if the user is affected by Psychic Terrain");
SINGLE_BATTLE_TEST("Expanding Force's power increases by 50% if the user is affected by Psychic Terrain", s16 damage)
{
bool32 terrain;
PARAMETRIZE { terrain = FALSE; }
PARAMETRIZE { terrain = TRUE; }
GIVEN {
ASSUME(GetMoveEffect(MOVE_EXPANDING_FORCE) == EFFECT_EXPANDING_FORCE);
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
if (terrain)
TURN { MOVE(player, MOVE_PSYCHIC_TERRAIN); }
TURN { MOVE(player, MOVE_EXPANDING_FORCE); }
} SCENE {
MESSAGE("Wobbuffet used Expanding Force!");
HP_BAR(opponent, captureDamage: &results[i].damage);
} FINALLY {
if (B_TERRAIN_TYPE_BOOST >= GEN_8)
// 1.3 Terrain boost x 1.5 effect boost = 1.95 boost
EXPECT_MUL_EQ(results[0].damage, Q_4_12(1.95), results[1].damage);
else
// 1.5 Terrain boost x 1.5 effect boost = 2.25 boost
EXPECT_MUL_EQ(results[0].damage, Q_4_12(2.25), results[1].damage);
}
}

View File

@ -6,6 +6,7 @@ SINGLE_BATTLE_TEST("Blizzard bypasses accuracy checks in Hail and Snow")
u32 move;
PARAMETRIZE { move = MOVE_HAIL; }
PARAMETRIZE { move = MOVE_SNOWSCAPE; }
PASSES_RANDOMLY(100, 100, RNG_ACCURACY);
GIVEN {
ASSUME(GetMoveAccuracy(MOVE_BLIZZARD) == 70);
ASSUME(MoveAlwaysHitsInHailSnow(MOVE_BLIZZARD));