Lines Matching full:set
19 // Empty set tests.
21 USet Set; in TEST() local
22 EXPECT_TRUE(Set.empty()); in TEST()
23 EXPECT_EQ(0u, Set.size()); in TEST()
25 Set.setUniverse(10); in TEST()
27 // Lookups on empty set. in TEST()
28 EXPECT_TRUE(Set.find(0) == Set.end()); in TEST()
29 EXPECT_TRUE(Set.find(9) == Set.end()); in TEST()
32 const USet &CSet = Set; in TEST()
40 // Single entry set tests.
42 USet Set; in TEST() local
43 Set.setUniverse(10); in TEST()
44 USet::iterator I = Set.insert(5); in TEST()
45 EXPECT_TRUE(I != Set.end()); in TEST()
48 EXPECT_FALSE(Set.empty()); in TEST()
49 EXPECT_EQ(1u, Set.size()); in TEST()
51 EXPECT_TRUE(Set.find(0) == Set.end()); in TEST()
52 EXPECT_TRUE(Set.find(9) == Set.end()); in TEST()
54 EXPECT_FALSE(Set.contains(0)); in TEST()
55 EXPECT_TRUE(Set.contains(5)); in TEST()
58 I = Set.insert(5); in TEST()
59 EXPECT_TRUE(I != Set.end()); in TEST()
60 EXPECT_TRUE(I == ++Set.find(5)); in TEST()
62 EXPECT_TRUE(I == Set.find(5)); in TEST()
65 I = Set.find(1); in TEST()
66 EXPECT_TRUE(I == Set.end()); in TEST()
67 EXPECT_EQ(2u, Set.size()); in TEST()
68 EXPECT_EQ(5u, *Set.find(5)); in TEST()
71 I = Set.find(5); in TEST()
72 EXPECT_TRUE(I != Set.end()); in TEST()
73 I = Set.erase(I); in TEST()
74 EXPECT_TRUE(I != Set.end()); in TEST()
75 I = Set.erase(I); in TEST()
76 EXPECT_TRUE(I == Set.end()); in TEST()
77 EXPECT_TRUE(Set.empty()); in TEST()
80 // Multiple entry set tests.
82 USet Set; in TEST() local
83 Set.setUniverse(10); in TEST()
85 Set.insert(5); in TEST()
86 Set.insert(5); in TEST()
87 Set.insert(5); in TEST()
88 Set.insert(3); in TEST()
89 Set.insert(2); in TEST()
90 Set.insert(1); in TEST()
91 Set.insert(4); in TEST()
92 EXPECT_EQ(7u, Set.size()); in TEST()
95 EXPECT_TRUE(Set.erase(Set.find(4)) == Set.end()); in TEST()
96 EXPECT_EQ(6u, Set.size()); in TEST()
97 EXPECT_FALSE(Set.contains(4)); in TEST()
98 EXPECT_TRUE(Set.find(4) == Set.end()); in TEST()
101 EXPECT_EQ(3u, Set.count(5)); in TEST()
102 EXPECT_TRUE(Set.find(5) != Set.end()); in TEST()
103 EXPECT_TRUE(Set.erase(Set.find(5)) != Set.end()); in TEST()
104 EXPECT_EQ(5u, Set.size()); in TEST()
105 EXPECT_EQ(2u, Set.count(5)); in TEST()
107 Set.insert(6); in TEST()
108 Set.insert(7); in TEST()
109 EXPECT_EQ(7u, Set.size()); in TEST()
112 EXPECT_TRUE(Set.getTail(6) == Set.getHead(6)); in TEST()
113 USet::iterator I = Set.erase(Set.find(6)); in TEST()
114 EXPECT_TRUE(I == Set.end()); in TEST()
115 EXPECT_EQ(6u, Set.size()); in TEST()
118 EXPECT_EQ(2u, Set.count(5)); in TEST()
119 I = Set.getTail(5); in TEST()
120 I = Set.erase(I); in TEST()
121 EXPECT_TRUE(I == Set.end()); in TEST()
123 EXPECT_EQ(1u, Set.count(5)); in TEST()
125 I = Set.erase(I); in TEST()
126 EXPECT_TRUE(I == Set.end()); in TEST()
127 EXPECT_EQ(0u, Set.count(5)); 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()
133 Set.insert(8); in TEST()
136 EXPECT_EQ(5, std::distance(Set.getHead(8), Set.end())); in TEST()
137 Set.eraseAll(8); in TEST()
138 EXPECT_EQ(0, std::distance(Set.getHead(8), Set.end())); in TEST()
141 Set.clear(); in TEST()
142 EXPECT_EQ(0u, Set.size()); in TEST()
143 EXPECT_FALSE(Set.contains(3)); in TEST()
144 Set.setUniverse(1000); in TEST()
148 Set.insert(i); in TEST()
151 Set.eraseAll(i); in TEST()
154 EXPECT_EQ(1u, Set.count(i)); in TEST()
156 EXPECT_FALSE(Set.contains(99)); in TEST()
157 EXPECT_FALSE(Set.contains(800)); in TEST()
158 EXPECT_EQ(700u, Set.size()); in TEST()
163 USet Set; in TEST() local
164 Set.setUniverse(100); in TEST()
166 Set.insert(0); in TEST()
167 Set.insert(1); in TEST()
168 Set.insert(2); in TEST()
169 Set.insert(0); in TEST()
170 Set.insert(1); in TEST()
171 Set.insert(0); in TEST()
173 USet::RangePair RangePair = Set.equal_range(0); in TEST()
180 EXPECT_EQ(++(++(++E)), Set.end()); in TEST()
182 EXPECT_EQ(++(++(++E)), Set.end()); in TEST()
185 Set.insert(0); in TEST()
187 EXPECT_EQ(++(++(++(++E))), Set.end()); in TEST()
189 EXPECT_EQ(++(++(++(++E))), Set.end()); in TEST()
192 USet::iterator Erased = Set.erase(Set.getTail(0)); in TEST()
200 EXPECT_TRUE(!Set.contains(3)); in TEST()
216 ASet Set; in TEST() local
217 Set.setUniverse(10); in TEST()
218 Set.insert(Alt(1005)); in TEST()
220 ASet::iterator I = Set.find(5); in TEST()
221 ASSERT_TRUE(I != Set.end()); in TEST()
224 Set.insert(Alt(1006)); in TEST()
225 Set.insert(Alt(1006)); in TEST()
226 I = Set.erase(Set.find(6)); in TEST()
227 ASSERT_TRUE(I != Set.end()); in TEST()
229 I = Set.erase(Set.find(6)); in TEST()
230 ASSERT_TRUE(I == Set.end()); in TEST()
232 EXPECT_TRUE(Set.contains(5)); in TEST()
233 EXPECT_FALSE(Set.contains(6)); in TEST()