mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2025-01-13 15:13:42 +01:00
At most one PASSES_RANDOMLY (#3065)
This commit is contained in:
parent
186d8763ea
commit
97bc8e4689
@ -844,9 +844,14 @@ void TestRunner_Battle_AfterLastTurn(void)
|
|||||||
static void CB2_BattleTest_NextParameter(void)
|
static void CB2_BattleTest_NextParameter(void)
|
||||||
{
|
{
|
||||||
if (++STATE->runParameter >= STATE->parameters)
|
if (++STATE->runParameter >= STATE->parameters)
|
||||||
|
{
|
||||||
SetMainCallback2(CB2_TestRunner);
|
SetMainCallback2(CB2_TestRunner);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
STATE->trials = 0;
|
||||||
BattleTest_Run(gTestRunnerState.test->data);
|
BattleTest_Run(gTestRunnerState.test->data);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void CB2_BattleTest_NextTrial(void)
|
static void CB2_BattleTest_NextTrial(void)
|
||||||
@ -942,6 +947,7 @@ static bool32 BattleTest_HandleExitWithResult(void *data, enum TestResult result
|
|||||||
void Randomly(u32 sourceLine, u32 passes, u32 trials, struct RandomlyContext ctx)
|
void Randomly(u32 sourceLine, u32 passes, u32 trials, struct RandomlyContext ctx)
|
||||||
{
|
{
|
||||||
const struct BattleTest *test = gTestRunnerState.test->data;
|
const struct BattleTest *test = gTestRunnerState.test->data;
|
||||||
|
INVALID_IF(STATE->trials != 0, "PASSES_RANDOMLY can only be used once per test");
|
||||||
INVALID_IF(test->resultsSize > 0, "PASSES_RANDOMLY is incompatible with results");
|
INVALID_IF(test->resultsSize > 0, "PASSES_RANDOMLY is incompatible with results");
|
||||||
INVALID_IF(passes > trials, "%d passes specified, but only %d trials", passes, trials);
|
INVALID_IF(passes > trials, "%d passes specified, but only %d trials", passes, trials);
|
||||||
STATE->rngTag = ctx.tag;
|
STATE->rngTag = ctx.tag;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user