From 83f3338663c4969eebefd8c2c43bd3fc43587fdd Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Wed, 21 Dec 2011 22:18:10 +0000 Subject: Merge branches/jmb/dom-alloc-purge back to trunk svn path=/trunk/libdom/; revision=13316 --- test/DOMTSHandler.pm | 11 +++-------- test/testutils/comparators.c | 8 ++++---- test/testutils/domtsasserts.c | 10 +++++----- test/testutils/load.c | 6 ++---- 4 files changed, 14 insertions(+), 21 deletions(-) (limited to 'test') diff --git a/test/DOMTSHandler.pm b/test/DOMTSHandler.pm index 0bd4b81..4b469fe 100644 --- a/test/DOMTSHandler.pm +++ b/test/DOMTSHandler.pm @@ -374,11 +374,6 @@ int main(int argc, char **argv) (void)argc; (void)argv; - /* Firstly, initialise dom and dom implementations */ - exp = dom_initialise(myrealloc, NULL); - if (exp != DOM_NO_ERR) - return exp; - if (chdir("$self->{chdir}") < 0) { perror("chdir (\\"$self->{chdir})\\""); return 1; @@ -1215,7 +1210,7 @@ sub generate_control_statement { print "while(get_next_list($coll, \&iterator$iterator_index, "; if ($conversion eq 1) { print "\&tstring$temp_index)) {\n"; - print "exp = dom_string_create(myrealloc, NULL, (const uint8_t *)tstring$temp_index,"; + print "exp = dom_string_create((const uint8_t *)tstring$temp_index,"; print "strlen(tstring$temp_index), &$member);"; print "if (exp != DOM_NO_ERR) {"; print "fprintf(stderr, \"Can't create DOMString\\n\");"; @@ -1275,7 +1270,7 @@ sub generate_domstring { print << "__EOF__"; const char *string$string_index = $str; dom_string *dstring$string_index; - exp = dom_string_create(myrealloc, NULL, (const uint8_t *)string$string_index, + exp = dom_string_create((const uint8_t *)string$string_index, strlen(string$string_index), &dstring$string_index); if (exp != DOM_NO_ERR) { fprintf(stderr, "Can't create DOMString\\n"); @@ -1453,7 +1448,7 @@ sub end_half_assertion { sub cleanup_domvar { my ($self, $indent) = @_; - my $str = join($indent, @{$self->{unref}}); + my $str = join($indent, reverse @{$self->{unref}}); print $indent.$str."\n"; } diff --git a/test/testutils/comparators.c b/test/testutils/comparators.c index b7ec1b1..ee8b227 100644 --- a/test/testutils/comparators.c +++ b/test/testutils/comparators.c @@ -27,12 +27,12 @@ int str_cmp(const void *a, const void *b) dom_exception err; bool ret; - err = dom_string_create(myrealloc, NULL, expected, strlen((const char *)expected), + err = dom_string_create(expected, strlen((const char *)expected), &exp); if (err != DOM_NO_ERR) return false; - ret = dom_string_cmp(exp, actual) == 0; + ret = dom_string_isequal(exp, actual); dom_string_unref(exp); @@ -58,12 +58,12 @@ int str_icmp(const void *a, const void *b) dom_exception err; bool ret; - err = dom_string_create(myrealloc, NULL, expected, strlen((const char *)expected), + err = dom_string_create(expected, strlen((const char *)expected), &exp); if (err != DOM_NO_ERR) return false; - ret = dom_string_icmp(exp, actual) == 0; + ret = dom_string_caseless_isequal(exp, actual); dom_string_unref(exp); diff --git a/test/testutils/domtsasserts.c b/test/testutils/domtsasserts.c index 03d0907..92e8222 100644 --- a/test/testutils/domtsasserts.c +++ b/test/testutils/domtsasserts.c @@ -90,15 +90,15 @@ bool is_equals_string(const char *expected, dom_string *actual, dom_exception err; bool ret; - err = dom_string_create(myrealloc, NULL, (const uint8_t *)expected, strlen(expected), + err = dom_string_create((const uint8_t *)expected, strlen(expected), &exp); if (err != DOM_NO_ERR) return false; if (ignoreCase == true) - ret = dom_string_icmp(exp, actual) == 0; + ret = dom_string_caseless_isequal(exp, actual); else - ret = dom_string_cmp(exp, actual) == 0; + ret = dom_string_isequal(exp, actual); dom_string_unref(exp); return ret; @@ -109,9 +109,9 @@ bool is_equals_domstring(dom_string *expected, dom_string *actual, bool ignoreCase) { if (ignoreCase == true) - return dom_string_icmp(expected, actual) == 0; + return dom_string_caseless_isequal(expected, actual); else - return dom_string_cmp(expected, actual) == 0; + return dom_string_isequal(expected, actual); } /* The param actual should always contain dom_sting and expectd should diff --git a/test/testutils/load.c b/test/testutils/load.c index 57e07ef..254aa8d 100644 --- a/test/testutils/load.c +++ b/test/testutils/load.c @@ -42,8 +42,7 @@ dom_document *load_xml(const char *file, bool willBeModified) UNUSED(willBeModified); - parser = dom_xml_parser_create(NULL, NULL, - myrealloc, NULL, mymsg, NULL); + parser = dom_xml_parser_create(NULL, NULL, mymsg, NULL); if (parser == NULL) { fprintf(stderr, "Can't create XMLParser\n"); return NULL; @@ -104,8 +103,7 @@ dom_document *load_html(const char *file, bool willBeModified) UNUSED(willBeModified); - parser = dom_hubbub_parser_create(NULL, true, - myrealloc, NULL, mymsg, NULL); + parser = dom_hubbub_parser_create(NULL, true, mymsg, NULL); if (parser == NULL) { fprintf(stderr, "Can't create Hubbub Parser\n"); return NULL; -- cgit v1.2.3