From 300d1fc0c31b6122d2e897acd5cee93a05eef61c Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sat, 2 Sep 2006 11:16:22 +0000 Subject: (refs #3) Automatically initialise Windows sockets for all tests --- infrastructure/buildenv-testmain-template.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'infrastructure') diff --git a/infrastructure/buildenv-testmain-template.cpp b/infrastructure/buildenv-testmain-template.cpp index c64c1fa5..7adbafa9 100644 --- a/infrastructure/buildenv-testmain-template.cpp +++ b/infrastructure/buildenv-testmain-template.cpp @@ -103,6 +103,14 @@ int main(int argc, const char *argv[]) // banner printf("Running test TEST_NAME in " MODE_TEXT " mode...\n"); + + #ifdef WIN32 + // Under win32 we must initialise the Winsock library + // before using sockets + + WSADATA info; + TEST_THAT(WSAStartup(0x0101, &info) != SOCKET_ERROR) + #endif } try { -- cgit v1.2.3