aboutsummaryrefslogtreecommitdiffstats
path: root/include/gtest/gtest.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/gtest/gtest.h')
-rw-r--r--include/gtest/gtest.h38
1 files changed, 38 insertions, 0 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:
//