10 #include <boost/test/unit_test.hpp>
20 for (
int i = 0; i < 100; ++i) {
24 uint32_t b_not_a = errors - a_not_b;
26 uint32_t end_a = start_a + a_not_b + both;
27 uint32_t start_b = start_a + a_not_b;
28 uint32_t end_b = start_b + both + b_not_a;
31 for (uint32_t a = start_a; a < end_a; ++a) sketch_a.Add(a);
33 for (uint32_t b = start_b; b < end_b; ++b) sketch_b.Add(b);
37 sketch_ar.Deserialize(sketch_a.Serialize());
38 sketch_br.Deserialize(sketch_b.Serialize());
40 Minisketch sketch_c = std::move(sketch_ar);
41 sketch_c.Merge(sketch_br);
42 auto dec = sketch_c.Decode(errors);
44 auto sols = std::move(*dec);
45 std::sort(sols.begin(), sols.end());
47 for (uint32_t i = 0; i < b_not_a; ++i)
BOOST_CHECK_EQUAL(sols[i + a_not_b], start_b + both + i);