aboutsummaryrefslogtreecommitdiffstats
path: root/googlemock
diff options
context:
space:
mode:
authorXiaoyi Zhang <zhangxy@google.com>2020-01-21 16:26:24 -0500
committerXiaoyi Zhang <zhangxy@google.com>2020-01-21 16:26:24 -0500
commit9417fb401a578b32656f7c4d05a0e6a18940b825 (patch)
tree6d96ef85e747b15b631ab515f79c06d112a0680f /googlemock
parentc59c7bab50569b65c7b4f5c6680a8c180f562213 (diff)
parentc7137f0b8422cb4544a8adb2ebc1de0ea71cae55 (diff)
downloadgoogletest-9417fb401a578b32656f7c4d05a0e6a18940b825.tar.gz
googletest-9417fb401a578b32656f7c4d05a0e6a18940b825.tar.bz2
googletest-9417fb401a578b32656f7c4d05a0e6a18940b825.zip
Merge pull request #2665 from bysreg:fix_noshortcircuitfailure_detectsflakyshortcircuit_test
PiperOrigin-RevId: 290256504
Diffstat (limited to 'googlemock')
-rw-r--r--googlemock/test/gmock-matchers_test.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/googlemock/test/gmock-matchers_test.cc b/googlemock/test/gmock-matchers_test.cc
index e6e8c8f4..c667ecbe 100644
--- a/googlemock/test/gmock-matchers_test.cc
+++ b/googlemock/test/gmock-matchers_test.cc
@@ -140,7 +140,7 @@ Matcher<int> GreaterThan(int n) {
std::string OfType(const std::string& type_name) {
#if GTEST_HAS_RTTI
- return " (of type " + type_name + ")";
+ return IsReadableTypeName(type_name) ? " (of type " + type_name + ")" : "";
#else
return "";
#endif
@@ -6885,7 +6885,8 @@ TEST_F(PredicateFormatterFromMatcherTest, NoShortCircuitOnFailure) {
EXPECT_FALSE(result); // Implicit cast to bool.
std::string expect =
"Value of: dummy-name\nExpected: [DescribeTo]\n"
- " Actual: 1, [MatchAndExplain]";
+ " Actual: 1" +
+ OfType(internal::GetTypeName<Behavior>()) + ", [MatchAndExplain]";
EXPECT_EQ(expect, result.message());
}
@@ -6896,7 +6897,8 @@ TEST_F(PredicateFormatterFromMatcherTest, DetectsFlakyShortCircuit) {
"Value of: dummy-name\nExpected: [DescribeTo]\n"
" The matcher failed on the initial attempt; but passed when rerun to "
"generate the explanation.\n"
- " Actual: 2, [MatchAndExplain]";
+ " Actual: 2" +
+ OfType(internal::GetTypeName<Behavior>()) + ", [MatchAndExplain]";
EXPECT_EQ(expect, result.message());
}