]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/console/console.cpp
Removed 'interface' pragma for gcc 2.96
[wxWidgets.git] / samples / console / console.cpp
index a935db655f1da7741ad2d345687ee3c15a3137f6..e33f32e87c61986119b1e649a7bd109ca6d35eb9 100644 (file)
@@ -41,7 +41,7 @@
 //#define TEST_DIR
 //#define TEST_DLLLOADER
 //#define TEST_EXECUTE
-#define TEST_FILE
+//#define TEST_FILE
 //#define TEST_FILECONF
 //#define TEST_HASH
 //#define TEST_LIST
@@ -50,6 +50,7 @@
 //#define TEST_MIME
 //#define TEST_INFO_FUNCTIONS
 //#define TEST_SOCKETS
+#define TEST_STREAMS
 //#define TEST_STRINGS
 //#define TEST_THREADS
 //#define TEST_TIMER
@@ -1301,6 +1302,33 @@ static void TestProtocolFtpUpload()
 
 #endif // TEST_SOCKETS
 
+// ----------------------------------------------------------------------------
+// streams
+// ----------------------------------------------------------------------------
+
+#ifdef TEST_STREAMS
+
+#include <wx/mstream.h>
+
+static void TestMemoryStream()
+{
+    puts("*** Testing wxMemoryInputStream ***");
+
+    wxChar buf[1024];
+    wxStrncpy(buf, _T("Hello, stream!"), WXSIZEOF(buf));
+
+    wxMemoryInputStream memInpStream(buf, wxStrlen(buf));
+    printf(_T("Memory stream size: %u\n"), memInpStream.GetSize());
+    while ( !memInpStream.Eof() )
+    {
+        putchar(memInpStream.GetC());
+    }
+
+    puts("\n*** wxMemoryInputStream test done ***");
+}
+
+#endif // TEST_STREAMS
+
 // ----------------------------------------------------------------------------
 // timers
 // ----------------------------------------------------------------------------
@@ -3594,6 +3622,10 @@ int main(int argc, char **argv)
         TestProtocolFtpUpload();
 #endif // TEST_SOCKETS
 
+#ifdef TEST_STREAMS
+    TestMemoryStream();
+#endif // TEST_STREAMS
+
 #ifdef TEST_TIMER
     TestStopWatch();
 #endif // TEST_TIMER