Fixes tests rng (#3433)

* Seed RNG before setUp

Co-authored-by: Martin Griffin <martinrgriffin@gmail.com>
This commit is contained in:
Alex 2023-10-22 11:20:27 +02:00 committed by GitHub
parent 0a6c0261fe
commit 8ab2fbd9a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -6,7 +6,7 @@
// Therefore the maximum error is 8*3584, or 28672.
#define SHUFFLE_TEST_IMPL \
u32 i, j, error; \
u16 indexSum[7]; \
u16 indexSum[8]; \
memset(indexSum, 0, sizeof(indexSum)); \
for (i = 0; i < 1024; i++) \
{ \

View File

@ -201,6 +201,8 @@ void CB2_TestRunner(void)
case STATE_RUN_TEST:
gTestRunnerState.state = STATE_REPORT_RESULT;
sCurrentTest.state = CURRENT_TEST_STATE_RUN;
SeedRng(0);
SeedRng2(0);
if (gTestRunnerState.test->runner->setUp)
gTestRunnerState.test->runner->setUp(gTestRunnerState.test->data);
// NOTE: Assumes that the compiler interns __FILE__.