Lines Matching full:set
18 // Empty set tests.
20 USet Set; in TEST() local
21 EXPECT_TRUE(Set.empty()); in TEST()
22 EXPECT_EQ(0u, Set.size()); in TEST()
24 Set.setUniverse(10); in TEST()
26 // Lookups on empty set. in TEST()
27 EXPECT_TRUE(Set.find(0) == Set.end()); in TEST()
28 EXPECT_TRUE(Set.find(9) == Set.end()); in TEST()
31 const USet &CSet = Set; in TEST()
39 // Single entry set tests.
41 USet Set; in TEST() local
42 Set.setUniverse(10); in TEST()
43 USet::iterator I = Set.insert(5); in TEST()
44 EXPECT_TRUE(I != Set.end()); in TEST()
47 EXPECT_FALSE(Set.empty()); in TEST()
48 EXPECT_EQ(1u, Set.size()); in TEST()
50 EXPECT_TRUE(Set.find(0) == Set.end()); in TEST()
51 EXPECT_TRUE(Set.find(9) == Set.end()); in TEST()
53 EXPECT_FALSE(Set.contains(0)); in TEST()
54 EXPECT_TRUE(Set.contains(5)); in TEST()
57 I = Set.insert(5); in TEST()
58 EXPECT_TRUE(I != Set.end()); in TEST()
59 EXPECT_TRUE(I == ++Set.find(5)); in TEST()
61 EXPECT_TRUE(I == Set.find(5)); in TEST()
64 I = Set.find(1); in TEST()
65 EXPECT_TRUE(I == Set.end()); in TEST()
66 EXPECT_EQ(2u, Set.size()); in TEST()
67 EXPECT_EQ(5u, *Set.find(5)); in TEST()
70 I = Set.find(5); in TEST()
71 EXPECT_TRUE(I != Set.end()); in TEST()
72 I = Set.erase(I); in TEST()
73 EXPECT_TRUE(I != Set.end()); 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(5); in TEST()
86 Set.insert(5); in TEST()
87 Set.insert(3); in TEST()
88 Set.insert(2); in TEST()
89 Set.insert(1); in TEST()
90 Set.insert(4); in TEST()
91 EXPECT_EQ(7u, Set.size()); in TEST()
94 EXPECT_TRUE(Set.erase(Set.find(4)) == Set.end()); in TEST()
95 EXPECT_EQ(6u, Set.size()); in TEST()
96 EXPECT_FALSE(Set.contains(4)); in TEST()
97 EXPECT_TRUE(Set.find(4) == Set.end()); in TEST()
100 EXPECT_EQ(3u, Set.count(5)); in TEST()
101 EXPECT_TRUE(Set.find(5) != Set.end()); in TEST()
102 EXPECT_TRUE(Set.erase(Set.find(5)) != Set.end()); in TEST()
103 EXPECT_EQ(5u, Set.size()); in TEST()
104 EXPECT_EQ(2u, Set.count(5)); in TEST()
106 Set.insert(6); in TEST()
107 Set.insert(7); in TEST()
108 EXPECT_EQ(7u, Set.size()); in TEST()
111 EXPECT_TRUE(Set.getTail(6) == Set.getHead(6)); in TEST()
112 USet::iterator I = Set.erase(Set.find(6)); in TEST()
113 EXPECT_TRUE(I == Set.end()); in TEST()
114 EXPECT_EQ(6u, Set.size()); in TEST()
117 EXPECT_EQ(2u, Set.count(5)); in TEST()
118 I = Set.getTail(5); in TEST()
119 I = Set.erase(I); in TEST()
120 EXPECT_TRUE(I == Set.end()); in TEST()
122 EXPECT_EQ(1u, Set.count(5)); in TEST()
124 I = Set.erase(I); in TEST()
125 EXPECT_TRUE(I == Set.end()); in TEST()
126 EXPECT_EQ(0u, Set.count(5)); in TEST()
128 Set.insert(8); in TEST()
129 Set.insert(8); in TEST()
130 Set.insert(8); in TEST()
131 Set.insert(8); in TEST()
132 Set.insert(8); in TEST()
135 EXPECT_EQ(5, std::distance(Set.getHead(8), Set.end())); in TEST()
136 Set.eraseAll(8); in TEST()
137 EXPECT_EQ(0, std::distance(Set.getHead(8), Set.end())); in TEST()
140 Set.clear(); in TEST()
141 EXPECT_EQ(0u, Set.size()); in TEST()
142 EXPECT_FALSE(Set.contains(3)); in TEST()
143 Set.setUniverse(1000); in TEST()
147 Set.insert(i); in TEST()
150 Set.eraseAll(i); in TEST()
153 EXPECT_EQ(1u, Set.count(i)); in TEST()
155 EXPECT_FALSE(Set.contains(99)); in TEST()
156 EXPECT_FALSE(Set.contains(800)); in TEST()
157 EXPECT_EQ(700u, Set.size()); in TEST()
162 USet Set; in TEST() local
163 Set.setUniverse(100); in TEST()
165 Set.insert(0); in TEST()
166 Set.insert(1); in TEST()
167 Set.insert(2); in TEST()
168 Set.insert(0); in TEST()
169 Set.insert(1); in TEST()
170 Set.insert(0); in TEST()
172 USet::RangePair RangePair = Set.equal_range(0); in TEST()
179 EXPECT_EQ(++(++(++E)), Set.end()); in TEST()
181 EXPECT_EQ(++(++(++E)), Set.end()); in TEST()
184 Set.insert(0); in TEST()
186 EXPECT_EQ(++(++(++(++E))), Set.end()); in TEST()
188 EXPECT_EQ(++(++(++(++E))), Set.end()); in TEST()
191 USet::iterator Erased = Set.erase(Set.getTail(0)); in TEST()
199 EXPECT_TRUE(!Set.contains(3)); in TEST()
215 ASet Set; in TEST() local
216 Set.setUniverse(10); in TEST()
217 Set.insert(Alt(1005)); in TEST()
219 ASet::iterator I = Set.find(5); in TEST()
220 ASSERT_TRUE(I != Set.end()); in TEST()
223 Set.insert(Alt(1006)); in TEST()
224 Set.insert(Alt(1006)); in TEST()
225 I = Set.erase(Set.find(6)); in TEST()
226 ASSERT_TRUE(I != Set.end()); in TEST()
228 I = Set.erase(Set.find(6)); in TEST()
229 ASSERT_TRUE(I == Set.end()); in TEST()
231 EXPECT_TRUE(Set.contains(5)); in TEST()
232 EXPECT_FALSE(Set.contains(6)); in TEST()