Changeset 1cf3f8d3
- Timestamp:
- Jul 7, 2007, 5:42:45 PM (17 years ago)
- Branches:
- master, barnowl_perlaim, debian, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
- Children:
- 535d68b
- Parents:
- 9a6cc40
- Files:
-
- 1 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
Makefile.in
r702aee7 r1cf3f8d3 45 45 #AUTOGEN=$(GEN_C) 46 46 47 HEADERS=$(GEN_H) owl.h config.h 47 HEADERS=$(GEN_H) owl.h config.h test.h 48 48 49 49 %.o: %.c $(HEADERS) -
dict.c
r0138478 r1cf3f8d3 152 152 char *av="aval", *bv="bval", *cv="cval", *dv="dval"; 153 153 154 printf(" BEGIN testing owl_dict\n");154 printf("# BEGIN testing owl_dict\n"); 155 155 FAIL_UNLESS("create", 0==owl_dict_create(&d)); 156 156 FAIL_UNLESS("insert b", 0==owl_dict_insert_element(&d, "b", (void*)bv, owl_dict_noop_free)); … … 179 179 owl_dict_free_all(&d, NULL); 180 180 181 if (numfailed) printf("*** WARNING: failures encountered with owl_dict\n");182 printf(" END testing owl_dict (%d failures)\n", numfailed);181 // if (numfailed) printf("*** WARNING: failures encountered with owl_dict\n"); 182 printf("# END testing owl_dict (%d failures)\n", numfailed); 183 183 return(numfailed); 184 184 } -
test.h
r0138478 r1cf3f8d3 3 3 4 4 #define FAIL_UNLESS(desc,pred) do { int __pred = (pred); \ 5 printf(" \t%-4s: %s", (__pred)?"ok":(numfailed++,"FAIL"), desc); \5 printf("%s %s", (__pred)?"ok":(numfailed++,"not ok"), desc); \ 6 6 if(!(__pred)) printf("\t(%s:%d)", __FILE__, __LINE__); printf("%c", '\n'); } while(0) 7 7 -
tester.c
re7dc035 r1cf3f8d3 143 143 144 144 145 #define OWL_DICT_NTESTS 20 146 #define OWL_UTIL_NTESTS 9 147 #define OWL_OBARRAY_NTESTS 5 148 #define OWL_VARIABLE_NTESTS 52 149 #define OWL_FILTER_NTESTS 23 150 145 151 int main(int argc, char **argv, char **env) 146 152 { … … 149 155 150 156 int numfailures=0; 151 if (argc==2 && 0==strcmp(argv[1],"reg")) { 157 if (argc==1 || (argc==2 && 0==strcmp(argv[1],"reg"))) { 158 printf("1..%d\n", OWL_UTIL_NTESTS+OWL_DICT_NTESTS+OWL_VARIABLE_NTESTS 159 +OWL_FILTER_NTESTS+OWL_OBARRAY_NTESTS); 152 160 numfailures += owl_util_regtest(); 153 161 numfailures += owl_dict_regtest(); … … 156 164 numfailures += owl_obarray_regtest(); 157 165 if (numfailures) { 158 fprintf(stderr, " *** WARNING: %d failures total\n", numfailures);166 fprintf(stderr, "# *** WARNING: %d failures total\n", numfailures); 159 167 } 160 168 return(numfailures); -
util.c
rc2c5c77 r1cf3f8d3 789 789 int numfailed=0; 790 790 791 printf(" BEGIN testing owl_util\n");791 printf("# BEGIN testing owl_util\n"); 792 792 793 793 FAIL_UNLESS("owl_util_substitute 1", … … 812 812 !strcmp("meep foo bar", owl_util_uniq("meep foo", "bar foo meep", "-"))); 813 813 814 if (numfailed) printf("*** WARNING: failures encountered with owl_util\n");815 printf(" END testing owl_util (%d failures)\n", numfailed);814 // if (numfailed) printf("*** WARNING: failures encountered with owl_util\n"); 815 printf("# END testing owl_util (%d failures)\n", numfailed); 816 816 return(numfailed); 817 817 } -
variable.c
ra695a68 r1cf3f8d3 977 977 in_regtest = 1; 978 978 979 printf(" BEGIN testing owl_variable\n");979 printf("# BEGIN testing owl_variable\n"); 980 980 FAIL_UNLESS("setup", 0==owl_variable_dict_setup(&vd)); 981 981 … … 1049 1049 owl_variable_dict_free(&vd); 1050 1050 1051 if (numfailed) printf("*** WARNING: failures encountered with owl_variable\n");1052 printf(" END testing owl_variable (%d failures)\n", numfailed);1051 // if (numfailed) printf("*** WARNING: failures encountered with owl_variable\n"); 1052 printf("# END testing owl_variable (%d failures)\n", numfailed); 1053 1053 return(numfailed); 1054 1054 }
Note: See TracChangeset
for help on using the changeset viewer.