git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15918
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
#undef TEST_ALL
static const bool TEST_ALL = TRUE;
#else
#undef TEST_ALL
static const bool TEST_ALL = TRUE;
#else
static const bool TEST_ALL = FALSE;
#endif
static const bool TEST_ALL = FALSE;
#endif
+ wxDir dir("s:/tmp/foo");
if ( !dir.IsOpened() )
{
printf("ERROR: failed to open current directory '%s'.\n", cwd.c_str());
if ( !dir.IsOpened() )
{
printf("ERROR: failed to open current directory '%s'.\n", cwd.c_str());
static void TestMemoryStream()
{
static void TestMemoryStream()
{
- puts("*** Testing wxMemoryInputStream ***");
+ wxPuts(_T("*** Testing wxMemoryOutputStream ***"));
+
+ wxMemoryOutputStream memOutStream;
+ wxPrintf(_T("Initially out stream offset: %lu\n"),
+ (unsigned long)memOutStream.TellO());
+
+ for ( const wxChar *p = _T("Hello, stream!"); *p; p++ )
+ {
+ memOutStream.PutC(*p);
+ }
+
+ wxPrintf(_T("Final out stream offset: %lu\n"),
+ (unsigned long)memOutStream.TellO());
+
+ wxPuts(_T("*** Testing wxMemoryInputStream ***"));
- wxStrncpy(buf, _T("Hello, stream!"), WXSIZEOF(buf));
+ size_t len = memOutStream.CopyTo(buf, WXSIZEOF(buf));
- wxMemoryInputStream memInpStream(buf, wxStrlen(buf));
- printf(_T("Memory stream size: %u\n"), memInpStream.GetSize());
+ wxMemoryInputStream memInpStream(buf, len);
+ wxPrintf(_T("Memory stream size: %u\n"), memInpStream.GetSize());
while ( !memInpStream.Eof() )
{
putchar(memInpStream.GetC());
while ( !memInpStream.Eof() )
{
putchar(memInpStream.GetC());
#endif // TEST_ARRAYS
#ifdef TEST_DIR
#endif // TEST_ARRAYS
#ifdef TEST_DIR
#endif // TEST_DIR
#ifdef TEST_DLLLOADER
#endif // TEST_DIR
#ifdef TEST_DLLLOADER
#endif // TEST_SOCKETS
#ifdef TEST_STREAMS
#endif // TEST_SOCKETS
#ifdef TEST_STREAMS
- TestFileStream();
- TestMemoryStream();
+ if ( TEST_ALL )
+ {
+ TestFileStream();
+ }
+ TestMemoryStream();
#endif // TEST_STREAMS
#ifdef TEST_THREADS
#endif // TEST_STREAMS
#ifdef TEST_THREADS