#if wxUSE_SOCKETS
#include "wx/socket.h"
+#include "wx/url.h"
+#include "wx/sstream.h"
#include "wx/evtloop.h"
#include <memory>
ALL_SOCKET_TESTS();
CPPUNIT_TEST( PseudoTest_SetUseEventLoop );
ALL_SOCKET_TESTS();
+ CPPUNIT_TEST( UrlTest );
CPPUNIT_TEST_SUITE_END();
// helper event loop class which sets itself as active only if we pass it
void ReadNowait();
void ReadWaitall();
+ void UrlTest();
+
static bool ms_useLoop;
DECLARE_NO_COPY_CLASS(SocketTestCase)
CPPUNIT_ASSERT_EQUAL( WXSIZEOF(buf), sock->LastCount() );
}
+void SocketTestCase::UrlTest()
+{
+ if ( gs_serverHost.empty() )
+ return;
+
+ SocketTestEventLoop loop(ms_useLoop);
+
+ wxURL url("http://" + gs_serverHost);
+ wxInputStream * const in = url.GetInputStream();
+ CPPUNIT_ASSERT( in );
+
+ wxStringOutputStream out;
+ CPPUNIT_ASSERT_EQUAL( wxSTREAM_EOF, in->Read(out).GetLastError() );
+}
+
#endif // wxUSE_SOCKETS