Add comment about randomOrder and random seed
This commit is contained in:
@@ -551,6 +551,13 @@ int SDLTest_RunSuites(SDLTest_TestSuiteReference *testSuites[], const char *user
|
|||||||
int tmp;
|
int tmp;
|
||||||
a = SDLTest_RandomIntegerInRange(0, nbSuites - 1);
|
a = SDLTest_RandomIntegerInRange(0, nbSuites - 1);
|
||||||
b = 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 */
|
/* Swap */
|
||||||
if (randomOrder) {
|
if (randomOrder) {
|
||||||
tmp = arraySuites[b];
|
tmp = arraySuites[b];
|
||||||
@@ -602,6 +609,7 @@ int SDLTest_RunSuites(SDLTest_TestSuiteReference *testSuites[], const char *user
|
|||||||
a = SDLTest_RandomIntegerInRange(0, nbTestCases - 1);
|
a = SDLTest_RandomIntegerInRange(0, nbTestCases - 1);
|
||||||
b = SDLTest_RandomIntegerInRange(0, nbTestCases - 1);
|
b = SDLTest_RandomIntegerInRange(0, nbTestCases - 1);
|
||||||
/* Swap */
|
/* Swap */
|
||||||
|
/* See previous note */
|
||||||
if (randomOrder) {
|
if (randomOrder) {
|
||||||
tmp = arrayTestCases[b];
|
tmp = arrayTestCases[b];
|
||||||
arrayTestCases[b] = arrayTestCases[a];
|
arrayTestCases[b] = arrayTestCases[a];
|
||||||
|
|||||||
Reference in New Issue
Block a user