From: Vadim Zeitlin Date: Mon, 14 Jul 2008 21:01:41 +0000 (+0000) Subject: only initialize sockets if IPC implementation is socket-based X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/02ab8d3a754e4b70384e613b9c160a2aaa5f5d3d only initialize sockets if IPC implementation is socket-based git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54620 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/tests/net/ipc.cpp b/tests/net/ipc.cpp index 1ac9167f75..735cbcf58f 100644 --- a/tests/net/ipc.cpp +++ b/tests/net/ipc.cpp @@ -26,6 +26,8 @@ #include "wx/ipc.h" #include "wx/thread.h" +#define wxUSE_SOCKETS_FOR_IPC (!wxUSE_DDE_FOR_IPC) + namespace { @@ -91,8 +93,10 @@ public: { m_conn = NULL; +#if wxUSE_SOCKETS_FOR_IPC // we must call this from the main thread wxSocketBase::Initialize(); +#endif // wxUSE_SOCKETS_FOR_IPC // we need event dispatching to work for IPC server to work m_thread = new EventThread; @@ -109,7 +113,9 @@ public: delete m_conn; +#if wxUSE_SOCKETS_FOR_IPC wxSocketBase::Shutdown(); +#endif // wxUSE_SOCKETS_FOR_IPC } virtual wxConnectionBase *OnAcceptConnection(const wxString& topic) @@ -202,8 +208,7 @@ private: DECLARE_NO_COPY_CLASS(IPCTestCase) }; -// this test is not enabled by default because it requires an IPC server to run -//CPPUNIT_TEST_SUITE_REGISTRATION( IPCTestCase ); +CPPUNIT_TEST_SUITE_REGISTRATION( IPCTestCase ); CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( IPCTestCase, "IPCTestCase" ); void IPCTestCase::Connect()