From 0b1eecec7d3cbbfa672261697db450e9d7eff4be Mon Sep 17 00:00:00 2001 From: ngie Date: Mon, 11 Mar 2019 02:57:00 +0000 Subject: [PATCH] Expect `WhenDynamicCastToTest.AmbiguousCast` to fail on FreeBSD Casting `AmbiguousCastTypes::DerivedSub1` to `Base` currently succeeds, when it's expected to fail. See https://github.com/google/googletest/issues/2172 for more details. --- .../googletest/googlemock/test/gmock-matchers_test.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/contrib/googletest/googlemock/test/gmock-matchers_test.cc b/contrib/googletest/googlemock/test/gmock-matchers_test.cc index 4697f0bf5956..0ded4c445bd3 100644 --- a/contrib/googletest/googlemock/test/gmock-matchers_test.cc +++ b/contrib/googletest/googlemock/test/gmock-matchers_test.cc @@ -3767,6 +3767,12 @@ TEST(WhenDynamicCastToTest, AmbiguousCast) { AmbiguousCastTypes::DerivedSub1 sub1; AmbiguousCastTypes::ManyDerivedInHierarchy many_derived; // Multiply derived from Base. dynamic_cast<> returns NULL. + + // This testcase fails on FreeBSD. See this GitHub issue for more details: + // https://github.com/google/googletest/issues/2172 +#ifdef __FreeBSD__ + EXPECT_NONFATAL_FAILURE({ +#endif Base* as_base_ptr = static_cast(&many_derived); EXPECT_THAT(as_base_ptr, @@ -3775,6 +3781,9 @@ TEST(WhenDynamicCastToTest, AmbiguousCast) { EXPECT_THAT( as_base_ptr, WhenDynamicCastTo(Not(IsNull()))); +#ifdef __FreeBSD__ + }, ""); +#endif } TEST(WhenDynamicCastToTest, Describe) {