aboutsummaryrefslogtreecommitdiff
path: root/src/test/test_pubsub_build.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2019-03-13 16:30:56 -0400
committerNick Mathewson <nickm@torproject.org>2019-03-25 16:35:34 -0400
commitd976cda49f7346e8fab16c062973c38ec4da4f4b (patch)
treed228ceceed828136120a87bb20e1d9dcd0fc143c /src/test/test_pubsub_build.c
parent3552cd69bdeefb5d4fbbc905b24120573cc26f81 (diff)
downloadtor-d976cda49f7346e8fab16c062973c38ec4da4f4b.tar.gz
tor-d976cda49f7346e8fab16c062973c38ec4da4f4b.zip
pubsub: add test for items_out in builder_finalize()
Diffstat (limited to 'src/test/test_pubsub_build.c')
-rw-r--r--src/test/test_pubsub_build.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/test/test_pubsub_build.c b/src/test/test_pubsub_build.c
index 86b5f763a4..19aa1f0e0e 100644
--- a/src/test/test_pubsub_build.c
+++ b/src/test/test_pubsub_build.c
@@ -2,6 +2,7 @@
/* See LICENSE for licensing information */
#define DISPATCH_PRIVATE
+#define PUBSUB_PRIVATE
#include "test/test.h"
@@ -119,13 +120,16 @@ test_pubsub_build_types_ok(void *arg)
pubsub_builder_t *b = NULL;
dispatch_t *dispatcher = NULL;
pubsub_connector_t *c = NULL;
+ pubsub_items_t *items = NULL;
b = pubsub_builder_new();
seed_pubsub_builder_basic(b);
- dispatcher = pubsub_builder_finalize(b, NULL);
+ dispatcher = pubsub_builder_finalize(b, &items);
b = NULL;
tt_assert(dispatcher);
+ tt_assert(items);
+ tt_int_op(smartlist_len(items->items), OP_EQ, 4);
tt_int_op(dispatcher->n_types, OP_GE, 2);
tt_assert(dispatcher->typefns);
@@ -138,6 +142,7 @@ test_pubsub_build_types_ok(void *arg)
pubsub_connector_free(c);
pubsub_builder_free(b);
dispatch_free(dispatcher);
+ pubsub_items_free(items);
}
/* We fail if the same type is defined in two places with different functions.