summaryrefslogtreecommitdiffstats
path: root/googlemock/test/gmock-matchers_test.cc
diff options
context:
space:
mode:
authorScott Graham <scottmg@chromium.org>2018-05-02 11:14:39 -0700
committerScott Graham <scottmg@chromium.org>2018-05-02 11:14:39 -0700
commita9653c401e799933be77ee9dfa4aa0c378031b1d (patch)
treecdeab1fa6bc3dc622a46026b47f4a32eba36c9ad /googlemock/test/gmock-matchers_test.cc
parent278aba369c41e90e9e77a6f51443beb3692919cf (diff)
downloadgoogletest-a9653c401e799933be77ee9dfa4aa0c378031b1d.tar.gz
googletest-a9653c401e799933be77ee9dfa4aa0c378031b1d.zip
Fix gmock not building when -fno-rtti
Fixes issue #1554. This is internal cl/195020996.
Diffstat (limited to 'googlemock/test/gmock-matchers_test.cc')
-rw-r--r--googlemock/test/gmock-matchers_test.cc6
1 files changed, 2 insertions, 4 deletions
diff --git a/googlemock/test/gmock-matchers_test.cc b/googlemock/test/gmock-matchers_test.cc
index b4224651..87b2ad5c 100644
--- a/googlemock/test/gmock-matchers_test.cc
+++ b/googlemock/test/gmock-matchers_test.cc
@@ -3704,6 +3704,7 @@ MATCHER_P(FieldIIs, inner_matcher, "") {
return ExplainMatchResult(inner_matcher, arg.i, result_listener);
}
+#if GTEST_HAS_RTTI
TEST(WhenDynamicCastToTest, SameType) {
Derived derived;
derived.i = 4;
@@ -3761,12 +3762,8 @@ TEST(WhenDynamicCastToTest, AmbiguousCast) {
TEST(WhenDynamicCastToTest, Describe) {
Matcher<Base*> matcher = WhenDynamicCastTo<Derived*>(Pointee(_));
-#if GTEST_HAS_RTTI
const std::string prefix =
"when dynamic_cast to " + internal::GetTypeName<Derived*>() + ", ";
-#else // GTEST_HAS_RTTI
- const std::string prefix = "when dynamic_cast, ";
-#endif // GTEST_HAS_RTTI
EXPECT_EQ(prefix + "points to a value that is anything", Describe(matcher));
EXPECT_EQ(prefix + "does not point to a value that is anything",
DescribeNegation(matcher));
@@ -3799,6 +3796,7 @@ TEST(WhenDynamicCastToTest, BadReference) {
Base& as_base_ref = derived;
EXPECT_THAT(as_base_ref, Not(WhenDynamicCastTo<const OtherDerived&>(_)));
}
+#endif // GTEST_HAS_RTTI
// Minimal const-propagating pointer.
template <typename T>
OpenPOWER on IntegriCloud