add wxTempFile test

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43050 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2006-11-04 18:25:08 +00:00
parent a85dda4ad8
commit 59062ec113

View File

@@ -88,7 +88,7 @@
#define TEST_WCHAR
#define TEST_ZIP
#else // #if TEST_ALL
#define TEST_CMDLINE
#define TEST_FILE
#endif
// some tests are interactive, define this to run them
@@ -720,6 +720,24 @@ static void TestFileCopy()
wxPuts(wxEmptyString);
}
static void TestTempFile()
{
wxPuts(_T("*** wxTempFile test ***"));
wxTempFile tmpFile;
if ( tmpFile.Open(_T("test2")) && tmpFile.Write(_T("the answer is 42")) )
{
if ( tmpFile.Commit() )
wxPuts(_T("File committed."));
else
wxPuts(_T("ERROR: could't commit temp file."));
wxRemoveFile(_T("test2"));
}
wxPuts(wxEmptyString);
}
#endif // TEST_FILE
// ----------------------------------------------------------------------------
@@ -4304,6 +4322,7 @@ int main(int argc, char **argv)
TestFileRead();
TestTextFileRead();
TestFileCopy();
TestTempFile();
#endif // TEST_FILE
#ifdef TEST_FILENAME