Home | History | Annotate | Download | only in test

Lines Matching refs:Failure

72 // This function calls a test subroutine, catches the fatal failure it
75 // Calls a subrountine that yields a fatal failure.
78 // Catches the fatal failure and aborts the test.
94 // Tests catching a fatal failure in a subroutine.
96 printf("(expecting a failure that x should be 1)\n");
101 // Tests catching a fatal failure in a nested subroutine.
103 printf("(expecting a failure that x should be 1)\n");
105 // Calls a subrountine that yields a fatal failure.
108 // Catches the fatal failure and aborts the test.
120 printf("(expecting a failure on false)\n");
121 EXPECT_TRUE(false); // Generates a nonfatal failure
158 ADD_FAILURE() << "This failure is expected, and shouldn't have a trace.";
162 // After SCOPED_TRACE(), a failure in the current scope should contain
164 ADD_FAILURE() << "This failure is expected, and should have a trace.";
169 ADD_FAILURE() << "This failure is expected, and shouldn't have a trace.";
206 << "This failure is expected, and should contain trace point A.";
210 << "This failure is expected, and should contain trace point A and B.";
214 ADD_FAILURE() << "This failure is expected, and should contain "
219 ADD_FAILURE() << "This failure is expected, and should contain "
252 ADD_FAILURE() << "Expected failure #1, in the test fixture c'tor.";
256 ADD_FAILURE() << "Expected failure #5, in the test fixture d'tor.";
260 ADD_FAILURE() << "Expected failure #2, in SetUp().";
264 ADD_FAILURE() << "Expected failure #4, in TearDown.";
269 ADD_FAILURE() << "Expected failure #3, in the test body.";
281 ADD_FAILURE() << "Expected failure #2, in the test fixture d'tor.";
285 ADD_FAILURE() << "UNEXPECTED failure in SetUp(). "
287 << "had a fatal failure.";
291 ADD_FAILURE() << "UNEXPECTED failure in TearDown(). "
293 << "had a fatal failure.";
297 FAIL() << "Expected failure #1, in the test fixture c'tor.";
302 ADD_FAILURE() << "UNEXPECTED failure in the test body. "
304 << "had a fatal failure.";
316 ADD_FAILURE() << "Expected failure #1, in SetUp().";
320 FAIL() << "Expected failure #3, in TearDown().";
324 FAIL() << "Expected failure #4, in the test fixture d'tor.";
329 FAIL() << "Expected failure #2, in the test function.";
341 FAIL() << "Expected failure #1, in SetUp().";
345 FAIL() << "Expected failure #2, in TearDown().";
349 FAIL() << "Expected failure #3, in the test fixture d'tor.";
354 FAIL() << "UNEXPECTED failure in the test function. "
373 printf("(expecting a failure on thrown exception "
384 FAIL() << "UNEXPECTED failure in SetUp(). "
389 FAIL() << "UNEXPECTED failure in TearDown(). "
394 FAIL() << "UNEXPECTED failure in the d'tor. "
400 FAIL() << "UNEXPECTED failure in the test function. "
418 FAIL() << "Expected failure #2, in TearDown().";
422 FAIL() << "Expected failure #3, in the test fixture d'tor.";
427 FAIL() << "UNEXPECTED failure in the test function. "
440 FAIL() << "Expected failure #2, in TearDown().";
444 FAIL() << "Expected failure #3, in the test fixture d'tor.";
477 FAIL() << "Expected failure #2, in the test fixture d'tor.";
566 EXPECT_EQ(1, global_integer) << "Expected non-fatal failure.";
567 }, "Expected non-fatal failure.");
577 EXPECT_EQ(m, n) << "Expected non-fatal failure.";
578 }, "Expected non-fatal failure.");
582 // one non-fatal failure and no fatal failure.
585 ADD_FAILURE() << "Expected non-fatal failure.";
586 }, "Expected non-fatal failure.");
590 // non-fatal failure.
592 printf("(expecting a failure)\n");
600 printf("(expecting a failure)\n");
602 ADD_FAILURE() << "Expected non-fatal failure 1.";
603 ADD_FAILURE() << "Expected non-fatal failure 2.";
608 // failure.
610 printf("(expecting a failure)\n");
612 FAIL() << "Expected fatal failure.";
619 printf("(expecting a failure)\n");
630 printf("(expecting a failure)\n");
645 ASSERT_EQ(1, global_integer) << "Expected fatal failure.";
646 }, "Expected fatal failure.");
655 ASSERT_EQ(0, n) << "Expected fatal failure.";
656 }, "Expected fatal failure.");
660 // one fatal failure and no non-fatal failure.
663 FAIL() << "Expected fatal failure.";
664 }, "Expected fatal failure.");
668 // failure.
670 printf("(expecting a failure)\n");
675 // A helper for generating a fatal failure.
677 FAIL() << "Expected fatal failure.";
683 printf("(expecting a failure)\n");
691 // failure.
693 printf("(expecting a failure)\n");
695 ADD_FAILURE() << "Expected non-fatal failure.";
702 printf("(expecting a failure)\n");
713 printf("(expecting a failure)\n");
737 TYPED_TEST(TypedTest, Failure) {
738 EXPECT_EQ(1, TypeParam()) << "Expected failure";
756 TYPED_TEST_P(TypedTestP, Failure) {
757 EXPECT_EQ(1, TypeParam()) << "Expected failure";
760 REGISTER_TYPED_TEST_CASE_P(TypedTestP, Success, Failure);
815 // Tests various failure conditions of
823 static void AddFailure(FailureMode failure) {
824 if (failure == FATAL_FAILURE) {
825 FAIL() << "Expected fatal failure.";
827 ADD_FAILURE() << "Expected non-fatal failure.";
833 // Expected fatal failure, but succeeds.
834 printf("(expecting 1 failure)\n");
835 EXPECT_FATAL_FAILURE(SUCCEED(), "Expected fatal failure.");
836 // Expected fatal failure, but got a non-fatal failure.
837 printf("(expecting 1 failure)\n");
839 "failure.");
841 printf("(expecting 1 failure)\n");
842 EXPECT_FATAL_FAILURE(AddFailure(FATAL_FAILURE), "Some other fatal failure "
847 // Expected non-fatal failure, but succeeds.
848 printf("(expecting 1 failure)\n");
849 EXPECT_NONFATAL_FAILURE(SUCCEED(), "Expected non-fatal failure.");
850 // Expected non-fatal failure, but got a fatal failure.
851 printf("(expecting 1 failure)\n");
852 EXPECT_NONFATAL_FAILURE(AddFailure(FATAL_FAILURE), "Expected fatal failure.");
854 printf("(expecting 1 failure)\n");
856 "failure.");
863 static void AddFailureInOtherThread(FailureMode failure) {
868 &failure);
873 FailureMode* failure = static_cast<FailureMode*>(attr);
874 AddFailure(*failure);
883 "Expected fatal failure.");
890 "Expected non-fatal failure.");
914 // Expected fatal failure, but succeeds.
915 printf("(expecting 1 failure)\n");
916 EXPECT_FATAL_FAILURE_ON_ALL_THREADS(SUCCEED(), "Expected fatal failure.");
917 // Expected fatal failure, but got a non-fatal failure.
918 printf("(expecting 1 failure)\n");
920 "Expected non-fatal failure.");
922 printf("(expecting 1 failure)\n");
924 "Some other fatal failure expected.");
928 // Expected non-fatal failure, but succeeds.
929 printf("(expecting 1 failure)\n");
931 "failure.");
932 // Expected non-fatal failure, but got a fatal failure.
933 printf("(expecting 1 failure)\n");
935 "Expected fatal failure.");
937 printf("(expecting 1 failure)\n");
939 "Some other non-fatal failure.");
953 FAIL() << "Expected fatal failure.";
965 ADD_FAILURE() << "Expected non-fatal failure.";