mirror of
https://github.com/libsdl-org/SDL.git
synced 2024-11-27 05:43:29 +08:00
Add comment about randomOrder and random seed
This commit is contained in:
parent
b5b868044f
commit
bd7d4a3752
@ -551,6 +551,13 @@ int SDLTest_RunSuites(SDLTest_TestSuiteReference *testSuites[], const char *user
|
||||
int tmp;
|
||||
a = SDLTest_RandomIntegerInRange(0, nbSuites - 1);
|
||||
b = SDLTest_RandomIntegerInRange(0, nbSuites - 1);
|
||||
/*
|
||||
* NB: prevent swapping here to make sure the tests start with the same
|
||||
* random seed (whether they are run in order or not).
|
||||
* So we consume same number of SDLTest_RandomIntegerInRange() in all cases.
|
||||
*
|
||||
* If some random value were used at initialization before the tests start, the --seed wouldn't do the same with or without randomOrder.
|
||||
*/
|
||||
/* Swap */
|
||||
if (randomOrder) {
|
||||
tmp = arraySuites[b];
|
||||
@ -602,6 +609,7 @@ int SDLTest_RunSuites(SDLTest_TestSuiteReference *testSuites[], const char *user
|
||||
a = SDLTest_RandomIntegerInRange(0, nbTestCases - 1);
|
||||
b = SDLTest_RandomIntegerInRange(0, nbTestCases - 1);
|
||||
/* Swap */
|
||||
/* See previous note */
|
||||
if (randomOrder) {
|
||||
tmp = arrayTestCases[b];
|
||||
arrayTestCases[b] = arrayTestCases[a];
|
||||
|
Loading…
Reference in New Issue
Block a user