Home | History | Annotate | Download | only in test

Lines Matching refs:failure

68 // This function calls a test subroutine, catches the fatal failure it
71 // Calls a subrountine that yields a fatal failure.
74 // Catches the fatal failure and aborts the test.
104 // Tests catching a fatal failure in a subroutine.
106 printf("(expecting a failure that x should be 1)\n");
111 // Tests catching a fatal failure in a nested subroutine.
113 printf("(expecting a failure that x should be 1)\n");
115 // Calls a subrountine that yields a fatal failure.
118 // Catches the fatal failure and aborts the test.
130 printf("(expecting a failure on false)\n");
131 EXPECT_TRUE(false); // Generates a nonfatal failure
168 ADD_FAILURE() << "This failure is expected, and shouldn't have a trace.";
172 // After SCOPED_TRACE(), a failure in the current scope should contain
174 ADD_FAILURE() << "This failure is expected, and should have a trace.";
179 ADD_FAILURE() << "This failure is expected, and shouldn't have a trace.";
216 << "This failure is expected, and should contain trace point A.";
220 << "This failure is expected, and should contain trace point A and B.";
224 ADD_FAILURE() << "This failure is expected, and should contain "
229 ADD_FAILURE() << "This failure is expected, and should contain "
245 // | generates failure #1
249 // generates failure #2 |
252 // waits for n3 | generates failure #3
254 // | generates failure #4
257 // generates failure #5 | finishes
259 // generates failure #6 |
273 << "Expected failure #1 (in thread B, only trace B alive).";
278 << "Expected failure #3 (in thread B, trace A & B both alive).";
281 << "Expected failure #4 (in thread B, only trace A alive).";
297 << "Expected failure #2 (in thread A, trace A & B both alive).";
302 << "Expected failure #5 (in thread A, only trace A alive).";
305 << "Expected failure #6 (in thread A, no trace alive).";
338 ADD_FAILURE() << "Expected failure #1, in the test fixture c'tor.";
342 ADD_FAILURE() << "Expected failure #5, in the test fixture d'tor.";
346 ADD_FAILURE() << "Expected failure #2, in SetUp().";
350 ADD_FAILURE() << "Expected failure #4, in TearDown.";
355 ADD_FAILURE() << "Expected failure #3, in the test body.";
367 ADD_FAILURE() << "Expected failure #2, in the test fixture d'tor.";
371 ADD_FAILURE() << "UNEXPECTED failure in SetUp(). "
373 << "had a fatal failure.";
377 ADD_FAILURE() << "UNEXPECTED failure in TearDown(). "
379 << "had a fatal failure.";
383 FAIL() << "Expected failure #1, in the test fixture c'tor.";
388 ADD_FAILURE() << "UNEXPECTED failure in the test body. "
390 << "had a fatal failure.";
402 ADD_FAILURE() << "Expected failure #1, in SetUp().";
406 FAIL() << "Expected failure #3, in TearDown().";
410 FAIL() << "Expected failure #4, in the test fixture d'tor.";
415 FAIL() << "Expected failure #2, in the test function.";
427 FAIL() << "Expected failure #1, in SetUp().";
431 FAIL() << "Expected failure #2, in TearDown().";
435 FAIL() << "Expected failure #3, in the test fixture d'tor.";
440 FAIL() << "UNEXPECTED failure in the test function. "
445 ADD_FAILURE_AT("foo.cc", 42) << "Expected failure in foo.cc";
582 EXPECT_EQ(1, global_integer) << "Expected non-fatal failure.";
583 }, "Expected non-fatal failure.");
593 EXPECT_EQ(m, n) << "Expected non-fatal failure.";
594 }, "Expected non-fatal failure.");
598 // one non-fatal failure and no fatal failure.
601 ADD_FAILURE() << "Expected non-fatal failure.";
602 }, "Expected non-fatal failure.");
606 // non-fatal failure.
608 printf("(expecting a failure)\n");
616 printf("(expecting a failure)\n");
618 ADD_FAILURE() << "Expected non-fatal failure 1.";
619 ADD_FAILURE() << "Expected non-fatal failure 2.";
624 // failure.
626 printf("(expecting a failure)\n");
628 FAIL() << "Expected fatal failure.";
635 printf("(expecting a failure)\n");
646 printf("(expecting a failure)\n");
661 ASSERT_EQ(1, global_integer) << "Expected fatal failure.";
662 }, "Expected fatal failure.");
671 ASSERT_EQ(0, n) << "Expected fatal failure.";
672 }, "Expected fatal failure.");
676 // one fatal failure and no non-fatal failure.
679 FAIL() << "Expected fatal failure.";
680 }, "Expected fatal failure.");
684 // failure.
686 printf("(expecting a failure)\n");
691 // A helper for generating a fatal failure.
693 FAIL() << "Expected fatal failure.";
699 printf("(expecting a failure)\n");
707 // failure.
709 printf("(expecting a failure)\n");
711 ADD_FAILURE() << "Expected non-fatal failure.";
718 printf("(expecting a failure)\n");
729 printf("(expecting a failure)\n");
753 TYPED_TEST(TypedTest, Failure) {
754 EXPECT_EQ(1, TypeParam()) << "Expected failure";
772 TYPED_TEST_P(TypedTestP, Failure) {
773 EXPECT_EQ(1U, TypeParam()) << "Expected failure";
776 REGISTER_TYPED_TEST_CASE_P(TypedTestP, Success, Failure);
831 // Tests various failure conditions of
839 static void AddFailure(FailureMode failure) {
840 if (failure == FATAL_FAILURE) {
841 FAIL() << "Expected fatal failure.";
843 ADD_FAILURE() << "Expected non-fatal failure.";
849 // Expected fatal failure, but succeeds.
850 printf("(expecting 1 failure)\n");
851 EXPECT_FATAL_FAILURE(SUCCEED(), "Expected fatal failure.");
852 // Expected fatal failure, but got a non-fatal failure.
853 printf("(expecting 1 failure)\n");
855 "failure.");
857 printf("(expecting 1 failure)\n");
858 EXPECT_FATAL_FAILURE(AddFailure(FATAL_FAILURE), "Some other fatal failure "
863 // Expected non-fatal failure, but succeeds.
864 printf("(expecting 1 failure)\n");
865 EXPECT_NONFATAL_FAILURE(SUCCEED(), "Expected non-fatal failure.");
866 // Expected non-fatal failure, but got a fatal failure.
867 printf("(expecting 1 failure)\n");
868 EXPECT_NONFATAL_FAILURE(AddFailure(FATAL_FAILURE), "Expected fatal failure.");
870 printf("(expecting 1 failure)\n");
872 "failure.");
879 static void AddFailureInOtherThread(FailureMode failure) {
880 ThreadWithParam<FailureMode> thread(&AddFailure, failure, NULL);
889 "Expected fatal failure.");
896 "Expected non-fatal failure.");
920 // Expected fatal failure, but succeeds.
921 printf("(expecting 1 failure)\n");
922 EXPECT_FATAL_FAILURE_ON_ALL_THREADS(SUCCEED(), "Expected fatal failure.");
923 // Expected fatal failure, but got a non-fatal failure.
924 printf("(expecting 1 failure)\n");
926 "Expected non-fatal failure.");
928 printf("(expecting 1 failure)\n");
930 "Some other fatal failure expected.");
934 // Expected non-fatal failure, but succeeds.
935 printf("(expecting 1 failure)\n");
937 "failure.");
938 // Expected non-fatal failure, but got a fatal failure.
939 printf("(expecting 1 failure)\n");
941 "Expected fatal failure.");
943 printf("(expecting 1 failure)\n");
945 "Some other non-fatal failure.");
959 FAIL() << "Expected fatal failure.";
971 ADD_FAILURE() << "Expected non-fatal failure.";