]> git.saurik.com Git - wxWidgets.git/blobdiff - tests/config/fileconf.cpp
define wxCurrentPoppuMenu for wxUniv too
[wxWidgets.git] / tests / config / fileconf.cpp
index fe41fa8d26e1d6932f9b7923c28e971123407510..a7f67216a3f83d192719fc8d49e4ede314f42ab2 100644 (file)
@@ -79,6 +79,7 @@ private:
         CPPUNIT_TEST( CreateSubgroupAndEntries );
         CPPUNIT_TEST( DeleteLastGroup );
         CPPUNIT_TEST( DeleteAndRecreateGroup );
         CPPUNIT_TEST( CreateSubgroupAndEntries );
         CPPUNIT_TEST( DeleteLastGroup );
         CPPUNIT_TEST( DeleteAndRecreateGroup );
+        CPPUNIT_TEST( AddToExistingRoot );
     CPPUNIT_TEST_SUITE_END();
 
     void Path();
     CPPUNIT_TEST_SUITE_END();
 
     void Path();
@@ -99,6 +100,8 @@ private:
     void CreateSubgroupAndEntries();
     void DeleteLastGroup();
     void DeleteAndRecreateGroup();
     void CreateSubgroupAndEntries();
     void DeleteLastGroup();
     void DeleteAndRecreateGroup();
+    void AddToExistingRoot();
+
 
     static wxString ChangePath(wxFileConfig& fc, const wxChar *path)
     {
 
     static wxString ChangePath(wxFileConfig& fc, const wxChar *path)
     {
@@ -607,5 +610,23 @@ void FileConfigTestCase::DeleteAndRecreateGroup()
                          fc );
 }
 
                          fc );
 }
 
+void FileConfigTestCase::AddToExistingRoot()
+{
+    static const wxChar *confInitial =
+        _T("[Group]\n")
+        _T("value1=foo\n");
+
+    wxStringInputStream sis(confInitial);
+    wxFileConfig fc(sis);
+
+    fc.Write(_T("/value1"), _T("bar"));
+    wxVERIFY_FILECONFIG(
+        _T("value1=bar\n")
+        _T("[Group]\n")
+        _T("value1=foo\n"),
+        fc
+    );
+}
+
 #endif // wxUSE_FILECONFIG
 
 #endif // wxUSE_FILECONFIG