Skip to content

Commit 41d85fe

Browse files
committed
[libc++] Remove signal-based checkpoints in libc++ tests
While this adds some convenience to the test suite, it prevents the tests using these checkpoints from being used on systems where signals are not available, such as some embedded systems. It will also prevent these tests from being constexpr-friendly once e.g. std::map is made constexpr, due to the use of statics. Instead, one can always use a debugger to figure out exactly where a test is failing when that isn't clear from the log output without checkpoints.
1 parent b21ad3b commit 41d85fe

File tree

9 files changed

+105
-186
lines changed

9 files changed

+105
-186
lines changed

libcxx/test/libcxx/debug/containers/db_sequence_container_iterators.pass.cpp

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,14 @@ struct SequenceContainerChecks : BasicContainerChecks<Container, CT> {
7070

7171
private:
7272
static void SanityTest() {
73-
CHECKPOINT("sanity test");
73+
// sanity test
7474
Container C = {1, 1, 1, 1};
7575
::DoNotOptimize(&C);
7676
}
7777

7878
static void RemoveFirstElem() {
7979
// See llvm.org/PR35564
80-
CHECKPOINT("remove(<first-elem>)");
80+
// remove(<first-elem>)
8181
{
8282
Container C = makeContainer(1);
8383
auto FirstVal = *(C.begin());
@@ -94,7 +94,7 @@ struct SequenceContainerChecks : BasicContainerChecks<Container, CT> {
9494

9595
static void SpliceFirstElem() {
9696
// See llvm.org/PR35564
97-
CHECKPOINT("splice(<first-elem>)");
97+
// splice(<first-elem>)
9898
{
9999
Container C = makeContainer(1);
100100
Container C2;
@@ -108,14 +108,14 @@ struct SequenceContainerChecks : BasicContainerChecks<Container, CT> {
108108
}
109109

110110
static void SpliceSameContainer() {
111-
CHECKPOINT("splice(<same-container>)");
111+
// splice(<same-container>)
112112
Container C = {1, 1};
113113
C.splice(C.end(), C, C.begin());
114114
}
115115

116116
static void SpliceFirstElemAfter() {
117117
// See llvm.org/PR35564
118-
CHECKPOINT("splice(<first-elem>)");
118+
// splice(<first-elem>)
119119
{
120120
Container C = makeContainer(1);
121121
Container C2;
@@ -129,7 +129,7 @@ struct SequenceContainerChecks : BasicContainerChecks<Container, CT> {
129129
}
130130

131131
static void AssignInvalidates() {
132-
CHECKPOINT("assign(Size, Value)");
132+
// assign(Size, Value)
133133
Container C(allocator_type{});
134134
iterator it1, it2, it3;
135135
auto reset = [&]() {
@@ -147,7 +147,7 @@ struct SequenceContainerChecks : BasicContainerChecks<Container, CT> {
147147
C.assign(2, makeValueType(4));
148148
check();
149149
reset();
150-
CHECKPOINT("assign(Iter, Iter)");
150+
// assign(Iter, Iter)
151151
std::vector<value_type> V = {
152152
makeValueType(1),
153153
makeValueType(2),
@@ -156,13 +156,13 @@ struct SequenceContainerChecks : BasicContainerChecks<Container, CT> {
156156
C.assign(V.begin(), V.end());
157157
check();
158158
reset();
159-
CHECKPOINT("assign(initializer_list)");
159+
// assign(initializer_list)
160160
C.assign({makeValueType(1), makeValueType(2), makeValueType(3)});
161161
check();
162162
}
163163

164164
static void BackOnEmptyContainer() {
165-
CHECKPOINT("testing back on empty");
165+
// testing back on empty
166166
Container C = makeContainer(1);
167167
Container const& CC = C;
168168
(void)C.back();
@@ -173,7 +173,7 @@ struct SequenceContainerChecks : BasicContainerChecks<Container, CT> {
173173
}
174174

175175
static void FrontOnEmptyContainer() {
176-
CHECKPOINT("testing front on empty");
176+
// testing front on empty
177177
Container C = makeContainer(1);
178178
Container const& CC = C;
179179
(void)C.front();
@@ -184,7 +184,7 @@ struct SequenceContainerChecks : BasicContainerChecks<Container, CT> {
184184
}
185185

186186
static void EraseIterIter() {
187-
CHECKPOINT("testing erase iter iter invalidation");
187+
// testing erase iter iter invalidation
188188
Container C1 = makeContainer(3);
189189
iterator it1 = C1.begin();
190190
iterator it1_next = ++C1.begin();
@@ -206,7 +206,7 @@ struct SequenceContainerChecks : BasicContainerChecks<Container, CT> {
206206
}
207207

208208
static void PopBack() {
209-
CHECKPOINT("testing pop_back() invalidation");
209+
// testing pop_back() invalidation
210210
Container C1 = makeContainer(2);
211211
iterator it1 = C1.end();
212212
--it1;
@@ -218,7 +218,7 @@ struct SequenceContainerChecks : BasicContainerChecks<Container, CT> {
218218
}
219219

220220
static void PopFront() {
221-
CHECKPOINT("testing pop_front() invalidation");
221+
// testing pop_front() invalidation
222222
Container C1 = makeContainer(2);
223223
iterator it1 = C1.begin();
224224
C1.pop_front();
@@ -229,7 +229,7 @@ struct SequenceContainerChecks : BasicContainerChecks<Container, CT> {
229229
}
230230

231231
static void InsertIterValue() {
232-
CHECKPOINT("testing insert(iter, value)");
232+
// testing insert(iter, value)
233233
Container C1 = makeContainer(2);
234234
iterator it1 = C1.begin();
235235
iterator it1_next = it1;
@@ -254,7 +254,7 @@ struct SequenceContainerChecks : BasicContainerChecks<Container, CT> {
254254
}
255255

256256
static void EmplaceIterValue() {
257-
CHECKPOINT("testing emplace(iter, value)");
257+
// testing emplace(iter, value)
258258
Container C1 = makeContainer(2);
259259
iterator it1 = C1.begin();
260260
iterator it1_next = it1;
@@ -274,7 +274,7 @@ struct SequenceContainerChecks : BasicContainerChecks<Container, CT> {
274274
}
275275

276276
static void InsertIterSizeValue() {
277-
CHECKPOINT("testing insert(iter, size, value)");
277+
// testing insert(iter, size, value)
278278
Container C1 = makeContainer(2);
279279
iterator it1 = C1.begin();
280280
iterator it1_next = it1;
@@ -293,7 +293,7 @@ struct SequenceContainerChecks : BasicContainerChecks<Container, CT> {
293293
}
294294

295295
static void InsertIterIterIter() {
296-
CHECKPOINT("testing insert(iter, iter, iter)");
296+
// testing insert(iter, iter, iter)
297297
Container C1 = makeContainer(2);
298298
iterator it1 = C1.begin();
299299
iterator it1_next = it1;

libcxx/test/libcxx/debug/containers/db_string.pass.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ struct StringContainerChecks : BasicContainerChecks<Container, CT> {
5151

5252
private:
5353
static void BackOnEmptyContainer(int N) {
54-
CHECKPOINT("testing back on empty");
54+
// testing back on empty
5555
Container C = makeContainer(N);
5656
Container const& CC = C;
5757
iterator it = --C.end();
@@ -65,7 +65,7 @@ struct StringContainerChecks : BasicContainerChecks<Container, CT> {
6565
}
6666

6767
static void FrontOnEmptyContainer(int N) {
68-
CHECKPOINT("testing front on empty");
68+
// testing front on empty
6969
Container C = makeContainer(N);
7070
Container const& CC = C;
7171
(void)C.front();
@@ -76,7 +76,7 @@ struct StringContainerChecks : BasicContainerChecks<Container, CT> {
7676
}
7777

7878
static void PopBack(int N) {
79-
CHECKPOINT("testing pop_back() invalidation");
79+
// testing pop_back() invalidation
8080
Container C1 = makeContainer(N);
8181
iterator it1 = C1.end();
8282
--it1;

0 commit comments

Comments
 (0)