static void test_getaddrinfo_all(int use_network)
{
int flag_PASSIVE, flag_CANONNAME, flag_NUMERICHOST, flag_NUMERICSERV;
- int exp_results, flags, i, j, k, l, passhints;
+ int exp_results, flags, flagcount, i, j, k, l, passhints;
unsigned long ipaddr;
/* loop through various parameter values */
for (flag_NUMERICSERV = 0; flag_NUMERICSERV < 2; flag_NUMERICSERV++)
for (passhints = 0; passhints < 2; passhints++)
{
+ /* skip some redundant combinations */
+ flagcount = flag_PASSIVE + flag_CANONNAME +
+ flag_NUMERICHOST + flag_NUMERICSERV;
+ if (flagcount > 1 && flagcount < 4) continue;
+
/* skip tests that need but cannot use network */
if (!use_network && hosts[i].need_network)
continue;
static void test_getnameinfo_all(void)
{
int flag_NUMERICHOST, flag_NAMEREQD, flag_NUMERICSERV, flag_DGRAM;
- int exp_results, flags, i, j, k, l, socktypemismatch;
+ int exp_results, flagcount, flags, i, j, k, l, socktypemismatch;
const char *nodename, *servname;
/* set ports servent structs */
for (flag_NUMERICSERV = 0; flag_NUMERICSERV < 2; flag_NUMERICSERV++)
for (flag_DGRAM = 0; flag_DGRAM < 2; flag_DGRAM++)
{
+ /* skip some redundant combinations */
+ flagcount = flag_NUMERICHOST + flag_NAMEREQD +
+ flag_NUMERICSERV + flag_DGRAM;
+ if (flagcount > 1 && flagcount < 4) continue;
+ if (k > 1 && k < LENGTH(buflens) - 2 &&
+ l > 1 && l < LENGTH(buflens) - 2) continue;
+
/* determine flags */
flags = (flag_NUMERICHOST ? NI_NUMERICHOST : 0) |
(flag_NAMEREQD ? NI_NAMEREQD : 0) |