fix bug with adding entries to a root group containing only subgroups (as shown by new AddToExistingRoot() unit test)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@49476 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user