Changeset 3f6555d for tester.c


Ignore:
Timestamp:
May 16, 2010, 1:15:25 AM (11 years ago)
Author:
David Benjamin <davidben@mit.edu>
Branches:
master, release-1.7, release-1.8, release-1.9
Children:
c314f39
Parents:
f034ac0
git-author:
David Benjamin <davidben@mit.edu> (05/15/10 17:38:31)
git-committer:
David Benjamin <davidben@mit.edu> (05/16/10 01:15:25)
Message:
Punt obarray and friends in favor of g_intern_string

It's somewhat faster (about 1.5x by completely unrigorous tests), and
it's less code for us to maintain.

Signed-off-by: David Benjamin <davidben@mit.edu>
File:
1 edited

Legend:

Unmodified
Added
Removed
  • tester.c

    rf034ac0 r3f6555d  
    3333  numfailures += owl_variable_regtest();
    3434  numfailures += owl_filter_regtest();
    35   numfailures += owl_obarray_regtest();
    3635  numfailures += owl_editwin_regtest();
    3736  if (numfailures) {
     
    301300}
    302301
    303 
    304 int owl_obarray_regtest(void) {
    305   int numfailed = 0;
    306   const char *p,*p2;
    307 
    308   owl_obarray oa;
    309   owl_obarray_init(&oa);
    310 
    311   printf("# BEGIN testing owl_obarray\n");
    312 
    313   p = owl_obarray_insert(&oa, "test");
    314   FAIL_UNLESS("returned string is equal", p && !strcmp(p, "test"));
    315   p2 = owl_obarray_insert(&oa, "test");
    316   FAIL_UNLESS("returned string is equal", p2 && !strcmp(p2, "test"));
    317   FAIL_UNLESS("returned the same string", p2 && p == p2);
    318 
    319   p = owl_obarray_insert(&oa, "test2");
    320   FAIL_UNLESS("returned string is equal", p && !strcmp(p, "test2"));
    321   p2 = owl_obarray_find(&oa, "test2");
    322   FAIL_UNLESS("returned the same string", p2 && !strcmp(p2, "test2"));
    323 
    324   p = owl_obarray_find(&oa, "nothere");
    325   FAIL_UNLESS("Didn't find a string that isn't there", p == NULL);
    326 
    327   printf("# END testing owl_obarray (%d failures)\n", numfailed);
    328 
    329   return numfailed;
    330 }
    331 
    332302int owl_editwin_regtest(void) {
    333303  int numfailed = 0;
Note: See TracChangeset for help on using the changeset viewer.