PARAMETRIZE_LABEL now supports multiple args (#9206)

This commit is contained in:
Eduardo Quezada 2026-03-14 12:43:43 -03:00 committed by GitHub
parent eada46a5ed
commit 4c3ff3979c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 7 deletions

View File

@ -259,7 +259,7 @@ static inline struct Benchmark BenchmarkStop(void)
#define PARAMETRIZE if (gFunctionTestRunnerState->parameters++ == gFunctionTestRunnerState->runParameter) #define PARAMETRIZE if (gFunctionTestRunnerState->parameters++ == gFunctionTestRunnerState->runParameter)
#define PARAMETRIZE_LABEL(f, label) if (gFunctionTestRunnerState->parameters++ == gFunctionTestRunnerState->runParameter && (Test_MgbaPrintf(":N%s: " f " (%d/%d)", gTestRunnerState.test->name, label, gFunctionTestRunnerState->runParameter + 1, gFunctionTestRunnerState->parameters), 1)) #define PARAMETRIZE_LABEL(f, ...) if (gFunctionTestRunnerState->parameters++ == gFunctionTestRunnerState->runParameter && (Test_MgbaPrintf(":N%s: (%d/%d) " f, gTestRunnerState.test->name, gFunctionTestRunnerState->runParameter + 1, gFunctionTestRunnerState->parameters, __VA_ARGS__), 1))
#define SET_RNG(tag, value) SetupRiggedRng(__LINE__, tag, value) #define SET_RNG(tag, value) SetupRiggedRng(__LINE__, tag, value)

View File

@ -13,7 +13,7 @@ TEST("Form species ID tables are shared between all forms")
{ {
if (gSpeciesInfo[i].formSpeciesIdTable) if (gSpeciesInfo[i].formSpeciesIdTable)
{ {
PARAMETRIZE_LABEL("%S", gSpeciesInfo[i].speciesName) { species = i; } PARAMETRIZE_LABEL("ID:%d - %S", i, gSpeciesInfo[i].speciesName) { species = i; }
} }
} }
@ -36,7 +36,7 @@ TEST("Form change tables contain only forms in the form species ID table")
{ {
if (gSpeciesInfo[i].formChangeTable) if (gSpeciesInfo[i].formChangeTable)
{ {
PARAMETRIZE_LABEL("%S", gSpeciesInfo[i].speciesName) { species = i; } PARAMETRIZE_LABEL("ID:%d - %S", i, gSpeciesInfo[i].speciesName) { species = i; }
} }
} }
@ -71,7 +71,7 @@ TEST("Forms have the appropriate species form changes")
|| gSpeciesInfo[i].isUltraBurst || gSpeciesInfo[i].isUltraBurst
|| gSpeciesInfo[i].isPrimalReversion) || gSpeciesInfo[i].isPrimalReversion)
{ {
PARAMETRIZE_LABEL("%S", gSpeciesInfo[i].speciesName) { species = i; } PARAMETRIZE_LABEL("ID:%d - %S", i, gSpeciesInfo[i].speciesName) { species = i; }
} }
} }
bool32 hasBattleEnd = FALSE, hasFaint = FALSE; bool32 hasBattleEnd = FALSE, hasFaint = FALSE;
@ -111,7 +111,7 @@ TEST("Form change targets have the appropriate species flags")
{ {
if (gSpeciesInfo[i].formChangeTable) if (gSpeciesInfo[i].formChangeTable)
{ {
PARAMETRIZE_LABEL("%S", gSpeciesInfo[i].speciesName) { species = i; } PARAMETRIZE_LABEL("ID:%d - %S", i, gSpeciesInfo[i].speciesName) { species = i; }
} }
} }
@ -148,7 +148,8 @@ TEST("No species has two evolutions that use the evolution tracker")
for (i = 0; i < NUM_SPECIES; i++) for (i = 0; i < NUM_SPECIES; i++)
{ {
if (IsSpeciesEnabled(i) && GetSpeciesEvolutions(i) != NULL) PARAMETRIZE { species = i; } if (IsSpeciesEnabled(i) && GetSpeciesEvolutions(i) != NULL)
PARAMETRIZE_LABEL("ID:%d - %S", i, GetSpeciesName(i)) { species = i; }
} }
evolutionTrackerEvolutions = 0; evolutionTrackerEvolutions = 0;
@ -190,7 +191,7 @@ TEST("Every species has a description")
for (i = 1; i < NUM_SPECIES; i++) for (i = 1; i < NUM_SPECIES; i++)
{ {
if (IsSpeciesEnabled(i)) if (IsSpeciesEnabled(i))
PARAMETRIZE { species = i; } PARAMETRIZE_LABEL("ID:%d - %S", i, GetSpeciesName(i)) { species = i; }
} }
EXPECT_NE(StringCompare(GetSpeciesPokedexDescription(species), gFallbackPokedexText), 0); EXPECT_NE(StringCompare(GetSpeciesPokedexDescription(species), gFallbackPokedexText), 0);