[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
getaddrinfo tests: fix test failure on MSVC
From: |
Bruno Haible |
Subject: |
getaddrinfo tests: fix test failure on MSVC |
Date: |
Tue, 02 Jul 2019 19:38:53 +0200 |
User-agent: |
KMail/5.1.3 (Linux/4.4.0-151-generic; KDE/5.18.0; x86_64; ; ) |
On native Windows with MSVC, I observe this test failure:
FAIL: test-getaddrinfo
======================
FAIL test-getaddrinfo.exe (exit status: 4)
The cause is a missing call to WSAStartup(). This patch fixes it.
2019-07-02 Bruno Haible <address@hidden>
getaddrinfo tests: Fix test failure on MSVC.
* tests/test-getaddrinfo.c: Include sockets.h.
(main): Invoke gl_sockets_startup.
* modules/getaddrinfo-tests (Depends-on): Add sockets.
diff --git a/tests/test-getaddrinfo.c b/tests/test-getaddrinfo.c
index 2f9dcc3..41910ec 100644
--- a/tests/test-getaddrinfo.c
+++ b/tests/test-getaddrinfo.c
@@ -39,6 +39,8 @@ SIGNATURE_CHECK (getaddrinfo, int, (char const *, char const
*,
#include <stdio.h>
#include <string.h>
+#include "sockets.h"
+
/* Whether to print debugging messages. */
#define ENABLE_DEBUGGING 0
@@ -167,6 +169,8 @@ simple (char const *host, char const *service)
int main (void)
{
+ (void) gl_sockets_startup (SOCKETS_1_1);
+
return simple (HOST1, SERV1)
+ simple (HOST2, SERV2)
+ simple (HOST3, SERV3)
diff --git a/modules/getaddrinfo-tests b/modules/getaddrinfo-tests
index 521cf68..64a7c2d 100644
--- a/modules/getaddrinfo-tests
+++ b/modules/getaddrinfo-tests
@@ -3,6 +3,7 @@ tests/signature.h
tests/test-getaddrinfo.c
Depends-on:
+sockets
inet_ntop
strerror
- getaddrinfo tests: fix test failure on MSVC,
Bruno Haible <=