From 42cb03425bbdcf74df5432ffcdaf0797802b6e21 Mon Sep 17 00:00:00 2001 From: Adam Kupczyk Date: Fri, 28 Jun 2024 12:16:52 +0000 Subject: [PATCH] tests/bluestore_types: Fix % 0 in tests It was possible to get x % 0. It generated exception. Signed-off-by: Adam Kupczyk --- src/test/objectstore/test_bluestore_types.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/objectstore/test_bluestore_types.cc b/src/test/objectstore/test_bluestore_types.cc index 535b2fb7c3249..e8b2054a4fbc1 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, -- 2.39.5