]> git.saurik.com Git - wxWidgets.git/blobdiff - tests/font/fonttest.cpp
Fix bytes to integers conversion in png2c script.
[wxWidgets.git] / tests / font / fonttest.cpp
index 69df21a2f549a07ca914a4c4f2de13804669180d..21b26855782ac5b02cfd0f5145046d02319f76b5 100644 (file)
@@ -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++);
 
@@ -113,23 +113,17 @@ void FontTestCase::GetSet()
         // consider adding another branch to this #if
 #if defined(__WXMSW__) || defined(__WXOSX__)
         static const char *knownGoodFaceName = "Arial";
-#elif defined(__LINUX__)
-        static const char *knownGoodFaceName;
-        wxString distroname = wxGetLinuxDistributionInfo().Id;
-        
-        if (distroname.Contains("Ubuntu"))
-            knownGoodFaceName = "FreeSerif";
-                // ttf-freefont and ttf-dejavu packages are installed by default on [X,K]Ubuntu systems
-        else if (distroname == "Debian")
-            knownGoodFaceName = "Fixed";
-        else
-            knownGoodFaceName = "DejaVu Sans";
-                // this is very popular in many linux distro...
 #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() );
 
 
@@ -137,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()