X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/cc14bd00586cb5107f39c77704163e847cdb2e01..b8190883d0ecb3dc5ccdb1b0142c2fe079a7e79a:/tests/misc/misctests.cpp diff --git a/tests/misc/misctests.cpp b/tests/misc/misctests.cpp index 9e42f1cca3..25459a11c9 100644 --- a/tests/misc/misctests.cpp +++ b/tests/misc/misctests.cpp @@ -56,9 +56,11 @@ CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( MiscTestCase, "MiscTestCase" ); namespace { -void AssertIfOdd(int n) +bool AssertIfOdd(int n) { - wxASSERT_MSG( !(n % 2), "parameter must be even" ); + wxCHECK_MSG( !(n % 2), false, "parameter must be even" ); + + return true; } } // anonymous namespace @@ -99,6 +101,18 @@ void MiscTestCase::Delete() #endif } +namespace +{ + +// helper function used just to avoid warnings about value computed not being +// used in WX_ASSERT_FAILS_WITH_ASSERT() in StaticCast() below +bool IsNull(void *p) +{ + return p == NULL; +} + +} // anonymous namespace + void MiscTestCase::StaticCast() { wxTarEntry tarEntry; @@ -111,7 +125,7 @@ void MiscTestCase::StaticCast() entry = &zipEntry; CPPUNIT_ASSERT( wxStaticCast(entry, wxZipEntry) ); - WX_ASSERT_FAILS_WITH_ASSERT( wxStaticCast(entry, wxTarEntry) ); - WX_ASSERT_FAILS_WITH_ASSERT( wxStaticCast(&zipEntry, wxTarEntry) ); + WX_ASSERT_FAILS_WITH_ASSERT( IsNull(wxStaticCast(entry, wxTarEntry)) ); + WX_ASSERT_FAILS_WITH_ASSERT( IsNull(wxStaticCast(&zipEntry, wxTarEntry)) ); }