Lines Matching defs:failure

69 // This function calls a test subroutine, catches the fatal failure it
72 // Calls a subrountine that yields a fatal failure.
75 // Catches the fatal failure and aborts the test.
120 // Tests catching a fatal failure in a subroutine.
122 printf("(expecting a failure that x should be 1)\n");
127 // Tests catching a fatal failure in a nested subroutine.
129 printf("(expecting a failure that x should be 1)\n");
131 // Calls a subrountine that yields a fatal failure.
134 // Catches the fatal failure and aborts the test.
146 printf("(expecting a failure on false)\n");
147 EXPECT_TRUE(false); // Generates a nonfatal failure
184 ADD_FAILURE() << "This failure is expected, and shouldn't have a trace.";
188 // After SCOPED_TRACE(), a failure in the current scope should contain
190 ADD_FAILURE() << "This failure is expected, and should have a trace.";
195 ADD_FAILURE() << "This failure is expected, and shouldn't have a trace.";
232 << "This failure is expected, and should contain trace point A.";
236 << "This failure is expected, and should contain trace point A and B.";
240 ADD_FAILURE() << "This failure is expected, and should "
245 ADD_FAILURE() << "This failure is expected, and should "
261 // | generates failure #1
265 // generates failure #2 |
268 // waits for n3 | generates failure #3
270 // | generates failure #4
273 // generates failure #5 | finishes
275 // generates failure #6 |
289 << "Expected failure #1 (in thread B, only trace B alive).";
294 << "Expected failure #3 (in thread B, trace A & B both alive).";
297 << "Expected failure #4 (in thread B, only trace A alive).";
313 << "Expected failure #2 (in thread A, trace A & B both alive).";
318 << "Expected failure #5 (in thread A, only trace A alive).";
321 << "Expected failure #6 (in thread A, no trace alive).";
354 ADD_FAILURE() << "Expected failure #1, in the test fixture c'tor.";
358 ADD_FAILURE() << "Expected failure #5, in the test fixture d'tor.";
362 ADD_FAILURE() << "Expected failure #2, in SetUp().";
366 ADD_FAILURE() << "Expected failure #4, in TearDown.";
371 ADD_FAILURE() << "Expected failure #3, in the test body.";
383 ADD_FAILURE() << "Expected failure #2, in the test fixture d'tor.";
387 ADD_FAILURE() << "UNEXPECTED failure in SetUp(). "
389 << "had a fatal failure.";
393 ADD_FAILURE() << "UNEXPECTED failure in TearDown(). "
395 << "had a fatal failure.";
400 FAIL() << "Expected failure #1, in the test fixture c'tor.";
405 ADD_FAILURE() << "UNEXPECTED failure in the test body. "
407 << "had a fatal failure.";
419 ADD_FAILURE() << "Expected failure #1, in SetUp().";
423 FAIL() << "Expected failure #3, in TearDown().";
427 FAIL() << "Expected failure #4, in the test fixture d'tor.";
432 FAIL() << "Expected failure #2, in the test function.";
444 FAIL() << "Expected failure #1, in SetUp().";
448 FAIL() << "Expected failure #2, in TearDown().";
452 FAIL() << "Expected failure #3, in the test fixture d'tor.";
457 FAIL() << "UNEXPECTED failure in the test function. "
462 ADD_FAILURE_AT("foo.cc", 42) << "Expected failure in foo.cc";
600 EXPECT_EQ(1, global_integer) << "Expected non-fatal failure.";
601 }, "Expected non-fatal failure.");
611 EXPECT_EQ(m, n) << "Expected non-fatal failure.";
612 }, "Expected non-fatal failure.");
616 // one non-fatal failure and no fatal failure.
619 ADD_FAILURE() << "Expected non-fatal failure.";
620 }, "Expected non-fatal failure.");
624 // non-fatal failure.
626 printf("(expecting a failure)\n");
634 printf("(expecting a failure)\n");
636 ADD_FAILURE() << "Expected non-fatal failure 1.";
637 ADD_FAILURE() << "Expected non-fatal failure 2.";
642 // failure.
644 printf("(expecting a failure)\n");
646 FAIL() << "Expected fatal failure.";
653 printf("(expecting a failure)\n");
664 printf("(expecting a failure)\n");
679 ASSERT_EQ(1, global_integer) << "Expected fatal failure.";
680 }, "Expected fatal failure.");
689 ASSERT_EQ(0, n) << "Expected fatal failure.";
690 }, "Expected fatal failure.");
694 // one fatal failure and no non-fatal failure.
697 FAIL() << "Expected fatal failure.";
698 }, "Expected fatal failure.");
702 // failure.
704 printf("(expecting a failure)\n");
709 // A helper for generating a fatal failure.
711 FAIL() << "Expected fatal failure.";
717 printf("(expecting a failure)\n");
725 // failure.
727 printf("(expecting a failure)\n");
729 ADD_FAILURE() << "Expected non-fatal failure.";
736 printf("(expecting a failure)\n");
747 printf("(expecting a failure)\n");
774 EXPECT_EQ("b", GetParam()) << "Expected failure";
798 EXPECT_EQ(1, TypeParam()) << "Expected failure";
817 EXPECT_EQ(1U, TypeParam()) << "Expected failure";
875 // Tests various failure conditions of
883 static void AddFailure(FailureMode failure) {
884 if (failure == FATAL_FAILURE) {
885 FAIL() << "Expected fatal failure.";
887 ADD_FAILURE() << "Expected non-fatal failure.";
893 // Expected fatal failure, but succeeds.
894 printf("(expecting 1 failure)\n");
895 EXPECT_FATAL_FAILURE(SUCCEED(), "Expected fatal failure.");
896 // Expected fatal failure, but got a non-fatal failure.
897 printf("(expecting 1 failure)\n");
899 "failure.");
901 printf("(expecting 1 failure)\n");
902 EXPECT_FATAL_FAILURE(AddFailure(FATAL_FAILURE), "Some other fatal failure "
907 // Expected non-fatal failure, but succeeds.
908 printf("(expecting 1 failure)\n");
909 EXPECT_NONFATAL_FAILURE(SUCCEED(), "Expected non-fatal failure.");
910 // Expected non-fatal failure, but got a fatal failure.
911 printf("(expecting 1 failure)\n");
912 EXPECT_NONFATAL_FAILURE(AddFailure(FATAL_FAILURE), "Expected fatal failure.");
914 printf("(expecting 1 failure)\n");
916 "failure.");
923 static void AddFailureInOtherThread(FailureMode failure) {
924 ThreadWithParam<FailureMode> thread(&AddFailure, failure, NULL);
933 "Expected fatal failure.");
940 "Expected non-fatal failure.");
964 // Expected fatal failure, but succeeds.
965 printf("(expecting 1 failure)\n");
966 EXPECT_FATAL_FAILURE_ON_ALL_THREADS(SUCCEED(), "Expected fatal failure.");
967 // Expected fatal failure, but got a non-fatal failure.
968 printf("(expecting 1 failure)\n");
970 "Expected non-fatal failure.");
972 printf("(expecting 1 failure)\n");
974 "Some other fatal failure expected.");
978 // Expected non-fatal failure, but succeeds.
979 printf("(expecting 1 failure)\n");
981 "failure.");
982 // Expected non-fatal failure, but got a fatal failure.
983 printf("(expecting 1 failure)\n");
985 "Expected fatal failure.");
987 printf("(expecting 1 failure)\n");
989 "Some other non-fatal failure.");
1003 FAIL() << "Expected fatal failure.";
1015 ADD_FAILURE() << "Expected non-fatal failure.";