From: Vadim Zeitlin Date: Sun, 21 Nov 2010 13:00:13 +0000 (+0000) Subject: Correct wxFont::GetFamily() unit test to test for wxFONTFAMILY_DEFAULT. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/aa6b8882a48c2e1afffb82daed2655ec750a975a?hp=f9ee3f4710fcd55fe7012721a69cf08857eb1abe Correct wxFont::GetFamily() unit test to test for wxFONTFAMILY_DEFAULT. GetFamily() returns wxFONTFAMILY_DEFAULT and not wxFONTFAMILY_UNKNOWN since r65670. Correct the test to handle wxFONTFAMILY_DEFAULT as allowed value. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66221 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/tests/font/fonttest.cpp b/tests/font/fonttest.cpp index 1c436ddf20..21b2685578 100644 --- a/tests/font/fonttest.cpp +++ b/tests/font/fonttest.cpp @@ -131,10 +131,13 @@ void FontTestCase::GetSet() test.SetFamily( wxFONTFAMILY_ROMAN ); CPPUNIT_ASSERT( test.IsOk() ); - CPPUNIT_ASSERT( wxFONTFAMILY_ROMAN == test.GetFamily() || - wxFONTFAMILY_UNKNOWN == test.GetFamily() ); - // note that there is always the possibility that GetFamily() returns - // wxFONTFAMILY_UNKNOWN so that we consider it as a valid return value + + // note that there is always the possibility that GetFamily() returns + // wxFONTFAMILY_DEFAULT (meaning "unknown" in this case) so that we + // consider it as a valid return value + const wxFontFamily family = test.GetFamily(); + if ( family != wxFONTFAMILY_DEFAULT ) + CPPUNIT_ASSERT_EQUAL( wxFONTFAMILY_ROMAN, family ); // test Get/SetEncoding()