@@ -63,15 +63,15 @@ static void handleCustomErrorUPVoid(std::unique_ptr<CustomError> CE) {}
6363} // end anonymous namespace
6464
6565// Test that a checked success value doesn't cause any issues.
66- TEST (Error , CheckedSuccess) {
66+ TEST (ErrorTest , CheckedSuccess) {
6767 Error E = Error::success ();
6868 EXPECT_FALSE (E) << " Unexpected error while testing Error 'Success'" ;
6969}
7070
7171// Check that a consumed success value doesn't cause any issues.
72- TEST (Error , ConsumeSuccess) { consumeError (Error::success ()); }
72+ TEST (ErrorTest , ConsumeSuccess) { consumeError (Error::success ()); }
7373
74- TEST (Error , ConsumeError) {
74+ TEST (ErrorTest , ConsumeError) {
7575 Error E = make_error<CustomError>(42 );
7676 if (E) {
7777 consumeError (std::move (E));
@@ -80,15 +80,15 @@ TEST(Error, ConsumeError) {
8080}
8181
8282// Test that unchecked success values cause an abort.
83- TEST (Error , UncheckedSuccess) {
83+ TEST (ErrorTest , UncheckedSuccess) {
8484 EXPECT_DEATH (
8585 { Error E = Error::success (); },
8686 " Error must be checked prior to destruction" )
8787 << " Unchecked Error Succes value did not cause abort()" ;
8888}
8989
9090// Test that a checked but unhandled error causes an abort.
91- TEST (Error , CheckedButUnhandledError) {
91+ TEST (ErrorTest , CheckedButUnhandledError) {
9292 auto DropUnhandledError = []() {
9393 Error E = make_error<CustomError>(42 );
9494 (void )!E;
@@ -99,7 +99,7 @@ TEST(Error, CheckedButUnhandledError) {
9999}
100100
101101// Check that we can handle a custom error.
102- TEST (Error , HandleCustomError) {
102+ TEST (ErrorTest , HandleCustomError) {
103103 int CaughtErrorInfo = 0 ;
104104 handleAllErrors (make_error<CustomError>(42 ), [&](const CustomError &CE) {
105105 CaughtErrorInfo = CE.getInfo ();
@@ -121,7 +121,7 @@ TEST(Error, HandleCustomError) {
121121// void (unique_ptr<Err>)
122122// Error (unique_ptr<Err>) mutable
123123// void (unique_ptr<Err>) mutable
124- TEST (Error , HandlerTypeDeduction) {
124+ TEST (ErrorTest , HandlerTypeDeduction) {
125125
126126 handleAllErrors (make_error<CustomError>(42 ), [](const CustomError &CE) {});
127127
@@ -173,7 +173,7 @@ TEST(Error, HandlerTypeDeduction) {
173173}
174174
175175// Test that we can handle errors with custom base classes.
176- TEST (Error , HandleCustomErrorWithCustomBaseClass) {
176+ TEST (ErrorTest , HandleCustomErrorWithCustomBaseClass) {
177177 int CaughtErrorInfo = 0 ;
178178 std::string CaughtErrorExtraInfo;
179179 handleAllErrors (make_error<CustomSubError>(42 , " foo" ),
@@ -188,7 +188,7 @@ TEST(Error, HandleCustomErrorWithCustomBaseClass) {
188188}
189189
190190// Check that we trigger only the first handler that applies.
191- TEST (Error , FirstHandlerOnly) {
191+ TEST (ErrorTest , FirstHandlerOnly) {
192192 int DummyInfo = 0 ;
193193 int CaughtErrorInfo = 0 ;
194194 std::string CaughtErrorExtraInfo;
@@ -208,7 +208,7 @@ TEST(Error, FirstHandlerOnly) {
208208}
209209
210210// Check that general handlers shadow specific ones.
211- TEST (Error , HandlerShadowing) {
211+ TEST (ErrorTest , HandlerShadowing) {
212212 int CaughtErrorInfo = 0 ;
213213 int DummyInfo = 0 ;
214214 std::string DummyExtraInfo;
@@ -240,14 +240,14 @@ static void errAsOutParamHelper(Error &Err) {
240240}
241241
242242// Test that ErrorAsOutParameter sets the checked flag on construction.
243- TEST (Error , ErrorAsOutParameterChecked) {
243+ TEST (ErrorTest , ErrorAsOutParameterChecked) {
244244 Error E = Error::success ();
245245 errAsOutParamHelper (E);
246246 (void )!!E;
247247}
248248
249249// Test that ErrorAsOutParameter clears the checked flag on destruction.
250- TEST (Error , ErrorAsOutParameterUnchecked) {
250+ TEST (ErrorTest , ErrorAsOutParameterUnchecked) {
251251 EXPECT_DEATH (
252252 {
253253 Error E = Error::success ();
@@ -258,7 +258,7 @@ TEST(Error, ErrorAsOutParameterUnchecked) {
258258}
259259
260260// Check 'Error::isA<T>' method handling.
261- TEST (Error , IsAHandling) {
261+ TEST (ErrorTest , IsAHandling) {
262262 // Check 'isA' handling.
263263 Error E = make_error<CustomError>(42 );
264264 Error F = make_error<CustomSubError>(42 , " foo" );
@@ -275,7 +275,7 @@ TEST(Error, IsAHandling) {
275275 consumeError (std::move (G));
276276}
277277
278- TEST (Error , StringError) {
278+ TEST (ErrorTest , StringError) {
279279 auto E = make_error<StringError>(" foo" );
280280 if (E.isA <StringError>())
281281 EXPECT_EQ (toString (std::move (E)), " foo" ) << " Unexpected StringError value" ;
@@ -284,15 +284,15 @@ TEST(Error, StringError) {
284284}
285285
286286// Test Checked Expected<T> in success mode.
287- TEST (Error , CheckedExpectedInSuccessMode) {
287+ TEST (ErrorTest , CheckedExpectedInSuccessMode) {
288288 Expected<int > A = 7 ;
289289 EXPECT_TRUE (!!A) << " Expected with non-error value doesn't convert to 'true'" ;
290290 // Access is safe in second test, since we checked the error in the first.
291291 EXPECT_EQ (*A, 7 ) << " Incorrect Expected non-error value" ;
292292}
293293
294294// Test Expected with reference type.
295- TEST (Error , ExpectedWithReferenceType) {
295+ TEST (ErrorTest , ExpectedWithReferenceType) {
296296 int A = 7 ;
297297 Expected<int &> B = A;
298298 // 'Check' B.
@@ -304,7 +304,7 @@ TEST(Error, ExpectedWithReferenceType) {
304304// Test Unchecked Expected<T> in success mode.
305305// We expect this to blow up the same way Error would.
306306// Test runs in debug mode only.
307- TEST (Error , UncheckedExpectedInSuccessModeDestruction) {
307+ TEST (ErrorTest , UncheckedExpectedInSuccessModeDestruction) {
308308 EXPECT_DEATH (
309309 { Expected<int > A = 7 ; },
310310 " Expected<T> must be checked before access or destruction." )
@@ -314,7 +314,7 @@ TEST(Error, UncheckedExpectedInSuccessModeDestruction) {
314314// Test Unchecked Expected<T> in success mode.
315315// We expect this to blow up the same way Error would.
316316// Test runs in debug mode only.
317- TEST (Error , UncheckedExpectedInSuccessModeAccess) {
317+ TEST (ErrorTest , UncheckedExpectedInSuccessModeAccess) {
318318 EXPECT_DEATH (
319319 {
320320 Expected<int > A = 7 ;
@@ -327,7 +327,7 @@ TEST(Error, UncheckedExpectedInSuccessModeAccess) {
327327// Test Unchecked Expected<T> in success mode.
328328// We expect this to blow up the same way Error would.
329329// Test runs in debug mode only.
330- TEST (Error , UncheckedExpectedInSuccessModeAssignment) {
330+ TEST (ErrorTest , UncheckedExpectedInSuccessModeAssignment) {
331331 EXPECT_DEATH (
332332 {
333333 Expected<int > A = 7 ;
@@ -338,7 +338,7 @@ TEST(Error, UncheckedExpectedInSuccessModeAssignment) {
338338}
339339
340340// Test Expected<T> in failure mode.
341- TEST (Error , ExpectedInFailureMode) {
341+ TEST (ErrorTest , ExpectedInFailureMode) {
342342 Expected<int > A = make_error<CustomError>(42 );
343343 EXPECT_FALSE (!!A) << " Expected with error value doesn't convert to 'false'" ;
344344 Error E = A.takeError ();
@@ -349,7 +349,7 @@ TEST(Error, ExpectedInFailureMode) {
349349// Check that an Expected instance with an error value doesn't allow access to
350350// operator*.
351351// Test runs in debug mode only.
352- TEST (Error , AccessExpectedInFailureMode) {
352+ TEST (ErrorTest , AccessExpectedInFailureMode) {
353353 Expected<int > A = make_error<CustomError>(42 );
354354 EXPECT_DEATH (*A, " Expected<T> must be checked before access or destruction." )
355355 << " Incorrect Expected error value" ;
@@ -359,15 +359,15 @@ TEST(Error, AccessExpectedInFailureMode) {
359359// Check that an Expected instance with an error triggers an abort if
360360// unhandled.
361361// Test runs in debug mode only.
362- TEST (Error , UnhandledExpectedInFailureMode) {
362+ TEST (ErrorTest , UnhandledExpectedInFailureMode) {
363363 EXPECT_DEATH (
364364 { Expected<int > A = make_error<CustomError>(42 ); },
365365 " Expected<T> must be checked before access or destruction." )
366366 << " Unchecked Expected<T> failure value did not cause an abort()" ;
367367}
368368
369369// Test covariance of Expected.
370- TEST (Error , ExpectedCovariance) {
370+ TEST (ErrorTest , ExpectedCovariance) {
371371 class B {};
372372 class D : public B {};
373373
@@ -387,7 +387,7 @@ TEST(Error, ExpectedCovariance) {
387387}
388388
389389// Test that the ExitOnError utility works as expected.
390- TEST (Error , CantFailSuccess) {
390+ TEST (ErrorTest , CantFailSuccess) {
391391 cantFail (Error::success ());
392392
393393 int X = cantFail (Expected<int >(42 ));
@@ -399,7 +399,7 @@ TEST(Error, CantFailSuccess) {
399399}
400400
401401// Test that cantFail results in a crash if you pass it a failure value.
402- TEST (Error , CantFailDeath) {
402+ TEST (ErrorTest , CantFailDeath) {
403403 EXPECT_DEATH (cantFail (make_error<StringError>(" foo" )), " " )
404404 << " cantFail(Error) did not cause an abort for failure value" ;
405405
0 commit comments