From 2654304d6a88215cd53454680ae705e4b09d7965 Mon Sep 17 00:00:00 2001 From: LoRd_MuldeR Date: Sun, 18 Dec 2016 22:38:35 +0100 Subject: [PATCH] Simplified next_random() tests. --- test/src/GlobalTest.cpp | 26 +++++--------------------- 1 file changed, 5 insertions(+), 21 deletions(-) diff --git a/test/src/GlobalTest.cpp b/test/src/GlobalTest.cpp index 40390dd..e658f6b 100644 --- a/test/src/GlobalTest.cpp +++ b/test/src/GlobalTest.cpp @@ -51,31 +51,15 @@ protected: // Random //----------------------------------------------------------------- -#define TEST_RANDOM_MAX 99991 +#define TEST_RANDOM_MAX 29989 #define TEST_RANDOM(X,Y) do \ { \ - MUtils::seed_rand(); \ QSet test; \ - int attempts = 0; \ - while(test.count() != TEST_RANDOM_MAX) \ - { \ - if(++attempts <= 64) \ - { \ - if(attempts > 1) \ - { \ - MUtils::OS::sleep_ms(1); \ - } \ - test.clear(); \ - for (size_t i = 0; i < TEST_RANDOM_MAX; ++i) \ - { \ - test.insert(MUtils::next_rand_##Y()); \ - } \ - } \ - else \ - { \ - FAIL(); /*too many attempts!*/ \ - } \ + for (size_t i = 0; i < TEST_RANDOM_MAX; ++i) \ + { \ + test.insert(MUtils::next_rand_##Y()); \ } \ + ASSERT_EQ(test.count(), TEST_RANDOM_MAX); \ } \ while(0) -- 2.11.4.GIT