- Timestamp:
- Sep 25, 2009, 7:43:51 PM (15 years ago)
- Branches:
- master, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
- Children:
- dd6af02
- Parents:
- da60ba9
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tester.c
re30ed92 r7b4d90e 12 12 int owl_filter_regtest(void); 13 13 int owl_obarray_regtest(void); 14 int owl_fmtext_regtest(void); 14 15 15 16 int main(int argc, char **argv, char **env) … … 29 30 numfailures += owl_filter_regtest(); 30 31 numfailures += owl_obarray_regtest(); 32 numfailures += owl_fmtext_regtest(); 31 33 if (numfailures) { 32 34 fprintf(stderr, "# *** WARNING: %d failures total\n", numfailures); … … 306 308 return numfailed; 307 309 } 310 311 312 int owl_fmtext_regtest(void) { 313 int numfailed = 0; 314 char *p; 315 316 owl_fmtext fm1, fm2; 317 318 owl_fmtext_init_null(&fm1); 319 owl_fmtext_init_null(&fm2); 320 321 printf("# BEGIN testing owl_fmtext\n"); 322 323 /* Test truncate_cols: 324 * - newline removal on long lines 325 * - handle lines without trailing newlines 326 * - don't kill short lines 327 */ 328 owl_fmtext_append_normal(&fm1, "foo\n1234567890\n1234567890\nbaz"); 329 owl_fmtext_truncate_cols(&fm1, 1, 5, &fm2); 330 p = owl_fmtext_print_plain(&fm2); 331 FAIL_UNLESS("returned truncating columns worked properly", p && !strcmp(p, "oo\n2345623456az")); 332 owl_free(p); 333 334 owl_fmtext_free(&fm1); 335 owl_fmtext_free(&fm2); 336 337 printf("# END testing owl_fmtext (%d failures)\n", numfailed); 338 339 return numfailed; 340 }
Note: See TracChangeset
for help on using the changeset viewer.