+void FileConfigTestCase::DeleteLastRootEntry()
+{
+ // This tests for the bug which occurred when the last entry of the root
+ // group was deleted: this corrupted internal state and resulted in a crash
+ // after trying to write the just deleted entry again.
+ wxStringInputStream sis("");
+ wxFileConfig fc(sis);
+
+ fc.Write("key", "value");
+ wxVERIFY_FILECONFIG( "key=value\n", fc );
+
+ fc.DeleteEntry("key");
+ wxVERIFY_FILECONFIG( "", fc );
+
+ fc.Write("key", "value");
+ wxVERIFY_FILECONFIG( "key=value\n", fc );
+}
+