Skip to content

Commit 28f98a8

Browse files
more files updated
1 parent 7e8a820 commit 28f98a8

16 files changed

+136
-24
lines changed

libcxx/test/std/containers/sequences/deque/deque.cons/alloc.pass.cpp

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,23 +20,31 @@
2020
#include "min_allocator.h"
2121

2222
template <class T, class Allocator>
23-
void test(const Allocator& a) {
23+
void test_util(const Allocator& a) {
2424
std::deque<T, Allocator> d(a);
2525
assert(d.size() == 0);
2626
assert(d.get_allocator() == a);
2727
LIBCPP_ASSERT(is_double_ended_contiguous_container_asan_correct(d));
2828
}
2929

30-
int main(int, char**) {
31-
test<int>(std::allocator<int>());
32-
test<NotConstructible>(test_allocator<NotConstructible>(3));
30+
TEST_CONSTEXPR_CXX26 bool test() {
31+
test_util<int>(std::allocator<int>());
32+
test_util<NotConstructible>(test_allocator<NotConstructible>(3));
3333
#if TEST_STD_VER >= 11
34-
test<int>(min_allocator<int>());
35-
test<int>(safe_allocator<int>());
36-
test<NotConstructible>(min_allocator<NotConstructible>{});
37-
test<NotConstructible>(safe_allocator<NotConstructible>{});
38-
test<int>(explicit_allocator<int>());
39-
test<NotConstructible>(explicit_allocator<NotConstructible>{});
34+
test_util<int>(min_allocator<int>());
35+
test_util<int>(safe_allocator<int>());
36+
test_util<NotConstructible>(min_allocator<NotConstructible>{});
37+
test_util<NotConstructible>(safe_allocator<NotConstructible>{});
38+
test_util<int>(explicit_allocator<int>());
39+
test_util<NotConstructible>(explicit_allocator<NotConstructible>{});
40+
#endif
41+
return false;
42+
}
43+
44+
int main(int, char**) {
45+
test();
46+
#if TEST_STD_VER >= 26
47+
static_assert(test());
4048
#endif
4149

4250
return 0;

libcxx/test/std/containers/sequences/deque/deque.cons/assign_initializer_list.pass.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#include "test_macros.h"
2020
#include "min_allocator.h"
2121

22-
int main(int, char**) {
22+
TEST_CONSTEXPR_CXX26 bool test() {
2323
{
2424
std::deque<int> d;
2525
d.assign({3, 4, 5, 6});
@@ -40,6 +40,13 @@ int main(int, char**) {
4040
assert(d[3] == 6);
4141
LIBCPP_ASSERT(is_double_ended_contiguous_container_asan_correct(d));
4242
}
43+
return true;
44+
}
4345

46+
int main(int, char**) {
47+
test();
48+
#if TEST_STD_VER >= 26
49+
static_assert(test());
50+
#endif
4451
return 0;
4552
}

libcxx/test/std/containers/sequences/deque/deque.cons/assign_iter_iter.pass.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,8 @@ void test_iterators() {
144144

145145
int main(int, char**) {
146146
basic_test();
147-
147+
#if TEST_STD_VER >= 26
148+
static_assert(basic_test());
149+
#endif
148150
return 0;
149151
}

libcxx/test/std/containers/sequences/deque/deque.cons/assign_size_value.pass.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ void testN(int start, int N, int M) {
5555
test(c1, M, -10);
5656
}
5757

58-
int main(int, char**) {
58+
TEST_CONSTEXPR_CXX26 bool test() {
5959
{
6060
int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049};
6161
const int N = sizeof(rng) / sizeof(rng[0]);
@@ -74,6 +74,14 @@ int main(int, char**) {
7474
testN<std::deque<int, min_allocator<int>> >(rng[i], rng[j], rng[k]);
7575
}
7676
#endif
77+
return true;
78+
}
79+
80+
int main(int, char**) {
81+
test();
82+
#if TEST_STD_VER >= 26
83+
static_assert(test());
84+
#endif
7785

7886
return 0;
7987
}

libcxx/test/std/containers/sequences/deque/deque.cons/copy.pass.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ void test(const C& x) {
2626
LIBCPP_ASSERT(is_double_ended_contiguous_container_asan_correct(x));
2727
}
2828

29-
int main(int, char**) {
29+
TEST_CONSTEXPR_CXX26 bool tests() {
3030
{
3131
int ab[] = {3, 4, 2, 8, 0, 1, 44, 34, 45, 96, 80, 1, 13, 31, 45};
3232
int* an = ab + sizeof(ab) / sizeof(ab[0]);
@@ -63,6 +63,14 @@ int main(int, char**) {
6363
LIBCPP_ASSERT(is_double_ended_contiguous_container_asan_correct(v2));
6464
}
6565
#endif
66+
return true;
67+
}
68+
69+
int main(int, char**) {
70+
tests();
71+
#if TEST_STD_VER >= 26
72+
static_assert(tests());
73+
#endif
6674

6775
return 0;
6876
}

libcxx/test/std/containers/sequences/deque/deque.cons/copy_alloc.pass.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ void test(const C& x, const typename C::allocator_type& a) {
2626
LIBCPP_ASSERT(is_double_ended_contiguous_container_asan_correct(c));
2727
}
2828

29-
int main(int, char**) {
29+
TEST_CONSTEXPR_CXX26 bool tests() {
3030
{
3131
int ab[] = {3, 4, 2, 8, 0, 1, 44, 34, 45, 96, 80, 1, 13, 31, 45};
3232
int* an = ab + sizeof(ab) / sizeof(ab[0]);
@@ -49,6 +49,14 @@ int main(int, char**) {
4949
test(std::deque<int, safe_allocator<int> >(ab, an, safe_allocator<int>()), safe_allocator<int>());
5050
}
5151
#endif
52+
return true;
53+
}
54+
55+
int main(int, char**) {
56+
tests();
57+
#if TEST_STD_VER >= 26
58+
static_assert(tests());
59+
#endif
5260

5361
return 0;
5462
}

libcxx/test/std/containers/sequences/deque/deque.cons/deduct.pass.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
struct A {};
3434

35-
int main(int, char**) {
35+
TEST_CONSTEXPR_CXX26 bool test() {
3636
// Test the explicit deduction guides
3737
{
3838
const int arr[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
@@ -156,6 +156,14 @@ int main(int, char**) {
156156
#endif
157157

158158
SequenceContainerDeductionGuidesSfinaeAway<std::deque, std::deque<int>>();
159+
return true;
160+
}
161+
162+
int main(int, char**) {
163+
test();
164+
#if TEST_STD_VER >= 26
165+
static_assert(test());
166+
#endif
159167

160168
return 0;
161169
}

libcxx/test/std/containers/sequences/deque/deque.cons/default.pass.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,21 @@ void test() {
3131
#endif
3232
}
3333

34-
int main(int, char**) {
34+
TEST_CONSTEXPR_CXX26 bool tests() {
3535
test<int, std::allocator<int> >();
3636
test<NotConstructible, limited_allocator<NotConstructible, 1> >();
3737
#if TEST_STD_VER >= 11
3838
test<int, min_allocator<int> >();
3939
test<NotConstructible, min_allocator<NotConstructible> >();
4040
#endif
41+
return true;
42+
}
43+
44+
int main(int, char**) {
45+
tests();
46+
#if TEST_STD_VER >= 26
47+
static_assert(test());
48+
#endif
4149

4250
return 0;
4351
}

libcxx/test/std/containers/sequences/deque/deque.cons/default_noexcept.pass.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ struct some_alloc {
2929
void allocate(std::size_t);
3030
};
3131

32-
int main(int, char**) {
32+
TEST_CONSTEXPR_CXX26 bool test() {
3333
#if defined(_LIBCPP_VERSION)
3434
{
3535
typedef std::deque<MoveOnly> C;
@@ -48,6 +48,14 @@ int main(int, char**) {
4848
typedef std::deque<MoveOnly, some_alloc<MoveOnly>> C;
4949
static_assert(!std::is_nothrow_default_constructible<C>::value, "");
5050
}
51+
return true;
52+
}
53+
54+
int main(int, char**) {
55+
test();
56+
#if TEST_STD_VER >= 26
57+
static_assert(test());
58+
#endif
5159

5260
return 0;
5361
}

libcxx/test/std/containers/sequences/deque/deque.cons/dtor_noexcept.pass.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ struct some_alloc {
2727
void allocate(std::size_t);
2828
};
2929

30-
int main(int, char**) {
30+
TEST_CONSTEXPR_CXX26 bool test() {
3131
{
3232
typedef std::deque<MoveOnly> C;
3333
static_assert(std::is_nothrow_destructible<C>::value, "");
@@ -46,6 +46,14 @@ int main(int, char**) {
4646
static_assert(!std::is_nothrow_destructible<C>::value, "");
4747
}
4848
#endif // _LIBCPP_VERSION
49+
return true;
50+
}
51+
52+
int main(int, char**) {
53+
test();
54+
#if TEST_STD_VER >= 26
55+
static_assert(test());
56+
#endif
4957

5058
return 0;
5159
}

0 commit comments

Comments
 (0)