]> git.saurik.com Git - wxWidgets.git/commitdiff
close the file before removing it
authorVadim Zeitlin <vadim@wxwidgets.org>
Thu, 2 Nov 2006 01:48:38 +0000 (01:48 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Thu, 2 Nov 2006 01:48:38 +0000 (01:48 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42930 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

samples/console/console.cpp

index 945201f3b1b8291b803807eee4d7902140b8dcae..a151a12468b12153d868f69bf250b0bd51c37121 100644 (file)
@@ -88,7 +88,7 @@
     #define TEST_WCHAR
     #define TEST_ZIP
 #else // #if TEST_ALL
-    #define TEST_INFO_FUNCTIONS
+    #define TEST_CMDLINE
 #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++ )
@@ -2814,11 +2814,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) )