From 8ab2fbd9a2b2ae7b3ca5f319567577ede7a0bf2b Mon Sep 17 00:00:00 2001 From: Alex <93446519+AlexOn1ine@users.noreply.github.com> Date: Sun, 22 Oct 2023 11:20:27 +0200 Subject: [PATCH] Fixes tests rng (#3433) * Seed RNG before setUp Co-authored-by: Martin Griffin --- test/random.c | 2 +- test/test_runner.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/test/random.c b/test/random.c index 5ca4b814df..80b86745f2 100644 --- a/test/random.c +++ b/test/random.c @@ -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++) \ { \ diff --git a/test/test_runner.c b/test/test_runner.c index 7ca66ec081..0ae4f0a185 100644 --- a/test/test_runner.c +++ b/test/test_runner.c @@ -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__.