X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5df663afecdfe2db0447064ea64a4dd8ecbbf889..e8f33d9e11205d7bf1d5e95b52021f0aaef7c567:/samples/console/console.cpp diff --git a/samples/console/console.cpp b/samples/console/console.cpp index a151a12468..c2e691b401 100644 --- a/samples/console/console.cpp +++ b/samples/console/console.cpp @@ -88,7 +88,7 @@ #define TEST_WCHAR #define TEST_ZIP #else // #if TEST_ALL - #define TEST_CMDLINE + #define TEST_STDPATHS #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 // ---------------------------------------------------------------------------- @@ -2781,6 +2799,7 @@ static void TestStandardPaths() wxPrintf(_T("Data dir (user):\t%s\n"), stdp.GetUserDataDir().c_str()); wxPrintf(_T("Data dir (user local):\t%s\n"), stdp.GetUserLocalDataDir().c_str()); wxPrintf(_T("Documents dir:\t\t%s\n"), stdp.GetDocumentsDir().c_str()); + wxPrintf(_T("Executable path:\t%s\n"), stdp.GetExecutablePath().c_str()); wxPrintf(_T("Plugins dir:\t\t%s\n"), stdp.GetPluginsDir().c_str()); wxPrintf(_T("Resources dir:\t\t%s\n"), stdp.GetResourcesDir().c_str()); wxPrintf(_T("Localized res. dir:\t%s\n"), @@ -4304,6 +4323,7 @@ int main(int argc, char **argv) TestFileRead(); TestTextFileRead(); TestFileCopy(); + TestTempFile(); #endif // TEST_FILE #ifdef TEST_FILENAME @@ -4348,9 +4368,9 @@ int main(int argc, char **argv) wxLog::AddTraceMask(_T("mime")); #if TEST_ALL TestMimeEnum(); + #endif TestMimeOverride(); TestMimeAssociate(); - #endif TestMimeFilename(); #endif // TEST_MIME