From 142ccc64fbf30ac4e202c4634bf0cd3bb8989490 Mon Sep 17 00:00:00 2001 From: Pavel Emelyanov Date: Thu, 5 Sep 2024 10:02:25 +0300 Subject: [PATCH] test: Simplify test_range_reads() counting It used to keep counter with the help of a smart pointer, now it can just use on-stack variable. Signed-off-by: Pavel Emelyanov --- test/boost/sstable_mutation_test.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/boost/sstable_mutation_test.cc b/test/boost/sstable_mutation_test.cc index f72dfe0bc9..6fbf9fae15 100644 --- a/test/boost/sstable_mutation_test.cc +++ b/test/boost/sstable_mutation_test.cc @@ -303,7 +303,7 @@ SEASTAR_TEST_CASE(complex_sst3_k2) { void test_range_reads(sstables::test_env& env, const dht::token& min, const dht::token& max, std::vector& expected) { auto sstp = env.reusable_sst(uncompressed_schema(), uncompressed_dir()).get(); auto s = uncompressed_schema(); - auto count = make_lw_shared(0); + size_t count = 0; auto expected_size = expected.size(); auto pr = dht::partition_range::make(dht::ring_position::starting_at(min), dht::ring_position::ending_at(max)); auto mutations = sstp->make_reader(s, env.make_reader_permit(), pr, s->full_slice()); @@ -317,13 +317,13 @@ void test_range_reads(sstables::test_env& env, const dht::token& min, const dht: break; } BOOST_REQUIRE(mfopt->is_partition_start()); - BOOST_REQUIRE(*count < expected_size); + BOOST_REQUIRE(count < expected_size); BOOST_REQUIRE(std::vector({expected.back()}) == mfopt->as_partition_start().key().key().explode()); expected.pop_back(); - (*count)++; + count++; mutations.next_partition().get(); } - BOOST_REQUIRE(*count == expected_size); + BOOST_REQUIRE(count == expected_size); } SEASTAR_TEST_CASE(read_range) {