summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/dict_bench.c2
-rw-r--r--test/patree_test.c8
2 files changed, 6 insertions, 4 deletions
diff --git a/test/dict_bench.c b/test/dict_bench.c
index d7407d3..a940ed2 100644
--- a/test/dict_bench.c
+++ b/test/dict_bench.c
@@ -128,7 +128,7 @@ main(int argc, char** argv)
// ZixPatree
insert_start = bench_start();
for (size_t i = 0; i < n; ++i) {
- ZixStatus st = zix_patree_insert(patree, strings[i]);
+ ZixStatus st = zix_patree_insert(patree, strings[i], lengths[i]);
if (st && st != ZIX_STATUS_EXISTS) {
return test_fail("Failed to insert `%s'\n", strings[i]);
}
diff --git a/test/patree_test.c b/test/patree_test.c
index 6d30509..c28ec40 100644
--- a/test/patree_test.c
+++ b/test/patree_test.c
@@ -63,17 +63,19 @@ main(int argc, char** argv)
// Insert each string
for (size_t i = 0; i < n_strings; ++i) {
- ZixStatus st = zix_patree_insert(patree, strings[i]);
+ ZixStatus st = zix_patree_insert(patree, strings[i], strlen(strings[i]));
if (st) {
return test_fail("Failed to insert `%s'\n", strings[i]);
}
}
- //zix_patree_print_dot(patree, stdout);
+ FILE* dot_file = fopen("patree.dot", "w");
+ zix_patree_print_dot(patree, dot_file);
+ fclose(dot_file);
// Attempt to insert each string again
for (size_t i = 0; i < n_strings; ++i) {
- ZixStatus st = zix_patree_insert(patree, strings[i]);
+ ZixStatus st = zix_patree_insert(patree, strings[i], strlen(strings[i]));
if (st != ZIX_STATUS_EXISTS) {
return test_fail("Double inserted `%s'\n", strings[i]);
}