[libxslt] Treat XSLT_STATE_STOPPED same as errors
- From: Nick Wellnhofer <nwellnhof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libxslt] Treat XSLT_STATE_STOPPED same as errors
- Date: Tue, 21 Jun 2016 12:21:21 +0000 (UTC)
commit 5816849ebefa457337a954f55f5380572355f891
Author: Nick Wellnhofer <wellnhofer aevum de>
Date: Fri Jun 3 17:36:17 2016 +0200
Treat XSLT_STATE_STOPPED same as errors
xsltApplyStylesheetInternal should treat a stopped transform the same
as an error that didn't stop the transform and return NULL.
Changes the output of some tests that cause errors.
libxslt/transform.c | 2 +-
tests/documents/message.result | 1 +
tests/exslt/saxon/Makefile.am | 14 +++++---------
tests/exslt/saxon/eval.2.err | 1 +
tests/exslt/saxon/eval.2.out | 2 --
tests/exslt/saxon/eval.3.err | 1 +
tests/exslt/saxon/eval.3.out | 2 --
tests/general/bug-165.err | 1 +
tests/general/bug-165.out | 8 --------
tests/general/bug-180.err | 1 +
tests/general/bug-184.err | 1 +
tests/general/bug-184.out | 2 --
12 files changed, 12 insertions(+), 24 deletions(-)
---
diff --git a/libxslt/transform.c b/libxslt/transform.c
index f0e168c..6b2000e 100644
--- a/libxslt/transform.c
+++ b/libxslt/transform.c
@@ -6151,7 +6151,7 @@ xsltApplyStylesheetInternal(xsltStylesheetPtr style, xmlDocPtr doc,
/*
* Be pedantic.
*/
- if ((ctxt != NULL) && (ctxt->state == XSLT_STATE_ERROR)) {
+ if ((ctxt != NULL) && (ctxt->state != XSLT_STATE_OK)) {
xmlFreeDoc(res);
res = NULL;
}
diff --git a/tests/documents/message.result b/tests/documents/message.result
index 0dbde5b..965a84b 100644
--- a/tests/documents/message.result
+++ b/tests/documents/message.result
@@ -1,2 +1,3 @@
A simple message
A fatal message
+no result for ./message.xml
diff --git a/tests/exslt/saxon/Makefile.am b/tests/exslt/saxon/Makefile.am
index 9e7b316..3ef3a2c 100644
--- a/tests/exslt/saxon/Makefile.am
+++ b/tests/exslt/saxon/Makefile.am
@@ -29,15 +29,11 @@ test tests: $(top_builddir)/xsltproc/xsltproc
mv $$name.bad $(srcdir)/$$name.err ; \
fi ; \
else \
- if [ ! -s $$name.res ] ; then \
- echo "Fatal error, no $$name.res\n" ; \
- else \
- diff $(srcdir)/$$name.out $$name.res ; \
- if [ -s $(srcdir)/$$name.err ] ; then \
- diff $(srcdir)/$$name.err $$name.bad; \
- else \
- diff /dev/null $$name.bad; \
- fi ; \
+ diff $(srcdir)/$$name.out $$name.res ; \
+ if [ -s $(srcdir)/$$name.err ] ; then \
+ diff $(srcdir)/$$name.err $$name.bad; \
+ else \
+ diff /dev/null $$name.bad; \
fi ; \
fi; \
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" || true`;\
diff --git a/tests/exslt/saxon/eval.2.err b/tests/exslt/saxon/eval.2.err
index df8adfb..6cb392f 100644
--- a/tests/exslt/saxon/eval.2.err
+++ b/tests/exslt/saxon/eval.2.err
@@ -5,3 +5,4 @@ XPath error : Invalid expression
xmlXPathCompiledEval: evaluation failed
runtime error: file ./eval.2.xsl line 11 element value-of
XPath evaluation returned no result.
+no result for ./eval.2.xml
diff --git a/tests/exslt/saxon/eval.2.out b/tests/exslt/saxon/eval.2.out
index 3048a90..e69de29 100644
--- a/tests/exslt/saxon/eval.2.out
+++ b/tests/exslt/saxon/eval.2.out
@@ -1,2 +0,0 @@
-<?xml version="1.0"?>
-<results/>
diff --git a/tests/exslt/saxon/eval.3.err b/tests/exslt/saxon/eval.3.err
index 5a87793..22b5de7 100644
--- a/tests/exslt/saxon/eval.3.err
+++ b/tests/exslt/saxon/eval.3.err
@@ -4,3 +4,4 @@ XPath error : Invalid expression
xmlXPathCompiledEval: evaluation failed
runtime error: file ./eval.3.xsl line 11 element value-of
XPath evaluation returned no result.
+no result for ./eval.3.xml
diff --git a/tests/exslt/saxon/eval.3.out b/tests/exslt/saxon/eval.3.out
index 3048a90..e69de29 100644
--- a/tests/exslt/saxon/eval.3.out
+++ b/tests/exslt/saxon/eval.3.out
@@ -1,2 +0,0 @@
-<?xml version="1.0"?>
-<results/>
diff --git a/tests/general/bug-165.err b/tests/general/bug-165.err
index d7564e2..490fe53 100644
--- a/tests/general/bug-165.err
+++ b/tests/general/bug-165.err
@@ -2,3 +2,4 @@ runtime error: file ./bug-165.xsl line 6 element value-of
Variable 'pStyle' has not been declared.
runtime error: file ./bug-165.xsl line 6 element value-of
XPath evaluation returned no result.
+no result for ./../docs/bug-165.xml
diff --git a/tests/general/bug-165.out b/tests/general/bug-165.out
index 0d7d44b..e69de29 100644
--- a/tests/general/bug-165.out
+++ b/tests/general/bug-165.out
@@ -1,8 +0,0 @@
-<?xml version="1.0"?>
-
-
-
-
-
-
-
diff --git a/tests/general/bug-180.err b/tests/general/bug-180.err
index e0e568e..6dd9bb2 100644
--- a/tests/general/bug-180.err
+++ b/tests/general/bug-180.err
@@ -1,2 +1,3 @@
runtime error: file ./bug-180.xsl line 4 element copy-of
Variable 'xxx' has not been declared.
+no result for ./../docs/bug-180.xml
diff --git a/tests/general/bug-184.err b/tests/general/bug-184.err
index ec5e912..b0d5c21 100644
--- a/tests/general/bug-184.err
+++ b/tests/general/bug-184.err
@@ -3,3 +3,4 @@ Variable 'nonexistent' has not been declared.
xmlXPathCompiledEval: 1 objects left on the stack.
runtime error: file ./bug-184.xsl line 5 element value-of
XPath evaluation returned no result.
+no result for ./../docs/bug-184.xml
diff --git a/tests/general/bug-184.out b/tests/general/bug-184.out
index e829790..e69de29 100644
--- a/tests/general/bug-184.out
+++ b/tests/general/bug-184.out
@@ -1,2 +0,0 @@
-<?xml version="1.0"?>
-<result/>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]