summaryrefslogtreecommitdiffstats
path: root/googletest
diff options
context:
space:
mode:
authorJonny007-MKD <me@jonny007-mkd.de>2018-09-23 13:46:47 (GMT)
committerJonny007-MKD <me@jonny007-mkd.de>2018-09-23 13:46:47 (GMT)
commitcecea92af84a978479a9d875500edf0ee7b8aef3 (patch)
treed6a35966bea7bab2788e33da70dfac10dad63b4c /googletest
parent1cb10b357a8a96b54ae60d4103918892f58d7fb3 (diff)
downloadgoogletest-cecea92af84a978479a9d875500edf0ee7b8aef3.zip
googletest-cecea92af84a978479a9d875500edf0ee7b8aef3.tar.gz
googletest-cecea92af84a978479a9d875500edf0ee7b8aef3.tar.bz2
Rename private member of AdditionalMessage
Shorten lines in unit tests
Diffstat (limited to 'googletest')
-rw-r--r--googletest/include/gtest/internal/gtest-internal.h8
-rw-r--r--googletest/test/gtest_unittest.cc29
2 files changed, 19 insertions, 18 deletions
diff --git a/googletest/include/gtest/internal/gtest-internal.h b/googletest/include/gtest/internal/gtest-internal.h
index 0dbf100..7a896ab 100644
--- a/googletest/include/gtest/internal/gtest-internal.h
+++ b/googletest/include/gtest/internal/gtest-internal.h
@@ -1192,14 +1192,14 @@ class NativeArray {
class AdditionalMessage
{
public:
- AdditionalMessage(const char* message) : value(message) {}
- void set(const std::string& message) { value = message; }
+ AdditionalMessage(const char* message) : msg(message) {}
+ void set(const std::string& message) { msg = message; }
operator bool() const { return true; }
- const std::string& get() const { return value; }
+ const std::string& get() const { return msg; }
private:
- std::string value;
+ std::string msg;
};
} // namespace internal
diff --git a/googletest/test/gtest_unittest.cc b/googletest/test/gtest_unittest.cc
index 6b75ab4..721e0cb 100644
--- a/googletest/test/gtest_unittest.cc
+++ b/googletest/test/gtest_unittest.cc
@@ -3821,9 +3821,9 @@ TEST(AssertionTest, ASSERT_THROW) {
" Actual: it throws nothing.");
EXPECT_FATAL_FAILURE(
- ASSERT_THROW(ThrowAnException("buuh"), bool),
- "Expected: ThrowAnException(\"buuh\") throws an exception of type bool.\n"
- " Actual: it throws a different type with message: buuh");
+ ASSERT_THROW(ThrowAnException("b"), bool),
+ "Expected: ThrowAnException(\"b\") throws an exception of type bool.\n"
+ " Actual: it throws a different type with message: b");
}
// Tests ASSERT_NO_THROW.
@@ -3833,8 +3833,8 @@ TEST(AssertionTest, ASSERT_NO_THROW) {
"Expected: ThrowAnInteger() doesn't throw an exception."
"\n Actual: it throws.");
EXPECT_FATAL_FAILURE(ASSERT_NO_THROW(ThrowAnException("blablubb")),
- "Expected: ThrowAnException(\"blablubb\") doesn't throw an exception."
- "\n Actual: it throws: blablubb");
+ "Expected: ThrowAnException(\"blablubb\") doesn't throw"
+ "an exception.\n Actual: it throws: blablubb");
}
// Tests ASSERT_ANY_THROW.
@@ -4563,14 +4563,15 @@ TEST(ExpectTest, EXPECT_THROW) {
EXPECT_THROW(ThrowAnInteger(), int);
EXPECT_THROW(ThrowAnException(""), std::exception);
EXPECT_NONFATAL_FAILURE(EXPECT_THROW(ThrowAnInteger(), bool),
- "Expected: ThrowAnInteger() throws an exception of type bool.\n"
- " Actual: it throws a different type.");
+ "Expected: ThrowAnInteger() throws an exception of "
+ "type bool.\n Actual: it throws a different type.");
EXPECT_NONFATAL_FAILURE(EXPECT_THROW(ThrowNothing(), bool),
- "Expected: ThrowNothing() throws an exception of type bool.\n"
- " Actual: it throws nothing.");
+ "Expected: ThrowNothing() throws an exception of "
+ "type bool.\n Actual: it throws nothing.");
EXPECT_NONFATAL_FAILURE(EXPECT_THROW(ThrowAnException("buuh"), bool),
- "Expected: ThrowAnException(\"buuh\") throws an exception of type bool.\n"
- " Actual: it throws a different type with message: buuh");
+ "Expected: ThrowAnException(\"buuh\") throws an "
+ "exception of type bool.\n Actual: "
+ "it throws a different type with message: buuh");
}
// Tests EXPECT_NO_THROW.
@@ -4579,9 +4580,9 @@ TEST(ExpectTest, EXPECT_NO_THROW) {
EXPECT_NONFATAL_FAILURE(EXPECT_NO_THROW(ThrowAnInteger()),
"Expected: ThrowAnInteger() doesn't throw an "
"exception.\n Actual: it throws.");
- EXPECT_NONFATAL_FAILURE(EXPECT_NO_THROW(ThrowAnException("blablubb")),
- "Expected: ThrowAnException(\"blablubb\") doesn't throw an "
- "exception.\n Actual: it throws: blablubb");
+ EXPECT_NONFATAL_FAILURE(EXPECT_NO_THROW(ThrowAnException("blah")),
+ "Expected: ThrowAnException(\"blah\") doesn't "
+ "throw an exception.\n Actual: it throws: blah");
}
// Tests EXPECT_ANY_THROW.