1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-03-09 04:58:16 +03:00

558452 fight with reg test and error report

* relaxng.c: tiny fix and provide more context on some errors
* result/relaxng/558452_0* test/relaxng/558452*: add some regression
  tests for the bugs
* Makefile.am runtest.c: fight with the fact streaming error messages
  can differ due to missing node context
This commit is contained in:
Daniel Veillard 2009-08-26 18:37:43 +02:00
parent fd78077281
commit ec18c96008
21 changed files with 61 additions and 2 deletions

View File

@ -1053,7 +1053,7 @@ Relaxtests: xmllint$(EXEEXT)
> res.$$name 2> err.$$name;\
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
diff $(srcdir)/result/relaxng/"$$name"_"$$xno" res.$$name;\
if [ "$$name" != "tutor10_1" -a "$$name" != "tutor10_2" -a "$$name" != "tutor3_2" -a "$$name" != "307377" ] ; then \
if [ "$$name" != "tutor10_1" -a "$$name" != "tutor10_2" -a "$$name" != "tutor3_2" -a "$$name" != "307377" -a "$$name" != "tutor8_2" ] ; then \
diff $(srcdir)/result/relaxng/"$$name"_"$$xno".err \
err.$$name | grep -v "error detected at";\
fi ; grep Unimplemented err.$$name`; \

View File

@ -2374,6 +2374,9 @@ xmlRelaxNGAddValidError(xmlRelaxNGValidCtxtPtr ctxt,
} else {
node = seq = NULL;
}
if ((node == NULL) && (seq == NULL)) {
node = ctxt->pnode;
}
xmlRelaxNGShowValidError(ctxt, err, node, seq, arg1, arg2);
}
/*
@ -4682,6 +4685,7 @@ xmlRelaxNGParseImportRefs(xmlRelaxNGParserCtxtPtr ctxt,
return(-1);
}
xmlHashScan(grammar->refs, xmlRelaxNGParseImportRef, ctxt);
return(0);
}
/**

0
result/relaxng/558452_0 Normal file
View File

View File

@ -0,0 +1 @@
./test/relaxng/558452_0.xml validates

0
result/relaxng/558452_1 Normal file
View File

View File

@ -0,0 +1,2 @@
./test/relaxng/558452_1.xml:2: element doc: Relax-NG validity error : Expecting an element , got nothing
./test/relaxng/558452_1.xml fails to validate

0
result/relaxng/558452_2 Normal file
View File

View File

@ -0,0 +1 @@
./test/relaxng/558452_2.xml validates

0
result/relaxng/558452_3 Normal file
View File

View File

@ -0,0 +1 @@
./test/relaxng/558452_3.xml validates

0
result/relaxng/558452_4 Normal file
View File

View File

@ -0,0 +1,2 @@
./test/relaxng/558452_4.xml:6: element elem: Relax-NG validity error : Did not expect element elem there
./test/relaxng/558452_4.xml fails to validate

View File

@ -0,0 +1 @@
./test/relaxng/558452.rng validates

View File

View File

@ -3257,7 +3257,8 @@ rngStreamTest(const char *filename,
* hack is also done in the Makefile
*/
if ((!strcmp(prefix, "tutor10_1")) || (!strcmp(prefix, "tutor10_2")) ||
(!strcmp(prefix, "tutor3_2")) || (!strcmp(prefix, "307377")))
(!strcmp(prefix, "tutor3_2")) || (!strcmp(prefix, "307377")) ||
(!strcmp(prefix, "tutor8_2")))
disable_err = 1;
snprintf(pattern, 499, "./test/relaxng/%s_?.xml", prefix);

21
test/relaxng/558452.rng Normal file
View File

@ -0,0 +1,21 @@
<?xml version="1.0"?>
<grammar ns="http://www.example.com/choice"
xmlns="http://relaxng.org/ns/structure/1.0">
<start>
<element name="doc" ns="">
<ref name="elem"/>
<optional>
<ref name="elem"/>
<optional>
<ref name="elem"/>
</optional>
</optional>
</element>
</start>
<define name="elem">
<element name="elem" ns="">
<text/>
</element>
</define>
</grammar>

View File

@ -0,0 +1,6 @@
<?xml version="1.0"?>
<doc>
<elem/>
<elem/>
<elem/>
</doc>

View File

@ -0,0 +1,3 @@
<?xml version="1.0"?>
<doc>
</doc>

View File

@ -0,0 +1,4 @@
<?xml version="1.0"?>
<doc>
<elem/>
</doc>

View File

@ -0,0 +1,5 @@
<?xml version="1.0"?>
<doc>
<elem/>
<elem/>
</doc>

View File

@ -0,0 +1,7 @@
<?xml version="1.0"?>
<doc>
<elem/>
<elem/>
<elem/>
<elem/>
</doc>