21 {
22 LOG_UNIT_TEST;
23
25 s.insert(std::make_unique<int>(1));
26 s.insert(std::make_unique<int>(2));
27 s.insert(std::make_unique<int>(3));
28 s.insert(std::make_unique<int>(3));
29
30
31
32 int * first = s.begin()->get();
33 auto result = s.find(first);
34 CPPUNIT_ASSERT(result != s.end());
35 CPPUNIT_ASSERT(result->get() == first);
36
37
38
39 CPPUNIT_ASSERT(s.count(first) == 1);
40
41
42
43 auto four = std::make_unique<int>(4);
44
45
46
47 s.insert(std::move(four));
48 CPPUNIT_ASSERT(s.size() == 5);
49
50
51
52 s.insert(std::move(four));
53 CPPUNIT_ASSERT(s.size() == 6);
54
55
56
57 s.insert(std::move(four));
58 CPPUNIT_ASSERT(s.size() == 6);
59 }
Struct which defines a custom comparison object that can be used with std::sets of std::unique_ptrs.