Renamed TEST_RESULT_SKIP to TEST_RESULT_ASSUMPTION_FAIL

This commit is contained in:
Eduardo Quezada 2023-03-08 08:26:33 -03:00
parent e3ed114754
commit eb49e28e6c
3 changed files with 7 additions and 7 deletions

View File

@ -9,7 +9,7 @@ enum TestResult
{
TEST_RESULT_FAIL,
TEST_RESULT_PASS,
TEST_RESULT_SKIP,
TEST_RESULT_ASSUMPTION_FAIL,
TEST_RESULT_INVALID,
TEST_RESULT_ERROR,
TEST_RESULT_TIMEOUT,
@ -77,7 +77,7 @@ s32 MgbaPrintf_(const char *fmt, ...);
do \
{ \
if (!(c)) \
Test_ExitWithResult(TEST_RESULT_SKIP, "%s:%d: ASSUME failed", gTestRunnerState.test->filename, __LINE__); \
Test_ExitWithResult(TEST_RESULT_ASSUMPTION_FAIL, "%s:%d: ASSUME failed", gTestRunnerState.test->filename, __LINE__); \
} while (0)
#define EXPECT(c) \

View File

@ -121,7 +121,7 @@ void CB2_TestRunner(void)
// NOTE: Assumes that the compiler interns __FILE__.
if (gTestRunnerState.skipFilename == gTestRunnerState.test->filename)
{
gTestRunnerState.result = TEST_RESULT_SKIP;
gTestRunnerState.result = TEST_RESULT_ASSUMPTION_FAIL;
}
else
{
@ -157,7 +157,7 @@ void CB2_TestRunner(void)
color = "\e[32m";
MgbaPrintf_(":N%s", gTestRunnerState.test->name);
}
else if (gTestRunnerState.result != TEST_RESULT_SKIP || gTestRunnerSkipIsFail)
else if (gTestRunnerState.result != TEST_RESULT_ASSUMPTION_FAIL || gTestRunnerSkipIsFail)
{
gTestRunnerState.exitCode = 1;
color = "\e[31m";
@ -187,7 +187,7 @@ void CB2_TestRunner(void)
}
break;
case TEST_RESULT_PASS: result = "PASS"; break;
case TEST_RESULT_SKIP:
case TEST_RESULT_ASSUMPTION_FAIL:
result = "ASSUMPTION_FAIL";
color = "\e[33m";
break;
@ -199,7 +199,7 @@ void CB2_TestRunner(void)
if (gTestRunnerState.result == TEST_RESULT_PASS)
MgbaPrintf_(":P%s%s\e[0m", color, result);
else if (gTestRunnerState.result == TEST_RESULT_SKIP)
else if (gTestRunnerState.result == TEST_RESULT_ASSUMPTION_FAIL)
MgbaPrintf_(":A%s%s\e[0m", color, result);
else if (gTestRunnerState.expectedResult == gTestRunnerState.result)
MgbaPrintf_(":K%s%s\e[0m", color, result);

View File

@ -720,7 +720,7 @@ static void CB2_BattleTest_NextTrial(void)
case TEST_RESULT_PASS:
STATE->observedPasses++;
break;
case TEST_RESULT_SKIP:
case TEST_RESULT_ASSUMPTION_FAIL:
STATE->skippedTrials++;
if (STATE->skippedTrials > STATE->trials / 4)
Test_ExitWithResult(TEST_RESULT_INVALID, "25%% of the trials were SKIPed");