Home | History | Annotate | Download | only in test

Lines Matching refs:Failure

66 // This function calls a test subroutine, catches the fatal failure it
69 // Calls a subrountine that yields a fatal failure.
72 // Catches the fatal failure and aborts the test.
88 // Tests catching a fatal failure in a subroutine.
90 printf("(expecting a failure that x should be 1)\n");
95 // Tests catching a fatal failure in a nested subroutine.
97 printf("(expecting a failure that x should be 1)\n");
99 // Calls a subrountine that yields a fatal failure.
102 // Catches the fatal failure and aborts the test.
114 printf("(expecting a failure on false)\n");
115 EXPECT_TRUE(false); // Generates a nonfatal failure
152 ADD_FAILURE() << "This failure is expected, and shouldn't have a trace.";
156 // After SCOPED_TRACE(), a failure in the current scope should contain
158 ADD_FAILURE() << "This failure is expected, and should have a trace.";
163 ADD_FAILURE() << "This failure is expected, and shouldn't have a trace.";
200 << "This failure is expected, and should contain trace point A.";
204 << "This failure is expected, and should contain trace point A and B.";
208 ADD_FAILURE() << "This failure is expected, and should contain "
213 ADD_FAILURE() << "This failure is expected, and should contain "
245 ADD_FAILURE() << "Expected failure #1, in the test fixture c'tor.";
249 ADD_FAILURE() << "Expected failure #5, in the test fixture d'tor.";
253 ADD_FAILURE() << "Expected failure #2, in SetUp().";
257 ADD_FAILURE() << "Expected failure #4, in TearDown.";
262 ADD_FAILURE() << "Expected failure #3, in the test body.";
274 ADD_FAILURE() << "Expected failure #2, in the test fixture d'tor.";
278 ADD_FAILURE() << "UNEXPECTED failure in SetUp(). "
280 << "had a fatal failure.";
284 ADD_FAILURE() << "UNEXPECTED failure in TearDown(). "
286 << "had a fatal failure.";
290 FAIL() << "Expected failure #1, in the test fixture c'tor.";
295 ADD_FAILURE() << "UNEXPECTED failure in the test body. "
297 << "had a fatal failure.";
309 ADD_FAILURE() << "Expected failure #1, in SetUp().";
313 FAIL() << "Expected failure #3, in TearDown().";
317 FAIL() << "Expected failure #4, in the test fixture d'tor.";
322 FAIL() << "Expected failure #2, in the test function.";
334 FAIL() << "Expected failure #1, in SetUp().";
338 FAIL() << "Expected failure #2, in TearDown().";
342 FAIL() << "Expected failure #3, in the test fixture d'tor.";
347 FAIL() << "UNEXPECTED failure in the test function. "
366 printf("(expecting a failure on thrown exception "
377 FAIL() << "UNEXPECTED failure in SetUp(). "
382 FAIL() << "UNEXPECTED failure in TearDown(). "
387 FAIL() << "UNEXPECTED failure in the d'tor. "
393 FAIL() << "UNEXPECTED failure in the test function. "
411 FAIL() << "Expected failure #2, in TearDown().";
415 FAIL() << "Expected failure #3, in the test fixture d'tor.";
420 FAIL() << "UNEXPECTED failure in the test function. "
433 FAIL() << "Expected failure #2, in TearDown().";
437 FAIL() << "Expected failure #3, in the test fixture d'tor.";
470 FAIL() << "Expected failure #2, in the test fixture d'tor.";
559 EXPECT_EQ(1, global_integer) << "Expected non-fatal failure.";
560 }, "Expected non-fatal failure.");
570 EXPECT_EQ(m, n) << "Expected non-fatal failure.";
571 }, "Expected non-fatal failure.");
575 // one non-fatal failure and no fatal failure.
578 ADD_FAILURE() << "Expected non-fatal failure.";
579 }, "Expected non-fatal failure.");
583 // non-fatal failure.
585 printf("(expecting a failure)\n");
593 printf("(expecting a failure)\n");
595 ADD_FAILURE() << "Expected non-fatal failure 1.";
596 ADD_FAILURE() << "Expected non-fatal failure 2.";
601 // failure.
603 printf("(expecting a failure)\n");
605 FAIL() << "Expected fatal failure.";
612 printf("(expecting a failure)\n");
623 printf("(expecting a failure)\n");
638 ASSERT_EQ(1, global_integer) << "Expected fatal failure.";
639 }, "Expected fatal failure.");
648 ASSERT_EQ(0, n) << "Expected fatal failure.";
649 }, "Expected fatal failure.");
653 // one fatal failure and no non-fatal failure.
656 FAIL() << "Expected fatal failure.";
657 }, "Expected fatal failure.");
661 // failure.
663 printf("(expecting a failure)\n");
668 // A helper for generating a fatal failure.
670 FAIL() << "Expected fatal failure.";
676 printf("(expecting a failure)\n");
684 // failure.
686 printf("(expecting a failure)\n");
688 ADD_FAILURE() << "Expected non-fatal failure.";
695 printf("(expecting a failure)\n");
706 printf("(expecting a failure)\n");
730 TYPED_TEST(TypedTest, Failure) {
731 EXPECT_EQ(1, TypeParam()) << "Expected failure";
749 TYPED_TEST_P(TypedTestP, Failure) {
750 EXPECT_EQ(1U, TypeParam()) << "Expected failure";
753 REGISTER_TYPED_TEST_CASE_P(TypedTestP, Success, Failure);
808 // Tests various failure conditions of
816 static void AddFailure(FailureMode failure) {
817 if (failure == FATAL_FAILURE) {
818 FAIL() << "Expected fatal failure.";
820 ADD_FAILURE() << "Expected non-fatal failure.";
826 // Expected fatal failure, but succeeds.
827 printf("(expecting 1 failure)\n");
828 EXPECT_FATAL_FAILURE(SUCCEED(), "Expected fatal failure.");
829 // Expected fatal failure, but got a non-fatal failure.
830 printf("(expecting 1 failure)\n");
832 "failure.");
834 printf("(expecting 1 failure)\n");
835 EXPECT_FATAL_FAILURE(AddFailure(FATAL_FAILURE), "Some other fatal failure "
840 // Expected non-fatal failure, but succeeds.
841 printf("(expecting 1 failure)\n");
842 EXPECT_NONFATAL_FAILURE(SUCCEED(), "Expected non-fatal failure.");
843 // Expected non-fatal failure, but got a fatal failure.
844 printf("(expecting 1 failure)\n");
845 EXPECT_NONFATAL_FAILURE(AddFailure(FATAL_FAILURE), "Expected fatal failure.");
847 printf("(expecting 1 failure)\n");
849 "failure.");
856 static void AddFailureInOtherThread(FailureMode failure) {
861 &failure);
866 FailureMode* failure = static_cast<FailureMode*>(attr);
867 AddFailure(*failure);
876 "Expected fatal failure.");
883 "Expected non-fatal failure.");
907 // Expected fatal failure, but succeeds.
908 printf("(expecting 1 failure)\n");
909 EXPECT_FATAL_FAILURE_ON_ALL_THREADS(SUCCEED(), "Expected fatal failure.");
910 // Expected fatal failure, but got a non-fatal failure.
911 printf("(expecting 1 failure)\n");
913 "Expected non-fatal failure.");
915 printf("(expecting 1 failure)\n");
917 "Some other fatal failure expected.");
921 // Expected non-fatal failure, but succeeds.
922 printf("(expecting 1 failure)\n");
924 "failure.");
925 // Expected non-fatal failure, but got a fatal failure.
926 printf("(expecting 1 failure)\n");
928 "Expected fatal failure.");
930 printf("(expecting 1 failure)\n");
932 "Some other non-fatal failure.");
946 FAIL() << "Expected fatal failure.";
958 ADD_FAILURE() << "Expected non-fatal failure.";