Changeset 7feba19 for tester.c


Ignore:
Timestamp:
Jul 9, 2011, 4:01:01 PM (10 years ago)
Author:
David Benjamin <davidben@mit.edu>
Branches:
master, release-1.8, release-1.9
Children:
c0c48d14
Parents:
a16d7e5
git-author:
David Benjamin <davidben@mit.edu> (06/25/11 05:41:08)
git-committer:
David Benjamin <davidben@mit.edu> (07/09/11 16:01:01)
Message:
Add some tests for owl_util_baseclass

Mostly to stress some edge cases and make sure we don't accidentally
crash them someday.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • tester.c

    rb4a678a r7feba19  
    131131{
    132132  int numfailed=0;
     133  char *s;
    133134
    134135  printf("# BEGIN testing owl_util\n");
     
    225226  g_string_free(g, true);
    226227
     228
     229  s = owl_util_baseclass("barnowl");
     230  FAIL_UNLESS("baseclass barnowl", !strcmp("barnowl", s));
     231  g_free(s);
     232  s = owl_util_baseclass("unbarnowl");
     233  FAIL_UNLESS("baseclass unbarnowl", !strcmp("barnowl", s));
     234  g_free(s);
     235  s = owl_util_baseclass("unununbarnowl.d.d");
     236  FAIL_UNLESS("baseclass unununbarnowl.d.d", !strcmp("barnowl", s));
     237  g_free(s);
     238  s = owl_util_baseclass("ununun.d.d");
     239  FAIL_UNLESS("baseclass ununun.d.d", !strcmp("", s));
     240  g_free(s);
     241  s = owl_util_baseclass("d.d.d.d");
     242  FAIL_UNLESS("baseclass d.d.d.d", !strcmp("d", s));
     243  g_free(s);
     244  s = owl_util_baseclass("n.d.d.d");
     245  FAIL_UNLESS("baseclass n.d.d.d", !strcmp("n", s));
     246  g_free(s);
     247  s = owl_util_baseclass("ununun.");
     248  FAIL_UNLESS("baseclass ununun.", !strcmp(".", s));
     249  g_free(s);
     250  s = owl_util_baseclass("unununu");
     251  FAIL_UNLESS("baseclass unununu", !strcmp("u", s));
     252  g_free(s);
     253
     254
     255
    227256  /* if (numfailed) printf("*** WARNING: failures encountered with owl_util\n"); */
    228257  printf("# END testing owl_util (%d failures)\n", numfailed);
Note: See TracChangeset for help on using the changeset viewer.