Skip to content

Commit 129f6d6

Browse files
update more test files
1 parent 82e293b commit 129f6d6

File tree

12 files changed

+116
-17
lines changed

12 files changed

+116
-17
lines changed

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

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

2323
struct A {};
2424

25-
int main(int, char**) {
25+
TEST_CONSTEXPR_CXX26 bool test() {
2626
// Test the explicit deduction guides
2727

2828
// Test the implicit deduction guides
@@ -34,6 +34,14 @@ int main(int, char**) {
3434
// Also, we can't use {} instead of parens, because that constructs a
3535
// deque<allocator<int>, allocator<allocator<int>>>
3636
}
37+
return true;
38+
}
39+
40+
int main(int, char**) {
41+
test();
42+
#if TEST_STD_VER >= 26
43+
static_assert(test());
44+
#endif
3745

3846
return 0;
3947
}

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#include "test_allocator.h"
2222
#include "min_allocator.h"
2323

24-
int main(int, char**) {
24+
TEST_CONSTEXPR_CXX26 bool test() {
2525
{
2626
int ab[] = {3, 4, 2, 8, 0, 1, 44, 34, 45, 96, 80, 1, 13, 31, 45};
2727
int* an = ab + sizeof(ab) / sizeof(ab[0]);
@@ -79,6 +79,14 @@ int main(int, char**) {
7979
LIBCPP_ASSERT(is_double_ended_contiguous_container_asan_correct(c2));
8080
LIBCPP_ASSERT(is_double_ended_contiguous_container_asan_correct(c3));
8181
}
82+
return true;
83+
}
84+
85+
int main(int, char**) {
86+
test();
87+
#if TEST_STD_VER >= 26
88+
static_assert(test());
89+
#endif
8290

8391
return 0;
8492
}

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

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
#include "test_allocator.h"
2222
#include "min_allocator.h"
2323

24-
int main(int, char**) {
25-
{
24+
TEST_CONSTEXPR_CXX26 bool test() {
25+
{
2626
int ab[] = {3, 4, 2, 8, 0, 1, 44, 34, 45, 96, 80, 1, 13, 31, 45};
2727
int* an = ab + sizeof(ab) / sizeof(ab[0]);
2828
typedef test_allocator<MoveOnly> A;
@@ -98,6 +98,14 @@ int main(int, char**) {
9898
LIBCPP_ASSERT(is_double_ended_contiguous_container_asan_correct(c2));
9999
LIBCPP_ASSERT(is_double_ended_contiguous_container_asan_correct(c3));
100100
}
101+
return true;
102+
}
103+
104+
int main(int, char**) {
105+
test();
106+
#if TEST_STD_VER >= 26
107+
static_assert(test());
108+
#endif
101109

102110
return 0;
103111
}

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

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ struct some_alloc {
2929
void allocate(std::size_t);
3030
};
3131

32-
int main(int, char**) {
33-
#if defined(_LIBCPP_VERSION)
32+
TEST_CONSTEXPR_CXX26 bool test() {
33+
#if defined(_LIBCPP_VERSION)
3434
{
3535
typedef std::deque<MoveOnly> C;
3636
static_assert(std::is_nothrow_move_constructible<C>::value, "");
@@ -48,6 +48,14 @@ int main(int, char**) {
4848
static_assert(!std::is_nothrow_move_constructible<C>::value, "");
4949
}
5050
#endif // _LIBCPP_VERSION
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/op_equal.pass.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ void test(const C& x) {
2626
LIBCPP_ASSERT(is_double_ended_contiguous_container_asan_correct(x));
2727
}
2828

29-
int main(int, char**) {
30-
{
29+
TEST_CONSTEXPR_CXX26 bool test() {
30+
{
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]);
3333
test(std::deque<int>(ab, an));
@@ -66,6 +66,14 @@ int main(int, char**) {
6666
LIBCPP_ASSERT(is_double_ended_contiguous_container_asan_correct(l2));
6767
}
6868
#endif
69+
return true;
70+
}
71+
72+
int main(int, char**) {
73+
test();
74+
#if TEST_STD_VER >= 26
75+
static_assert(test());
76+
#endif
6977

7078
return 0;
7179
}

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

Lines changed: 10 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 = {3, 4, 5, 6};
@@ -40,6 +40,15 @@ 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+
}
45+
46+
47+
int main(int, char**) {
48+
test();
49+
#if TEST_STD_VER >= 26
50+
static_assert(test());
51+
#endif
4352

4453
return 0;
4554
}

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ void test(unsigned n) {
8282
test2<T, Allocator>(n);
8383
}
8484

85-
int main(int, char**) {
85+
TEST_CONSTEXPR_CXX26 bool tests() {
8686
test<DefaultOnly, std::allocator<DefaultOnly> >(0);
8787
test<DefaultOnly, std::allocator<DefaultOnly> >(1);
8888
test<DefaultOnly, std::allocator<DefaultOnly> >(10);
@@ -107,6 +107,14 @@ int main(int, char**) {
107107
test3<int, std::allocator<int>>(1);
108108
test3<int, min_allocator<int>>(3);
109109
#endif
110+
return true;
111+
}
112+
113+
int main(int, char**) {
114+
tests();
115+
#if TEST_STD_VER >= 26
116+
static_assert(tests());
117+
#endif
110118

111119
return 0;
112120
}

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

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ void test(unsigned n, const T& x) {
3131
assert(*i == x);
3232
}
3333

34-
int main(int, char**) {
35-
test<int, std::allocator<int> >(0, 5);
34+
TEST_CONSTEXPR_CXX26 bool tests() {
35+
test<int, std::allocator<int> >(0, 5);
3636
test<int, std::allocator<int> >(1, 10);
3737
test<int, std::allocator<int> >(10, 11);
3838
test<int, std::allocator<int> >(1023, -11);
@@ -48,6 +48,15 @@ int main(int, char**) {
4848
#if TEST_STD_VER >= 11
4949
test<int, min_allocator<int> >(4095, 90);
5050
#endif
51+
return true;
52+
}
53+
54+
55+
int main(int, char**) {
56+
tests();
57+
#if TEST_STD_VER >= 26
58+
static_assert(tests());
59+
#endif
5160

5261
return 0;
5362
}

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

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ void test(unsigned n, const T& x, const Allocator& a) {
3131
assert(*i == x);
3232
}
3333

34-
int main(int, char**) {
35-
{
34+
TEST_CONSTEXPR_CXX26 bool tests() {
35+
{
3636
std::allocator<int> a;
3737
test(0, 5, a);
3838
test(1, 10, a);
@@ -64,6 +64,14 @@ int main(int, char**) {
6464
test(4097, 157, a);
6565
}
6666
#endif
67+
return true;
68+
}
69+
70+
int main(int, char**) {
71+
tests();
72+
#if TEST_STD_VER >= 26
73+
static_assert(tests());
74+
#endif
6775

6876
return 0;
6977
}

libcxx/test/std/containers/sequences/deque/deque.erasure/erase.pass.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,22 @@ void test() {
6666
test0(S({1, 2, 1}), opt(3), S({1, 2, 1}), 0);
6767
}
6868

69-
int main(int, char**) {
69+
TEST_CONSTEXPR_CXX26 bool tests() {
7070
test<std::deque<int>>();
7171
test<std::deque<int, min_allocator<int>>>();
7272
test<std::deque<int, safe_allocator<int>>>();
7373
test<std::deque<int, test_allocator<int>>>();
7474

7575
test<std::deque<long>>();
7676
test<std::deque<double>>();
77+
return true;
78+
}
79+
80+
int main(int, char**) {
81+
tests();
82+
#if TEST_STD_VER >= 26
83+
static_assert(tests());
84+
#endif
7785

7886
return 0;
7987
}

0 commit comments

Comments
 (0)