• Home
  • Raw
  • Download

Lines Matching full:set

18 // Empty set tests.
20 USet Set; in TEST() local
21 EXPECT_TRUE(Set.empty()); in TEST()
22 EXPECT_TRUE(Set.begin() == Set.end()); 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_FALSE(Set.contains(0)); in TEST()
29 EXPECT_FALSE(Set.contains(9)); in TEST()
32 const USet &CSet = Set; in TEST()
41 // Single entry set tests.
43 USet Set; in TEST() local
44 Set.setUniverse(10); in TEST()
45 std::pair<USet::iterator, bool> IP = Set.insert(5); in TEST()
47 EXPECT_TRUE(IP.first == Set.begin()); in TEST()
49 EXPECT_FALSE(Set.empty()); in TEST()
50 EXPECT_FALSE(Set.begin() == Set.end()); in TEST()
51 EXPECT_TRUE(Set.begin() + 1 == Set.end()); in TEST()
52 EXPECT_EQ(1u, Set.size()); in TEST()
54 EXPECT_FALSE(Set.contains(0)); in TEST()
55 EXPECT_FALSE(Set.contains(9)); in TEST()
56 EXPECT_TRUE(Set.contains(5)); 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_FALSE(Set.contains(5)); 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(3); in TEST()
87 Set.insert(2); in TEST()
88 Set.insert(1); in TEST()
89 Set.insert(4); in TEST()
90 EXPECT_EQ(5u, Set.size()); in TEST()
93 USet::const_iterator I = Set.begin(); in TEST()
104 EXPECT_TRUE(I == Set.end()); in TEST()
107 std::pair<USet::iterator, bool> IP = Set.insert(3); in TEST()
109 EXPECT_TRUE(IP.first == Set.begin() + 1); in TEST()
112 EXPECT_TRUE(Set.erase(4)); in TEST()
113 EXPECT_EQ(4u, Set.size()); in TEST()
114 EXPECT_FALSE(Set.count(4)); in TEST()
115 EXPECT_FALSE(Set.erase(4)); in TEST()
116 EXPECT_EQ(4u, Set.size()); in TEST()
117 EXPECT_FALSE(Set.count(4)); in TEST()
120 EXPECT_TRUE(Set.count(5)); in TEST()
121 EXPECT_TRUE(Set.find(5) == Set.begin()); in TEST()
122 EXPECT_TRUE(Set.erase(5)); in TEST()
123 EXPECT_EQ(3u, Set.size()); in TEST()
124 EXPECT_FALSE(Set.count(5)); in TEST()
125 EXPECT_FALSE(Set.erase(5)); in TEST()
126 EXPECT_EQ(3u, Set.size()); in TEST()
127 EXPECT_FALSE(Set.count(5)); in TEST()
129 Set.insert(6); in TEST()
130 Set.insert(7); in TEST()
131 EXPECT_EQ(5u, Set.size()); in TEST()
134 I = Set.erase(Set.end() - 1); in TEST()
135 EXPECT_TRUE(I == Set.end()); in TEST()
136 EXPECT_EQ(4u, Set.size()); in TEST()
139 I = Set.erase(Set.begin() + 1); in TEST()
140 EXPECT_TRUE(I == Set.begin() + 1); in TEST()
143 Set.clear(); in TEST()
144 EXPECT_FALSE(Set.count(5)); in TEST()
145 Set.setUniverse(1000); in TEST()
149 Set.insert(i); in TEST()
152 Set.erase(i); in TEST()
155 EXPECT_TRUE(Set.count(i)); in TEST()
157 EXPECT_FALSE(Set.count(99)); in TEST()
158 EXPECT_FALSE(Set.count(800)); in TEST()
159 EXPECT_EQ(700u, Set.size()); in TEST()
170 ASet Set; in TEST() local
171 Set.setUniverse(10); in TEST()
172 Set.insert(Alt(1005)); in TEST()
174 ASet::iterator I = Set.find(5); in TEST()
175 ASSERT_TRUE(I == Set.begin()); in TEST()
178 Set.insert(Alt(1006)); in TEST()
179 Set.insert(Alt(1006)); in TEST()
180 I = Set.erase(Set.begin()); in TEST()
181 ASSERT_TRUE(I == Set.begin()); in TEST()
184 EXPECT_FALSE(Set.erase(5)); in TEST()
185 EXPECT_TRUE(Set.erase(6)); in TEST()
189 USet Set; in TEST() local
191 Set.setUniverse(UpperBound); in TEST()
193 Set.insert(i); in TEST()
198 while (!Set.empty()) in TEST()
199 ASSERT_TRUE(--Expected == Set.pop_back_val()); in TEST()
201 // Insert again the same elements in the sparse set and make sure in TEST()
205 ASSERT_TRUE(Set.insert(i).second); in TEST()