]> gcc.gnu.org Git - gcc.git/commit
libstdc++: Fix test that fails randomly [PR101866]
authorJonathan Wakely <jwakely@redhat.com>
Wed, 11 Aug 2021 21:11:19 +0000 (22:11 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Wed, 11 Aug 2021 22:39:34 +0000 (23:39 +0100)
commit93f1dbc7cdcc4b31ea4061efb4c2acf2d4f81eb8
tree9d6b82308d1dc545c306af1fe79dbcde90f0a0fc
parent873273449a944d7796d08ce6fae06eabcab7bf65
libstdc++: Fix test that fails randomly [PR101866]

This test assumes that the same sequence of three values cannot occur,
which is incorect. It's unlikely, but not impossible.

Perform the check in a loop, so that in the unlikely event of an
identical sequence, we retry. If the library code is buggy it will keep
producing the same sequence and the test will time out. If the code is
working correctly then we will usually break out of the loop after one
iteration, or very rarely after two or three.

libstdc++-v3/ChangeLog:

PR libstdc++/101866
* testsuite/experimental/random/randint.cc: Loop and retry if
reseed() produces the same sequence.
libstdc++-v3/testsuite/experimental/random/randint.cc
This page took 0.056827 seconds and 6 git commands to generate.