summaryrefslogtreecommitdiffstats
path: root/googlemock
diff options
context:
space:
mode:
authorBilly Donahue <BillyDonahue@users.noreply.github.com>2015-11-10 22:48:26 (GMT)
committerBilly Donahue <BillyDonahue@users.noreply.github.com>2015-11-10 22:48:26 (GMT)
commit71a26ac68b28c61686b8941730a6b2577912e239 (patch)
treeb2e35bdefe5509564d9ddab884d88aebbd81c0ce /googlemock
parent5bd7c2b589e3cef554496fce85236de7be3e62db (diff)
parentc8a1050704af1cc09a7a05820a6dbefc88fb3b4a (diff)
downloadgoogletest-71a26ac68b28c61686b8941730a6b2577912e239.zip
googletest-71a26ac68b28c61686b8941730a6b2577912e239.tar.gz
googletest-71a26ac68b28c61686b8941730a6b2577912e239.tar.bz2
Merge pull request #612 from mark-chromium/gmock_rtti
googlemock: Disable WhenDynamicCastToTest tests when RTTI is off
Diffstat (limited to 'googlemock')
-rw-r--r--googlemock/test/gmock-matchers_test.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/googlemock/test/gmock-matchers_test.cc b/googlemock/test/gmock-matchers_test.cc
index 2ff5556..7282469 100644
--- a/googlemock/test/gmock-matchers_test.cc
+++ b/googlemock/test/gmock-matchers_test.cc
@@ -3179,6 +3179,8 @@ 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;
@@ -3236,12 +3238,8 @@ TEST(WhenDynamicCastToTest, AmbiguousCast) {
TEST(WhenDynamicCastToTest, Describe) {
Matcher<Base*> matcher = WhenDynamicCastTo<Derived*>(Pointee(_));
-#if GTEST_HAS_RTTI
const string prefix =
"when dynamic_cast to " + internal::GetTypeName<Derived*>() + ", ";
-#else // GTEST_HAS_RTTI
- const 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));
@@ -3275,6 +3273,8 @@ TEST(WhenDynamicCastToTest, BadReference) {
EXPECT_THAT(as_base_ref, Not(WhenDynamicCastTo<const OtherDerived&>(_)));
}
+#endif // GTEST_HAS_RTTI
+
// Minimal const-propagating pointer.
template <typename T>
class ConstPropagatingPtr {