#include #include #include #include "../../include/hashtable.h" static int hfun(void* key); static int cmpfun (void *, void *); static int hfun( void* key) { return *(int *)key; } static int cmpfun( void* v1, void* v2) { int i1; int i2; i1 = *(int *)v1; i2 = *(int *)v2; return (i1 < i2 ? -1 : (i1 > i2 ? 1 : 0)); } static bool do_hashtest( int argelems, int argsize) { bool succp = true; HASHTABLE* h; int nelems; int i; int* val_arr; int hsize; int longest; ss_dfprintf(stderr, "testhash : creating hash table of size %d, including %d " "elements in total.", argsize, argelems); val_arr = (int *)malloc(sizeof(void *)*argelems); h = hashtable_alloc(argsize, hfun, cmpfun); ss_dfprintf(stderr, "\t..done\nAdd %d elements to hash table.", argelems); for (i=0; i