aboutsummaryrefslogtreecommitdiffstats
path: root/src/gtest.cc
diff options
context:
space:
mode:
authorzhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925>2009-04-07 21:03:22 +0000
committerzhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925>2009-04-07 21:03:22 +0000
commitc12f63214e9b7761d27e68353e4aaf1761c9cf88 (patch)
tree78dba5344afb37f56eb716fbe75786aab1eb52d9 /src/gtest.cc
parent0da92aaf7f696ebfa2374247ae9010dacbc057fc (diff)
downloadgoogletest-c12f63214e9b7761d27e68353e4aaf1761c9cf88.tar.gz
googletest-c12f63214e9b7761d27e68353e4aaf1761c9cf88.tar.bz2
googletest-c12f63214e9b7761d27e68353e4aaf1761c9cf88.zip
Adds sample4_unittest to scons (by Vlad Losev); adds logic for getting the thread count on Mac (by Vlad Losev); adds HasFailure() and HasNonfatalFailure() (by Zhanyong Wan).
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