Plain assert() is compiled out under NDEBUG, leaving the checked
variables unused. Use the always-evaluated gtest macros instead.
src/test/crimson/seastore/test_cbjournal.cc:586: variable 'old_written_to' set but not used [-Wunused-but-set-variable]
src/test/crimson/seastore/test_btree_lba_manager.cc:345: unused structured binding declaration [-Wunused-variable]
Signed-off-by: Sun Yuechi <sunyuechi@iscas.ac.cn>
get_op_context(t), addr,
get_map_val(len, extent->get_type()), extent.get()
).si_then([addr, extent](auto p){
- auto& [iter, inserted] = p;
- assert(inserted);
+ // there should be no element at the given addr before insert(),
+ // so the insertion (p.second) should take place here.
+ EXPECT_TRUE(p.second);
extent->set_laddr(addr);
});
});
return Journal::replay_ertr::make_ready_future<
std::pair<bool, CachedExtentRef>>(true, nullptr);
}).unsafe_get();
- assert(get_written_to() == old_written_to);
+ ASSERT_EQ(get_written_to(), old_written_to);
});
}