]> git.saurik.com Git - wxWidgets.git/blobdiff - tests/fileconf/fileconftest.cpp
fix compation with Watcom after latest vararg templates changes
[wxWidgets.git] / tests / fileconf / fileconftest.cpp
index fa10884e15adc5063f428c2ff12e0ab608cd5c69..6f4aa5ff5357d1d215a02f01a6f8ef62a4730e44 100644 (file)
@@ -76,6 +76,7 @@ private:
         CPPUNIT_TEST( CreateEntriesAndSubgroup );
         CPPUNIT_TEST( CreateSubgroupAndEntries );
         CPPUNIT_TEST( DeleteLastGroup );
+        CPPUNIT_TEST( DeleteAndRecreateGroup );
     CPPUNIT_TEST_SUITE_END();
 
     void Path();
@@ -93,6 +94,7 @@ private:
     void CreateEntriesAndSubgroup();
     void CreateSubgroupAndEntries();
     void DeleteLastGroup();
+    void DeleteAndRecreateGroup();
 
     static wxString ChangePath(wxFileConfig& fc, const wxChar *path)
     {
@@ -512,5 +514,29 @@ void FileConfigTestCase::DeleteLastGroup()
     (void) ::wxRemoveFile(wxFileConfig::GetLocalFileName(_T("deleteconftest")));
 }
 
+void FileConfigTestCase::DeleteAndRecreateGroup()
+{
+    static const wxChar *confInitial =
+        _T("[First]\n")
+        _T("Value1=Foo\n")
+        _T("[Second]\n")
+        _T("Value2=Bar\n");
+
+    wxStringInputStream sis(confInitial);
+    wxFileConfig fc(sis);
+
+    fc.DeleteGroup(_T("Second"));
+    wxVERIFY_FILECONFIG( _T("[First]\n")
+                         _T("Value1=Foo\n"),
+                         fc );
+
+    fc.Write(_T("Second/Value2"), _T("New"));
+    wxVERIFY_FILECONFIG( _T("[First]\n")
+                         _T("Value1=Foo\n")
+                         _T("[Second]\n")
+                         _T("Value2=New\n"),
+                         fc );
+}
+
 #endif // wxUSE_FILECONFIG