Lines Matching full:set
19 // Empty set tests.
21 USet Set; in TEST() local
22 EXPECT_TRUE(Set.empty()); in TEST()
23 EXPECT_TRUE(Set.begin() == Set.end()); in TEST()
24 EXPECT_EQ(0u, Set.size()); in TEST()
26 Set.setUniverse(10); in TEST()
28 // Lookups on empty set. in TEST()
29 EXPECT_TRUE(Set.find(0) == Set.end()); in TEST()
30 EXPECT_TRUE(Set.find(9) == Set.end()); in TEST()
33 const USet &CSet = Set; in TEST()
42 // Single entry set tests.
44 USet Set; in TEST() local
45 Set.setUniverse(10); in TEST()
46 std::pair<USet::iterator, bool> IP = Set.insert(5); in TEST()
48 EXPECT_TRUE(IP.first == Set.begin()); in TEST()
50 EXPECT_FALSE(Set.empty()); in TEST()
51 EXPECT_FALSE(Set.begin() == Set.end()); in TEST()
52 EXPECT_TRUE(Set.begin() + 1 == Set.end()); in TEST()
53 EXPECT_EQ(1u, Set.size()); in TEST()
55 EXPECT_TRUE(Set.find(0) == Set.end()); in TEST()
56 EXPECT_TRUE(Set.find(9) == Set.end()); in TEST()
58 EXPECT_FALSE(Set.count(0)); in TEST()
59 EXPECT_TRUE(Set.count(5)); in TEST()
62 IP = Set.insert(5); in TEST()
64 EXPECT_TRUE(IP.first == Set.begin()); in TEST()
67 EXPECT_FALSE(Set.erase(1)); in TEST()
68 EXPECT_EQ(1u, Set.size()); in TEST()
69 EXPECT_EQ(5u, *Set.begin()); in TEST()
72 USet::iterator I = Set.find(5); in TEST()
73 EXPECT_TRUE(I == Set.begin()); in TEST()
74 I = Set.erase(I); in TEST()
75 EXPECT_TRUE(I == Set.end()); in TEST()
76 EXPECT_TRUE(Set.empty()); in TEST()
79 // Multiple entry set tests.
81 USet Set; in TEST() local
82 Set.setUniverse(10); in TEST()
84 Set.insert(5); in TEST()
85 Set.insert(3); in TEST()
86 Set.insert(2); in TEST()
87 Set.insert(1); in TEST()
88 Set.insert(4); in TEST()
89 EXPECT_EQ(5u, Set.size()); in TEST()
92 USet::const_iterator I = Set.begin(); in TEST()
103 EXPECT_TRUE(I == Set.end()); in TEST()
106 std::pair<USet::iterator, bool> IP = Set.insert(3); in TEST()
108 EXPECT_TRUE(IP.first == Set.begin() + 1); in TEST()
111 EXPECT_TRUE(Set.erase(4)); in TEST()
112 EXPECT_EQ(4u, Set.size()); in TEST()
113 EXPECT_FALSE(Set.count(4)); in TEST()
114 EXPECT_FALSE(Set.erase(4)); in TEST()
115 EXPECT_EQ(4u, Set.size()); in TEST()
116 EXPECT_FALSE(Set.count(4)); in TEST()
119 EXPECT_TRUE(Set.count(5)); in TEST()
120 EXPECT_TRUE(Set.find(5) == Set.begin()); in TEST()
121 EXPECT_TRUE(Set.erase(5)); in TEST()
122 EXPECT_EQ(3u, Set.size()); in TEST()
123 EXPECT_FALSE(Set.count(5)); in TEST()
124 EXPECT_FALSE(Set.erase(5)); in TEST()
125 EXPECT_EQ(3u, Set.size()); in TEST()
126 EXPECT_FALSE(Set.count(5)); in TEST()
128 Set.insert(6); in TEST()
129 Set.insert(7); in TEST()
130 EXPECT_EQ(5u, Set.size()); in TEST()
133 I = Set.erase(Set.end() - 1); in TEST()
134 EXPECT_TRUE(I == Set.end()); in TEST()
135 EXPECT_EQ(4u, Set.size()); in TEST()
138 I = Set.erase(Set.begin() + 1); in TEST()
139 EXPECT_TRUE(I == Set.begin() + 1); in TEST()
142 Set.clear(); in TEST()
143 EXPECT_FALSE(Set.count(5)); in TEST()
144 Set.setUniverse(1000); in TEST()
148 Set.insert(i); in TEST()
151 Set.erase(i); in TEST()
154 EXPECT_TRUE(Set.count(i)); in TEST()
156 EXPECT_FALSE(Set.count(99)); in TEST()
157 EXPECT_FALSE(Set.count(800)); in TEST()
158 EXPECT_EQ(700u, Set.size()); in TEST()
169 ASet Set; in TEST() local
170 Set.setUniverse(10); in TEST()
171 Set.insert(Alt(1005)); in TEST()
173 ASet::iterator I = Set.find(5); in TEST()
174 ASSERT_TRUE(I == Set.begin()); in TEST()
177 Set.insert(Alt(1006)); in TEST()
178 Set.insert(Alt(1006)); in TEST()
179 I = Set.erase(Set.begin()); in TEST()
180 ASSERT_TRUE(I == Set.begin()); in TEST()
183 EXPECT_FALSE(Set.erase(5)); in TEST()
184 EXPECT_TRUE(Set.erase(6)); in TEST()
188 USet Set; in TEST() local
190 Set.setUniverse(UpperBound); in TEST()
192 Set.insert(i); in TEST()
197 while (!Set.empty()) in TEST()
198 ASSERT_TRUE(--Expected == Set.pop_back_val()); in TEST()
200 // Insert again the same elements in the sparse set and make sure in TEST()
204 ASSERT_TRUE(Set.insert(i).second); in TEST()