From: Carl Hetherington Date: Wed, 26 May 2021 10:56:36 +0000 (+0200) Subject: Fix potential very rare test failure. X-Git-Tag: v2.15.152~5 X-Git-Url: https://main.carlh.net/gitweb/?p=dcpomatic.git;a=commitdiff_plain;h=5919403f312ecd14b6d5d92c07c4cd8d3772c14a Fix potential very rare test failure. --- 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));