OSDN Git Service
(root)
/
mutilities
/
MUtilities.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
751e0f6
)
Simplified next_random() tests.
author
LoRd_MuldeR
<mulder2@gmx.de>
Sun, 18 Dec 2016 21:38:35 +0000
(22:38 +0100)
committer
LoRd_MuldeR
<mulder2@gmx.de>
Sun, 18 Dec 2016 21:38:35 +0000
(22:38 +0100)
test/src/GlobalTest.cpp
patch
|
blob
|
history
diff --git
a/test/src/GlobalTest.cpp
b/test/src/GlobalTest.cpp
index
40390dd
..
e658f6b
100644
(file)
--- a/
test/src/GlobalTest.cpp
+++ b/
test/src/GlobalTest.cpp
@@
-51,31
+51,15
@@
protected:
// Random
//-----------------------------------------------------------------
// Random
//-----------------------------------------------------------------
-#define TEST_RANDOM_MAX
99991
+#define TEST_RANDOM_MAX
29989
#define TEST_RANDOM(X,Y) do \
{ \
#define TEST_RANDOM(X,Y) do \
{ \
- MUtils::seed_rand(); \
QSet<X> test; \
QSet<X> 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)
} \
while(0)