#include "wx/fileconf.h"
#include "wx/sstream.h"
+#include "wx/wfstream.h"
#include "wx/cppunit.h"
class FileConfigTestCase : public CppUnit::TestCase
{
public:
- FileConfigTestCase() { }
+ FileConfigTestCase()
+ {
+ }
private:
CPPUNIT_TEST_SUITE( FileConfigTestCase );
static wxString Dump(wxFileConfig& fc)
{
- wxStringOutputStream sos;
- fc.Save(sos);
- return wxTextFile::Translate(sos.GetString(), wxTextFileType_Unix);
+ wxFileOutputStream* pOutFile = new wxFileOutputStream(_T("outconf.txt"));
+ fc.Save(*pOutFile);
+ delete pOutFile;
+
+ wxFileInputStream* pInFile = new wxFileInputStream(_T("outconf.txt"));
+ char* szOut = new char[pInFile->GetSize()];
+ pInFile->Read(szOut, pInFile->GetSize());
+
+ wxString realString = wxTextFile::Translate(
+ wxString(szOut, wxConvLocal, pInFile->GetSize()),
+ wxTextFileType_Unix
+ );
+
+ delete szOut;
+ delete pInFile;
+
+ return realString;
}
void CheckGroupEntries(const wxFileConfig& fc,