]> git.donarmstrong.com Git - biopieces.git/blobdiff - code_c/Maasha/src/test_hash.c
Here we go
[biopieces.git] / code_c / Maasha / src / test_hash.c
diff --git a/code_c/Maasha/src/test_hash.c b/code_c/Maasha/src/test_hash.c
new file mode 100644 (file)
index 0000000..a1b8065
--- /dev/null
@@ -0,0 +1,35 @@
+#include <stdio.h>
+#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;
+}