From 64e9feb8d0e62a4428d1db7a18cf00fdc2917252 Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Sat, 4 Dec 2010 23:12:24 +0000 Subject: Make libdom work again given lack of init/finalise in hubbub and prepare initial attempt at importing tests into the makefile svn path=/trunk/dom/; revision=10992 --- bindings/hubbub/parser.c | 18 +- bindings/hubbub/parser.h | 2 +- src/core/string.c | 2 - test/DOMTSHandler.pm | 25 +- test/Makefile | 63 ++++- test/data/Aliases | 303 --------------------- test/run-test.sh | 9 +- .../tests/level1/core/cdatasectionnormalize.xml | 49 ---- .../level1/core/cdatasectionnormalize.xml.notimpl | 49 ++++ .../tests/level1/core/elementnormalize.xml | 46 ---- .../tests/level1/core/elementnormalize.xml.notimpl | 46 ++++ .../tests/level1/core/entitygetentityname.xml | 46 ---- .../level1/core/entitygetentityname.xml.notimpl | 46 ++++ .../tests/level1/core/entitygetpublicid.xml | 55 ---- .../level1/core/entitygetpublicid.xml.notimpl | 55 ++++ .../tests/level1/core/entitygetpublicidnull.xml | 45 --- .../level1/core/entitygetpublicidnull.xml.notimpl | 45 +++ .../tests/level1/core/hc_attrnormalize.xml | 65 ----- .../tests/level1/core/hc_attrnormalize.xml.notimpl | 65 +++++ .../tests/level1/core/hc_elementnormalize.xml | 49 ---- .../level1/core/hc_elementnormalize.xml.notimpl | 49 ++++ .../tests/level1/core/hc_elementnormalize2.xml | 51 ---- .../level1/core/hc_elementnormalize2.xml.notimpl | 51 ++++ .../tests/level1/core/hc_entitiessetnameditem1.xml | 50 ---- .../core/hc_entitiessetnameditem1.xml.notimpl | 50 ++++ .../level1/core/hc_notationssetnameditem1.xml | 50 ---- .../core/hc_notationssetnameditem1.xml.notimpl | 50 ++++ .../tests/level1/core/nodenotationnodetype.xml | 44 --- .../level1/core/nodenotationnodetype.xml.notimpl | 44 +++ .../core/nodeprocessinginstructionsetnodevalue.xml | 43 --- ...deprocessinginstructionsetnodevalue.xml.notimpl | 43 +++ .../tests/level1/core/notationgetnotationname.xml | 43 --- .../core/notationgetnotationname.xml.notimpl | 43 +++ .../tests/level1/core/notationgetpublicid.xml | 40 --- .../level1/core/notationgetpublicid.xml.notimpl | 40 +++ .../tests/level1/core/notationgetpublicidnull.xml | 45 --- .../core/notationgetpublicidnull.xml.notimpl | 45 +++ .../tests/level1/core/notationgetsystemid.xml | 45 --- .../level1/core/notationgetsystemid.xml.notimpl | 45 +++ .../tests/level1/core/notationgetsystemidnull.xml | 41 --- .../core/notationgetsystemidnull.xml.notimpl | 41 +++ .../level1/core/processinginstructiongetdata.xml | 43 --- .../core/processinginstructiongetdata.xml.notimpl | 43 +++ .../level1/core/processinginstructiongettarget.xml | 42 --- .../processinginstructiongettarget.xml.notimpl | 42 +++ ...ginstructionsetdatanomodificationallowederr.xml | 53 ---- ...tionsetdatanomodificationallowederr.xml.notimpl | 53 ++++ ...nstructionsetdatanomodificationallowederrEE.xml | 57 ---- ...onsetdatanomodificationallowederrEE.xml.notimpl | 57 ++++ test/testutils/comparators.c | 8 +- test/testutils/domts.h | 4 +- test/testutils/domtsasserts.c | 55 ++-- test/testutils/domtsasserts.h | 6 +- test/testutils/domtscondition.h | 27 +- test/testutils/foreach.c | 3 + test/testutils/load.c | 11 +- test/transform.pl | 10 +- 57 files changed, 1146 insertions(+), 1404 deletions(-) delete mode 100644 test/data/Aliases delete mode 100644 test/testcases/tests/level1/core/cdatasectionnormalize.xml create mode 100644 test/testcases/tests/level1/core/cdatasectionnormalize.xml.notimpl delete mode 100644 test/testcases/tests/level1/core/elementnormalize.xml create mode 100644 test/testcases/tests/level1/core/elementnormalize.xml.notimpl delete mode 100644 test/testcases/tests/level1/core/entitygetentityname.xml create mode 100644 test/testcases/tests/level1/core/entitygetentityname.xml.notimpl delete mode 100644 test/testcases/tests/level1/core/entitygetpublicid.xml create mode 100644 test/testcases/tests/level1/core/entitygetpublicid.xml.notimpl delete mode 100644 test/testcases/tests/level1/core/entitygetpublicidnull.xml create mode 100644 test/testcases/tests/level1/core/entitygetpublicidnull.xml.notimpl delete mode 100644 test/testcases/tests/level1/core/hc_attrnormalize.xml create mode 100644 test/testcases/tests/level1/core/hc_attrnormalize.xml.notimpl delete mode 100644 test/testcases/tests/level1/core/hc_elementnormalize.xml create mode 100644 test/testcases/tests/level1/core/hc_elementnormalize.xml.notimpl delete mode 100644 test/testcases/tests/level1/core/hc_elementnormalize2.xml create mode 100644 test/testcases/tests/level1/core/hc_elementnormalize2.xml.notimpl delete mode 100644 test/testcases/tests/level1/core/hc_entitiessetnameditem1.xml create mode 100644 test/testcases/tests/level1/core/hc_entitiessetnameditem1.xml.notimpl delete mode 100644 test/testcases/tests/level1/core/hc_notationssetnameditem1.xml create mode 100644 test/testcases/tests/level1/core/hc_notationssetnameditem1.xml.notimpl delete mode 100644 test/testcases/tests/level1/core/nodenotationnodetype.xml create mode 100644 test/testcases/tests/level1/core/nodenotationnodetype.xml.notimpl delete mode 100644 test/testcases/tests/level1/core/nodeprocessinginstructionsetnodevalue.xml create mode 100644 test/testcases/tests/level1/core/nodeprocessinginstructionsetnodevalue.xml.notimpl delete mode 100644 test/testcases/tests/level1/core/notationgetnotationname.xml create mode 100644 test/testcases/tests/level1/core/notationgetnotationname.xml.notimpl delete mode 100644 test/testcases/tests/level1/core/notationgetpublicid.xml create mode 100644 test/testcases/tests/level1/core/notationgetpublicid.xml.notimpl delete mode 100644 test/testcases/tests/level1/core/notationgetpublicidnull.xml create mode 100644 test/testcases/tests/level1/core/notationgetpublicidnull.xml.notimpl delete mode 100644 test/testcases/tests/level1/core/notationgetsystemid.xml create mode 100644 test/testcases/tests/level1/core/notationgetsystemid.xml.notimpl delete mode 100644 test/testcases/tests/level1/core/notationgetsystemidnull.xml create mode 100644 test/testcases/tests/level1/core/notationgetsystemidnull.xml.notimpl delete mode 100644 test/testcases/tests/level1/core/processinginstructiongetdata.xml create mode 100644 test/testcases/tests/level1/core/processinginstructiongetdata.xml.notimpl delete mode 100644 test/testcases/tests/level1/core/processinginstructiongettarget.xml create mode 100644 test/testcases/tests/level1/core/processinginstructiongettarget.xml.notimpl delete mode 100644 test/testcases/tests/level1/core/processinginstructionsetdatanomodificationallowederr.xml create mode 100644 test/testcases/tests/level1/core/processinginstructionsetdatanomodificationallowederr.xml.notimpl delete mode 100644 test/testcases/tests/level1/core/processinginstructionsetdatanomodificationallowederrEE.xml create mode 100644 test/testcases/tests/level1/core/processinginstructionsetdatanomodificationallowederrEE.xml.notimpl diff --git a/bindings/hubbub/parser.c b/bindings/hubbub/parser.c index b567978..c7fc608 100644 --- a/bindings/hubbub/parser.c +++ b/bindings/hubbub/parser.c @@ -99,12 +99,9 @@ static hubbub_tree_handler tree_handler = { NULL }; -static bool __initialised = false; - /** * Create a Hubbub parser instance * - * \param aliases Path to encoding alias mapping file * \param enc Source charset, or NULL * \param fix_enc Whether fix the encoding * \param alloc Memory (de)allocation function @@ -113,7 +110,7 @@ static bool __initialised = false; * \param mctx Pointer to client-specific private data * \return Pointer to instance, or NULL on memory exhaustion */ -dom_hubbub_parser *dom_hubbub_parser_create(const char *aliases, +dom_hubbub_parser *dom_hubbub_parser_create( const char *enc, bool fix_enc, dom_alloc alloc, void *pw, dom_msg msg, void *mctx) { @@ -123,19 +120,6 @@ dom_hubbub_parser *dom_hubbub_parser_create(const char *aliases, dom_exception err; struct dom_string *features; - if (__initialised == false) { - error = hubbub_initialise(aliases, - (hubbub_allocator_fn) alloc, pw); - if (error != HUBBUB_OK) { - msg(DOM_MSG_ERROR, mctx, - "Failed initialising hubbub"); - return NULL; - } - - __initialised = true; - } - - parser = alloc(NULL, sizeof(dom_hubbub_parser), pw); if (parser == NULL) { msg(DOM_MSG_CRITICAL, mctx, "No memory for parsing context"); diff --git a/bindings/hubbub/parser.h b/bindings/hubbub/parser.h index 350f3d6..0d9f953 100644 --- a/bindings/hubbub/parser.h +++ b/bindings/hubbub/parser.h @@ -48,7 +48,7 @@ typedef enum dom_hubub_encoding_source { */ /* Create a Hubbub parser instance */ -dom_hubbub_parser *dom_hubbub_parser_create(const char *aliases, +dom_hubbub_parser *dom_hubbub_parser_create( const char *enc, bool fix_enc, dom_alloc alloc, void *pw, dom_msg msg, void *mctx); diff --git a/src/core/string.c b/src/core/string.c index 1a5b396..a443f55 100644 --- a/src/core/string.c +++ b/src/core/string.c @@ -903,8 +903,6 @@ dom_exception _dom_exception_from_lwc_error(lwc_error err) return DOM_NO_MEM_ERR; case lwc_error_range: return DOM_INDEX_SIZE_ERR; - case lwc_error_initialised: - return DOM_NO_ERR; } assert ("Unknow lwc_error, can't convert to dom_exception"); /* Suppress compile errors */ diff --git a/test/DOMTSHandler.pm b/test/DOMTSHandler.pm index bc86369..ce392c0 100644 --- a/test/DOMTSHandler.pm +++ b/test/DOMTSHandler.pm @@ -125,6 +125,7 @@ our @framework_statement = qw(assign increment decrement append plus subtract mu sub new { my $type = shift; my $dtd = shift; + my $chdir = shift; my $dd = XML::XPath->new(filename => $dtd); my $self = { # The DTD file of the xml files @@ -159,7 +160,8 @@ sub new { list_type => "", # Whether we are in exception assertion exception => 0, - + # Where to chdir + chdir => $chdir }; return bless $self, $type; @@ -330,7 +332,7 @@ sub characters { if ($self->{"list_type"} eq "") { if ($data->{Data} =~ /^\"/) { $self->{"list_type"} = "char *"; - print "char *".$self->{"list_name"}."Array[] = \{ $data->{Data}"; + print "const char *".$self->{"list_name"}."Array[] = \{ $data->{Data}"; } else { if ($data->{Data} =~ /^[0-9]+/) { $self->{"list_type"} = "int *"; @@ -356,9 +358,11 @@ sub generate_main { #include #include #include +#include #include #include +#include #include @@ -367,17 +371,19 @@ dom_implementation *doc_impl; int main(int argc, char **argv) { dom_exception exp; - lwc_error lerr; + + (void)argc; + (void)argv; /* Firstly, initialise dom and dom implementations */ exp = dom_initialise(myrealloc, NULL); if (exp != DOM_NO_ERR) return exp; - - lerr = lwc_initialise(myrealloc, NULL, 0); - if (lerr != lwc_error_ok) - return -1; + if (chdir("$self->{chdir}") < 0) { + perror("chdir (\\"$self->{chdir})\\""); + return 1; + } __EOF__ } @@ -473,11 +479,11 @@ sub generate_load { $test_index ++; # define the test file path, use HTML if there is, otherwise using XML # Attention: I intend to copy the test files to the program excuting dir - print "\tchar *test$test_index = \"$ats{'href'}.html\";\n\n"; + print "\tconst char *test$test_index = \"$ats{'href'}.html\";\n\n"; print "$doc = load_html(test$test_index, $ats{'willBeModified'});"; print "if ($doc == NULL) {"; $test_index ++; - print " char *test$test_index = \"$ats{'href'}.xml\";\n\n"; + print " const char *test$test_index = \"$ats{'href'}.xml\";\n\n"; print " $doc = load_xml(test$test_index, $ats{'willBeModified'});"; print " if ($doc == NULL)"; print " return 1;"; @@ -1465,6 +1471,7 @@ sub cleanup { print "\n\n"; $self->cleanup_domstring("\t"); $self->cleanup_domvar("\t"); + print "\n\tprintf(\"PASS\");\n"; print "\n\treturn 0;\n"; print "\n\}\n"; } diff --git a/test/Makefile b/test/Makefile index 2d20d02..5ccca9c 100644 --- a/test/Makefile +++ b/test/Makefile @@ -1,26 +1,61 @@ -testutils_files := testutils/comparators.c;testutils/list.c;testutils/domasserts.c +testutils_files := testutils/comparators.c;testutils/list.c;testutils/domtsasserts.c testutils_files := $(testutils_files);testutils/utils.c;testutils/foreach.c;testutils/load.c -TESTCFLAGS := $(TESTCFLAGS) -I$(CURDIR) -I$(CURDIR)/testutils +TESTCFLAGS := $(TESTCFLAGS) -I$(DIR) -I$(DIR)testutils -Ibindings/xml -Ibindings/hubbub -Wno-unused -DIR_TEST_ITEMS := $(testutils_files) +ALL_XML_TESTS := -define add_xml_test - ifeq ($$(WANT_TEST),yes) - $(DIR)xml/c/$1.c: $(DIR)xml/tests/$1.xml - $$(Q)$$(XSLTPROC) $$(XSLTPROCFLAGS) -o $$@ \ - $(DIR)transform/test-to-c.xsl $$< +# 1: Path to XML file +# 2: Fragment C file name +# 3: DTD file +# 4: Test name +define do_xml_test - DIR_TEST_ITEMS := $$(DIR_TEST_ITEMS) $1:xml/c/$1.c;$$(testlib_files) - endif - DISTCLEAN_ITEMS := $$(DISTCLEAN_ITEMS) $(DIR)xml/c/$1.c +ifeq ($$(WANT_TEST),yes) + +$(DIR)$2: $(DIR)testcases/tests/$1 $(DIR)transform.pl $(DIR)DOMTSHandler.pm + $(VQ)$(ECHO) " XFORM: $1" + $(Q)$(PERL) $(DIR)transform.pl $(DIR)$3 $(DIR)testcases/tests/$(dir $1)/files $(DIR)testcases/tests/$1 > $(DIR)$2 + +DIR_TEST_ITEMS := $$(DIR_TEST_ITEMS) $4:$2;$(testutils_files) + +endif + +DISTCLEAN_ITEMS := $$(DISTCLEAN_ITEMS) $(DIR)$2 + +ALL_XML_TESTS := $$(ALL_XML_TESTS) $4 + + + +endef + +# 1: suite base +# 2: dtd for suite +define do_xml_suite + +$(foreach XML,$(filter-out $1/metadata.xml,$(filter-out $1/alltests.xml,$(subst $(DIR)testcases/tests/,,$(wildcard $(DIR)testcases/tests/$1/*.xml)))),$(call do_xml_test,$(XML),$(subst /,_,$(XML:.xml=.c)),$2,$(subst /,_,$(XML:.xml=)))) endef -# Add DOMTS tests to the list of items to build -$(eval $(foreach XML,$(wildcard $(DIR)xml/tests/*.xml), \ - $(call add_xml_test,$(basename $(notdir $(XML)))))) +# 1: test name +define write_index + + $(Q)$(ECHO) "$1 $1" >> $@ + +endef + +$(DIR)INDEX: test/Makefile + $(VQ)$(ECHO) " INDEX: Making test index" + $(Q)$(ECHO) "#test desc dir" > $@ + $(foreach XMLTEST,$(ALL_XML_TESTS),$(call write_index,$(XMLTEST))) + +TEST_PREREQS := $(TEST_PREREQS) $(DIR)INDEX + +# Include the level 1 core tests +$(eval $(call do_xml_suite,level1/core,dom1-interfaces.xml)) + +DISTCLEAN_ITEMS := $(DISTCLEAN_ITEMS) $(DIR)INDEX include build/makefiles/Makefile.subdir diff --git a/test/data/Aliases b/test/data/Aliases deleted file mode 100644 index 8978ede..0000000 --- a/test/data/Aliases +++ /dev/null @@ -1,303 +0,0 @@ -# > Unicode:Files.Aliases -# Mapping of character set encoding names to their canonical form -# -# Lines starting with a '#' are comments, blank lines are ignored. -# -# Based on http://www.iana.org/assignments/character-sets and -# http://www.iana.org/assignments/ianacharset-mib -# -# Canonical Form MIBenum Aliases... -# -US-ASCII 3 iso-ir-6 ANSI_X3.4-1986 ISO_646.irv:1991 ASCII ISO646-US ANSI_X3.4-1968 us IBM367 cp367 csASCII -ISO-10646-UTF-1 27 csISO10646UTF1 -ISO_646.basic:1983 28 ref csISO646basic1983 -INVARIANT 29 csINVARIANT -ISO_646.irv:1983 30 iso-ir-2 irv csISO2IntlRefVersion -BS_4730 20 iso-ir-4 ISO646-GB gb uk csISO4UnitedKingdom -NATS-SEFI 31 iso-ir-8-1 csNATSSEFI -NATS-SEFI-ADD 32 iso-ir-8-2 csNATSSEFIADD -NATS-DANO 33 iso-ir-9-1 csNATSDANO -NATS-DANO-ADD 34 iso-ir-9-2 csNATSDANOADD -SEN_850200_B 35 iso-ir-10 FI ISO646-FI ISO646-SE se csISO10Swedish -SEN_850200_C 21 iso-ir-11 ISO646-SE2 se2 csISO11SwedishForNames -KS_C_5601-1987 36 iso-ir-149 KS_C_5601-1989 KSC_5601 korean csKSC56011987 -ISO-2022-KR 37 csISO2022KR -EUC-KR 38 csEUCKR EUCKR -ISO-2022-JP 39 csISO2022JP -ISO-2022-JP-2 40 csISO2022JP2 -ISO-2022-CN 104 -ISO-2022-CN-EXT 105 -JIS_C6220-1969-jp 41 JIS_C6220-1969 iso-ir-13 katakana x0201-7 csISO13JISC6220jp -JIS_C6220-1969-ro 42 iso-ir-14 jp ISO646-JP csISO14JISC6220ro -IT 22 iso-ir-15 ISO646-IT csISO15Italian -PT 43 iso-ir-16 ISO646-PT csISO16Portuguese -ES 23 iso-ir-17 ISO646-ES csISO17Spanish -greek7-old 44 iso-ir-18 csISO18Greek7Old -latin-greek 45 iso-ir-19 csISO19LatinGreek -DIN_66003 24 iso-ir-21 de ISO646-DE csISO21German -NF_Z_62-010_(1973) 46 iso-ir-25 ISO646-FR1 csISO25French -Latin-greek-1 47 iso-ir-27 csISO27LatinGreek1 -ISO_5427 48 iso-ir-37 csISO5427Cyrillic -JIS_C6226-1978 49 iso-ir-42 csISO42JISC62261978 -BS_viewdata 50 iso-ir-47 csISO47BSViewdata -INIS 51 iso-ir-49 csISO49INIS -INIS-8 52 iso-ir-50 csISO50INIS8 -INIS-cyrillic 53 iso-ir-51 csISO51INISCyrillic -ISO_5427:1981 54 iso-ir-54 ISO5427Cyrillic1981 -ISO_5428:1980 55 iso-ir-55 csISO5428Greek -GB_1988-80 56 iso-ir-57 cn ISO646-CN csISO57GB1988 -GB_2312-80 57 iso-ir-58 chinese csISO58GB231280 -NS_4551-1 25 iso-ir-60 ISO646-NO no csISO60DanishNorwegian csISO60Norwegian1 -NS_4551-2 58 ISO646-NO2 iso-ir-61 no2 csISO61Norwegian2 -NF_Z_62-010 26 iso-ir-69 ISO646-FR fr csISO69French -videotex-suppl 59 iso-ir-70 csISO70VideotexSupp1 -PT2 60 iso-ir-84 ISO646-PT2 csISO84Portuguese2 -ES2 61 iso-ir-85 ISO646-ES2 csISO85Spanish2 -MSZ_7795.3 62 iso-ir-86 ISO646-HU hu csISO86Hungarian -JIS_C6226-1983 63 iso-ir-87 x0208 JIS_X0208-1983 csISO87JISX0208 -greek7 64 iso-ir-88 csISO88Greek7 -ASMO_449 65 ISO_9036 arabic7 iso-ir-89 csISO89ASMO449 -iso-ir-90 66 csISO90 -JIS_C6229-1984-a 67 iso-ir-91 jp-ocr-a csISO91JISC62291984a -JIS_C6229-1984-b 68 iso-ir-92 ISO646-JP-OCR-B jp-ocr-b csISO92JISC62991984b -JIS_C6229-1984-b-add 69 iso-ir-93 jp-ocr-b-add csISO93JIS62291984badd -JIS_C6229-1984-hand 70 iso-ir-94 jp-ocr-hand csISO94JIS62291984hand -JIS_C6229-1984-hand-add 71 iso-ir-95 jp-ocr-hand-add csISO95JIS62291984handadd -JIS_C6229-1984-kana 72 iso-ir-96 csISO96JISC62291984kana -ISO_2033-1983 73 iso-ir-98 e13b csISO2033 -ANSI_X3.110-1983 74 iso-ir-99 CSA_T500-1983 NAPLPS csISO99NAPLPS -ISO-8859-1 4 iso-ir-100 ISO_8859-1 ISO_8859-1:1987 latin1 l1 IBM819 CP819 csISOLatin1 8859_1 ISO8859-1 -ISO-8859-2 5 iso-ir-101 ISO_8859-2 ISO_8859-2:1987 latin2 l2 csISOLatin2 8859_2 ISO8859-2 -T.61-7bit 75 iso-ir-102 csISO102T617bit -T.61-8bit 76 T.61 iso-ir-103 csISO103T618bit -ISO-8859-3 6 iso-ir-109 ISO_8859-3 ISO_8859-3:1988 latin3 l3 csISOLatin3 8859_3 ISO8859-3 -ISO-8859-4 7 iso-ir-110 ISO_8859-4 ISO_8859-4:1988 latin4 l4 csISOLatin4 8859_4 ISO8859-4 -ECMA-cyrillic 77 iso-ir-111 KOI8-E csISO111ECMACyrillic -CSA_Z243.4-1985-1 78 iso-ir-121 ISO646-CA csa7-1 ca csISO121Canadian1 -CSA_Z243.4-1985-2 79 iso-ir-122 ISO646-CA2 csa7-2 csISO122Canadian2 -CSA_Z243.4-1985-gr 80 iso-ir-123 csISO123CSAZ24341985gr -ISO-8859-6 9 iso-ir-127 ISO_8859-6 ISO_8859-6:1987 ECMA-114 ASMO-708 arabic csISOLatinArabic -ISO-8859-6-E 81 csISO88596E ISO_8859-6-E -ISO-8859-6-I 82 csISO88596I ISO_8859-6-I -ISO-8859-7 10 iso-ir-126 ISO_8859-7 ISO_8859-7:1987 ELOT_928 ECMA-118 greek greek8 csISOLatinGreek 8859_7 ISO8859-7 -T.101-G2 83 iso-ir-128 csISO128T101G2 -ISO-8859-8 11 iso-ir-138 ISO_8859-8 ISO_8859-8:1988 hebrew csISOLatinHebrew 8859_8 ISO8859-8 -ISO-8859-8-E 84 csISO88598E ISO_8859-8-E -ISO-8859-8-I 85 csISO88598I ISO_8859-8-I -CSN_369103 86 iso-ir-139 csISO139CSN369103 -JUS_I.B1.002 87 iso-ir-141 ISO646-YU js yu csISO141JUSIB1002 -ISO_6937-2-add 14 iso-ir-142 csISOTextComm -IEC_P27-1 88 iso-ir-143 csISO143IECP271 -ISO-8859-5 8 iso-ir-144 ISO_8859-5 ISO_8859-5:1988 cyrillic csISOLatinCyrillic 8859_5 ISO8859-5 -JUS_I.B1.003-serb 89 iso-ir-146 serbian csISO146Serbian -JUS_I.B1.003-mac 90 macedonian iso-ir-147 csISO147Macedonian -ISO-8859-9 12 iso-ir-148 ISO_8859-9 ISO_8859-9:1989 latin5 l5 csISOLatin5 8859_9 ISO8859-9 -greek-ccitt 91 iso-ir-150 csISO150 csISO150GreekCCITT -NC_NC00-10:81 92 cuba iso-ir-151 ISO646-CU csISO151Cuba -ISO_6937-2-25 93 iso-ir-152 csISO6937Add -GOST_19768-74 94 ST_SEV_358-88 iso-ir-153 csISO153GOST1976874 -ISO_8859-supp 95 iso-ir-154 latin1-2-5 csISO8859Supp -ISO_10367-box 96 iso-ir-155 csISO10367Box -ISO-8859-10 13 iso-ir-157 l6 ISO_8859-10:1992 csISOLatin6 latin6 8859_10 ISO8859-10 -latin-lap 97 lap iso-ir-158 csISO158Lap -JIS_X0212-1990 98 x0212 iso-ir-159 csISO159JISX02121990 -DS_2089 99 DS2089 ISO646-DK dk csISO646Danish -us-dk 100 csUSDK -dk-us 101 csDKUS -JIS_X0201 15 X0201 csHalfWidthKatakana -KSC5636 102 ISO646-KR csKSC5636 -ISO-10646-UCS-2 1000 csUnicode UCS-2 UCS2 -ISO-10646-UCS-4 1001 csUCS4 UCS-4 UCS4 -DEC-MCS 2008 dec csDECMCS -hp-roman8 2004 roman8 r8 csHPRoman8 -macintosh 2027 mac csMacintosh MACROMAN MAC-ROMAN X-MAC-ROMAN -IBM037 2028 cp037 ebcdic-cp-us ebcdic-cp-ca ebcdic-cp-wt ebcdic-cp-nl csIBM037 -IBM038 2029 EBCDIC-INT cp038 csIBM038 -IBM273 2030 CP273 csIBM273 -IBM274 2031 EBCDIC-BE CP274 csIBM274 -IBM275 2032 EBCDIC-BR cp275 csIBM275 -IBM277 2033 EBCDIC-CP-DK EBCDIC-CP-NO csIBM277 -IBM278 2034 CP278 ebcdic-cp-fi ebcdic-cp-se csIBM278 -IBM280 2035 CP280 ebcdic-cp-it csIBM280 -IBM281 2036 EBCDIC-JP-E cp281 csIBM281 -IBM284 2037 CP284 ebcdic-cp-es csIBM284 -IBM285 2038 CP285 ebcdic-cp-gb csIBM285 -IBM290 2039 cp290 EBCDIC-JP-kana csIBM290 -IBM297 2040 cp297 ebcdic-cp-fr csIBM297 -IBM420 2041 cp420 ebcdic-cp-ar1 csIBM420 -IBM423 2042 cp423 ebcdic-cp-gr csIBM423 -IBM424 2043 cp424 ebcdic-cp-he csIBM424 -IBM437 2011 cp437 437 csPC8CodePage437 -IBM500 2044 CP500 ebcdic-cp-be ebcdic-cp-ch csIBM500 -IBM775 2087 cp775 csPC775Baltic -IBM850 2009 cp850 850 csPC850Multilingual -IBM851 2045 cp851 851 csIBM851 -IBM852 2010 cp852 852 csPCp852 -IBM855 2046 cp855 855 csIBM855 -IBM857 2047 cp857 857 csIBM857 -IBM860 2048 cp860 860 csIBM860 -IBM861 2049 cp861 861 cp-is csIBM861 -IBM862 2013 cp862 862 csPC862LatinHebrew -IBM863 2050 cp863 863 csIBM863 -IBM864 2051 cp864 csIBM864 -IBM865 2052 cp865 865 csIBM865 -IBM866 2086 cp866 866 csIBM866 -IBM868 2053 CP868 cp-ar csIBM868 -IBM869 2054 cp869 869 cp-gr csIBM869 -IBM870 2055 CP870 ebcdic-cp-roece ebcdic-cp-yu csIBM870 -IBM871 2056 CP871 ebcdic-cp-is csIBM871 -IBM880 2057 cp880 EBCDIC-Cyrillic csIBM880 -IBM891 2058 cp891 csIBM891 -IBM903 2059 cp903 csIBM903 -IBM904 2060 cp904 904 csIBBM904 -IBM905 2061 CP905 ebcdic-cp-tr csIBM905 -IBM918 2062 CP918 ebcdic-cp-ar2 csIBM918 -IBM1026 2063 CP1026 csIBM1026 -EBCDIC-AT-DE 2064 csIBMEBCDICATDE -EBCDIC-AT-DE-A 2065 csEBCDICATDEA -EBCDIC-CA-FR 2066 csEBCDICCAFR -EBCDIC-DK-NO 2067 csEBCDICDKNO -EBCDIC-DK-NO-A 2068 csEBCDICDKNOA -EBCDIC-FI-SE 2069 csEBCDICFISE -EBCDIC-FI-SE-A 2070 csEBCDICFISEA -EBCDIC-FR 2071 csEBCDICFR -EBCDIC-IT 2072 csEBCDICIT -EBCDIC-PT 2073 csEBCDICPT -EBCDIC-ES 2074 csEBCDICES -EBCDIC-ES-A 2075 csEBCDICESA -EBCDIC-ES-S 2076 csEBCDICESS -EBCDIC-UK 2077 csEBCDICUK -EBCDIC-US 2078 csEBCDICUS -UNKNOWN-8BIT 2079 csUnknown8BiT -MNEMONIC 2080 csMnemonic -MNEM 2081 csMnem -VISCII 2082 csVISCII -VIQR 2083 csVIQR -KOI8-R 2084 csKOI8R -KOI8-U 2088 -IBM00858 2089 CCSID00858 CP00858 PC-Multilingual-850+euro -IBM00924 2090 CCSID00924 CP00924 ebcdic-Latin9--euro -IBM01140 2091 CCSID01140 CP01140 ebcdic-us-37+euro -IBM01141 2092 CCSID01141 CP01141 ebcdic-de-273+euro -IBM01142 2093 CCSID01142 CP01142 ebcdic-dk-277+euro ebcdic-no-277+euro -IBM01143 2094 CCSID01143 CP01143 ebcdic-fi-278+euro ebcdic-se-278+euro -IBM01144 2095 CCSID01144 CP01144 ebcdic-it-280+euro -IBM01145 2096 CCSID01145 CP01145 ebcdic-es-284+euro -IBM01146 2097 CCSID01146 CP01146 ebcdic-gb-285+euro -IBM01147 2098 CCSID01147 CP01147 ebcdic-fr-297+euro -IBM01148 2099 CCSID01148 CP01148 ebcdic-international-500+euro -IBM01149 2100 CCSID01149 CP01149 ebcdic-is-871+euro -Big5-HKSCS 2101 -IBM1047 2102 IBM-1047 -PTCP154 2103 csPTCP154 PT154 CP154 Cyrillic-Asian -Amiga-1251 2104 Ami1251 Amiga1251 Ami-1251 -KOI7-switched 2105 -UNICODE-1-1 1010 csUnicode11 -SCSU 1011 -UTF-7 1012 -UTF-16BE 1013 -UTF-16LE 1014 -UTF-16 1015 -CESU-8 1016 csCESU-8 -UTF-32 1017 -UTF-32BE 1018 -UTF-32LE 1019 -BOCU-1 1020 csBOCU-1 -UNICODE-1-1-UTF-7 103 csUnicode11UTF7 -UTF-8 106 UNICODE-1-1-UTF-8 UNICODE-2-0-UTF-8 utf8 -ISO-8859-13 109 8859_13 ISO8859-13 -ISO-8859-14 110 iso-ir-199 ISO_8859-14:1998 ISO_8859-14 latin8 iso-celtic l8 8859_14 ISO8859-14 -ISO-8859-15 111 ISO_8859-15 Latin-9 8859_15 ISO8859-15 -ISO-8859-16 112 iso-ir-226 ISO_8859-16:2001 ISO_8859-16 latin10 l10 -GBK 113 CP936 MS936 windows-936 -GB18030 114 -OSD_EBCDIC_DF04_15 115 -OSD_EBCDIC_DF03_IRV 116 -OSD_EBCDIC_DF04_1 117 -JIS_Encoding 16 csJISEncoding -Shift_JIS 17 MS_Kanji csShiftJIS X-SJIS Shift-JIS -EUC-JP 18 csEUCPkdFmtJapanese Extended_UNIX_Code_Packed_Format_for_Japanese EUCJP -Extended_UNIX_Code_Fixed_Width_for_Japanese 19 csEUCFixWidJapanese -ISO-10646-UCS-Basic 1002 csUnicodeASCII -ISO-10646-Unicode-Latin1 1003 csUnicodeLatin1 ISO-10646 -ISO-Unicode-IBM-1261 1005 csUnicodeIBM1261 -ISO-Unicode-IBM-1268 1006 csUnicodeIBM1268 -ISO-Unicode-IBM-1276 1007 csUnicodeIBM1276 -ISO-Unicode-IBM-1264 1008 csUnicodeIBM1264 -ISO-Unicode-IBM-1265 1009 csUnicodeIBM1265 -ISO-8859-1-Windows-3.0-Latin-1 2000 csWindows30Latin1 -ISO-8859-1-Windows-3.1-Latin-1 2001 csWindows31Latin1 -ISO-8859-2-Windows-Latin-2 2002 csWindows31Latin2 -ISO-8859-9-Windows-Latin-5 2003 csWindows31Latin5 -Adobe-Standard-Encoding 2005 csAdobeStandardEncoding -Ventura-US 2006 csVenturaUS -Ventura-International 2007 csVenturaInternational -PC8-Danish-Norwegian 2012 csPC8DanishNorwegian -PC8-Turkish 2014 csPC8Turkish -IBM-Symbols 2015 csIBMSymbols -IBM-Thai 2016 csIBMThai -HP-Legal 2017 csHPLegal -HP-Pi-font 2018 csHPPiFont -HP-Math8 2019 csHPMath8 -Adobe-Symbol-Encoding 2020 csHPPSMath -HP-DeskTop 2021 csHPDesktop -Ventura-Math 2022 csVenturaMath -Microsoft-Publishing 2023 csMicrosoftPublishing -Windows-31J 2024 csWindows31J -GB2312 2025 csGB2312 EUC-CN EUCCN CN-GB -Big5 2026 csBig5 BIG-FIVE BIG-5 CN-BIG5 BIG_FIVE x-x-big5 -windows-1250 2250 CP1250 MS-EE -windows-1251 2251 CP1251 MS-CYRL -windows-1252 2252 CP1252 MS-ANSI -windows-1253 2253 CP1253 MS-GREEK -windows-1254 2254 CP1254 MS-TURK -windows-1255 2255 -windows-1256 2256 CP1256 MS-ARAB -windows-1257 2257 CP1257 WINBALTRIM -windows-1258 2258 -TIS-620 2259 -HZ-GB-2312 2085 - -# Additional encodings not defined by IANA - -# Arbitrary allocations -#CP737 3001 -#CP853 3002 -#CP856 3003 -CP874 3004 WINDOWS-874 -#CP922 3005 -#CP1046 3006 -#CP1124 3007 -#CP1125 3008 WINDOWS-1125 -#CP1129 3009 -#CP1133 3010 IBM-CP1133 -#CP1161 3011 IBM-1161 IBM1161 CSIBM1161 -#CP1162 3012 IBM-1162 IBM1162 CSIBM1162 -#CP1163 3013 IBM-1163 IBM1163 CSIBM1163 -#GEORGIAN-ACADEMY 3014 -#GEORGIAN-PS 3015 -#KOI8-RU 3016 -#KOI8-T 3017 -#MACARABIC 3018 X-MAC-ARABIC MAC-ARABIC -#MACCROATIAN 3019 X-MAC-CROATIAN MAC-CROATIAN -#MACGREEK 3020 X-MAC-GREEK MAC-GREEK -#MACHEBREW 3021 X-MAC-HEBREW MAC-HEBREW -#MACICELAND 3022 X-MAC-ICELAND MAC-ICELAND -#MACROMANIA 3023 X-MAC-ROMANIA MAC-ROMANIA -#MACTHAI 3024 X-MAC-THAI MAC-THAI -#MACTURKISH 3025 X-MAC-TURKISH MAC-TURKISH -#MULELAO-1 3026 -CP949 3027 WINDOWS-949 - -# From Unicode Lib -ISO-IR-182 4000 -ISO-IR-197 4002 -ISO-2022-JP-1 4008 -MACCYRILLIC 4009 X-MAC-CYRILLIC MAC-CYRILLIC -MACUKRAINE 4010 X-MAC-UKRAINIAN MAC-UKRAINIAN -MACCENTRALEUROPE 4011 X-MAC-CENTRALEURROMAN MAC-CENTRALEURROMAN -JOHAB 4012 -ISO-8859-11 4014 iso-ir-166 ISO_8859-11 ISO8859-11 8859_11 -X-CURRENT 4999 X-SYSTEM -X-ACORN-LATIN1 5001 -X-ACORN-FUZZY 5002 diff --git a/test/run-test.sh b/test/run-test.sh index 47364d2..366368e 100755 --- a/test/run-test.sh +++ b/test/run-test.sh @@ -25,15 +25,10 @@ dtd=${dtd:?"The DTD file must be given"}; testdir="$domts"/tests/"$level"/"$module" log="$output"/"$level"/"$module"/test.log; -sysdir="/home/netsurf2morebits/sys"; -libdir="$sysdir/lib"; -incdir="$sysdir/include"; - src="testutils/comparators.c testutils/domtsasserts.c testutils/foreach.c testutils/list.c testutils/load.c testutils/utils.c testutils/domtscondition.c" domdir="../build-Linux-Linux-debug-lib-static" -ldflags="-L$domdir -ldom -L$libdir -lwapcaplet -L$libdir -lhubbub -lparserutils -L/usr/lib -lxml2" -#ldflags="-L/usr/lib -lm -lz -L$domdir -ldom -L/usr/local/lib -lwapcaplet -lxml2 -lhubbub -lparserutils" -cflags="-Itestutils/ -I../bindings/xml -I../include -I../bindings/hubbub -I$incdir" +ldflags="-L$libdir -L$libdir -lxml2 $(pkg-config --libs libdom libwapcaplet libparserutils libhubbub)" +cflags="-Itestutils/ -I../bindings/xml -I../include -I../bindings/hubbub $(pkg-config --cflags libwapcaplet libparserutils libhubbub)" total=0; fail=0; diff --git a/test/testcases/tests/level1/core/cdatasectionnormalize.xml b/test/testcases/tests/level1/core/cdatasectionnormalize.xml deleted file mode 100644 index ce654f6..0000000 --- a/test/testcases/tests/level1/core/cdatasectionnormalize.xml +++ /dev/null @@ -1,49 +0,0 @@ - - - - - -cdataSectionNormalize -NIST - -Adjacent CDATASection nodes cannot be merged together by -use of the "normalize()" method from the Element interface. -Retrieve second child of the second employee and invoke -the "normalize()" method. The Element under contains -two CDATASection nodes that should not be merged together -by the "normalize()" method. - -Mary Brady -2001-08-17 - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/testcases/tests/level1/core/cdatasectionnormalize.xml.notimpl b/test/testcases/tests/level1/core/cdatasectionnormalize.xml.notimpl new file mode 100644 index 0000000..ce654f6 --- /dev/null +++ b/test/testcases/tests/level1/core/cdatasectionnormalize.xml.notimpl @@ -0,0 +1,49 @@ + + + + + +cdataSectionNormalize +NIST + +Adjacent CDATASection nodes cannot be merged together by +use of the "normalize()" method from the Element interface. +Retrieve second child of the second employee and invoke +the "normalize()" method. The Element under contains +two CDATASection nodes that should not be merged together +by the "normalize()" method. + +Mary Brady +2001-08-17 + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/testcases/tests/level1/core/elementnormalize.xml b/test/testcases/tests/level1/core/elementnormalize.xml deleted file mode 100644 index bc85fff..0000000 --- a/test/testcases/tests/level1/core/elementnormalize.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - -elementNormalize -NIST - - The "normalize()" method puts all the nodes in the full - depth of the sub-tree underneath this element into a - "normal" form. - - Retrieve the third employee and access its second child. - This child contains a block of text that is spread - across multiple lines. The content of the "name" child - should be parsed and treated as a single Text node. - -Mary Brady -2001-08-17 - - - - - - - - - - - - - - - - - diff --git a/test/testcases/tests/level1/core/elementnormalize.xml.notimpl b/test/testcases/tests/level1/core/elementnormalize.xml.notimpl new file mode 100644 index 0000000..bc85fff --- /dev/null +++ b/test/testcases/tests/level1/core/elementnormalize.xml.notimpl @@ -0,0 +1,46 @@ + + + + + +elementNormalize +NIST + + The "normalize()" method puts all the nodes in the full + depth of the sub-tree underneath this element into a + "normal" form. + + Retrieve the third employee and access its second child. + This child contains a block of text that is spread + across multiple lines. The content of the "name" child + should be parsed and treated as a single Text node. + +Mary Brady +2001-08-17 + + + + + + + + + + + + + + + + + diff --git a/test/testcases/tests/level1/core/entitygetentityname.xml b/test/testcases/tests/level1/core/entitygetentityname.xml deleted file mode 100644 index 2aa4be3..0000000 --- a/test/testcases/tests/level1/core/entitygetentityname.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - -entityGetEntityName -NIST - - The nodeName attribute that is inherited from Node - contains the name of the entity. - - Retrieve the entity named "ent1" and access its name by - invoking the "getNodeName()" method inherited from - the Node interface. - -Mary Brady -2001-08-17 - - - - - - - - - - - - - - - - - - - diff --git a/test/testcases/tests/level1/core/entitygetentityname.xml.notimpl b/test/testcases/tests/level1/core/entitygetentityname.xml.notimpl new file mode 100644 index 0000000..2aa4be3 --- /dev/null +++ b/test/testcases/tests/level1/core/entitygetentityname.xml.notimpl @@ -0,0 +1,46 @@ + + + + + +entityGetEntityName +NIST + + The nodeName attribute that is inherited from Node + contains the name of the entity. + + Retrieve the entity named "ent1" and access its name by + invoking the "getNodeName()" method inherited from + the Node interface. + +Mary Brady +2001-08-17 + + + + + + + + + + + + + + + + + + + diff --git a/test/testcases/tests/level1/core/entitygetpublicid.xml b/test/testcases/tests/level1/core/entitygetpublicid.xml deleted file mode 100644 index 645a781..0000000 --- a/test/testcases/tests/level1/core/entitygetpublicid.xml +++ /dev/null @@ -1,55 +0,0 @@ - - - - - -entityGetPublicId -NIST - - The "getPublicId()" method of an Entity node contains - the public identifier associated with the entity, if - one was specified. - - Retrieve the entity named "ent5" and access its - public identifier. The string "entityURI" should be - returned. - -Mary Brady -2001-08-17 - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/testcases/tests/level1/core/entitygetpublicid.xml.notimpl b/test/testcases/tests/level1/core/entitygetpublicid.xml.notimpl new file mode 100644 index 0000000..645a781 --- /dev/null +++ b/test/testcases/tests/level1/core/entitygetpublicid.xml.notimpl @@ -0,0 +1,55 @@ + + + + + +entityGetPublicId +NIST + + The "getPublicId()" method of an Entity node contains + the public identifier associated with the entity, if + one was specified. + + Retrieve the entity named "ent5" and access its + public identifier. The string "entityURI" should be + returned. + +Mary Brady +2001-08-17 + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/testcases/tests/level1/core/entitygetpublicidnull.xml b/test/testcases/tests/level1/core/entitygetpublicidnull.xml deleted file mode 100644 index 172ba80..0000000 --- a/test/testcases/tests/level1/core/entitygetpublicidnull.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - -entityGetPublicIdNull -NIST - - The "getPublicId()" method of an Entity node contains - the public identifier associated with the entity, if - one was not specified a null value should be returned. - - Retrieve the entity named "ent1" and access its - public identifier. Since a public identifier was not - specified for this entity, the "getPublicId()" method - should return null. - -Mary Brady -2001-08-17 - - - - - - - - - - - - - - - - diff --git a/test/testcases/tests/level1/core/entitygetpublicidnull.xml.notimpl b/test/testcases/tests/level1/core/entitygetpublicidnull.xml.notimpl new file mode 100644 index 0000000..172ba80 --- /dev/null +++ b/test/testcases/tests/level1/core/entitygetpublicidnull.xml.notimpl @@ -0,0 +1,45 @@ + + + + + +entityGetPublicIdNull +NIST + + The "getPublicId()" method of an Entity node contains + the public identifier associated with the entity, if + one was not specified a null value should be returned. + + Retrieve the entity named "ent1" and access its + public identifier. Since a public identifier was not + specified for this entity, the "getPublicId()" method + should return null. + +Mary Brady +2001-08-17 + + + + + + + + + + + + + + + + diff --git a/test/testcases/tests/level1/core/hc_attrnormalize.xml b/test/testcases/tests/level1/core/hc_attrnormalize.xml deleted file mode 100644 index bc5a892..0000000 --- a/test/testcases/tests/level1/core/hc_attrnormalize.xml +++ /dev/null @@ -1,65 +0,0 @@ - - - - - -hc_attrnormalize -Curt Arnold - -Appends a text node to an attribute, normalizes the attribute -and checks for a single child node. - - -2004-01-01 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/testcases/tests/level1/core/hc_attrnormalize.xml.notimpl b/test/testcases/tests/level1/core/hc_attrnormalize.xml.notimpl new file mode 100644 index 0000000..bc5a892 --- /dev/null +++ b/test/testcases/tests/level1/core/hc_attrnormalize.xml.notimpl @@ -0,0 +1,65 @@ + + + + + +hc_attrnormalize +Curt Arnold + +Appends a text node to an attribute, normalizes the attribute +and checks for a single child node. + + +2004-01-01 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/testcases/tests/level1/core/hc_elementnormalize.xml b/test/testcases/tests/level1/core/hc_elementnormalize.xml deleted file mode 100644 index e1df08f..0000000 --- a/test/testcases/tests/level1/core/hc_elementnormalize.xml +++ /dev/null @@ -1,49 +0,0 @@ - - - - - -hc_elementnormalize -Curt Arnold - -Append a couple of text nodes to the first sup element, normalize the -document element and check that the element has been normalized. - - -2002-06-09 - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/testcases/tests/level1/core/hc_elementnormalize.xml.notimpl b/test/testcases/tests/level1/core/hc_elementnormalize.xml.notimpl new file mode 100644 index 0000000..e1df08f --- /dev/null +++ b/test/testcases/tests/level1/core/hc_elementnormalize.xml.notimpl @@ -0,0 +1,49 @@ + + + + + +hc_elementnormalize +Curt Arnold + +Append a couple of text nodes to the first sup element, normalize the +document element and check that the element has been normalized. + + +2002-06-09 + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/testcases/tests/level1/core/hc_elementnormalize2.xml b/test/testcases/tests/level1/core/hc_elementnormalize2.xml deleted file mode 100644 index 0adf0d8..0000000 --- a/test/testcases/tests/level1/core/hc_elementnormalize2.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - - -hc_elementnormalize2 -Curt Arnold - -Add an empty text node to an existing attribute node, normalize the containing element -and check that the attribute node has eliminated the empty text. - - -2002-06-09 - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/testcases/tests/level1/core/hc_elementnormalize2.xml.notimpl b/test/testcases/tests/level1/core/hc_elementnormalize2.xml.notimpl new file mode 100644 index 0000000..0adf0d8 --- /dev/null +++ b/test/testcases/tests/level1/core/hc_elementnormalize2.xml.notimpl @@ -0,0 +1,51 @@ + + + + + +hc_elementnormalize2 +Curt Arnold + +Add an empty text node to an existing attribute node, normalize the containing element +and check that the attribute node has eliminated the empty text. + + +2002-06-09 + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/testcases/tests/level1/core/hc_entitiessetnameditem1.xml b/test/testcases/tests/level1/core/hc_entitiessetnameditem1.xml deleted file mode 100644 index 301bdf1..0000000 --- a/test/testcases/tests/level1/core/hc_entitiessetnameditem1.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - - - -hc_entitiessetnameditem1 -Curt Arnold - -An attempt to add an element to the named node map returned by entities should -result in a NO_MODIFICATION_ERR or HIERARCHY_REQUEST_ERR. - -2004-01-11 - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/testcases/tests/level1/core/hc_entitiessetnameditem1.xml.notimpl b/test/testcases/tests/level1/core/hc_entitiessetnameditem1.xml.notimpl new file mode 100644 index 0000000..301bdf1 --- /dev/null +++ b/test/testcases/tests/level1/core/hc_entitiessetnameditem1.xml.notimpl @@ -0,0 +1,50 @@ + + + + + +hc_entitiessetnameditem1 +Curt Arnold + +An attempt to add an element to the named node map returned by entities should +result in a NO_MODIFICATION_ERR or HIERARCHY_REQUEST_ERR. + +2004-01-11 + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/testcases/tests/level1/core/hc_notationssetnameditem1.xml b/test/testcases/tests/level1/core/hc_notationssetnameditem1.xml deleted file mode 100644 index 575b80b..0000000 --- a/test/testcases/tests/level1/core/hc_notationssetnameditem1.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - - - -hc_notationssetnameditem1 -Curt Arnold - -An attempt to add an element to the named node map returned by notations should -result in a NO_MODIFICATION_ERR or HIERARCHY_REQUEST_ERR. - -2004-01-11 - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/testcases/tests/level1/core/hc_notationssetnameditem1.xml.notimpl b/test/testcases/tests/level1/core/hc_notationssetnameditem1.xml.notimpl new file mode 100644 index 0000000..575b80b --- /dev/null +++ b/test/testcases/tests/level1/core/hc_notationssetnameditem1.xml.notimpl @@ -0,0 +1,50 @@ + + + + + +hc_notationssetnameditem1 +Curt Arnold + +An attempt to add an element to the named node map returned by notations should +result in a NO_MODIFICATION_ERR or HIERARCHY_REQUEST_ERR. + +2004-01-11 + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/testcases/tests/level1/core/nodenotationnodetype.xml b/test/testcases/tests/level1/core/nodenotationnodetype.xml deleted file mode 100644 index c2243d4..0000000 --- a/test/testcases/tests/level1/core/nodenotationnodetype.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - -nodeNotationNodeType -NIST - - The "getNodeType()" method for an Notation Node - returns the constant value 12. - - Retrieve the Notation declaration in the DocumentType - node and invoke the "getNodeType()" method. The method - should return 12. - -Mary Brady -2001-08-17 - - - - - - - - - - - - - - - - - diff --git a/test/testcases/tests/level1/core/nodenotationnodetype.xml.notimpl b/test/testcases/tests/level1/core/nodenotationnodetype.xml.notimpl new file mode 100644 index 0000000..c2243d4 --- /dev/null +++ b/test/testcases/tests/level1/core/nodenotationnodetype.xml.notimpl @@ -0,0 +1,44 @@ + + + + + +nodeNotationNodeType +NIST + + The "getNodeType()" method for an Notation Node + returns the constant value 12. + + Retrieve the Notation declaration in the DocumentType + node and invoke the "getNodeType()" method. The method + should return 12. + +Mary Brady +2001-08-17 + + + + + + + + + + + + + + + + + diff --git a/test/testcases/tests/level1/core/nodeprocessinginstructionsetnodevalue.xml b/test/testcases/tests/level1/core/nodeprocessinginstructionsetnodevalue.xml deleted file mode 100644 index 78f0f65..0000000 --- a/test/testcases/tests/level1/core/nodeprocessinginstructionsetnodevalue.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - -nodeProcessingInstructionSetNodeValue -Curt Arnold - - Setting the nodeValue should change the value returned by - nodeValue and ProcessingInstruction.getData. - -2001-10-21 - - - - - - - - - - - - - - - - - - - - - diff --git a/test/testcases/tests/level1/core/nodeprocessinginstructionsetnodevalue.xml.notimpl b/test/testcases/tests/level1/core/nodeprocessinginstructionsetnodevalue.xml.notimpl new file mode 100644 index 0000000..78f0f65 --- /dev/null +++ b/test/testcases/tests/level1/core/nodeprocessinginstructionsetnodevalue.xml.notimpl @@ -0,0 +1,43 @@ + + + + + +nodeProcessingInstructionSetNodeValue +Curt Arnold + + Setting the nodeValue should change the value returned by + nodeValue and ProcessingInstruction.getData. + +2001-10-21 + + + + + + + + + + + + + + + + + + + + + diff --git a/test/testcases/tests/level1/core/notationgetnotationname.xml b/test/testcases/tests/level1/core/notationgetnotationname.xml deleted file mode 100644 index ded685c..0000000 --- a/test/testcases/tests/level1/core/notationgetnotationname.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - -notationGetNotationName -NIST - - Retrieve the notation named "notation1" and access its - name by invoking the "getNodeName()" method inherited - from the Node interface. - -Mary Brady -2001-08-17 - - - - - - - - - - - - - - - - - - - diff --git a/test/testcases/tests/level1/core/notationgetnotationname.xml.notimpl b/test/testcases/tests/level1/core/notationgetnotationname.xml.notimpl new file mode 100644 index 0000000..ded685c --- /dev/null +++ b/test/testcases/tests/level1/core/notationgetnotationname.xml.notimpl @@ -0,0 +1,43 @@ + + + + + +notationGetNotationName +NIST + + Retrieve the notation named "notation1" and access its + name by invoking the "getNodeName()" method inherited + from the Node interface. + +Mary Brady +2001-08-17 + + + + + + + + + + + + + + + + + + + diff --git a/test/testcases/tests/level1/core/notationgetpublicid.xml b/test/testcases/tests/level1/core/notationgetpublicid.xml deleted file mode 100644 index 882cc54..0000000 --- a/test/testcases/tests/level1/core/notationgetpublicid.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - -notationGetPublicId -NIST - - Retrieve the notation named "notation1" and access its - public identifier. The string "notation1File" should be - returned. - -Mary Brady -2001-08-17 - - - - - - - - - - - - - - - - diff --git a/test/testcases/tests/level1/core/notationgetpublicid.xml.notimpl b/test/testcases/tests/level1/core/notationgetpublicid.xml.notimpl new file mode 100644 index 0000000..882cc54 --- /dev/null +++ b/test/testcases/tests/level1/core/notationgetpublicid.xml.notimpl @@ -0,0 +1,40 @@ + + + + + +notationGetPublicId +NIST + + Retrieve the notation named "notation1" and access its + public identifier. The string "notation1File" should be + returned. + +Mary Brady +2001-08-17 + + + + + + + + + + + + + + + + diff --git a/test/testcases/tests/level1/core/notationgetpublicidnull.xml b/test/testcases/tests/level1/core/notationgetpublicidnull.xml deleted file mode 100644 index 39e23ad..0000000 --- a/test/testcases/tests/level1/core/notationgetpublicidnull.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - -notationGetPublicIdNull -NIST - - The "getPublicId()" method of a Notation node contains - the public identifier associated with the notation, if - one was not specified a null value should be returned. - - Retrieve the notation named "notation2" and access its - public identifier. Since a public identifier was not - specified for this notation, the "getPublicId()" method - should return null. - -Mary Brady -2001-08-17 - - - - - - - - - - - - - - - - diff --git a/test/testcases/tests/level1/core/notationgetpublicidnull.xml.notimpl b/test/testcases/tests/level1/core/notationgetpublicidnull.xml.notimpl new file mode 100644 index 0000000..39e23ad --- /dev/null +++ b/test/testcases/tests/level1/core/notationgetpublicidnull.xml.notimpl @@ -0,0 +1,45 @@ + + + + + +notationGetPublicIdNull +NIST + + The "getPublicId()" method of a Notation node contains + the public identifier associated with the notation, if + one was not specified a null value should be returned. + + Retrieve the notation named "notation2" and access its + public identifier. Since a public identifier was not + specified for this notation, the "getPublicId()" method + should return null. + +Mary Brady +2001-08-17 + + + + + + + + + + + + + + + + diff --git a/test/testcases/tests/level1/core/notationgetsystemid.xml b/test/testcases/tests/level1/core/notationgetsystemid.xml deleted file mode 100644 index 04a84ac..0000000 --- a/test/testcases/tests/level1/core/notationgetsystemid.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - -notationGetSystemId -NIST - - The "getSystemId()" method of a Notation node contains - the system identifier associated with the notation, if - one was specified. - - Retrieve the notation named "notation2" and access its - system identifier. The string "notation2File" should be - returned. - -Mary Brady -2001-08-17 - - - - - - - - - - - - - - - - - diff --git a/test/testcases/tests/level1/core/notationgetsystemid.xml.notimpl b/test/testcases/tests/level1/core/notationgetsystemid.xml.notimpl new file mode 100644 index 0000000..04a84ac --- /dev/null +++ b/test/testcases/tests/level1/core/notationgetsystemid.xml.notimpl @@ -0,0 +1,45 @@ + + + + + +notationGetSystemId +NIST + + The "getSystemId()" method of a Notation node contains + the system identifier associated with the notation, if + one was specified. + + Retrieve the notation named "notation2" and access its + system identifier. The string "notation2File" should be + returned. + +Mary Brady +2001-08-17 + + + + + + + + + + + + + + + + + diff --git a/test/testcases/tests/level1/core/notationgetsystemidnull.xml b/test/testcases/tests/level1/core/notationgetsystemidnull.xml deleted file mode 100644 index cf15a2f..0000000 --- a/test/testcases/tests/level1/core/notationgetsystemidnull.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - -notationGetSystemIdNull -NIST - - Retrieve the notation named "notation1" and access its - system identifier. Since a system identifier was not - specified for this notation, the "getSystemId()" method - should return null. - -Mary Brady -2001-08-17 - - - - - - - - - - - - - - - - diff --git a/test/testcases/tests/level1/core/notationgetsystemidnull.xml.notimpl b/test/testcases/tests/level1/core/notationgetsystemidnull.xml.notimpl new file mode 100644 index 0000000..cf15a2f --- /dev/null +++ b/test/testcases/tests/level1/core/notationgetsystemidnull.xml.notimpl @@ -0,0 +1,41 @@ + + + + + +notationGetSystemIdNull +NIST + + Retrieve the notation named "notation1" and access its + system identifier. Since a system identifier was not + specified for this notation, the "getSystemId()" method + should return null. + +Mary Brady +2001-08-17 + + + + + + + + + + + + + + + + diff --git a/test/testcases/tests/level1/core/processinginstructiongetdata.xml b/test/testcases/tests/level1/core/processinginstructiongetdata.xml deleted file mode 100644 index 1760419..0000000 --- a/test/testcases/tests/level1/core/processinginstructiongetdata.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - -processinginstructionGetData -NIST - - The "getData()" method returns the content of the - processing instruction. It starts at the first non - white character following the target and ends at the - character immediately preceding the "?>". - - Retrieve the ProcessingInstruction node located - immediately after the prolog. Create a nodelist of the - child nodes of this document. Invoke the "getData()" - method on the first child in the list. This should - return the content of the ProcessingInstruction. - -Mary Brady -2001-08-17 - - - - - - - - - - - - diff --git a/test/testcases/tests/level1/core/processinginstructiongetdata.xml.notimpl b/test/testcases/tests/level1/core/processinginstructiongetdata.xml.notimpl new file mode 100644 index 0000000..1760419 --- /dev/null +++ b/test/testcases/tests/level1/core/processinginstructiongetdata.xml.notimpl @@ -0,0 +1,43 @@ + + + + + +processinginstructionGetData +NIST + + The "getData()" method returns the content of the + processing instruction. It starts at the first non + white character following the target and ends at the + character immediately preceding the "?>". + + Retrieve the ProcessingInstruction node located + immediately after the prolog. Create a nodelist of the + child nodes of this document. Invoke the "getData()" + method on the first child in the list. This should + return the content of the ProcessingInstruction. + +Mary Brady +2001-08-17 + + + + + + + + + + + + diff --git a/test/testcases/tests/level1/core/processinginstructiongettarget.xml b/test/testcases/tests/level1/core/processinginstructiongettarget.xml deleted file mode 100644 index e02e3d6..0000000 --- a/test/testcases/tests/level1/core/processinginstructiongettarget.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - -processinginstructionGetTarget -NIST - - The "getTarget()" method returns the target of the - processing instruction. It is the first token following - the markup that begins the processing instruction. - - Retrieve the ProcessingInstruction node located - immediately after the prolog. Create a nodelist of the - child nodes of this document. Invoke the "getTarget()" - method on the first child in the list. This should - return the target of the ProcessingInstruction. - -Mary Brady -2001-08-17 - - - - - - - - - - - - diff --git a/test/testcases/tests/level1/core/processinginstructiongettarget.xml.notimpl b/test/testcases/tests/level1/core/processinginstructiongettarget.xml.notimpl new file mode 100644 index 0000000..e02e3d6 --- /dev/null +++ b/test/testcases/tests/level1/core/processinginstructiongettarget.xml.notimpl @@ -0,0 +1,42 @@ + + + + + +processinginstructionGetTarget +NIST + + The "getTarget()" method returns the target of the + processing instruction. It is the first token following + the markup that begins the processing instruction. + + Retrieve the ProcessingInstruction node located + immediately after the prolog. Create a nodelist of the + child nodes of this document. Invoke the "getTarget()" + method on the first child in the list. This should + return the target of the ProcessingInstruction. + +Mary Brady +2001-08-17 + + + + + + + + + + + + diff --git a/test/testcases/tests/level1/core/processinginstructionsetdatanomodificationallowederr.xml b/test/testcases/tests/level1/core/processinginstructionsetdatanomodificationallowederr.xml deleted file mode 100644 index 8d7ed81..0000000 --- a/test/testcases/tests/level1/core/processinginstructionsetdatanomodificationallowederr.xml +++ /dev/null @@ -1,53 +0,0 @@ - - - - - -processinginstructionSetDataNoModificationAllowedErr -NIST - - The "setData(data)" method for a processing instruction causes the - DOMException NO_MODIFICATION_ALLOWED_ERR to be raised - if the node is readonly. - - Obtain the children of the THIRD "gender" element. The elements - content is an entity reference. Try to remove the "domestic" attribute - from the entity reference by executing the "setData(data)" method. - This causes a NO_MODIFICATION_ALLOWED_ERR DOMException to be thrown. - -Mary Brady -2001-08-17 - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/testcases/tests/level1/core/processinginstructionsetdatanomodificationallowederr.xml.notimpl b/test/testcases/tests/level1/core/processinginstructionsetdatanomodificationallowederr.xml.notimpl new file mode 100644 index 0000000..8d7ed81 --- /dev/null +++ b/test/testcases/tests/level1/core/processinginstructionsetdatanomodificationallowederr.xml.notimpl @@ -0,0 +1,53 @@ + + + + + +processinginstructionSetDataNoModificationAllowedErr +NIST + + The "setData(data)" method for a processing instruction causes the + DOMException NO_MODIFICATION_ALLOWED_ERR to be raised + if the node is readonly. + + Obtain the children of the THIRD "gender" element. The elements + content is an entity reference. Try to remove the "domestic" attribute + from the entity reference by executing the "setData(data)" method. + This causes a NO_MODIFICATION_ALLOWED_ERR DOMException to be thrown. + +Mary Brady +2001-08-17 + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/testcases/tests/level1/core/processinginstructionsetdatanomodificationallowederrEE.xml b/test/testcases/tests/level1/core/processinginstructionsetdatanomodificationallowederrEE.xml deleted file mode 100644 index 8c99919..0000000 --- a/test/testcases/tests/level1/core/processinginstructionsetdatanomodificationallowederrEE.xml +++ /dev/null @@ -1,57 +0,0 @@ - - - - - -processinginstructionSetDataNoModificationAllowedErrEE -Curt Arnold - - The "setData(data)" method for a processing instruction causes the - DOMException NO_MODIFICATION_ALLOWED_ERR to be raised - if the node is readonly. - - Create an ent4 entity reference and add to document of the THIRD "gender" element. The elements - content is an entity reference. Try to remove the "domestic" attribute - from the entity reference by executing the "setData(data)" method. - This causes a NO_MODIFICATION_ALLOWED_ERR DOMException to be thrown. - -2001-08-21 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/testcases/tests/level1/core/processinginstructionsetdatanomodificationallowederrEE.xml.notimpl b/test/testcases/tests/level1/core/processinginstructionsetdatanomodificationallowederrEE.xml.notimpl new file mode 100644 index 0000000..8c99919 --- /dev/null +++ b/test/testcases/tests/level1/core/processinginstructionsetdatanomodificationallowederrEE.xml.notimpl @@ -0,0 +1,57 @@ + + + + + +processinginstructionSetDataNoModificationAllowedErrEE +Curt Arnold + + The "setData(data)" method for a processing instruction causes the + DOMException NO_MODIFICATION_ALLOWED_ERR to be raised + if the node is readonly. + + Create an ent4 entity reference and add to document of the THIRD "gender" element. The elements + content is an entity reference. Try to remove the "domestic" attribute + from the entity reference by executing the "setData(data)" method. + This causes a NO_MODIFICATION_ALLOWED_ERR DOMException to be thrown. + +2001-08-21 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/testutils/comparators.c b/test/testutils/comparators.c index 20630c6..b7ec1b1 100644 --- a/test/testutils/comparators.c +++ b/test/testutils/comparators.c @@ -21,13 +21,13 @@ int int_comparator(const void* a, const void* b) { * one is a dom_string, return zero if equal */ int str_cmp(const void *a, const void *b) { - const char *excepted = (const char *) a; + const uint8_t *expected = (const uint8_t *) a; dom_string *actual = (dom_string *) b; dom_string *exp; dom_exception err; bool ret; - err = dom_string_create(myrealloc, NULL, excepted, strlen(excepted), + err = dom_string_create(myrealloc, NULL, expected, strlen((const char *)expected), &exp); if (err != DOM_NO_ERR) return false; @@ -52,13 +52,13 @@ int str_cmp_r(const void *a, const void *b) /* Similar with str_cmp but ignore the case of letters */ int str_icmp(const void *a, const void *b) { - const char *excepted = (const char *) a; + const uint8_t *expected = (const uint8_t *) a; dom_string *actual = (dom_string *) b; dom_string *exp; dom_exception err; bool ret; - err = dom_string_create(myrealloc, NULL, excepted, strlen(excepted), + err = dom_string_create(myrealloc, NULL, expected, strlen((const char *)expected), &exp); if (err != DOM_NO_ERR) return false; diff --git a/test/testutils/domts.h b/test/testutils/domts.h index 6aa8cc4..3c14adf 100644 --- a/test/testutils/domts.h +++ b/test/testutils/domts.h @@ -15,7 +15,7 @@ #include #include -dom_document *load_xml(char *file, bool willBeModified); -dom_document *load_html(char *file, bool willBeModified); +dom_document *load_xml(const char *file, bool willBeModified); +dom_document *load_html(const char *file, bool willBeModified); #endif diff --git a/test/testutils/domtsasserts.c b/test/testutils/domtsasserts.c index 731e19d..bd0eab1 100644 --- a/test/testutils/domtsasserts.c +++ b/test/testutils/domtsasserts.c @@ -42,57 +42,57 @@ bool is_null(void *arg) return arg == NULL; } -bool is_same(void *excepted, void *actual) +bool is_same(void *expected, void *actual) { - return excepted == actual; + return expected == actual; } -bool is_same_int(int excepted, int actual) +bool is_same_int(int expected, int actual) { - return excepted == actual; + return expected == actual; } -bool is_same_unsigned_long(unsigned long excepted, unsigned long actual) +bool is_same_unsigned_long(unsigned long expected, unsigned long actual) { - return excepted == actual; + return expected == actual; } -bool is_equals_int(int excepted, int actual, bool dummy) +bool is_equals_int(int expected, int actual, bool dummy) { UNUSED(dummy); - return excepted == actual; + return expected == actual; } -bool is_equals_bool(bool excepted, bool actual, bool dummy) +bool is_equals_bool(bool expected, bool actual, bool dummy) { UNUSED(dummy); - return excepted == actual; + return expected == actual; } -bool is_equals_unsigned_long(unsigned long excepted, unsigned long actual, bool dummy) +bool is_equals_unsigned_long(unsigned long expected, unsigned long actual, bool dummy) { UNUSED(dummy); - return excepted == actual; + return expected == actual; } /** * Test whether two string are equal * - * \param excepted The excepted string + * \param expected The expected string * \param actual The actual string * \param ignoreCase Whether to ignore letter case */ -bool is_equals_string(const char *excepted, dom_string *actual, +bool is_equals_string(const char *expected, dom_string *actual, bool ignoreCase) { dom_string *exp; dom_exception err; bool ret; - err = dom_string_create(myrealloc, NULL, excepted, strlen(excepted), + err = dom_string_create(myrealloc, NULL, (const uint8_t *)expected, strlen(expected), &exp); if (err != DOM_NO_ERR) return false; @@ -107,13 +107,13 @@ bool is_equals_string(const char *excepted, dom_string *actual, } /* Compare whether two dom_string are equal */ -bool is_equals_domstring(dom_string *excepted, dom_string *actual, +bool is_equals_domstring(dom_string *expected, dom_string *actual, bool ignoreCase) { if (ignoreCase == true) - return dom_string_icmp(excepted, actual) == 0; + return dom_string_icmp(expected, actual) == 0; else - return dom_string_cmp(excepted, actual) == 0; + return dom_string_cmp(expected, actual) == 0; } /* The param actual should always contain dom_sting and expectd should @@ -142,9 +142,7 @@ bool is_equals_list(list *expected, list *actual, bool ignoreCase) assert(cmp != NULL); - bool ret = list_contains_all(expected, actual, cmp); - if (ret) - return list_contains_all(actual, expected, rcmp); + return list_contains_all(expected, actual, cmp) && list_contains_all(actual, expected, rcmp); } @@ -152,12 +150,15 @@ bool is_equals_list(list *expected, list *actual, bool ignoreCase) bool is_instanceof(const char *type, dom_node *node) { assert("There is no instanceOf in the test-suite" == NULL); - + + (void)type; + (void)node; + return false; } -bool is_size_domnamednodemap(int size, dom_namednodemap *map) +bool is_size_domnamednodemap(unsigned long size, dom_namednodemap *map) { unsigned long len; dom_exception err; @@ -171,7 +172,7 @@ bool is_size_domnamednodemap(int size, dom_namednodemap *map) return size == len; } -bool is_size_domnodelist(int size, dom_nodelist *list) +bool is_size_domnodelist(unsigned long size, dom_nodelist *list) { unsigned long len; dom_exception err; @@ -185,7 +186,7 @@ bool is_size_domnodelist(int size, dom_nodelist *list) return size == len; } -bool is_size_list(int size, list *list) +bool is_size_list(unsigned long size, list *list) { return size == list->size; } @@ -224,12 +225,12 @@ bool has_feature(char *feature, char *version) bool ret; dom_string *df, *dv; - err = dom_string_create(myrealloc, NULL, feature, + err = dom_string_create(myrealloc, NULL, (const uint8_t *)feature, feature == NULL ? 0 : strlen(feature), &df); if (err != DOM_NO_ERR) return false; - err = dom_string_create(myrealloc, NULL, version, + err = dom_string_create(myrealloc, NULL, (const uint8_t *)version, version == NULL ? 0 : strlen(version), &dv); if (err != DOM_NO_ERR) { dom_string_unref(df); diff --git a/test/testutils/domtsasserts.h b/test/testutils/domtsasserts.h index a09603f..bb39fe5 100644 --- a/test/testutils/domtsasserts.h +++ b/test/testutils/domtsasserts.h @@ -45,9 +45,9 @@ bool is_equals_list(list *expected, list *actual, bool ignoreCase); bool is_instanceof(const char *type, dom_node *node); -bool is_size_domnamednodemap(int size, dom_namednodemap *map); -bool is_size_domnodelist(int size, dom_nodelist *list); -bool is_size_list(int size, list *list); +bool is_size_domnamednodemap(unsigned long size, dom_namednodemap *map); +bool is_size_domnodelist(unsigned long size, dom_nodelist *list); +bool is_size_list(unsigned long size, list *list); bool is_uri_equals(char *scheme, char *path, char *host, char *file, char *query, char *fragment, diff --git a/test/testutils/domtscondition.h b/test/testutils/domtscondition.h index 164977f..30da6cc 100644 --- a/test/testutils/domtscondition.h +++ b/test/testutils/domtscondition.h @@ -10,9 +10,28 @@ #include -inline bool less(int excepted, int actual); -inline bool less_or_equals(int excepted, int actual); -inline bool greater(int excepted, int actual); -inline bool greater_or_equals(int excepted, int actual); +/** + * Just simple functions which meet the needs of DOMTS conditions + */ + +static inline bool less(int excepted, int actual) +{ + return actual < excepted; +} + +static inline bool less_or_equals(int excepted, int actual) +{ + return actual <= excepted; +} + +static inline bool greater(int excepted, int actual) +{ + return actual > excepted; +} + +static inline bool greater_or_equals(int excepted, int actual) +{ + return actual >= excepted; +} #endif diff --git a/test/testutils/foreach.c b/test/testutils/foreach.c index c3868df..764920c 100644 --- a/test/testutils/foreach.c +++ b/test/testutils/foreach.c @@ -18,16 +18,19 @@ void foreach_initialise_domnodelist(dom_nodelist *list, unsigned int *iterator) { + (void)list; *iterator = 0; } void foreach_initialise_list(list *list, unsigned int *iterator) { + (void)list; *iterator = 0; } void foreach_initialise_domnamednodemap(dom_namednodemap *map, unsigned int *iterator) { + (void)map; *iterator = 0; } diff --git a/test/testutils/load.c b/test/testutils/load.c index 0028eb4..57e07ef 100644 --- a/test/testutils/load.c +++ b/test/testutils/load.c @@ -23,6 +23,7 @@ #include #include "utils.h" +#include "domts.h" /** * Load the file as it is a XML file @@ -30,14 +31,14 @@ * \param file The file path * \param willBeModified Whether this file will be modified, not used */ -dom_document *load_xml(char *file, bool willBeModified) +dom_document *load_xml(const char *file, bool willBeModified) { dom_xml_parser *parser = NULL; int handle; int readed; dom_xml_error error; dom_document *ret; - char buffer[1024]; + uint8_t buffer[1024]; UNUSED(willBeModified); @@ -92,18 +93,18 @@ dom_document *load_xml(char *file, bool willBeModified) * \param file The file path * \param willBeModified Whether this file will be modified, not used */ -dom_document *load_html(char *file, bool willBeModified) +dom_document *load_html(const char *file, bool willBeModified) { dom_hubbub_parser *parser = NULL; int handle; int readed; dom_hubbub_error error; dom_document *ret; - char buffer[1024]; + uint8_t buffer[1024]; UNUSED(willBeModified); - parser = dom_hubbub_parser_create("../data/Aliases", NULL, true, + parser = dom_hubbub_parser_create(NULL, true, myrealloc, NULL, mymsg, NULL); if (parser == NULL) { fprintf(stderr, "Can't create Hubbub Parser\n"); diff --git a/test/transform.pl b/test/transform.pl index 74d2f61..0c11d61 100755 --- a/test/transform.pl +++ b/test/transform.pl @@ -9,13 +9,15 @@ use warnings; use strict; +use lib qw(test); + use XML::Parser::PerlSAX; use DOMTSHandler; -if ($#ARGV ne 1) { - die "Usage: perl transform.pl dtd-file testcase-file"; +if ($#ARGV ne 2) { + die "Usage: perl transform.pl dtd-file testcase basedir testcase-file"; } -my $handler = DOMTSHandler->new($ARGV[0]); +my $handler = DOMTSHandler->new($ARGV[0], $ARGV[1]); my $parser = XML::Parser::PerlSAX->new(Handler => $handler); -$parser->parse(Source => {SystemId => "$ARGV[1]"}); +$parser->parse(Source => {SystemId => "$ARGV[2]"}); -- cgit v1.2.3