Lines Matching refs:failure
805 static void AddFailure(FailureMode failure) {
806 if (failure == FATAL_FAILURE) {
807 FAIL() << "Expected fatal failure.";
809 ADD_FAILURE() << "Expected non-fatal failure.";
846 static void AddFailureInOtherThread(FailureMode failure) {
852 &failure);
857 FailureMode* failure = static_cast<FailureMode*>(attr);
858 AddFailure(*failure);
889 EXPECT_FATAL_FAILURE(AddFailure(FATAL_FAILURE), "Expected fatal failure.");
896 "Expected fatal failure.");
913 // current function even though 'statement' generates a fatal failure.
953 "Expected non-fatal failure.");
960 "Expected non-fatal failure.");
985 "Expected fatal failure.");
990 AddFailureInOtherThread(NONFATAL_FAILURE), "Expected non-fatal failure.");
1012 // pr2 is for fatal failure.
1015 "Failure!");
1038 // r2 contains a SUCCESS, and a FAILURE.
1162 // that a non-fatal failure is added, a fatal failure is not added, and that the
1172 // should add a non-fatal failure and the property should not be recorded.
1178 // should add a non-fatal failure and the property should not be recorded.
1184 // should add a non-fatal failure and the property should not be recorded.
1190 // should add a non-fatal failure and the property should not be recorded.
1657 EXPECT_PRED1(IsEvenFunctor(), 2) << "This failure is UNEXPECTED!";
1660 // Failure cases.
1662 EXPECT_PRED1(IsEven, 5) << "This failure is expected.";
1663 }, "This failure is expected.");
1673 << "This failure is UNEXPECTED!";
1675 // Failure cases.
1680 ASSERT_PRED_FORMAT1(AssertIsEven, 5) << "This failure is expected.";
1681 }, "This failure is expected.");
1692 // A failure case.
1695 << "This failure is expected.";
1696 }, "This failure is expected.");
1706 ASSERT_PRED2(SumIsEven2, 2, 4) << "This failure is UNEXPECTED!";
1709 // Failure cases.
1713 EXPECT_PRED2(SumIsEven2, n1, n2) << "This failure is expected.";
1714 }, "This failure is expected.");
1724 "This failure is UNEXPECTED!";
1727 // Failure cases.
1737 << "This failure is expected.";
1738 }, "This failure is expected.");
1758 << "This failure is UNEXPECTED!";
1765 // A failure case.
1769 << "This failure is expected.";
1770 }, "This failure is expected.");
1775 // Another failure case.
1830 AssertionFailure(Message() << "Failure");
1835 AssertionFailure(Message() << "Failure");
1841 AssertionFailure(Message() << "Failure");
1848 AssertionFailure(Message() << "Failure");
2531 FAIL() << "Unexpected failure: Disabled test should not be run.";
2543 FAIL() << "Unexpected failure: Test in disabled test case should not be run.";
2549 FAIL() << "Unexpected failure: Test in disabled test case should not be run.";
2557 FAIL() << "Unexpected failure: All tests disabled in test case. "
2562 FAIL() << "Unexpected failure: All tests disabled in test case. "
2568 FAIL() << "Unexpected failure: Disabled test should not be run.";
2572 FAIL() << "Unexpected failure: Disabled test should not be run.";
2587 FAIL() << "Unexpected failure: Disabled typed test should not run.";
2597 FAIL() << "Unexpected failure: Disabled typed test should not run.";
2613 FAIL() << "Unexpected failure: "
2628 FAIL() << "Unexpected failure: "
2793 ADD_FAILURE() << "some non-fatal failure";
2796 FAIL() << "some fatal failure";
2806 ADD_FAILURE() << "other failure";
2818 "some non-fatal failure");
2821 "some non-fatal failure");
2835 EXPECT_PRED_FORMAT2(testing::IsSubstring, "some fatal failure",
2854 EXPECT_PRED_FORMAT2(testing::IsSubstring, "some fatal failure",
2858 EXPECT_PRED_FORMAT2(testing::IsSubstring, "other failure",
2967 // A failure.
2991 // A failure.
3008 // A failure.
3233 // success codes as well as failure message for each.
3278 EXPECT_HRESULT_SUCCEEDED(S_OK) << "unexpected failure";
3279 ASSERT_HRESULT_SUCCEEDED(S_OK) << "unexpected failure";
3280 EXPECT_HRESULT_FAILED(E_UNEXPECTED) << "unexpected failure";
3281 ASSERT_HRESULT_FAILED(E_UNEXPECTED) << "unexpected failure";
3284 EXPECT_HRESULT_SUCCEEDED(E_UNEXPECTED) << "expected failure",
3285 "expected failure");
3288 ASSERT_HRESULT_SUCCEEDED(E_UNEXPECTED) << "expected failure",
3289 "expected failure");
3292 EXPECT_HRESULT_FAILED(S_OK) << "expected failure",
3293 "expected failure");
3296 ASSERT_HRESULT_FAILED(S_OK) << "expected failure",
3297 "expected failure");
3514 // A failure.
3526 // A failure.
3543 // A failure.
3686 "This failure message is a std::string, and is expected.");
3741 ADD_FAILURE() << "Failure";
3749 "Failure");
3757 EXPECT_FATAL_FAILURE(FAIL() << "Intentional failure.",
3758 "Intentional failure.");
3770 // These tests fail *intentionally*, s.t. the failure messages can be
5188 TEST(NestedTestingNamespaceTest, Failure) {
5189 EXPECT_FATAL_FAILURE(FAIL() << "This failure is expected.",
5190 "This failure is expected.");
5214 EXPECT_NONFATAL_FAILURE(ADD_FAILURE() << "expected failure",
5215 "expected failure");
5216 EXPECT_FATAL_FAILURE(FAIL() << "expected failure",
5217 "expected failure");
5221 EXPECT_TRUE(true) << "unexpected failure";
5222 ASSERT_TRUE(true) << "unexpected failure";
5223 EXPECT_NONFATAL_FAILURE(EXPECT_TRUE(false) << "expected failure",
5224 "expected failure");
5225 EXPECT_FATAL_FAILURE(ASSERT_TRUE(false) << "expected failure",
5226 "expected failure");
5230 EXPECT_FALSE(false) << "unexpected failure";
5231 ASSERT_FALSE(false) << "unexpected failure";
5232 EXPECT_NONFATAL_FAILURE(EXPECT_FALSE(true) << "expected failure",
5233 "expected failure");
5234 EXPECT_FATAL_FAILURE(ASSERT_FALSE(true) << "expected failure",
5235 "expected failure");
5239 EXPECT_EQ(1, 1) << "unexpected failure";
5240 ASSERT_EQ(1, 1) << "unexpected failure";
5241 EXPECT_NONFATAL_FAILURE(EXPECT_EQ(1, 2) << "expected failure",
5242 "expected failure");
5243 EXPECT_FATAL_FAILURE(ASSERT_EQ(1, 2) << "expected failure",
5244 "expected failure");
5248 EXPECT_LT(1, 2) << "unexpected failure";
5249 ASSERT_LT(1, 2) << "unexpected failure";
5250 EXPECT_NONFATAL_FAILURE(EXPECT_LT(2, 1) << "expected failure",
5251 "expected failure");
5252 EXPECT_FATAL_FAILURE(ASSERT_LT(2, 1) << "expected failure",
5253 "expected failure");
5257 EXPECT_STREQ("foo", "foo") << "unexpected failure";
5258 ASSERT_STREQ("foo", "foo") << "unexpected failure";
5259 EXPECT_NONFATAL_FAILURE(EXPECT_STREQ("foo", "bar") << "expected failure",
5260 "expected failure");
5261 EXPECT_FATAL_FAILURE(ASSERT_STREQ("foo", "bar") << "expected failure",
5262 "expected failure");
5266 EXPECT_STRNE("foo", "bar") << "unexpected failure";
5267 ASSERT_STRNE("foo", "bar") << "unexpected failure";
5268 EXPECT_NONFATAL_FAILURE(EXPECT_STRNE("foo", "foo") << "expected failure",
5269 "expected failure");
5270 EXPECT_FATAL_FAILURE(ASSERT_STRNE("foo", "foo") << "expected failure",
5271 "expected failure");
5275 EXPECT_STRCASEEQ("foo", "FOO") << "unexpected failure";
5276 ASSERT_STRCASEEQ("foo", "FOO") << "unexpected failure";
5277 EXPECT_NONFATAL_FAILURE(EXPECT_STRCASEEQ("foo", "bar") << "expected failure",
5278 "expected failure");
5279 EXPECT_FATAL_FAILURE(ASSERT_STRCASEEQ("foo", "bar") << "expected failure",
5280 "expected failure");
5284 EXPECT_STRCASENE("foo", "bar") << "unexpected failure";
5285 ASSERT_STRCASENE("foo", "bar") << "unexpected failure";
5286 EXPECT_NONFATAL_FAILURE(EXPECT_STRCASENE("foo", "FOO") << "expected failure",
5287 "expected failure");
5288 EXPECT_FATAL_FAILURE(ASSERT_STRCASENE("bar", "BAR") << "expected failure",
5289 "expected failure");
5293 EXPECT_FLOAT_EQ(1.0, 1.0) << "unexpected failure";
5294 ASSERT_FLOAT_EQ(1.0, 1.0) << "unexpected failure";
5295 EXPECT_NONFATAL_FAILURE(EXPECT_FLOAT_EQ(0.0, 1.0) << "expected failure",
5296 "expected failure");
5297 EXPECT_FATAL_FAILURE(ASSERT_FLOAT_EQ(0.0, 1.0) << "expected failure",
5298 "expected failure");
5304 EXPECT_THROW(ThrowAnInteger(), int) << "unexpected failure";
5305 ASSERT_THROW(ThrowAnInteger(), int) << "unexpected failure";
5307 "expected failure", "expected failure");
5309 "expected failure", "expected failure");
5313 EXPECT_NO_THROW(ThrowNothing()) << "unexpected failure";
5314 ASSERT_NO_THROW(ThrowNothing()) << "unexpected failure";
5316 "expected failure", "expected failure");
5318 "expected failure", "expected failure");
5322 EXPECT_ANY_THROW(ThrowAnInteger()) << "unexpected failure";
5323 ASSERT_ANY_THROW(ThrowAnInteger()) << "unexpected failure";
5325 "expected failure", "expected failure");
5327 "expected failure", "expected failure");