Lines Matching defs:Set2

27   std::set<int> Set2 = {5, 6, 7, 8};
29 set_union(Set1, Set2);
30 // Set1 should be the union of input sets Set1 and Set2.
32 // Set2 should not be touched.
33 EXPECT_THAT(Set2, UnorderedElementsAre(5, 6, 7, 8));
36 Set2 = {1, 2};
38 set_union(Set1, Set2);
39 // Set1 should be the union of input sets Set1 and Set2, which in this case
40 // will be Set2.
42 // Set2 should not be touched.
43 EXPECT_THAT(Set2, UnorderedElementsAre(1, 2));
48 std::set<int> Set2 = {3, 4, 5, 6};
50 set_intersect(Set1, Set2);
51 // Set1 should be the intersection of sets Set1 and Set2.
53 // Set2 should not be touched.
54 EXPECT_THAT(Set2, UnorderedElementsAre(3, 4, 5, 6));
57 Set2 = {5, 6};
59 set_intersect(Set1, Set2);
60 // Set1 should be the intersection of sets Set1 and Set2, which
63 // Set2 should not be touched.
64 EXPECT_THAT(Set2, UnorderedElementsAre(5, 6));
72 set_intersect(SV, Set2);
79 std::set<int> Set2 = {3, 4, 5, 6};
82 Result = set_intersection(Set1, Set2);
83 // Result should be the intersection of sets Set1 and Set2.
85 // Set1 and Set2 should not be touched.
87 EXPECT_THAT(Set2, UnorderedElementsAre(3, 4, 5, 6));
90 Set2 = {5, 6};
92 Result = set_intersection(Set1, Set2);
93 // Result should be the intersection of sets Set1 and Set2, which
96 // Set1 and Set2 should not be touched.
98 EXPECT_THAT(Set2, UnorderedElementsAre(5, 6));
101 Set2 = {1, 2, 3, 4};
103 Result = set_intersection(Set1, Set2);
104 // Result should be the intersection of sets Set1 and Set2, which
109 // Set1 and Set2 should not be touched.
111 EXPECT_THAT(Set2, UnorderedElementsAre(1, 2, 3, 4));
116 std::set<int> Set2 = {3, 4, 5, 6};
119 Result = set_difference(Set1, Set2);
120 // Result should be Set1 - Set2, leaving only {1, 2}.
122 // Set1 and Set2 should not be touched.
124 EXPECT_THAT(Set2, UnorderedElementsAre(3, 4, 5, 6));
127 Set2 = {1, 2, 3, 4};
129 Result = set_difference(Set1, Set2);
130 // Result should be Set1 - Set2, which should be empty.
132 // Set1 and Set2 should not be touched.
134 EXPECT_THAT(Set2, UnorderedElementsAre(1, 2, 3, 4));
137 Set2 = {5, 6};
139 Result = set_difference(Set1, Set2);
140 // Result should be Set1 - Set2, which should be Set1 as they are
143 // Set1 and Set2 should not be touched.
145 EXPECT_THAT(Set2, UnorderedElementsAre(5, 6));
150 std::set<int> Set2 = {3, 4, 5, 6};
152 set_subtract(Set1, Set2);
153 // Set1 should get Set1 - Set2, leaving only {1, 2}.
155 // Set2 should not be touched.
156 EXPECT_THAT(Set2, UnorderedElementsAre(3, 4, 5, 6));
159 Set2 = {1, 2, 3, 4};
161 set_subtract(Set1, Set2);
162 // Set1 should get Set1 - Set2, which should be empty.
164 // Set2 should not be touched.
165 EXPECT_THAT(Set2, UnorderedElementsAre(1, 2, 3, 4));
168 Set2 = {5, 6};
170 set_subtract(Set1, Set2);
171 // Set1 should get Set1 - Set2, which should be Set1 as they are
174 // Set2 should not be touched.
175 EXPECT_THAT(Set2, UnorderedElementsAre(5, 6));
181 // Set1.size() < Set2.size()
183 SmallPtrSet<int *, 4> Set2 = {&A[1], &A[2], &A[3]};
184 set_subtract(Set1, Set2);
187 // Set1.size() > Set2.size()
189 Set2 = {&A[0], &A[2]};
190 set_subtract(Set1, Set2);
197 // Set1.size() < Set2.size()
199 SmallVector<int *> Set2 = {&A[1], &A[2], &A[3]};
200 set_subtract(Set1, Set2);
203 // Set1.size() > Set2.size()
205 Set2 = {&A[0], &A[2]};
206 set_subtract(Set1, Set2);
214 std::set<int> Set2 = {3, 4, 5, 6};
216 set_subtract(Set1, Set2, Removed, Remaining);
217 // Set1 should get Set1 - Set2, leaving only {1, 2}.
219 // Set2 should not be touched.
220 EXPECT_THAT(Set2, UnorderedElementsAre(3, 4, 5, 6));
221 // We should get back that {3, 4} from Set2 were removed from Set1, and {5, 6}
227 Set2 = {1, 2, 3, 4};
231 set_subtract(Set1, Set2, Removed, Remaining);
232 // Set1 should get Set1 - Set2, which should be empty.
234 // Set2 should not be touched.
235 EXPECT_THAT(Set2, UnorderedElementsAre(1, 2, 3, 4));
236 // Set should get back that all of Set2 was removed from Set1, and nothing
237 // left in Set2 was not removed from Set1.
242 Set2 = {5, 6};
246 set_subtract(Set1, Set2, Removed, Remaining);
247 // Set1 should get Set1 - Set2, which should be Set1 as they are
250 // Set2 should not be touched.
251 EXPECT_THAT(Set2, UnorderedElementsAre(5, 6));
253 // Set should get back that none of Set2 was removed from Set1, and all
254 // of Set2 was not removed from Set1.
260 std::set<int> Set2 = {3, 4};
261 EXPECT_FALSE(set_is_subset(Set1, Set2));
264 Set2 = {1, 2, 3, 4};
265 EXPECT_TRUE(set_is_subset(Set1, Set2));
268 Set2 = {1, 2, 3, 4};
269 EXPECT_TRUE(set_is_subset(Set1, Set2));
272 Set2 = {3, 4};
273 EXPECT_FALSE(set_is_subset(Set1, Set2));