From: Adam Kupczyk Date: Fri, 28 Jun 2024 12:16:52 +0000 (+0000) Subject: tests/bluestore_types: Fix % 0 in tests X-Git-Tag: testing/wip-vshankar-testing-20240814.051758-debug~10^2~27 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=42cb03425bbdcf74df5432ffcdaf0797802b6e21;p=ceph-ci.git tests/bluestore_types: Fix % 0 in tests It was possible to get x % 0. It generated exception. Signed-off-by: Adam Kupczyk --- diff --git a/src/test/objectstore/test_bluestore_types.cc b/src/test/objectstore/test_bluestore_types.cc index 535b2fb7c32..e8b2054a4fb 100644 --- a/src/test/objectstore/test_bluestore_types.cc +++ b/src/test/objectstore/test_bluestore_types.cc @@ -2055,7 +2055,7 @@ TEST_P(PunchHoleFixture, multipunch) BlueStore::volatile_statfs statfs_delta; for (int j = 0; j < 10; j++) { - uint32_t s = rand() % ((hole_end - hole_start) / 5) + 1; + uint32_t s = rand() % ((hole_end - hole_start) / 5 + 1); uint32_t p = rand() % (hole_end - hole_start - s) + hole_start; store->debug_punch_hole_2( coll, onode, p, s,