]> git.saurik.com Git - wxWidgets.git/commitdiff
Correct wxFont::GetFamily() unit test to test for wxFONTFAMILY_DEFAULT.
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 21 Nov 2010 13:00:13 +0000 (13:00 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 21 Nov 2010 13:00:13 +0000 (13:00 +0000)
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

index 1c436ddf2085c434967d98e5383692c20b9459b7..21b26855782ac5b02cfd0f5145046d02319f76b5 100644 (file)
@@ -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()