]> git.saurik.com Git - wxWidgets.git/blobdiff - tests/misc/settings.cpp
wxRTC table layout now uses cell content to calculate column widths if no other width...
[wxWidgets.git] / tests / misc / settings.cpp
index c87e8310ccdaa040ba80aaf55ce748adf9614d5d..8c94f0a3c16f747d0d8357a010e97112e2b43e9c 100644 (file)
@@ -3,7 +3,6 @@
 // Purpose:     test wxSettings
 // Author:      Francesco Montorsi
 // Created:     2009-03-24
-// RCS-ID:      $Id$
 // Copyright:   (c) 2009 Francesco Montorsi
 ///////////////////////////////////////////////////////////////////////////////
 
@@ -19,6 +18,8 @@
 
 #include "wx/settings.h"
 #include "wx/fontenum.h"
+#include "wx/brush.h"
+#include "wx/pen.h"
 
 // ----------------------------------------------------------------------------
 // test class
@@ -54,7 +55,7 @@ private:
 // register in the unnamed registry so that these tests are run by default
 CPPUNIT_TEST_SUITE_REGISTRATION( SettingsTestCase );
 
-// also include in it's own registry so that these tests can be run alone
+// also include in its own registry so that these tests can be run alone
 CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( SettingsTestCase, "SettingsTestCase" );
 
 
@@ -104,7 +105,7 @@ void SettingsTestCase::GlobalColours()
 
 void SettingsTestCase::GlobalFonts()
 {
-    wxFont font[] =
+    const wxFont font[] =
     {
         *wxNORMAL_FONT,
         *wxSMALL_FONT,
@@ -113,8 +114,18 @@ void SettingsTestCase::GlobalFonts()
     };
 
     for (unsigned int i=0; i < WXSIZEOF(font); i++)
-        CPPUNIT_ASSERT( font[i].IsOk() && 
-                        wxFontEnumerator::IsValidFacename(font[i].GetFaceName()) );
+    {
+        CPPUNIT_ASSERT( font[i].IsOk() );
+
+        const wxString facename = font[i].GetFaceName();
+        if ( !facename.empty() )
+        {
+            WX_ASSERT_MESSAGE(
+                ("font #%u: facename \"%s\" is invalid", i, facename),
+                wxFontEnumerator::IsValidFacename(facename)
+            );
+        }
+    }
 }
 
 void SettingsTestCase::GlobalBrushes()