bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
From: Bruno Haible <bruno@clisp.org>
To: bug-gnulib@gnu.org
Subject: getaddrinfo tests: fix test failure on MSVC
Date: Tue, 02 Jul 2019 19:38:53 +0200	[thread overview]
Message-ID: <45970095.fu9pO4Vmgl@omega> (raw)

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  <bruno@clisp.org>

	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
 



             reply	other threads:[~2019-07-02 20:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-02 17:38 Bruno Haible [this message]
2019-07-03  7:08 ` getaddrinfo tests: fix test failure on MSVC Gisle Vanem
2019-07-03 19:50   ` Bruno Haible

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://lists.gnu.org/mailman/listinfo/bug-gnulib

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=45970095.fu9pO4Vmgl@omega \
    --to=bruno@clisp.org \
    --cc=bug-gnulib@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).