Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(263)

Unified Diff: client/prune_crash_reports_test.cc

Issue 1417443002: Use an even better random number generation scheme in the prune test (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/prune_crash_reports_test.cc
diff --git a/client/prune_crash_reports_test.cc b/client/prune_crash_reports_test.cc
index 7ffe67bc09ece82623b0812fb695282fea8fc5df..bb9ea8e2b0b2e6296eb0b3c1bbd78beadd278041 100644
--- a/client/prune_crash_reports_test.cc
+++ b/client/prune_crash_reports_test.cc
@@ -208,7 +208,7 @@ TEST(PruneCrashReports, PruneOrder) {
}
// The randomness from std::rand() is not, so use a better rand() instead.
const auto random_generator = [](int rand_max) {
- return base::RandUint64() % rand_max;
+ return base::RandInt(0, rand_max - 1);
};
std::random_shuffle(reports.begin(), reports.end(), random_generator);
std::vector<CrashReportDatabase::Report> pending_reports(
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698