X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0219fd2faa62461a1e06576dde983b5a487c7d63..0edfdd963bdc9cfeb54d403ed77b5f36e4de8c84:/samples/console/console.cpp?ds=sidebyside diff --git a/samples/console/console.cpp b/samples/console/console.cpp index 945201f3b1..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_INFO_FUNCTIONS + #define TEST_STDPATHS #endif // some tests are interactive, define this to run them @@ -136,7 +136,7 @@ static wxString MakePrintable(const wxChar *s) static void ShowCmdLine(const wxCmdLineParser& parser) { - wxString s = _T("Input files: "); + wxString s = _T("Command line parsed successfully:\nInput files: "); size_t count = parser.GetParamCount(); for ( size_t param = 0; param < count; param++ ) @@ -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"), @@ -2814,11 +2833,13 @@ static void TestFileStream() fsOut.Write("foo", 3); } - wxFileInputStream fsIn(filename); - wxPrintf(_T("File stream size: %u\n"), fsIn.GetSize()); - while ( !fsIn.Eof() ) { - wxPutchar(fsIn.GetC()); + wxFileInputStream fsIn(filename); + wxPrintf(_T("File stream size: %u\n"), fsIn.GetSize()); + while ( !fsIn.Eof() ) + { + wxPutchar(fsIn.GetC()); + } } if ( !wxRemoveFile(filename) ) @@ -4302,6 +4323,7 @@ int main(int argc, char **argv) TestFileRead(); TestTextFileRead(); TestFileCopy(); + TestTempFile(); #endif // TEST_FILE #ifdef TEST_FILENAME @@ -4346,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