Skip to content

Commit 5162d6c

Browse files
fix test files in deque.special
1 parent 630e5c5 commit 5162d6c

File tree

6 files changed

+54
-6
lines changed

6 files changed

+54
-6
lines changed

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ void testN(int start, int N) {
7676
LIBCPP_ASSERT(is_double_ended_contiguous_container_asan_correct(c2));
7777
}
7878

79-
int main(int, char**) {
79+
TEST_CONSTEXPR_CXX26 bool tests() {
8080
{
8181
int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049};
8282
const int N = sizeof(rng) / sizeof(rng[0]);
@@ -93,6 +93,14 @@ int main(int, char**) {
9393
testN<std::deque<int, min_allocator<int>> >(rng[i], rng[j]);
9494
}
9595
#endif
96+
return true;
97+
}
98+
99+
int main(int, char**) {
100+
tests();
101+
#if TEST_STD_VER >= 26
102+
static_assert(tests());
103+
#endif
96104

97105
return 0;
98106
}

libcxx/test/std/containers/sequences/deque/deque.special/copy_backward.pass.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ void testN(int start, int N) {
7575
LIBCPP_ASSERT(is_double_ended_contiguous_container_asan_correct(c2));
7676
}
7777

78-
int main(int, char**) {
78+
TEST_CONSTEXPR_CXX26 bool tests() {
7979
{
8080
int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049};
8181
const int N = sizeof(rng) / sizeof(rng[0]);
@@ -92,6 +92,14 @@ int main(int, char**) {
9292
testN<std::deque<int, min_allocator<int>> >(rng[i], rng[j]);
9393
}
9494
#endif
95+
return true;
96+
}
97+
98+
int main(int, char**) {
99+
tests();
100+
#if TEST_STD_VER >= 26
101+
static_assert(tests());
102+
#endif
95103

96104
return 0;
97105
}

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ void testN(int start, int N) {
7575
LIBCPP_ASSERT(is_double_ended_contiguous_container_asan_correct(c2));
7676
}
7777

78-
int main(int, char**) {
78+
TEST_CONSTEXPR_CXX26 bool tests() {
7979
{
8080
int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049};
8181
const int N = sizeof(rng) / sizeof(rng[0]);
@@ -92,6 +92,14 @@ int main(int, char**) {
9292
testN<std::deque<int, min_allocator<int>> >(rng[i], rng[j]);
9393
}
9494
#endif
95+
return true;
96+
}
97+
98+
int main(int, char**) {
99+
tests();
100+
#if TEST_STD_VER >= 26
101+
static_assert(tests());
102+
#endif
95103

96104
return 0;
97105
}

libcxx/test/std/containers/sequences/deque/deque.special/move_backward.pass.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ void testN(int start, int N) {
7575
LIBCPP_ASSERT(is_double_ended_contiguous_container_asan_correct(c2));
7676
}
7777

78-
int main(int, char**) {
78+
TEST_CONSTEXPR_CXX26 bool tests() {
7979
{
8080
int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049};
8181
const int N = sizeof(rng) / sizeof(rng[0]);
@@ -92,6 +92,14 @@ int main(int, char**) {
9292
testN<std::deque<int, min_allocator<int> > >(rng[i], rng[j]);
9393
}
9494
#endif
95+
return true;
96+
}
97+
98+
int main(int, char**) {
99+
tests();
100+
#if TEST_STD_VER >= 26
101+
static_assert(tests());
102+
#endif
95103

96104
return 0;
97105
}

libcxx/test/std/containers/sequences/deque/deque.special/swap.pass.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ void testN(int start, int N, int M) {
5252
LIBCPP_ASSERT(is_double_ended_contiguous_container_asan_correct(c2_save));
5353
}
5454

55-
int main(int, char**) {
55+
TEST_CONSTEXPR_CXX26 bool tests() {
5656
{
5757
int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049};
5858
const int N = sizeof(rng) / sizeof(rng[0]);
@@ -113,6 +113,14 @@ int main(int, char**) {
113113
LIBCPP_ASSERT(is_double_ended_contiguous_container_asan_correct(c2));
114114
}
115115
#endif
116+
return true;
117+
}
118+
119+
int main(int, char**) {
120+
tests();
121+
#if TEST_STD_VER >= 26
122+
static_assert(tests());
123+
#endif
116124

117125
return 0;
118126
}

libcxx/test/std/containers/sequences/deque/deque.special/swap_noexcept.pass.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ struct some_alloc2 {
5252
typedef std::true_type is_always_equal;
5353
};
5454

55-
int main(int, char**) {
55+
TEST_CONSTEXPR_CXX26 bool test() {
5656
{
5757
typedef std::deque<MoveOnly> C;
5858
static_assert(noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
@@ -83,6 +83,14 @@ int main(int, char**) {
8383
static_assert(noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");
8484
}
8585
#endif
86+
return true;
87+
}
88+
89+
int main(int, char**) {
90+
test();
91+
#if TEST_STD_VER >= 26
92+
static_assert(test());
93+
#endif
8694

8795
return 0;
8896
}

0 commit comments

Comments
 (0)