X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3f7c8a876271eafa909c55293e3e999593ba4ade..bbd55ff9564dcaf1a5d2ee93d789c4d656baabef:/tests/font/fonttest.cpp?ds=sidebyside diff --git a/tests/font/fonttest.cpp b/tests/font/fonttest.cpp index 5f2c171c7f..1c436ddf20 100644 --- a/tests/font/fonttest.cpp +++ b/tests/font/fonttest.cpp @@ -97,7 +97,7 @@ void FontTestCase::GetSet() { unsigned numFonts; const wxFont *pf = GetTestFonts(numFonts); - for ( size_t n = 0; n < numFonts; n++ ) + for ( unsigned n = 0; n < numFonts; n++ ) { wxFont test(*pf++); @@ -114,10 +114,16 @@ void FontTestCase::GetSet() #if defined(__WXMSW__) || defined(__WXOSX__) static const char *knownGoodFaceName = "Arial"; #else - static const char *knownGoodFaceName = "Fixed"; + static const char *knownGoodFaceName = "Monospace"; #endif - CPPUNIT_ASSERT( test.SetFaceName(knownGoodFaceName) ); + WX_ASSERT_MESSAGE + ( + ("failed to set face name \"%s\" for test font #%u\n" + "(this failure is harmless if this face name is not " + "available on this system)", knownGoodFaceName, n), + test.SetFaceName(knownGoodFaceName) + ); CPPUNIT_ASSERT( test.IsOk() ); @@ -206,7 +212,14 @@ void FontTestCase::NativeFontInfo() // test that clearly invalid font info strings do not work wxFont font; CPPUNIT_ASSERT( !font.SetNativeFontInfo("") ); + + // pango_font_description_from_string() used by wxFont in wxGTK and wxX11 + // never returns an error at all so this assertion fails there -- and as it + // doesn't seem to be possible to do anything about it maybe we should + // change wxMSW and other ports to also accept any strings? +#if !defined(__WXGTK__) && !defined(__WXX11__) CPPUNIT_ASSERT( !font.SetNativeFontInfo("bloordyblop") ); +#endif } void FontTestCase::NativeFontInfoUserDesc()