summaryrefslogtreecommitdiff
path: root/tests/port/test_getaddrinfo.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/port/test_getaddrinfo.c')
-rw-r--r--tests/port/test_getaddrinfo.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/port/test_getaddrinfo.c b/tests/port/test_getaddrinfo.c
index f163189..530b518 100644
--- a/tests/port/test_getaddrinfo.c
+++ b/tests/port/test_getaddrinfo.c
@@ -13,6 +13,11 @@ int main( void ) {
int error;
char port_or_service[10];
+#ifdef _WIN32
+ WSADATA wsa_data;
+ WSAStartup( MAKEWORD( 2, 2 ), &wsa_data );
+#endif
+
/* tell getaddrinfo what we want */
memset( &hints, 0, sizeof( struct addrinfo ) );
hints.ai_flags = AI_PASSIVE;
@@ -48,6 +53,10 @@ int main( void ) {
}
freeaddrinfo( result );
+
+#ifdef _WIN32
+ WSACleanup( );
+#endif
return EXIT_SUCCESS;
}