From fe1b45b77687b0f9ab81f851e9eb2846f34e6765 Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Sun, 9 Nov 2008 17:54:43 +0000 Subject: Return errors from parser constructor/destructor. This changes the public API. svn path=/trunk/hubbub/; revision=5666 --- test/parser.c | 4 ++-- test/tree-buf.c | 4 ++-- test/tree.c | 4 ++-- test/tree2.c | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) (limited to 'test') diff --git a/test/parser.c b/test/parser.c index 6585bc7..5531af1 100644 --- a/test/parser.c +++ b/test/parser.c @@ -32,8 +32,8 @@ static int run_test(int argc, char **argv, unsigned int CHUNK_SIZE) /* Initialise library */ assert(hubbub_initialise(argv[1], myrealloc, NULL) == HUBBUB_OK); - parser = hubbub_parser_create("UTF-8", false, myrealloc, NULL); - assert(parser != NULL); + assert(hubbub_parser_create("UTF-8", false, myrealloc, NULL, &parser) == + HUBBUB_OK); params.token_handler.handler = token_handler; params.token_handler.pw = NULL; diff --git a/test/tree-buf.c b/test/tree-buf.c index 362f80a..e406a45 100644 --- a/test/tree-buf.c +++ b/test/tree-buf.c @@ -145,8 +145,8 @@ static hubbub_parser *setup_parser(void) hubbub_parser *parser; hubbub_parser_optparams params; - parser = hubbub_parser_create("UTF-8", false, myrealloc, NULL); - assert(parser != NULL); + assert(hubbub_parser_create("UTF-8", false, myrealloc, NULL, &parser) == + HUBBUB_OK); params.tree_handler = &tree_handler; assert(hubbub_parser_setopt(parser, HUBBUB_PARSER_TREE_HANDLER, diff --git a/test/tree.c b/test/tree.c index 74da1b0..9a5bf8c 100644 --- a/test/tree.c +++ b/test/tree.c @@ -95,8 +95,8 @@ static int run_test(int argc, char **argv, unsigned int CHUNK_SIZE) } node_ref_alloc = NODE_REF_CHUNK; - parser = hubbub_parser_create("UTF-8", false, myrealloc, NULL); - assert(parser != NULL); + assert(hubbub_parser_create("UTF-8", false, myrealloc, NULL, &parser) == + HUBBUB_OK); params.tree_handler = &tree_handler; assert(hubbub_parser_setopt(parser, HUBBUB_PARSER_TREE_HANDLER, diff --git a/test/tree2.c b/test/tree2.c index 3a9b5ad..8fba853 100644 --- a/test/tree2.c +++ b/test/tree2.c @@ -145,8 +145,8 @@ static hubbub_parser *setup_parser(void) hubbub_parser *parser; hubbub_parser_optparams params; - parser = hubbub_parser_create("UTF-8", false, myrealloc, NULL); - assert(parser != NULL); + assert(hubbub_parser_create("UTF-8", false, myrealloc, NULL, &parser) == + HUBBUB_OK); params.tree_handler = &tree_handler; assert(hubbub_parser_setopt(parser, HUBBUB_PARSER_TREE_HANDLER, -- cgit v1.2.3