summaryrefslogtreecommitdiffstats
path: root/contrib/mdocml/test-ohash.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/mdocml/test-ohash.c')
-rw-r--r--contrib/mdocml/test-ohash.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/contrib/mdocml/test-ohash.c b/contrib/mdocml/test-ohash.c
new file mode 100644
index 0000000..522ad70
--- /dev/null
+++ b/contrib/mdocml/test-ohash.c
@@ -0,0 +1,21 @@
+#include <stdint.h>
+#include <stddef.h>
+#include <stdlib.h>
+#include <ohash.h>
+
+void *xmalloc(size_t sz, void *arg) { return(calloc(1,sz)); }
+void *xcalloc(size_t nmemb, size_t sz, void *arg) { return(calloc(nmemb,sz)); }
+void xfree(void *p, void *arg) { free(p); }
+
+int
+main(void)
+{
+ struct ohash h;
+ struct ohash_info i;
+ i.alloc = xmalloc;
+ i.calloc = xcalloc;
+ i.free = xfree;
+ ohash_init(&h, 2, &i);
+ ohash_delete(&h);
+ return 0;
+}
OpenPOWER on IntegriCloud