summaryrefslogtreecommitdiff
path: root/tests/test_handlers.c
diff options
context:
space:
mode:
authorJosh Haberman <jhaberman@gmail.com>2018-12-17 09:16:46 -0800
committerJosh Haberman <jhaberman@gmail.com>2018-12-17 09:16:46 -0800
commit5e958a8c055872ecd5b7f7d00f48212de5711ae5 (patch)
treef35a85fd4f0ec2e9efa1f64fac686e3d052f6f19 /tests/test_handlers.c
parent377871f10403c7b4e1cc6f769b9443b5197aecc8 (diff)
test_json is working!
Diffstat (limited to 'tests/test_handlers.c')
-rw-r--r--tests/test_handlers.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/tests/test_handlers.c b/tests/test_handlers.c
index fe6fb82..2b19cab 100644
--- a/tests/test_handlers.c
+++ b/tests/test_handlers.c
@@ -1,9 +1,9 @@
-#include "upb/handlers.h"
-#include "upb/descriptor/descriptor.upbdefs.h"
-#include "upb_test.h"
#include <stdlib.h>
#include <string.h>
+#include "google/protobuf/descriptor.upbdefs.h"
+#include "upb/handlers.h"
+#include "upb_test.h"
static bool startmsg(void *c, const void *hd) {
UPB_UNUSED(c);
@@ -13,9 +13,9 @@ static bool startmsg(void *c, const void *hd) {
static void test_error() {
/* Test creating handlers of a static msgdef. */
- const upb_msgdef *m = upbdefs_google_protobuf_DescriptorProto_get(&m);
+ upb_symtab *s = upb_symtab_new();
+ const upb_msgdef *m = google_protobuf_DescriptorProto_getmsgdef(s);
upb_handlers *h = upb_handlers_new(m, &h);
- upb_msgdef_unref(m, &m);
/* Attempt to set the same handler twice causes error. */
ASSERT(upb_ok(upb_handlers_status(h)));
@@ -31,6 +31,7 @@ static void test_error() {
ASSERT(upb_handlers_isfrozen(h));
upb_handlers_unref(h, &h);
+ upb_symtab_free(s);
}
int run_tests(int argc, char *argv[]) {
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback