Restore wxObject::ms_classInfo public access

This undoes accidental change of ms_classInfo from public to protected
in 95c98a0b5f (Work around -Wuggest-override for event table macros from
gcc 11, 2021-04-25).

Also add a unit test checking that using wxCLASSINFO(wxObject) compiles
and works as expected.
This commit is contained in:
Vadim Zeitlin
2021-05-04 23:14:41 +02:00
parent a3b7244efe
commit 0585c96a3b
2 changed files with 17 additions and 2 deletions

View File

@@ -149,6 +149,18 @@ void MiscTestCase::StaticCast()
#endif // wxUSE_TARSTREAM
}
TEST_CASE("RTTI::ClassInfo", "[rtti]")
{
wxObject obj;
CHECK( obj.GetClassInfo()->IsKindOf(wxCLASSINFO(wxObject)) );
CHECK( !obj.GetClassInfo()->IsKindOf(wxCLASSINFO(wxArchiveEntry)) );
#if wxUSE_ZIPSTREAM
wxZipEntry zipEntry;
CHECK( zipEntry.GetClassInfo()->IsKindOf(wxCLASSINFO(wxArchiveEntry)) );
#endif // wxUSE_ZIPSTREAM
}
TEST_CASE("wxCTZ", "[math]")
{
CHECK( wxCTZ(1) == 0 );