summaryrefslogtreecommitdiff
path: root/test/util_test.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2021-05-26 12:56:36 +0200
committerCarl Hetherington <cth@carlh.net>2021-05-26 20:05:49 +0200
commit5919403f312ecd14b6d5d92c07c4cd8d3772c14a (patch)
treea1562817e156e5d87a01d27a0b482b0a847c6744 /test/util_test.cc
parent93048e5a6f33cc8e2fc547bf65c41551696e23c6 (diff)
Fix potential very rare test failure.
Diffstat (limited to 'test/util_test.cc')
-rw-r--r--test/util_test.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/util_test.cc b/test/util_test.cc
index 67c1a5265..b0abe04c9 100644
--- a/test/util_test.cc
+++ b/test/util_test.cc
@@ -139,7 +139,7 @@ progress (float p)
BOOST_AUTO_TEST_CASE (copy_in_bits_test)
{
for (int i = 0; i < 32; ++i) {
- make_random_file ("build/test/random.dat", rand() % (256 * 1024 * 1024));
+ make_random_file ("build/test/random.dat", std::max(1, rand() % (256 * 1024 * 1024)));
progress_values.clear ();
copy_in_bits ("build/test/random.dat", "build/test/random.dat2", boost::bind(&progress, _1));