aboutsummaryrefslogtreecommitdiff
path: root/googletest/include/gtest/gtest-test-part.h
diff options
context:
space:
mode:
authorArseny Aprelev <arseny.aprelev@gmail.com>2018-10-01 16:47:09 -0400
committerGennadiy Civil <misterg@google.com>2018-10-02 13:03:28 -0400
commit00938b2b228f3b70d3d9e51f29a1505bdad43f1e (patch)
tree2bebc032627672911353925d14d1fce101a36029 /googletest/include/gtest/gtest-test-part.h
parent2e91bbcf6f33eb85451001be2d4c95cca86ea9fc (diff)
downloadgoogletest-00938b2b228f3b70d3d9e51f29a1505bdad43f1e.tar.gz
Merge 2ce0685f76a4db403b7b2650433a584c150f2108 into 75e834700d19aa373b428c7c746f951737354c28
Closes #1544 With refinements and changes PiperOrigin-RevId: 215273083
Diffstat (limited to 'googletest/include/gtest/gtest-test-part.h')
-rw-r--r--googletest/include/gtest/gtest-test-part.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/googletest/include/gtest/gtest-test-part.h b/googletest/include/gtest/gtest-test-part.h
index 1c7b89e0..7b30aff6 100644
--- a/googletest/include/gtest/gtest-test-part.h
+++ b/googletest/include/gtest/gtest-test-part.h
@@ -53,7 +53,8 @@ class GTEST_API_ TestPartResult {
enum Type {
kSuccess, // Succeeded.
kNonFatalFailure, // Failed but the test can continue.
- kFatalFailure // Failed and the test should be terminated.
+ kFatalFailure, // Failed and the test should be terminated.
+ kSkip // Skipped.
};
// C'tor. TestPartResult does NOT have a default constructor.
@@ -89,18 +90,21 @@ class GTEST_API_ TestPartResult {
// Gets the message associated with the test part.
const char* message() const { return message_.c_str(); }
+ // Returns true iff the test part was skipped.
+ bool skipped() const { return type_ == kSkip; }
+
// Returns true iff the test part passed.
bool passed() const { return type_ == kSuccess; }
- // Returns true iff the test part failed.
- bool failed() const { return type_ != kSuccess; }
-
// Returns true iff the test part non-fatally failed.
bool nonfatally_failed() const { return type_ == kNonFatalFailure; }
// Returns true iff the test part fatally failed.
bool fatally_failed() const { return type_ == kFatalFailure; }
+ // Returns true iff the test part failed.
+ bool failed() const { return fatally_failed() || nonfatally_failed(); }
+
private:
Type type_;