libstdc++: Make spurious std::random_device FAIL less likely
It's possible that independent reads from /dev/random and /dev/urandom could produce the same value by chance. Retry if that happens. The chances of it happening twice are miniscule. libstdc++-v3/ChangeLog: * testsuite/26_numerics/random/random_device/cons/token.cc: Retry if random devices produce the same value.
This commit is contained in:
parent
0318df0ae6
commit
8d2d0a6c43
1 changed files with 1 additions and 1 deletions
|
@ -42,7 +42,7 @@ test02()
|
|||
#ifdef _GLIBCXX_USE_DEV_RANDOM
|
||||
std::random_device x1("/dev/urandom");
|
||||
std::random_device x2("/dev/random");
|
||||
VERIFY( x1() != x2() );
|
||||
VERIFY( x1() != x2() || x1() != x2() );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue