-
-
Notifications
You must be signed in to change notification settings - Fork 427
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixing problems with remove_copy algorithm tests #1601
Conversation
auto middle = boost::begin(c) + c.size()/2; | ||
std::iota(boost::begin(c), middle, std::rand()); | ||
auto middle = boost::begin(c) + std::rand() % (c.size()/2); | ||
std::iota(boost::begin(c), middle, static_cast<int>(std::rand() % c.size())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to make sure I understand the changes: Was the problem that std::iota was occasionally being given too large a value from std::rand()? And is line 26 changed just so that a random value from the 0th position to the 5003rd position is chosen instead of just the 5003rd position?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The first change (line 26) does not really fix anything, but rather increases the randomness of the tests by modifying the point from which on the input data is reset.
The second change (line 27) avoids that iota generates negative values (caused by overflowing before performing 5003 increments). This was causing the test to occasionally fail.
LGTM |
Fixing problems with remove_copy algorithm tests
This causes problems in buildbot, reverting... |
Nevermind, after looking at buildbot for some time I can see those two have been tested together, that's why there's no apparent difference in breakage. |
Nod, and most of the breakage we see is still caused by file system issues on Hermione :/ |
This fixes the occasional test failures we were seeing for the remove_copy_if tests. This also applies similar fly-by changes to the remove_copy test.