X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=code_c%2FMaasha%2Fsrc%2Ftest_hash.c;fp=code_c%2FMaasha%2Fsrc%2Ftest_hash.c;h=a1b80655d3099ba93c706f8d2ec4b77ec517b715;hb=54de880e571a403a6a67f83f1edbe222482a1de6;hp=0000000000000000000000000000000000000000;hpb=1e9ad5a70a3bc1fe63701bd3c770dc8c053039dc;p=biopieces.git diff --git a/code_c/Maasha/src/test_hash.c b/code_c/Maasha/src/test_hash.c new file mode 100644 index 0000000..a1b8065 --- /dev/null +++ b/code_c/Maasha/src/test_hash.c @@ -0,0 +1,35 @@ +#include +#include "common.h" +#include "hash.h" + + +int main() +{ + struct hash *my_hash; + int pot; + int i; + char *dummy; + + pot = 16; + + my_hash = hash_new( pot ); + + for ( i = 1; i <= ( 1 << pot ); i++ ) + { + sprintf( dummy, "dummy_%d", i ); + + hash_add( my_hash, dummy, "FOO" ); + } + + hash_collision_stats( my_hash ); + +// if ( ( val = ( char * ) hash_get( my_hash, key ) ) != NULL ) { +// printf( "Key: %s, Val: %s\n", key, val ); +// } else { +// printf( "Key: %s, Val: Not Found\n", key ); +// } + + hash_destroy( my_hash ); + + return 0; +}