From aa6b8882a48c2e1afffb82daed2655ec750a975a Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 21 Nov 2010 13:00:13 +0000 Subject: [PATCH 1/1] 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 --- tests/font/fonttest.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) 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() -- 2.45.2