diff options
author | Andrew Sidwell <andy@entai.co.uk> | 2008-08-09 19:34:52 +0000 |
---|---|---|
committer | Andrew Sidwell <andy@entai.co.uk> | 2008-08-09 19:34:52 +0000 |
commit | 6481bd7f3a503573c31b224dfde229dce2e9b68f (patch) | |
tree | 0b6caa76845679dad3de650979ab01bca8bb2a79 /test | |
parent | 14fc365f4e090760b853a004ba145954dae23be4 (diff) | |
download | libhubbub-6481bd7f3a503573c31b224dfde229dce2e9b68f.tar.gz libhubbub-6481bd7f3a503573c31b224dfde229dce2e9b68f.tar.bz2 |
Propagate the use of hubbub_error up into at least a bit of the treebuilder.
svn path=/trunk/hubbub/; revision=4979
Diffstat (limited to 'test')
-rw-r--r-- | test/parser.c | 6 | ||||
-rw-r--r-- | test/tokeniser.c | 6 | ||||
-rw-r--r-- | test/tokeniser2.c | 8 | ||||
-rw-r--r-- | test/tokeniser3.c | 8 |
4 files changed, 18 insertions, 10 deletions
diff --git a/test/parser.c b/test/parser.c index 63e39ff..1ab77d7 100644 --- a/test/parser.c +++ b/test/parser.c @@ -10,7 +10,7 @@ #include "testutils.h" -static void token_handler(const hubbub_token *token, void *pw); +static hubbub_error token_handler(const hubbub_token *token, void *pw); static void *myrealloc(void *ptr, size_t len, void *pw) { @@ -91,7 +91,7 @@ int main(int argc, char **argv) return 0; } -void token_handler(const hubbub_token *token, void *pw) +hubbub_error token_handler(const hubbub_token *token, void *pw) { static const char *token_names[] = { "DOCTYPE", "START TAG", "END TAG", @@ -170,4 +170,6 @@ void token_handler(const hubbub_token *token, void *pw) printf("\n"); break; } + + return HUBBUB_OK; } diff --git a/test/tokeniser.c b/test/tokeniser.c index 0ccf264..77635bc 100644 --- a/test/tokeniser.c +++ b/test/tokeniser.c @@ -11,7 +11,7 @@ #include "testutils.h" -static void token_handler(const hubbub_token *token, void *pw); +static hubbub_error token_handler(const hubbub_token *token, void *pw); static void *myrealloc(void *ptr, size_t len, void *pw) { @@ -98,7 +98,7 @@ int main(int argc, char **argv) return 0; } -void token_handler(const hubbub_token *token, void *pw) +hubbub_error token_handler(const hubbub_token *token, void *pw) { static const char *token_names[] = { "DOCTYPE", "START TAG", "END TAG", @@ -177,4 +177,6 @@ void token_handler(const hubbub_token *token, void *pw) printf("\n"); break; } + + return HUBBUB_OK; } diff --git a/test/tokeniser2.c b/test/tokeniser2.c index 2b9e739..3dee590 100644 --- a/test/tokeniser2.c +++ b/test/tokeniser2.c @@ -30,7 +30,7 @@ typedef struct context { } context; static void run_test(context *ctx); -static void token_handler(const hubbub_token *token, void *pw); +static hubbub_error token_handler(const hubbub_token *token, void *pw); static void *myrealloc(void *ptr, size_t len, void *pw) { @@ -219,7 +219,7 @@ void run_test(context *ctx) } } -void token_handler(const hubbub_token *token, void *pw) +hubbub_error token_handler(const hubbub_token *token, void *pw) { static const char *token_names[] = { "DOCTYPE", "StartTag", "EndTag", @@ -255,7 +255,7 @@ void token_handler(const hubbub_token *token, void *pw) /* Got a terminating EOF -- no error */ if (ctx->output_index >= array_list_length(ctx->output)) - return; + return HUBBUB_OK; /* Now increment the output index so we don't re-expect this token */ ctx->output_index++; @@ -477,4 +477,6 @@ void token_handler(const hubbub_token *token, void *pw) printf("\n"); break; } + + return HUBBUB_OK; } diff --git a/test/tokeniser3.c b/test/tokeniser3.c index e67b047..8febda9 100644 --- a/test/tokeniser3.c +++ b/test/tokeniser3.c @@ -28,7 +28,7 @@ typedef struct context { } context; static void run_test(context *ctx); -static void token_handler(const hubbub_token *token, void *pw); +static hubbub_error token_handler(const hubbub_token *token, void *pw); static void *myrealloc(void *ptr, size_t len, void *pw) { @@ -221,7 +221,7 @@ void run_test(context *ctx) } } -void token_handler(const hubbub_token *token, void *pw) +hubbub_error token_handler(const hubbub_token *token, void *pw) { static const char *token_names[] = { "DOCTYPE", "StartTag", "EndTag", @@ -257,7 +257,7 @@ void token_handler(const hubbub_token *token, void *pw) /* Got a terminating EOF -- no error */ if (ctx->output_index >= array_list_length(ctx->output)) - return; + return HUBBUB_OK; /* Now increment the output index so we don't re-expect this token */ ctx->output_index++; @@ -483,4 +483,6 @@ void token_handler(const hubbub_token *token, void *pw) printf("\n"); break; } + + return HUBBUB_OK; } |