mirror of
https://github.com/isc-projects/bind9.git
synced 2026-05-28 04:34:54 -04:00
The testing framework didn't handle T_UNTESTED at all. It also sucks.
This commit is contained in:
parent
ff6b5e8406
commit
529017a705
1 changed files with 19 additions and 8 deletions
|
|
@ -15,7 +15,7 @@
|
|||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: t_api.c,v 1.47 2001/01/09 22:00:36 bwelling Exp $ */
|
||||
/* $Id: t_api.c,v 1.48 2001/07/11 18:51:22 bwelling Exp $ */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
|
|
@ -724,8 +724,10 @@ t_eval(const char *filename, int (*func)(char **), int nargs) {
|
|||
int result;
|
||||
int nfails;
|
||||
int nprobs;
|
||||
int npass;
|
||||
char *tokens[T_MAXTOKS + 1];
|
||||
|
||||
npass = 0;
|
||||
nfails = 0;
|
||||
nprobs = 0;
|
||||
|
||||
|
|
@ -745,11 +747,18 @@ t_eval(const char *filename, int (*func)(char **), int nargs) {
|
|||
cnt = t_bustline(p, tokens);
|
||||
if (cnt == nargs) {
|
||||
result = func(tokens);
|
||||
if (result != T_PASS) {
|
||||
if (result == T_FAIL)
|
||||
++nfails;
|
||||
else
|
||||
++nprobs;
|
||||
switch (result) {
|
||||
case T_PASS:
|
||||
++npass;
|
||||
break;
|
||||
case T_FAIL:
|
||||
++nfails;
|
||||
break;
|
||||
case T_UNTESTED:
|
||||
break;
|
||||
default:
|
||||
++nprobs;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
t_info("bad format in %s at line %d\n",
|
||||
|
|
@ -767,10 +776,12 @@ t_eval(const char *filename, int (*func)(char **), int nargs) {
|
|||
|
||||
result = T_UNRESOLVED;
|
||||
|
||||
if ((nfails == 0) && (nprobs == 0))
|
||||
if (nfails == 0 && nprobs == 0 && npass > 0)
|
||||
result = T_PASS;
|
||||
else if (nfails)
|
||||
else if (nfails > 0)
|
||||
result = T_FAIL;
|
||||
else if (npass == 0)
|
||||
result = T_UNTESTED;
|
||||
|
||||
return (result);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue