From 5919403f312ecd14b6d5d92c07c4cd8d3772c14a Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Wed, 26 May 2021 12:56:36 +0200 Subject: [PATCH] Fix potential very rare test failure. --- test/util_test.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)); -- 2.30.2