tests: change tests to make summary non-copyable

Right now the summary can be copied, but in real life there is no reason
for this to be a requirement. Tests want it, so we can destroy a summary,
load another, and compare the two. We can achieve this by allowing the first
summary to be moved, and then we can still have a reference to the second.

I am about to make a change that will make the summary not copyable as a
requirement, so we need to do this first.

Signed-off-by: Glauber Costa <glauber@scylladb.com>
This commit is contained in:
Glauber Costa
2018-03-14 10:33:57 -04:00
parent 00d04b49a0
commit d15bfbe548
2 changed files with 6 additions and 2 deletions

View File

@@ -4533,12 +4533,12 @@ SEASTAR_TEST_CASE(summary_rebuild_sanity) {
};
auto sst = make_sstable_containing(sst_gen, mutations);
summary s1 = sstables::test(sst).get_summary();
summary s1 = sstables::test(sst).move_summary();
BOOST_REQUIRE(s1.entries.size() > 1);
sstables::test(sst).remove_component(sstable::component_type::Summary).get();
sst = reusable_sst(s, tmp->path, 1).get0();
summary s2 = sstables::test(sst).get_summary();
summary& s2 = sstables::test(sst).get_summary();
BOOST_REQUIRE(::memcmp(&s1.header, &s2.header, sizeof(summary::header)) == 0);
BOOST_REQUIRE(s1.positions == s2.positions);

View File

@@ -120,6 +120,10 @@ public:
return _sst->_components->summary;
}
summary move_summary() {
return std::move(_sst->_components->summary);
}
future<> read_toc() {
return _sst->read_toc();
}