summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJoshua Haberman <joshua@reverberate.org>2011-05-21 17:35:21 -0700
committerJoshua Haberman <joshua@reverberate.org>2011-05-21 17:35:21 -0700
commita503b8859c37906ab5012db163daca43bfe393bb (patch)
treebabc144389856dbe29bacb48bdbe267b9a48e5b8 /tests
parent2ccebb74c309c7ea4c4589b35893cdd6c996ac4b (diff)
Make all handlers objects refcounted.
I'm realizing that basically all upb objects will need to be refcounted to be sharable across languages, but *not* messages which are on their way out so we can get out of the business of data representations. Things which must be refcounted: - encoders, decoders - handlers objects - defs
Diffstat (limited to 'tests')
-rw-r--r--tests/tests.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/tests.c b/tests/tests.c
index 747593a..a78ca03 100644
--- a/tests/tests.c
+++ b/tests/tests.c
@@ -38,15 +38,15 @@ static void test_upb_jit() {
upb_string_unref(symname);
ASSERT(def);
- upb_handlers h;
- upb_handlers_init(&h);
+ upb_handlers *h = upb_handlers_new();
upb_handlerset hset = {NULL, NULL, &upb_test_onvalue, NULL, NULL, NULL, NULL};
- upb_handlers_reghandlerset(&h, upb_downcast_msgdef(def), &hset);
+ upb_handlers_reghandlerset(h, upb_downcast_msgdef(def), &hset);
upb_decoder d;
- upb_decoder_init(&d, &h);
+ upb_decoder_init(&d, h);
upb_decoder_uninit(&d);
upb_symtab_unref(s);
upb_def_unref(def);
+ upb_handlers_unref(h);
}
static void test_upb_symtab() {
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback