+ wxConfigPathChanger change(&fc, wxT("root/group1/subgroup/subentry2"));
+ CPPUNIT_ASSERT( fc.DeleteEntry(wxT("subentry2")) );
+ wxVERIFY_FILECONFIG( wxT("[root]\n")
+ wxT("entry=value\n")
+ wxT("[root/group1]\n")
+ wxT("[root/group2]\n"),
+ fc );
+}
+
+void FileConfigTestCase::DeleteAndWriteEntry()
+{
+ wxStringInputStream sis(
+ "[root/group1]\n"
+ "subentry=subvalue\n"
+ "subentry2=subvalue2\n"
+ "subentry3=subvalue3\n"
+ );
+
+ wxFileConfig fc(sis);
+
+ fc.DeleteEntry("/root/group1/subentry2");
+ fc.Write("/root/group1/subentry2", "testvalue");
+ fc.DeleteEntry("/root/group2/subentry2");
+ fc.Write("/root/group2/subentry2", "testvalue2");
+ fc.DeleteEntry("/root/group1/subentry2");
+ fc.Write("/root/group1/subentry2", "testvalue");
+ fc.DeleteEntry("/root/group2/subentry2");
+ fc.Write("/root/group2/subentry2", "testvalue2");
+
+ wxVERIFY_FILECONFIG( "[root/group1]\n"
+ "subentry=subvalue\n"
+ "subentry3=subvalue3\n"
+ "subentry2=testvalue\n"
+ "[root/group2]\n"
+ "subentry2=testvalue2\n",
+ fc );
+
+ fc.DeleteEntry("/root/group2/subentry2");
+ wxVERIFY_FILECONFIG( "[root/group1]\n"
+ "subentry=subvalue\n"
+ "subentry3=subvalue3\n"
+ "subentry2=testvalue\n",