Skip to content

Commit 1a55f75

Browse files
committed
Rename negative-compile tests to *.test.cpp naming convention
The Beman Standard's [file.test_names] check requires test source files to match *.test.cpp. Rename the 56 negative-compile-test sources under tests/beman/expected/ (used via the add_fail_test CMake macro) accordingly and update their CMakeLists.txt references.
1 parent 6698eff commit 1a55f75

57 files changed

Lines changed: 56 additions & 56 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

tests/beman/expected/CMakeLists.txt

Lines changed: 56 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -122,247 +122,247 @@ macro(add_fail_test name source reason)
122122
endmacro()
123123

124124
# Step 1 — unexpected<E> ill-formed instantiations [expected.un.general]
125-
add_fail_test(unexpected_array_fail unexpected_array_fail.cpp
125+
add_fail_test(unexpected_array_fail unexpected_array_fail.test.cpp
126126
"E must not be an array type"
127127
)
128-
add_fail_test(unexpected_cvref_fail unexpected_cvref_fail.cpp
128+
add_fail_test(unexpected_cvref_fail unexpected_cvref_fail.test.cpp
129129
"E must not be cv-qualified"
130130
)
131-
add_fail_test(unexpected_self_fail unexpected_self_fail.cpp
131+
add_fail_test(unexpected_self_fail unexpected_self_fail.test.cpp
132132
"E must not be a specialization of unexpected"
133133
)
134134

135135
# Step 3 — expected<T,E> ill-formed T/E [expected.object.general]
136-
add_fail_test(expected_t_ref_fail expected_t_ref_fail.cpp
136+
add_fail_test(expected_t_ref_fail expected_t_ref_fail.test.cpp
137137
"no default constructor|use of deleted function|call to deleted|attempting to reference"
138138
)
139139
# Note: expected_e_ref_fail removed — expected<int, int&> is now valid via expected<T,E&>
140-
add_fail_test(expected_t_array_fail expected_t_array_fail.cpp
140+
add_fail_test(expected_t_array_fail expected_t_array_fail.test.cpp
141141
"T must not be an array type"
142142
)
143143

144144
# Step 3 — expected<T,E> emplace Mandates: nothrow_constructible_v<T,Args...>
145-
add_fail_test(expected_emplace_throwing_fail expected_emplace_throwing_fail.cpp
145+
add_fail_test(expected_emplace_throwing_fail expected_emplace_throwing_fail.test.cpp
146146
"is_nothrow_constructible|no matching overloaded function found"
147147
)
148148

149149
# Step 4 — expected<void,E> ill-formed E [expected.void.general]
150150
# Note: expected_void_ref_fail.cpp is removed — expected<void, E&> is now valid via
151151
# the expected<void, E&> specialization added in Step 10.
152-
add_fail_test(expected_void_array_fail expected_void_array_fail.cpp
152+
add_fail_test(expected_void_array_fail expected_void_array_fail.test.cpp
153153
"E must not be an array type"
154154
)
155155

156156
# Step 5 — monadic Mandates [expected.object.monadic]
157-
add_fail_test(and_then_wrong_error_type_fail and_then_wrong_error_type_fail.cpp
157+
add_fail_test(and_then_wrong_error_type_fail and_then_wrong_error_type_fail.test.cpp
158158
"F must return expected with the same error_type"
159159
)
160-
add_fail_test(and_then_not_expected_fail and_then_not_expected_fail.cpp
160+
add_fail_test(and_then_not_expected_fail and_then_not_expected_fail.test.cpp
161161
"F must return a specialization of expected"
162162
)
163-
add_fail_test(or_else_wrong_value_type_fail or_else_wrong_value_type_fail.cpp
163+
add_fail_test(or_else_wrong_value_type_fail or_else_wrong_value_type_fail.test.cpp
164164
"F must return expected with the same value_type"
165165
)
166-
add_fail_test(transform_error_ref_result_fail transform_error_ref_result_fail.cpp
166+
add_fail_test(transform_error_ref_result_fail transform_error_ref_result_fail.test.cpp
167167
"G must be an object type"
168168
)
169169

170170
# Step 6 — void monadic Mandates [expected.void.monadic]
171-
add_fail_test(void_and_then_wrong_error_type_fail void_and_then_wrong_error_type_fail.cpp
171+
add_fail_test(void_and_then_wrong_error_type_fail void_and_then_wrong_error_type_fail.test.cpp
172172
"F must return expected with the same error_type"
173173
)
174-
add_fail_test(void_or_else_wrong_value_type_fail void_or_else_wrong_value_type_fail.cpp
174+
add_fail_test(void_or_else_wrong_value_type_fail void_or_else_wrong_value_type_fail.test.cpp
175175
"F must return expected with the same value_type"
176176
)
177177

178178
# Fix 1 — constraint 23.6: value ctor blocked for T=bool, U=expected specialization
179-
add_fail_test(expected_bool_value_ctor_from_expected_fail expected_bool_value_ctor_from_expected_fail.cpp
179+
add_fail_test(expected_bool_value_ctor_from_expected_fail expected_bool_value_ctor_from_expected_fail.test.cpp
180180
"no matching function|no matching constructor|no overloaded function could convert"
181181
)
182182

183183
# Fix 4 — Mandates: T must not be a specialization of unexpected
184-
add_fail_test(expected_unexpected_value_type_fail expected_unexpected_value_type_fail.cpp
184+
add_fail_test(expected_unexpected_value_type_fail expected_unexpected_value_type_fail.test.cpp
185185
"T must not be a specialization of unexpected"
186186
)
187187

188188
# Step 7 — expected<T&, E> reference specialization: constructor constraints
189-
add_fail_test(expected_ref_temporary_fail expected_ref_temporary_fail.cpp
189+
add_fail_test(expected_ref_temporary_fail expected_ref_temporary_fail.test.cpp
190190
"binding a temporary to T& creates a dangling reference|use of deleted function|call to deleted|no matching function|no matching constructor|no overloaded function could convert|attempting to reference"
191191
)
192-
add_fail_test(expected_ref_no_default_fail expected_ref_no_default_fail.cpp
192+
add_fail_test(expected_ref_no_default_fail expected_ref_no_default_fail.test.cpp
193193
"no default constructor|use of deleted function|call to deleted|attempting to reference"
194194
)
195-
add_fail_test(expected_ref_inplace_value_fail expected_ref_inplace_value_fail.cpp
195+
add_fail_test(expected_ref_inplace_value_fail expected_ref_inplace_value_fail.test.cpp
196196
"no in_place value constructor|use of deleted function|call to deleted|attempting to reference"
197197
)
198198

199199
# Step 8 — expected<T, E&> reference error: dangling prevention
200-
add_fail_test(expected_ref_e_temporary_error_fail expected_ref_e_temporary_error_fail.cpp
200+
add_fail_test(expected_ref_e_temporary_error_fail expected_ref_e_temporary_error_fail.test.cpp
201201
"cannot bind to non-const E&|use of deleted function|call to deleted|attempting to reference"
202202
)
203-
add_fail_test(expected_ref_e_const_lvalue_fail expected_ref_e_const_lvalue_fail.cpp
203+
add_fail_test(expected_ref_e_const_lvalue_fail expected_ref_e_const_lvalue_fail.test.cpp
204204
"cannot bind to non-const E&|use of deleted function|call to deleted|attempting to reference"
205205
)
206206

207207
# Step 8 — expected<T, E&>: no constructor or assignment from unexpected<G>
208208
# (would bind E& to storage inside the temporary unexpected — dangling)
209209
add_fail_test(expected_ref_e_construct_from_unexpected_fail
210-
expected_ref_e_construct_from_unexpected_fail.cpp
210+
expected_ref_e_construct_from_unexpected_fail.test.cpp
211211
"no constructor from unexpected|use of deleted function|call to deleted|invokes a deleted function|attempting to reference"
212212
)
213213
add_fail_test(expected_ref_e_assign_unexpected_fail
214-
expected_ref_e_assign_unexpected_fail.cpp
214+
expected_ref_e_assign_unexpected_fail.test.cpp
215215
"no assignment from unexpected|use of deleted function|call to deleted|selected deleted operator|attempting to reference"
216216
)
217217

218218
# Step 7/8 parity — expected<T&,E> or_else value_type mandate (added in Step 8 review)
219-
add_fail_test(expected_ref_or_else_wrong_value_type_fail expected_ref_or_else_wrong_value_type_fail.cpp
219+
add_fail_test(expected_ref_or_else_wrong_value_type_fail expected_ref_or_else_wrong_value_type_fail.test.cpp
220220
"F must return expected with the same value_type"
221221
)
222222

223223
# Step 9 — expected<T&, E&> dangling prevention and no-default constraint
224-
add_fail_test(expected_ref_both_temporary_val_fail expected_ref_both_temporary_val_fail.cpp
224+
add_fail_test(expected_ref_both_temporary_val_fail expected_ref_both_temporary_val_fail.test.cpp
225225
"binding a temporary to T& creates a dangling reference|use of deleted function|call to deleted|no matching function|no matching constructor|no overloaded function could convert|attempting to reference"
226226
)
227-
add_fail_test(expected_ref_both_temporary_err_fail expected_ref_both_temporary_err_fail.cpp
227+
add_fail_test(expected_ref_both_temporary_err_fail expected_ref_both_temporary_err_fail.test.cpp
228228
"cannot bind to non-const E&|use of deleted function|call to deleted|attempting to reference"
229229
)
230-
add_fail_test(expected_ref_both_no_default_fail expected_ref_both_no_default_fail.cpp
230+
add_fail_test(expected_ref_both_no_default_fail expected_ref_both_no_default_fail.test.cpp
231231
"no default constructor|use of deleted function|call to deleted|attempting to reference"
232232
)
233233

234234
# Step 9 — expected<T&, E&>: no constructor or assignment from unexpected<G>
235235
# (would bind E& to storage inside the temporary unexpected — dangling)
236236
add_fail_test(expected_ref_both_construct_from_unexpected_fail
237-
expected_ref_both_construct_from_unexpected_fail.cpp
237+
expected_ref_both_construct_from_unexpected_fail.test.cpp
238238
"no constructor from unexpected|use of deleted function|call to deleted|invokes a deleted function|attempting to reference"
239239
)
240240
add_fail_test(expected_ref_both_assign_unexpected_fail
241-
expected_ref_both_assign_unexpected_fail.cpp
241+
expected_ref_both_assign_unexpected_fail.test.cpp
242242
"no assignment from unexpected|use of deleted function|call to deleted|selected deleted operator|attempting to reference"
243243
)
244244

245245
# Step 9 — expected<T&, E&>: or_else value_type mandate
246246
add_fail_test(expected_ref_both_or_else_wrong_value_type_fail
247-
expected_ref_both_or_else_wrong_value_type_fail.cpp
247+
expected_ref_both_or_else_wrong_value_type_fail.test.cpp
248248
"F must return expected with the same value_type"
249249
)
250250

251251
# Step 7 — expected<T&, E> Mandates: E constraints
252-
add_fail_test(expected_ref_e_ref_fail expected_ref_e_ref_fail.cpp
252+
add_fail_test(expected_ref_e_ref_fail expected_ref_e_ref_fail.test.cpp
253253
"E must not be an rvalue reference"
254254
)
255-
add_fail_test(expected_ref_e_void_fail expected_ref_e_void_fail.cpp
255+
add_fail_test(expected_ref_e_void_fail expected_ref_e_void_fail.test.cpp
256256
"E must not be void"
257257
)
258-
add_fail_test(expected_ref_e_array_fail expected_ref_e_array_fail.cpp
258+
add_fail_test(expected_ref_e_array_fail expected_ref_e_array_fail.test.cpp
259259
"E must not be an array type"
260260
)
261-
add_fail_test(expected_ref_e_cv_fail expected_ref_e_cv_fail.cpp
261+
add_fail_test(expected_ref_e_cv_fail expected_ref_e_cv_fail.test.cpp
262262
"E must not be cv-qualified"
263263
)
264264

265265
# Step 7 — expected<T&, E> monadic mandates
266266
add_fail_test(expected_ref_and_then_wrong_error_type_fail
267-
expected_ref_and_then_wrong_error_type_fail.cpp
267+
expected_ref_and_then_wrong_error_type_fail.test.cpp
268268
"F must return expected with the same error_type"
269269
)
270270
add_fail_test(expected_ref_transform_error_ref_result_fail
271-
expected_ref_transform_error_ref_result_fail.cpp
271+
expected_ref_transform_error_ref_result_fail.test.cpp
272272
"G must be an object type"
273273
)
274274

275275
# Step 8 — expected<T, E&> Mandates: T and E type constraints
276276
add_fail_test(expected_ref_e_t_array_fail
277-
expected_ref_e_t_array_fail.cpp
277+
expected_ref_e_t_array_fail.test.cpp
278278
"T must not be an array type"
279279
)
280280
add_fail_test(expected_ref_e_e_array_fail
281-
expected_ref_e_e_array_fail.cpp
281+
expected_ref_e_e_array_fail.test.cpp
282282
"E must not be an array type"
283283
)
284284
add_fail_test(expected_ref_e_t_inplace_fail
285-
expected_ref_e_t_inplace_fail.cpp
285+
expected_ref_e_t_inplace_fail.test.cpp
286286
"T must not be in_place_t"
287287
)
288288
add_fail_test(expected_ref_e_t_unexpect_fail
289-
expected_ref_e_t_unexpect_fail.cpp
289+
expected_ref_e_t_unexpect_fail.test.cpp
290290
"T must not be unexpect_t"
291291
)
292292
add_fail_test(expected_ref_e_t_unexpected_fail
293-
expected_ref_e_t_unexpected_fail.cpp
293+
expected_ref_e_t_unexpected_fail.test.cpp
294294
"T must not be a specialization of unexpected"
295295
)
296296

297297
# Step 8 — expected<T, E&> monadic mandates
298298
add_fail_test(expected_ref_e_and_then_wrong_error_type_fail
299-
expected_ref_e_and_then_wrong_error_type_fail.cpp
299+
expected_ref_e_and_then_wrong_error_type_fail.test.cpp
300300
"F must return expected with the same error_type"
301301
)
302302
add_fail_test(expected_ref_e_or_else_wrong_value_type_fail
303-
expected_ref_e_or_else_wrong_value_type_fail.cpp
303+
expected_ref_e_or_else_wrong_value_type_fail.test.cpp
304304
"F must return expected with the same value_type"
305305
)
306306
add_fail_test(expected_ref_e_transform_error_ref_result_fail
307-
expected_ref_e_transform_error_ref_result_fail.cpp
307+
expected_ref_e_transform_error_ref_result_fail.test.cpp
308308
"G must be an object type"
309309
)
310310

311311
# Step 9 — expected<T&, E&> Mandates: T and E type constraints
312312
add_fail_test(expected_ref_both_t_array_fail
313-
expected_ref_both_t_array_fail.cpp
313+
expected_ref_both_t_array_fail.test.cpp
314314
"T must not be an array type"
315315
)
316316
add_fail_test(expected_ref_both_e_array_fail
317-
expected_ref_both_e_array_fail.cpp
317+
expected_ref_both_e_array_fail.test.cpp
318318
"E must not be an array type"
319319
)
320320
add_fail_test(expected_ref_both_t_inplace_fail
321-
expected_ref_both_t_inplace_fail.cpp
321+
expected_ref_both_t_inplace_fail.test.cpp
322322
"T must not be in_place_t"
323323
)
324324
add_fail_test(expected_ref_both_t_unexpect_fail
325-
expected_ref_both_t_unexpect_fail.cpp
325+
expected_ref_both_t_unexpect_fail.test.cpp
326326
"T must not be unexpect_t"
327327
)
328328
add_fail_test(expected_ref_both_t_unexpected_fail
329-
expected_ref_both_t_unexpected_fail.cpp
329+
expected_ref_both_t_unexpected_fail.test.cpp
330330
"T must not be a specialization of unexpected"
331331
)
332332
add_fail_test(expected_ref_both_inplace_value_fail
333-
expected_ref_both_inplace_value_fail.cpp
333+
expected_ref_both_inplace_value_fail.test.cpp
334334
"no in_place value constructor|use of deleted function|call to deleted|attempting to reference"
335335
)
336336

337337
# Step 9 — expected<T&, E&> monadic mandates
338338
add_fail_test(expected_ref_both_and_then_wrong_error_type_fail
339-
expected_ref_both_and_then_wrong_error_type_fail.cpp
339+
expected_ref_both_and_then_wrong_error_type_fail.test.cpp
340340
"F must return expected with the same error_type"
341341
)
342342
add_fail_test(expected_ref_both_transform_error_ref_result_fail
343-
expected_ref_both_transform_error_ref_result_fail.cpp
343+
expected_ref_both_transform_error_ref_result_fail.test.cpp
344344
"G must be an object type"
345345
)
346346

347347
# Step 10 — expected<void, E&> dangling prevention and no value_or
348348
add_fail_test(expected_void_ref_e_temporary_fail
349-
expected_void_ref_e_temporary_fail.cpp
349+
expected_void_ref_e_temporary_fail.test.cpp
350350
"cannot bind to non-const E&|use of deleted function|call to deleted|attempting to reference"
351351
)
352352
add_fail_test(expected_void_ref_e_const_lvalue_fail
353-
expected_void_ref_e_const_lvalue_fail.cpp
353+
expected_void_ref_e_const_lvalue_fail.test.cpp
354354
"cannot bind to non-const E&|use of deleted function|call to deleted|attempting to reference"
355355
)
356356
add_fail_test(expected_void_ref_e_no_value_or_fail
357-
expected_void_ref_e_no_value_or_fail.cpp
357+
expected_void_ref_e_no_value_or_fail.test.cpp
358358
"no value_or for void|use of deleted function|call to deleted|attempting to reference"
359359
)
360360
add_fail_test(expected_void_ref_e_construct_from_unexpected_fail
361-
expected_void_ref_e_construct_from_unexpected_fail.cpp
361+
expected_void_ref_e_construct_from_unexpected_fail.test.cpp
362362
"no constructor from unexpected|use of deleted function|call to deleted|invokes a deleted function|attempting to reference"
363363
)
364364
add_fail_test(expected_void_ref_e_assign_unexpected_fail
365-
expected_void_ref_e_assign_unexpected_fail.cpp
365+
expected_void_ref_e_assign_unexpected_fail.test.cpp
366366
"no assignment from unexpected|use of deleted function|call to deleted|invokes a deleted function|selected deleted operator|attempting to reference"
367367
)
368368

tests/beman/expected/and_then_not_expected_fail.cpp renamed to tests/beman/expected/and_then_not_expected_fail.test.cpp

File renamed without changes.

tests/beman/expected/and_then_wrong_error_type_fail.cpp renamed to tests/beman/expected/and_then_wrong_error_type_fail.test.cpp

File renamed without changes.

tests/beman/expected/expected_bool_value_ctor_from_expected_fail.cpp renamed to tests/beman/expected/expected_bool_value_ctor_from_expected_fail.test.cpp

File renamed without changes.

tests/beman/expected/expected_emplace_throwing_fail.cpp renamed to tests/beman/expected/expected_emplace_throwing_fail.test.cpp

File renamed without changes.

tests/beman/expected/expected_ref_and_then_wrong_error_type_fail.cpp renamed to tests/beman/expected/expected_ref_and_then_wrong_error_type_fail.test.cpp

File renamed without changes.

tests/beman/expected/expected_ref_both_and_then_wrong_error_type_fail.cpp renamed to tests/beman/expected/expected_ref_both_and_then_wrong_error_type_fail.test.cpp

File renamed without changes.

tests/beman/expected/expected_ref_both_assign_unexpected_fail.cpp renamed to tests/beman/expected/expected_ref_both_assign_unexpected_fail.test.cpp

File renamed without changes.

tests/beman/expected/expected_ref_both_construct_from_unexpected_fail.cpp renamed to tests/beman/expected/expected_ref_both_construct_from_unexpected_fail.test.cpp

File renamed without changes.

tests/beman/expected/expected_ref_both_e_array_fail.cpp renamed to tests/beman/expected/expected_ref_both_e_array_fail.test.cpp

File renamed without changes.

0 commit comments

Comments
 (0)