Skip to content

Commit 437a643

Browse files
committed
testing
1 parent 61f4722 commit 437a643

File tree

7 files changed

+748
-321
lines changed

7 files changed

+748
-321
lines changed

libcxx/test/std/containers/container.adaptors/flat.multiset/flat.multiset.cons/assign_initializer_list.pass.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,14 @@ void test() {
4343
double expected[] = {3};
4444
assert(std::ranges::equal(m, expected));
4545
}
46+
{
47+
// was empty
48+
M m;
49+
assert(m.size() == 0);
50+
m = {3, 1, 2, 2, 3, 4, 3, 5, 6, 5};
51+
int expected[] = {1, 2, 2, 3, 3, 3, 4, 5, 5, 6};
52+
assert(std::ranges::equal(m, expected));
53+
}
4654
}
4755

4856
void test() {

libcxx/test/std/containers/container.adaptors/flat.multiset/flat.multiset.cons/copy_assign.pass.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,18 @@ void test() {
8080
// self-assignment
8181
using M = std::flat_multiset<int>;
8282
M m = {{1, 2}};
83-
m = static_cast<const M&>(m);
83+
m = std::as_const(m);
8484
assert((m == M{{1, 2}}));
8585
}
86+
{
87+
// was empty
88+
using M = std::flat_multiset<int>;
89+
M m;
90+
assert(m.size() == 0);
91+
m = {3, 1, 2, 2, 3, 4, 3, 5, 6, 5};
92+
int expected[] = {1, 2, 2, 3, 3, 3, 4, 5, 5, 6};
93+
assert(std::ranges::equal(m, expected));
94+
}
8695
{
8796
// Validate whether the container can be copy-assigned (move-assigned, swapped)
8897
// with an ADL-hijacking operator&

libcxx/test/std/containers/container.adaptors/flat.multiset/flat.multiset.cons/deduct.compile.pass.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,21 +23,21 @@ struct NotAnAllocator {
2323
};
2424

2525
template <class... Args>
26-
concept CanDeductFlatSet = requires { std::flat_multiset(std::declval<Args>()...); };
26+
concept CanDeductFlatMultiSet = requires { std::flat_multiset(std::declval<Args>()...); };
2727

28-
static_assert(CanDeductFlatSet<std::vector<int>>);
28+
static_assert(CanDeductFlatMultiSet<std::vector<int>>);
2929

3030
// cannot deduce Key and T from nothing
31-
static_assert(!CanDeductFlatSet<>);
31+
static_assert(!CanDeductFlatMultiSet<>);
3232

3333
// cannot deduce Key and T from just (Compare)
34-
static_assert(!CanDeductFlatSet<std::less<int>>);
34+
static_assert(!CanDeductFlatMultiSet<std::less<int>>);
3535

3636
// cannot deduce Key and T from just (Compare, Allocator)
37-
static_assert(!CanDeductFlatSet<std::less<int>, std::allocator<int>>);
37+
static_assert(!CanDeductFlatMultiSet<std::less<int>, std::allocator<int>>);
3838

3939
// cannot deduce Key and T from just (Allocator)
40-
static_assert(!CanDeductFlatSet<std::allocator<int>>);
40+
static_assert(!CanDeductFlatMultiSet<std::allocator<int>>);
4141

4242
// cannot convert from some arbitrary unrelated type
43-
static_assert(!CanDeductFlatSet<NotAnAllocator>);
43+
static_assert(!CanDeductFlatMultiSet<NotAnAllocator>);

0 commit comments

Comments
 (0)