svn commit: r344996 - projects/import-googletest-1.8.1/contrib/googletest/googlemock/test

Enji Cooper ngie at FreeBSD.org
Mon Mar 11 02:57:02 UTC 2019


Author: ngie
Date: Mon Mar 11 02:57:00 2019
New Revision: 344996
URL: https://svnweb.freebsd.org/changeset/base/344996

Log:
  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.

Modified:
  projects/import-googletest-1.8.1/contrib/googletest/googlemock/test/gmock-matchers_test.cc

Modified: projects/import-googletest-1.8.1/contrib/googletest/googlemock/test/gmock-matchers_test.cc
==============================================================================
--- projects/import-googletest-1.8.1/contrib/googletest/googlemock/test/gmock-matchers_test.cc	Mon Mar 11 02:42:49 2019	(r344995)
+++ projects/import-googletest-1.8.1/contrib/googletest/googlemock/test/gmock-matchers_test.cc	Mon Mar 11 02:57:00 2019	(r344996)
@@ -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<AmbiguousCastTypes::DerivedSub1*>(&many_derived);
   EXPECT_THAT(as_base_ptr,
@@ -3775,6 +3781,9 @@ TEST(WhenDynamicCastToTest, AmbiguousCast) {
   EXPECT_THAT(
       as_base_ptr,
       WhenDynamicCastTo<AmbiguousCastTypes::VirtualDerived*>(Not(IsNull())));
+#ifdef __FreeBSD__
+  }, "");
+#endif
 }
 
 TEST(WhenDynamicCastToTest, Describe) {


More information about the svn-src-projects mailing list