From ab32194e91b298cfffd67c8e1215b9f4f20dbb03 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Fri, 26 Jun 2015 18:28:05 +0200 Subject: [PATCH] Initialize pseudo-random number generator only once when starting the tests (in propgrid sample). --- samples/propgrid/tests.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/samples/propgrid/tests.cpp b/samples/propgrid/tests.cpp index 16cea08029..3a966235ad 100644 --- a/samples/propgrid/tests.cpp +++ b/samples/propgrid/tests.cpp @@ -334,6 +334,8 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) pgman->ClearSelection(); + srand((unsigned int)(time(NULL) % UINT_MAX)); + int failures = 0; bool _failed_ = false; wxArrayString errorMessages; @@ -1233,8 +1235,6 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) wxPropertyGridPage* page = pgman->GetPage(0); - srand(0x1234); - wxArrayPGProperty arr1; arr1 = GetPropertiesInRandomOrder(page); @@ -1346,9 +1346,6 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) { RT_START_TEST(SetFlagsAsString and GetFlagsAsString) - unsigned int seed = time(NULL) % UINT_MAX; - srand(seed); - // Select the most error prone page as visible. pgman->SelectPage(1);