Skip to content

Commit 630e5c5

Browse files
update test files in deque.modifiers
1 parent 5f9a116 commit 630e5c5

26 files changed

+235
-26
lines changed

libcxx/test/std/containers/sequences/deque/deque.modifiers/assign_range.pass.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
// {empty/one-element/full} container);
2222
// - assigning move-only elements;
2323
// - an exception is thrown when copying the elements or when allocating new elements.
24-
int main(int, char**) {
24+
25+
TEST_CONSTEXPR_CXX26 bool test() {
2526
static_assert(test_constraints_assign_range<std::deque, int, double>());
2627

2728
for_all_iterators_and_allocators<int, const int*>([]<class Iter, class Sent, class Alloc>() {
@@ -33,6 +34,14 @@ int main(int, char**) {
3334

3435
test_assign_range_exception_safety_throwing_copy<std::deque>();
3536
test_assign_range_exception_safety_throwing_allocator<std::deque, int>();
37+
return true;
38+
}
39+
40+
int main(int, char**) {
41+
test();
42+
#if TEST_STD_VER >= 26
43+
static_assert(test());
44+
#endif
3645

3746
return 0;
3847
}

libcxx/test/std/containers/sequences/deque/deque.modifiers/clear.pass.cpp

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

21-
int main(int, char**) {
21+
TEST_CONSTEXPR_CXX26 bool test() {
2222
{
2323
typedef NotConstructible T;
2424
typedef std::deque<T> C;
@@ -69,6 +69,14 @@ int main(int, char**) {
6969
LIBCPP_ASSERT(is_double_ended_contiguous_container_asan_correct(c));
7070
}
7171
#endif
72+
return true;
73+
}
74+
75+
int main(int, char**) {
76+
test();
77+
#if TEST_STD_VER >= 26
78+
static_assert(test());
79+
#endif
7280

7381
return 0;
7482
}

libcxx/test/std/containers/sequences/deque/deque.modifiers/emplace.pass.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ void testN(int start, int N) {
7474
}
7575
}
7676

77-
int main(int, char**) {
77+
TEST_CONSTEXPR_CXX26 bool tests() {
7878
{
7979
int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049};
8080
const int N = sizeof(rng) / sizeof(rng[0]);
@@ -96,6 +96,14 @@ int main(int, char**) {
9696
for (int j = 0; j < N; ++j)
9797
testN<std::deque<Emplaceable, safe_allocator<Emplaceable>> >(rng[i], rng[j]);
9898
}
99+
return true;
100+
}
101+
102+
int main(int, char**) {
103+
tests();
104+
#if TEST_STD_VER >= 26
105+
static_assert(tests());
106+
#endif
99107

100108
return 0;
101109
}

libcxx/test/std/containers/sequences/deque/deque.modifiers/emplace_back.pass.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ void testN(int start, int N) {
6868
test(c1);
6969
}
7070

71-
int main(int, char**) {
71+
TEST_CONSTEXPR_CXX26 bool tests() {
7272
{
7373
int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049};
7474
const int N = sizeof(rng) / sizeof(rng[0]);
@@ -98,6 +98,14 @@ int main(int, char**) {
9898
assert(c.size() == 4);
9999
LIBCPP_ASSERT(is_double_ended_contiguous_container_asan_correct(c));
100100
}
101+
return true;
102+
}
103+
104+
int main(int, char**) {
105+
tests();
106+
#if TEST_STD_VER >= 26
107+
static_assert(tests());
108+
#endif
101109

102110
return 0;
103111
}

libcxx/test/std/containers/sequences/deque/deque.modifiers/emplace_front.pass.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ void testN(int start, int N) {
6868
test(c1);
6969
}
7070

71-
int main(int, char**) {
71+
TEST_CONSTEXPR_CXX26 bool tests() {
7272
{
7373
int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049};
7474
const int N = sizeof(rng) / sizeof(rng[0]);
@@ -98,6 +98,14 @@ int main(int, char**) {
9898
assert(c.size() == 4);
9999
LIBCPP_ASSERT(is_double_ended_contiguous_container_asan_correct(c));
100100
}
101+
return true;
102+
}
103+
104+
int main(int, char**) {
105+
tests();
106+
#if TEST_STD_VER >= 26
107+
static_assert(tests());
108+
#endif
101109

102110
return 0;
103111
}

libcxx/test/std/containers/sequences/deque/deque.modifiers/erase_iter.invalidation.pass.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ void del_at_end(C c) {
5656
LIBCPP_ASSERT(is_double_ended_contiguous_container_asan_correct(c));
5757
}
5858

59-
int main(int, char**) {
59+
TEST_CONSTEXPR_CXX26 bool test() {
6060
std::deque<int> queue;
6161
for (int i = 0; i < 20; ++i)
6262
queue.push_back(i);
@@ -66,6 +66,14 @@ int main(int, char**) {
6666
del_at_end(queue);
6767
queue.pop_back();
6868
}
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.modifiers/erase_iter.pass.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ void testN(int start, int N) {
9393
}
9494
}
9595

96-
int main(int, char**) {
96+
TEST_CONSTEXPR_CXX26 bool tests() {
9797
{
9898
int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049};
9999
const int N = sizeof(rng) / sizeof(rng[0]);
@@ -126,6 +126,14 @@ int main(int, char**) {
126126
LIBCPP_ASSERT(is_double_ended_contiguous_container_asan_correct(v));
127127
}
128128
#endif
129+
return true;
130+
}
131+
132+
int main(int, char**) {
133+
tests();
134+
#if TEST_STD_VER >= 26
135+
static_assert(tests());
136+
#endif
129137

130138
return 0;
131139
}

libcxx/test/std/containers/sequences/deque/deque.modifiers/erase_iter_iter.invalidation.pass.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ void del_at_end(C c, std::size_t num) {
6060
LIBCPP_ASSERT(is_double_ended_contiguous_container_asan_correct(c));
6161
}
6262

63-
int main(int, char**) {
63+
TEST_CONSTEXPR_CXX26 bool test() {
6464
std::deque<int> queue;
6565
for (int i = 0; i < 20; ++i)
6666
queue.push_back(i);
@@ -72,6 +72,14 @@ int main(int, char**) {
7272
}
7373
queue.pop_back();
7474
}
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/deque.modifiers/erase_iter_iter.pass.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ void testN(int start, int N) {
9999
}
100100
}
101101

102-
int main(int, char**) {
102+
TEST_CONSTEXPR_CXX26 bool tests() {
103103
{
104104
int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049};
105105
const int N = sizeof(rng) / sizeof(rng[0]);
@@ -132,6 +132,14 @@ int main(int, char**) {
132132
LIBCPP_ASSERT(is_double_ended_contiguous_container_asan_correct(v));
133133
}
134134
#endif
135+
return true;
136+
}
137+
138+
int main(int, char**) {
139+
tests();
140+
#if TEST_STD_VER >= 26
141+
static_assert(tests());
142+
#endif
135143

136144
return 0;
137145
}

libcxx/test/std/containers/sequences/deque/deque.modifiers/insert_iter_initializer_list.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
std::deque<int> d(10, 1);
2525
std::deque<int>::iterator i = d.insert(d.cbegin() + 2, {3, 4, 5, 6});
@@ -62,6 +62,14 @@ int main(int, char**) {
6262
assert(d[13] == 1);
6363
LIBCPP_ASSERT(is_double_ended_contiguous_container_asan_correct(d));
6464
}
65+
return true;
66+
}
67+
68+
int main(int, char**) {
69+
test();
70+
#if TEST_STD_VER >= 26
71+
static_assert(test());
72+
#endif
6573

6674
return 0;
6775
}

0 commit comments

Comments
 (0)