git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45557
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
All (Unix):
- Handle socket shutdown by the peer correctly in wxSocket (Tim Kosse)
All (Unix):
- Handle socket shutdown by the peer correctly in wxSocket (Tim Kosse)
+- Fix bug in wxFileConfig when recreating a group (Steven Van Ingelgem)
m_pLastGroup = NULL;
for ( wxFileConfigLineList *pl = pLine->Prev();
m_pLastGroup = NULL;
for ( wxFileConfigLineList *pl = pLine->Prev();
- pl && pl != m_pLine && !m_pLastGroup;
pl = pl->Prev() )
{
// does this line belong to our subgroup?
pl = pl->Prev() )
{
// does this line belong to our subgroup?
+
+ if ( pl == m_pLine )
+ break;
CPPUNIT_TEST( CreateEntriesAndSubgroup );
CPPUNIT_TEST( CreateSubgroupAndEntries );
CPPUNIT_TEST( DeleteLastGroup );
CPPUNIT_TEST( CreateEntriesAndSubgroup );
CPPUNIT_TEST( CreateSubgroupAndEntries );
CPPUNIT_TEST( DeleteLastGroup );
+ CPPUNIT_TEST( DeleteAndRecreateGroup );
CPPUNIT_TEST_SUITE_END();
void Path();
CPPUNIT_TEST_SUITE_END();
void Path();
void CreateEntriesAndSubgroup();
void CreateSubgroupAndEntries();
void DeleteLastGroup();
void CreateEntriesAndSubgroup();
void CreateSubgroupAndEntries();
void DeleteLastGroup();
+ void DeleteAndRecreateGroup();
static wxString ChangePath(wxFileConfig& fc, const wxChar *path)
{
static wxString ChangePath(wxFileConfig& fc, const wxChar *path)
{
(void) ::wxRemoveFile(wxFileConfig::GetLocalFileName(_T("deleteconftest")));
}
(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
#endif // wxUSE_FILECONFIG