summaryrefslogtreecommitdiffstats
path: root/src/libmain.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libmain.c')
-rw-r--r--src/libmain.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/libmain.c b/src/libmain.c
index eca383a..0801969 100644
--- a/src/libmain.c
+++ b/src/libmain.c
@@ -7,15 +7,21 @@
#define HT_IMPLEMENTATIONS
#include "htgen.h"
+#if 1
int main(int argc, char **argv) {
shash_t *hash = shash_create(8, 0.75f);
printf("%d\n", shash_put(hash, "test1", "test2"));
printf("%d\n", shash_put(hash, "abc", "def"));
+ shash__debug_table(hash);
printf("%d\n", shash_put(hash, "amingus", "val"));
printf("%d\n", shash_put(hash, "afungus", "val2"));
printf("%d\n", shash_put(hash, "abungus", "val3"));
+ shash__debug_table(hash);
printf("%d\n", shash_put(hash, "lethalbumpany", "crewmate_sus"));
+ shash__debug_table(hash);
printf("%d\n", shash_put(hash, "uuuu", "something"));
+ printf("%d\n", shash_put(hash, "afungus", "val2"));
+ shash__debug_table(hash);
printf("%d\n", shash_put(hash, "99asdas", "please collide >:O"));
bool found = false;
@@ -23,6 +29,33 @@ int main(int argc, char **argv) {
printf("%s %d\n", val ? val : "(null)", found);
shash__debug_table(hash);
+
+ shash_free(hash);
return 0;
}
+#else
+
+int main(int argc, char **argv)
+{
+ ihash_t *hash = ihash_create(8, 0.75f);
+
+ printf("%d\n", ihash_put(hash, 1, 10));
+ ihash__debug_table(hash);
+ printf("%d\n", ihash_put(hash, 5, 20));
+ printf("%d\n", ihash_put(hash, 3, 19));
+ printf("%d\n", ihash_put(hash, 56, 101));
+ ihash__debug_table(hash);
+ printf("%d\n", ihash_put(hash, 90, 6));
+ printf("%d\n", ihash_put(hash, 2000, 1));
+ ihash__debug_table(hash);
+ printf("%d\n", ihash_put(hash, 4, 2020));
+
+ ihash__debug_table(hash);
+
+ ihash_free(hash);
+
+ return 0;
+}
+
+#endif