]> git.saurik.com Git - wxWidgets.git/blobdiff - tests/config/config.cpp
fix rendering of wxGrid on wxMSW when a dialog is over the grid.
[wxWidgets.git] / tests / config / config.cpp
index e02693454d8a772a4c3cdef9d5bf31610d7d25db..8e9cc4e1809cf0926231663723933e7195f95d0a 100644 (file)
@@ -67,7 +67,9 @@ void ConfigTestCase::ReadWriteLocalTest()
     config->Write(wxString(wxT("long1")), 234L);
     config->Write(wxT("double1"), 345.67);
     config->Write(wxT("bool1"), true);
     config->Write(wxString(wxT("long1")), 234L);
     config->Write(wxT("double1"), 345.67);
     config->Write(wxT("bool1"), true);
+#ifdef wxHAS_CONFIG_TEMPLATE_RW
     config->Write(wxT("color1"), wxColour(11,22,33,44));
     config->Write(wxT("color1"), wxColour(11,22,33,44));
+#endif // wxHAS_CONFIG_TEMPLATE_RW
     config->Flush();
     delete config;
 
     config->Flush();
     delete config;
 
@@ -95,19 +97,34 @@ void ConfigTestCase::ReadWriteLocalTest()
     CPPUNIT_ASSERT( r );
     CPPUNIT_ASSERT_EQUAL( long1, 234L );
 
     CPPUNIT_ASSERT( r );
     CPPUNIT_ASSERT_EQUAL( long1, 234L );
 
+    CPPUNIT_ASSERT( config->ReadLong(wxT("long1"), 0) == 234 );
+
+    double double1;
+    r = config->Read(wxT("double1"), &double1);
+    CPPUNIT_ASSERT( r );
+    CPPUNIT_ASSERT_EQUAL( double1, 345.67 );
+
+    CPPUNIT_ASSERT( config->ReadDouble(wxT("double1"), 0) == double1 );
+
     bool bool1;
     bool bool1;
-    r = config->Read(wxT("foo"), &bool1);
+    r = config->Read(wxT("foo"), &bool1); // there is no "foo" key
     CPPUNIT_ASSERT( !r );
 
     r = config->Read(wxT("bool1"), &bool1);
     CPPUNIT_ASSERT( r );
     CPPUNIT_ASSERT_EQUAL( bool1, true );
 
     CPPUNIT_ASSERT( !r );
 
     r = config->Read(wxT("bool1"), &bool1);
     CPPUNIT_ASSERT( r );
     CPPUNIT_ASSERT_EQUAL( bool1, true );
 
+    CPPUNIT_ASSERT( config->ReadBool(wxT("bool1"), false) == bool1 );
+
+#ifdef wxHAS_CONFIG_TEMPLATE_RW
     wxColour color1;
     r = config->Read(wxT("color1"), &color1);
     CPPUNIT_ASSERT( r );
     CPPUNIT_ASSERT( color1 == wxColour(11,22,33,44) );
 
     wxColour color1;
     r = config->Read(wxT("color1"), &color1);
     CPPUNIT_ASSERT( r );
     CPPUNIT_ASSERT( color1 == wxColour(11,22,33,44) );
 
+    CPPUNIT_ASSERT( config->ReadObject(wxT("color1"), wxNullColour) == color1 );
+#endif // wxHAS_CONFIG_TEMPLATE_RW
+
     config->DeleteAll();
     delete config;
 }
     config->DeleteAll();
     delete config;
 }
@@ -136,9 +153,11 @@ void ConfigTestCase::ReadValues(wxConfig *config, bool has_values)
     bool bool1;
     r = config->Read(wxT("bool1"), &bool1, true);
     CPPUNIT_ASSERT_EQUAL( r, has_values );
     bool bool1;
     r = config->Read(wxT("bool1"), &bool1, true);
     CPPUNIT_ASSERT_EQUAL( r, has_values );
+#ifdef wxHAS_CONFIG_TEMPLATE_RW
     wxColour color1;
     r = config->Read(wxT("color1"), &color1, wxColour(11,22,33,44));
     CPPUNIT_ASSERT_EQUAL( r, has_values );
     wxColour color1;
     r = config->Read(wxT("color1"), &color1, wxColour(11,22,33,44));
     CPPUNIT_ASSERT_EQUAL( r, has_values );
+#endif // wxHAS_CONFIG_TEMPLATE_RW
 }
 
 
 }