test: fix util/getaddrinfo for netbsd (v2)

Fixes: c198b0ce ("test: fix util/getaddrinfo for netbsd")
Fixes: #1316
This commit is contained in:
Azat Khuzhin 2022-08-14 09:56:50 +02:00
parent 77a9b60e47
commit bb57cea387

View File

@ -1110,8 +1110,7 @@ test_evutil_getaddrinfo(void *arg)
hints.ai_family = PF_UNSPEC;
hints.ai_flags = EVUTIL_AI_NUMERICHOST;
r = evutil_getaddrinfo("www.google.com", "80", &hints, &ai);
if (r != EVUTIL_EAI_SERVICE && r != EVUTIL_EAI_NONAME)
tt_fail_msg("error is neither EAI_SERVICE nor EAI_NONAME\n");
tt_int_op(r,==,EVUTIL_EAI_NONAME);
tt_ptr_op(ai, ==, NULL);
/* Try symbolic service names wit AI_NUMERICSERV */
@ -1120,7 +1119,8 @@ test_evutil_getaddrinfo(void *arg)
hints.ai_socktype = SOCK_STREAM;
hints.ai_flags = EVUTIL_AI_NUMERICSERV;
r = evutil_getaddrinfo("1.2.3.4", "http", &hints, &ai);
tt_int_op(r,==,EVUTIL_EAI_NONAME);
if (r != EVUTIL_EAI_SERVICE && r != EVUTIL_EAI_NONAME)
tt_fail_msg("error is neither EAI_SERVICE nor EAI_NONAME\n");
/* Try symbolic service names */
memset(&hints, 0, sizeof(hints));