summaryrefslogtreecommitdiff
path: root/ccan/strgrp/test/api_test_free_cb.c
diff options
context:
space:
mode:
Diffstat (limited to 'ccan/strgrp/test/api_test_free_cb.c')
-rw-r--r--ccan/strgrp/test/api_test_free_cb.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/ccan/strgrp/test/api_test_free_cb.c b/ccan/strgrp/test/api_test_free_cb.c
new file mode 100644
index 00000000..bf85b36e
--- /dev/null
+++ b/ccan/strgrp/test/api_test_free_cb.c
@@ -0,0 +1,16 @@
+#include "../test/helpers.h"
+
+static void
+data_cb(void *data) {
+ ok1(streq("1", (char *)data));
+}
+
+int main(void) {
+ struct strgrp *ctx;
+
+ plan_tests(1);
+ create(ctx, DEFAULT_SIMILARITY);
+ strgrp_add(ctx, "a", (void *)"1");
+ strgrp_free_cb(ctx, &data_cb);
+ return exit_status();
+}