aboutsummaryrefslogtreecommitdiffstats
path: root/src/gtest.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/gtest.cc')
-rw-r--r--src/gtest.cc18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/gtest.cc b/src/gtest.cc
index ac5ed9d5..5903f2ae 100644
--- a/src/gtest.cc
+++ b/src/gtest.cc
@@ -1852,7 +1852,7 @@ int TestResult::failed_part_count() const {
}
// Returns true iff the test part fatally failed.
-static bool TestPartFatallyFailed(const TestPartResult & result) {
+static bool TestPartFatallyFailed(const TestPartResult& result) {
return result.fatally_failed();
}
@@ -1861,6 +1861,16 @@ bool TestResult::HasFatalFailure() const {
return test_part_results_.CountIf(TestPartFatallyFailed) > 0;
}
+// Returns true iff the test part non-fatally failed.
+static bool TestPartNonfatallyFailed(const TestPartResult& result) {
+ return result.nonfatally_failed();
+}
+
+// Returns true iff the test has a non-fatal failure.
+bool TestResult::HasNonfatalFailure() const {
+ return test_part_results_.CountIf(TestPartNonfatallyFailed) > 0;
+}
+
// Gets the number of all test parts. This is the sum of the number
// of successful test parts and the number of failed test parts.
int TestResult::total_part_count() const {
@@ -2059,6 +2069,12 @@ bool Test::HasFatalFailure() {
return internal::GetUnitTestImpl()->current_test_result()->HasFatalFailure();
}
+// Returns true iff the current test has a non-fatal failure.
+bool Test::HasNonfatalFailure() {
+ return internal::GetUnitTestImpl()->current_test_result()->
+ HasNonfatalFailure();
+}
+
// class TestInfo
// Constructs a TestInfo object. It assumes ownership of the test factory