aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2021-11-09 10:31:18 +0000
committerJonathan Wakely <jwakely@redhat.com>2021-11-09 14:40:33 +0000
commit8d2d0a6c4391e462555db6d33b2cc00f3da0932f (patch)
treef1cafb56f14d44429d04a8a76932ee02bf0c800a /libstdc++-v3
parent0318df0ae63e47f6b2f30e96205d00dcb3696538 (diff)
downloadgcc-8d2d0a6c4391e462555db6d33b2cc00f3da0932f.zip
gcc-8d2d0a6c4391e462555db6d33b2cc00f3da0932f.tar.gz
gcc-8d2d0a6c4391e462555db6d33b2cc00f3da0932f.tar.bz2
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.
Diffstat (limited to 'libstdc++-v3')
-rw-r--r--libstdc++-v3/testsuite/26_numerics/random/random_device/cons/token.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/libstdc++-v3/testsuite/26_numerics/random/random_device/cons/token.cc b/libstdc++-v3/testsuite/26_numerics/random/random_device/cons/token.cc
index d6ac3a3..07713e5 100644
--- a/libstdc++-v3/testsuite/26_numerics/random/random_device/cons/token.cc
+++ b/libstdc++-v3/testsuite/26_numerics/random/random_device/cons/token.cc
@@ -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
}