diff options
author | zhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925> | 2009-06-19 00:24:28 +0000 |
---|---|---|
committer | zhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925> | 2009-06-19 00:24:28 +0000 |
commit | ae3247986bbbafcc913b5fe6132090ad6f1c3f36 (patch) | |
tree | 2f098d474cb2f1fc56bcd67a7ef31fe0886da3da /include | |
parent | 532dc2de35f2cef191bc91c3587a9f8f4974756f (diff) | |
download | googletest-ae3247986bbbafcc913b5fe6132090ad6f1c3f36.tar.gz googletest-ae3247986bbbafcc913b5fe6132090ad6f1c3f36.tar.bz2 googletest-ae3247986bbbafcc913b5fe6132090ad6f1c3f36.zip |
Fixes broken gtest_unittest on Cygwin and cleans it up (by Vlad Losev); fixes the wrong usage of os.environ.clear() in gtest_output_test.py (by Vlad Losev); fixes the logic for detecting Symbian (by Zhanyong Wan); moves TestProperty for event listener (by Vlad Losev).
Diffstat (limited to 'include')
-rw-r--r-- | include/gtest/gtest.h | 38 | ||||
-rw-r--r-- | include/gtest/internal/gtest-port.h | 2 |
2 files changed, 39 insertions, 1 deletions
diff --git a/include/gtest/gtest.h b/include/gtest/gtest.h index f5437784..d15909b1 100644 --- a/include/gtest/gtest.h +++ b/include/gtest/gtest.h @@ -346,6 +346,44 @@ class Test { GTEST_DISALLOW_COPY_AND_ASSIGN_(Test); }; +namespace internal { + +// A copyable object representing a user specified test property which can be +// output as a key/value string pair. +// +// Don't inherit from TestProperty as its destructor is not virtual. +class TestProperty { + public: + // C'tor. TestProperty does NOT have a default constructor. + // Always use this constructor (with parameters) to create a + // TestProperty object. + TestProperty(const char* key, const char* value) : + key_(key), value_(value) { + } + + // Gets the user supplied key. + const char* key() const { + return key_.c_str(); + } + + // Gets the user supplied value. + const char* value() const { + return value_.c_str(); + } + + // Sets a new value, overriding the one supplied in the constructor. + void SetValue(const char* new_value) { + value_ = new_value; + } + + private: + // The key supplied by the user. + String key_; + // The value supplied by the user. + String value_; +}; + +} // namespace internal // A TestInfo object stores the following information about a test: // diff --git a/include/gtest/internal/gtest-port.h b/include/gtest/internal/gtest-port.h index e1a3597c..886e2dd8 100644 --- a/include/gtest/internal/gtest-port.h +++ b/include/gtest/internal/gtest-port.h @@ -177,7 +177,7 @@ // Determines the platform on which Google Test is compiled. #ifdef __CYGWIN__ #define GTEST_OS_CYGWIN 1 -#elif __SYMBIAN32__ +#elif defined __SYMBIAN32__ #define GTEST_OS_SYMBIAN 1 #elif defined _WIN32 #define GTEST_OS_WINDOWS 1 |