Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/tests/avltree/avl_test.c

    r14f6bb39 rcb2b15c  
    3636
    3737  // char* -> char*
    38   struct c_str { char *str; };  // wraps a C string
    39   int ?<?(c_str a, c_str b) {
    40     return strcmp(a.str,b.str) < 0;
     38  int ?<?(char *a, char *b) {
     39    return strcmp(a,b) < 0;
    4140  }
    42   tree(c_str, char *) * ssmap = create((c_str){"queso"}, "cheese");
    43   insert(&ssmap, (c_str){"foo"}, "bar");
    44   insert(&ssmap, (c_str){"hello"}, "world");
     41  tree(char *, char *) * ssmap = create("queso", "cheese");
     42  insert(&ssmap, "foo", "bar");
     43  insert(&ssmap, "hello", "world");
    4544  assert( height(ssmap) == 2 );
    4645
    47   printf("%s %s %s\n", *find(ssmap, (c_str){"hello"}), *find(ssmap, (c_str){"foo"}), *find(ssmap, (c_str){"queso"}));
     46  printf("%s %s %s\n", *find(ssmap, "hello"), *find(ssmap, "foo"), *find(ssmap, "queso"));
    4847
    49   remove(&ssmap, (c_str){"foo"});
     48  remove(&ssmap, "foo");
    5049  delete(ssmap);
    5150}
Note: See TracChangeset for help on using the changeset viewer.