aboutsummaryrefslogtreecommitdiffstats
path: root/gtest/include/gtest/gtest-test-part.h
diff options
context:
space:
mode:
Diffstat (limited to 'gtest/include/gtest/gtest-test-part.h')
-rw-r--r--gtest/include/gtest/gtest-test-part.h30
1 files changed, 15 insertions, 15 deletions
diff --git a/gtest/include/gtest/gtest-test-part.h b/gtest/include/gtest/gtest-test-part.h
index d5b2713..58e7df9 100644
--- a/gtest/include/gtest/gtest-test-part.h
+++ b/gtest/include/gtest/gtest-test-part.h
@@ -39,24 +39,24 @@
namespace testing {
-// The possible outcomes of a test part (i.e. an assertion or an
-// explicit SUCCEED(), FAIL(), or ADD_FAILURE()).
-enum TestPartResultType {
- TPRT_SUCCESS, // Succeeded.
- TPRT_NONFATAL_FAILURE, // Failed but the test can continue.
- TPRT_FATAL_FAILURE // Failed and the test should be terminated.
-};
-
// A copyable object representing the result of a test part (i.e. an
// assertion or an explicit FAIL(), ADD_FAILURE(), or SUCCESS()).
//
// Don't inherit from TestPartResult as its destructor is not virtual.
class TestPartResult {
public:
+ // The possible outcomes of a test part (i.e. an assertion or an
+ // explicit SUCCEED(), FAIL(), or ADD_FAILURE()).
+ enum Type {
+ kSuccess, // Succeeded.
+ kNonFatalFailure, // Failed but the test can continue.
+ kFatalFailure // Failed and the test should be terminated.
+ };
+
// C'tor. TestPartResult does NOT have a default constructor.
// Always use this constructor (with parameters) to create a
// TestPartResult object.
- TestPartResult(TestPartResultType type,
+ TestPartResult(Type type,
const char* file_name,
int line_number,
const char* message)
@@ -68,7 +68,7 @@ class TestPartResult {
}
// Gets the outcome of the test part.
- TestPartResultType type() const { return type_; }
+ Type type() const { return type_; }
// Gets the name of the source file where the test part took place, or
// NULL if it's unknown.
@@ -85,18 +85,18 @@ class TestPartResult {
const char* message() const { return message_.c_str(); }
// Returns true iff the test part passed.
- bool passed() const { return type_ == TPRT_SUCCESS; }
+ bool passed() const { return type_ == kSuccess; }
// Returns true iff the test part failed.
- bool failed() const { return type_ != TPRT_SUCCESS; }
+ bool failed() const { return type_ != kSuccess; }
// Returns true iff the test part non-fatally failed.
- bool nonfatally_failed() const { return type_ == TPRT_NONFATAL_FAILURE; }
+ bool nonfatally_failed() const { return type_ == kNonFatalFailure; }
// Returns true iff the test part fatally failed.
- bool fatally_failed() const { return type_ == TPRT_FATAL_FAILURE; }
+ bool fatally_failed() const { return type_ == kFatalFailure; }
private:
- TestPartResultType type_;
+ Type type_;
// Gets the summary of the failure message by omitting the stack
// trace in it.