Skip to content

Commit 7e8a820

Browse files
update test files to reflect constexpr
1 parent caf34bf commit 7e8a820

File tree

12 files changed

+106
-13
lines changed

12 files changed

+106
-13
lines changed

libcxx/test/std/containers/sequences/deque/compare.pass.cpp

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

3838
#include "test_comparisons.h"
3939

40-
int main(int, char**) {
40+
TEST_CONSTEXPR_CXX26 bool test() {
4141
{
4242
const std::deque<int> d1, d2;
4343
assert(testComparisons(d1, d2, true, false));
@@ -113,6 +113,14 @@ int main(int, char**) {
113113
const std::deque<LessAndEqComp> d2(items2, items2 + 2);
114114
assert(testComparisons(d1, d2, false, false));
115115
}
116+
return true;
117+
}
118+
119+
int main(int, char**) {
120+
test();
121+
#if TEST_STD_VER >= 26
122+
static_assert(test());
123+
#endif
116124

117125
return 0;
118126
}

libcxx/test/std/containers/sequences/deque/compare.three_way.pass.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,15 @@
1818

1919
#include "test_container_comparisons.h"
2020

21-
int main(int, char**) {
21+
TEST_CONSTEXPR_CXX26 bool test() {
2222
assert(test_sequence_container_spaceship<std::deque>());
23-
// `std::deque` is not constexpr, so no `static_assert` test here.
23+
return true;
24+
}
25+
26+
int main(int, char**) {
27+
test();
28+
#if TEST_STD_VER >= 26
29+
static_assert(test());
30+
#endif
2431
return 0;
2532
}

libcxx/test/std/containers/sequences/deque/deque.capacity/access.pass.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ C make(int size, int start = 0) {
4747
return c;
4848
}
4949

50-
int main(int, char**) {
50+
TEST_CONSTEXPR_CXX26 bool test() {
5151
{
5252
typedef std::deque<int> C;
5353
C c = make<std::deque<int> >(10);
@@ -118,6 +118,14 @@ int main(int, char**) {
118118
LIBCPP_ASSERT(is_double_ended_contiguous_container_asan_correct(c));
119119
}
120120
#endif
121+
return true;
122+
}
123+
124+
int main(int, char**) {
125+
test();
126+
#if TEST_STD_VER >= 26
127+
static_assert(test());
128+
#endif
121129

122130
return 0;
123131
}

libcxx/test/std/containers/sequences/deque/deque.capacity/empty.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
typedef std::deque<int> C;
2525
C c;
@@ -46,6 +46,13 @@ int main(int, char**) {
4646
LIBCPP_ASSERT(is_double_ended_contiguous_container_asan_correct(c));
4747
}
4848
#endif
49+
return true;
50+
}
4951

52+
int main(int, char**) {
53+
test();
54+
#if TEST_STD_VER >= 26
55+
static_assert(test());
56+
#endif
5057
return 0;
5158
}

libcxx/test/std/containers/sequences/deque/deque.capacity/max_size.pass.cpp

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

22-
int main(int, char**) {
22+
TEST_CONSTEXPR_CXX26 bool test() {
2323
{
2424
typedef limited_allocator<int, 10> A;
2525
typedef std::deque<int, A> C;
@@ -45,6 +45,14 @@ int main(int, char**) {
4545
assert(c.max_size() <= alloc_max_size(c.get_allocator()));
4646
LIBCPP_ASSERT(is_double_ended_contiguous_container_asan_correct(c));
4747
}
48+
return true;
49+
}
50+
51+
int main(int, char**) {
52+
test();
53+
#if TEST_STD_VER >= 26
54+
static_assert(test());
55+
#endif
4856

4957
return 0;
5058
}

libcxx/test/std/containers/sequences/deque/deque.capacity/resize_size.pass.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ void testN(int start, int N, int M) {
6363
test(c1, M);
6464
}
6565

66-
int main(int, char**) {
66+
TEST_CONSTEXPR_CXX26 bool test() {
6767
{
6868
int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049};
6969
const int N = sizeof(rng) / sizeof(rng[0]);
@@ -90,6 +90,14 @@ int main(int, char**) {
9090
testN<std::deque<int, safe_allocator<int>>>(rng[i], rng[j], rng[k]);
9191
}
9292
#endif
93+
return true;
94+
}
95+
96+
int main(int, char**) {
97+
test();
98+
#if TEST_STD_VER >= 26
99+
static_assert(test());
100+
#endif
93101

94102
return 0;
95103
}

libcxx/test/std/containers/sequences/deque/deque.capacity/resize_size_value.pass.cpp

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

66-
int main(int, char**) {
66+
TEST_CONSTEXPR_CXX26 bool test() {
6767
{
6868
int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049};
6969
const int N = sizeof(rng) / sizeof(rng[0]);
@@ -91,5 +91,13 @@ int main(int, char**) {
9191
}
9292
#endif
9393

94+
return true;
95+
}
96+
97+
int main(int, char**) {
98+
test();
99+
#if TEST_STD_VER >= 26
100+
static_assert(test());
101+
#endif
94102
return 0;
95103
}

libcxx/test/std/containers/sequences/deque/deque.capacity/shrink_to_fit.pass.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ void testN(int start, int N) {
5050
test(c1);
5151
}
5252

53-
int main(int, char**) {
53+
TEST_CONSTEXPR_CXX26 bool test() {
5454
{
5555
int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049};
5656
const int N = sizeof(rng) / sizeof(rng[0]);
@@ -74,6 +74,14 @@ int main(int, char**) {
7474
testN<std::deque<int, safe_allocator<int>> >(rng[i], rng[j]);
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.capacity/size.pass.cpp

Lines changed: 9 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
typedef std::deque<int> C;
2525
C c;
@@ -72,6 +72,14 @@ int main(int, char**) {
7272
LIBCPP_ASSERT(is_double_ended_contiguous_container_asan_correct(c));
7373
}
7474
#endif
75+
return true;
76+
}
77+
78+
int main(int, char**) {
79+
test();
80+
#if TEST_STD_VER >= 26
81+
static_assert(test());
82+
#endif
7583

7684
return 0;
7785
}

libcxx/test/std/containers/sequences/deque/get_allocator.pass.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#include "test_allocator.h"
1919
#include "test_macros.h"
2020

21-
int main(int, char**) {
21+
TEST_CONSTEXPR_CXX26 bool test() {
2222
{
2323
std::allocator<int> alloc;
2424
const std::deque<int> d(alloc);
@@ -29,6 +29,14 @@ int main(int, char**) {
2929
const std::deque<int, other_allocator<int> > d(alloc);
3030
assert(d.get_allocator() == alloc);
3131
}
32+
return true;
33+
}
34+
35+
int main(int, char**) {
36+
test();
37+
#if TEST_STD_VER >= 26
38+
static_assert(test());
39+
#endif
3240

3341
return 0;
3442
}

0 commit comments

Comments
 (0)