X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e86882e38dc301aee6551ab73f12824a52e9dcff..8bb0880114088f0f72411d4e26e1a77208ece4ae:/tests/config/fileconf.cpp diff --git a/tests/config/fileconf.cpp b/tests/config/fileconf.cpp index fe41fa8d26..a7f67216a3 100644 --- a/tests/config/fileconf.cpp +++ b/tests/config/fileconf.cpp @@ -79,6 +79,7 @@ private: CPPUNIT_TEST( CreateSubgroupAndEntries ); CPPUNIT_TEST( DeleteLastGroup ); CPPUNIT_TEST( DeleteAndRecreateGroup ); + CPPUNIT_TEST( AddToExistingRoot ); CPPUNIT_TEST_SUITE_END(); void Path(); @@ -99,6 +100,8 @@ private: void CreateSubgroupAndEntries(); void DeleteLastGroup(); void DeleteAndRecreateGroup(); + void AddToExistingRoot(); + static wxString ChangePath(wxFileConfig& fc, const wxChar *path) { @@ -607,5 +610,23 @@ void FileConfigTestCase::DeleteAndRecreateGroup() 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