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.
This commit is contained in:
Enji Cooper 2019-03-11 02:57:00 +00:00
parent b18a4ccab9
commit b7d75bb75c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/projects/import-googletest-1.8.1/; revision=344996

View File

@ -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) {