From: Erik van der Kouwe Date: Wed, 8 Jul 2015 07:32:17 +0000 (+0200) Subject: test48: skip some redundant combinations of parameters X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/zpipe.c?a=commitdiff_plain;h=refs%2Fchanges%2F24%2F3024%2F1;p=minix.git test48: skip some redundant combinations of parameters Change-Id: I8ebecf4f61a99c653fd6dc0ae9510d5fd154dd4e --- diff --git a/minix/tests/test48.c b/minix/tests/test48.c index 73294c33b..ef8d55733 100644 --- a/minix/tests/test48.c +++ b/minix/tests/test48.c @@ -367,7 +367,7 @@ static struct 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 */ @@ -381,6 +381,11 @@ static void test_getaddrinfo_all(int use_network) 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; @@ -490,7 +495,7 @@ static int buflens[] = { 0, 1, 2, 3, 4, 5, 6, 9, 10, 11, 255 }; 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 */ @@ -530,6 +535,13 @@ static void test_getnameinfo_all(void) 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) |