+2025-02-17 Bruno Haible <bruno@clisp.org>
+
+ getaddrinfo tests: Make failures more verbose.
+ * tests/test-getaddrinfo.c (simple): Print some info before returning 1.
+
2025-02-16 Collin Funk <collin.funk1@gmail.com>
doc: Adjust platforms that define O_CLOEXEC in unistd.h.
dbgprintf ("res %d: %s\n", res, gai_strerror (res));
- if (pass == 3 && ! isdigit (host[0]))
- return res != EAI_NONAME;
-
- if (pass == 4 && ! isdigit (service[0]))
- return res != EAI_NONAME;
+ if ((pass == 3 && ! isdigit (host[0]))
+ || (pass == 4 && ! isdigit (service[0])))
+ {
+ if (res != EAI_NONAME)
+ {
+ fprintf (stderr,
+ "Test case pass=%d, host=%s, service=%s failed: "
+ "expected EAI_NONAME, got %d\n",
+ pass, host, service, res);
+ return 1;
+ }
+ return 0;
+ }
if (res != 0)
{
if (res == EAI_SYSTEM)
fprintf (stderr, "system error: %s\n", strerror (err));
+ fprintf (stderr,
+ "Test case pass=%d, host=%s, service=%s failed: "
+ "expected 0, got %d\n",
+ pass, host, service, res);
return 1;
}