// Author: Mike Wetherell
// RCS-ID: $Id$
// Copyright: (c) 2005 Mike Wetherell
-// Licence: wxWidgets licence
+// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#include "testprec.h"
#include "wx/wx.h"
#endif
+#if wxUSE_STREAMS
+
#ifdef __UNIX__
#include <sys/socket.h>
#endif
#include "wx/sckstrm.h"
#include "wx/mstream.h"
-#if wxUSE_STREAMS
+#ifdef __VISUALC__
+ #define isatty _isatty
+ #define fdopen _fdopen
+ #define fileno _fileno
+#endif
///////////////////////////////////////////////////////////////////////////////
// The test case
#endif
CPPUNIT_TEST(Stdin);
CPPUNIT_TEST(MemoryStream);
+#if wxUSE_SOCKETS
CPPUNIT_TEST(SocketStream);
+#endif
CPPUNIT_TEST_SUITE_END();
void File();
void Socket();
void Stdin();
void MemoryStream();
+#if wxUSE_SOCKETS
void SocketStream();
+#endif
void TestFILE(wxFFile& file, bool expected);
void TestFd(wxFile& file, bool expected);
{
TempFile tmp; // put first
wxFile file;
- tmp.m_name = wxFileName::CreateTempFileName(_T("wxft"), &file);
+ tmp.m_name = wxFileName::CreateTempFileName(wxT("wxft"), &file);
TestFd(file, true);
file.Close();
void FileKindTestCase::Pipe()
{
int afd[2];
+ int rc;
#ifdef __UNIX__
- pipe(afd);
+ rc = pipe(afd);
#else
- _pipe(afd, 256, O_BINARY);
+ rc = _pipe(afd, 256, O_BINARY);
#endif
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Failed to create pipe", 0, rc);
wxFile file0(afd[0]);
wxFile file1(afd[1]);
// register in the unnamed registry so that these tests are run by default
CPPUNIT_TEST_SUITE_REGISTRATION(FileKindTestCase);
-// also include in it's own registry so that these tests can be run alone
+// also include in its own registry so that these tests can be run alone
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(FileKindTestCase, "FileKindTestCase");
#endif // wxUSE_STREAMS