From 28b06ed590c8e0d2acb4a0d42e4eca4d6f0aef3c Mon Sep 17 00:00:00 2001 From: Andrew Sidwell Date: Thu, 19 Jun 2008 01:49:02 +0000 Subject: Add CDATA tests and the infrastructure to support them. svn path=/trunk/hubbub/; revision=4410 --- test/tokeniser2.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'test/tokeniser2.c') diff --git a/test/tokeniser2.c b/test/tokeniser2.c index 2ac508c..2054c6b 100644 --- a/test/tokeniser2.c +++ b/test/tokeniser2.c @@ -25,6 +25,7 @@ typedef struct context { const char *last_start_tag; struct array_list *content_model; + bool process_cdata; } context; static void run_test(context *ctx); @@ -97,6 +98,9 @@ int main(int argc, char **argv) } else if (strcmp(key, "contentModelFlags") == 0) { ctx.content_model = json_object_get_array(val); + } else if (strcmp(key, "processCDATA") == 0) { + ctx.process_cdata = + json_object_get_boolean(val); } } @@ -153,6 +157,13 @@ void run_test(context *ctx) assert(hubbub_tokeniser_run(tok) == HUBBUB_OK); } + if (ctx->process_cdata) { + params.process_cdata = ctx->process_cdata; + assert(hubbub_tokeniser_setopt(tok, + HUBBUB_TOKENISER_PROCESS_CDATA, + ¶ms) == HUBBUB_OK); + } + params.buffer_handler.handler = buffer_handler; params.buffer_handler.pw = ctx; assert(hubbub_tokeniser_setopt(tok, -- cgit v1.2.3