From 95f6e42ef766d5dd8e1e4038cffd870eebb36635 Mon Sep 17 00:00:00 2001 From: Daniel Veillard Date: Thu, 22 Nov 2001 18:10:38 +0000 Subject: [PATCH] fixed xsltDebug() to output with the normal error routines updated the * libxslt/extra.c: fixed xsltDebug() to output with the normal error routines * tests/namespaces/*: updated the tests to separate stdout and stderr * libxslt/transform.c: increasing xsltMaxDepth to 5000 Daniel --- ChangeLog | 8 ++++++++ libxslt/extra.c | 35 ++++++++++++++++++++--------------- libxslt/transform.c | 10 +--------- tests/namespaces/Makefile.am | 5 ++++- tests/namespaces/extra.err | 0 tests/namespaces/extra2.err | 3 +++ tests/namespaces/extra2.out | 3 --- tests/namespaces/tst.err | 0 tests/namespaces/tst2.err | 0 tests/namespaces/tst3.err | 0 tests/namespaces/tst4.err | 0 11 files changed, 36 insertions(+), 28 deletions(-) create mode 100644 tests/namespaces/extra.err create mode 100644 tests/namespaces/extra2.err create mode 100644 tests/namespaces/tst.err create mode 100644 tests/namespaces/tst2.err create mode 100644 tests/namespaces/tst3.err create mode 100644 tests/namespaces/tst4.err diff --git a/ChangeLog b/ChangeLog index 9186ec2..81392e6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +Thu Nov 22 19:08:23 CET 2001 Daniel Veillard + + * libxslt/extra.c: fixed xsltDebug() to output with the normal + error routines + * tests/namespaces/*: updated the tests to separate stdout and + stderr + * libxslt/transform.c: increasing xsltMaxDepth to 5000 + Thu Nov 22 12:09:56 CET 2001 Daniel Veillard * configure.in libexslt/Makefile.am: more Makefile fixups diff --git a/libxslt/extra.c b/libxslt/extra.c index f0620b3..eae261d 100644 --- a/libxslt/extra.c +++ b/libxslt/extra.c @@ -61,45 +61,50 @@ xsltDebug(xsltTransformContextPtr ctxt, xmlNodePtr node ATTRIBUTE_UNUSED, { int i, j; - fprintf(stdout, "Templates:\n"); + xsltGenericError(xsltGenericErrorContext, "Templates:\n"); for (i = 0, j = ctxt->templNr - 1; ((i < 15) && (j >= 0)); i++, j--) { - fprintf(stdout, "#%d ", i); + xsltGenericError(xsltGenericErrorContext, "#%d ", i); if (ctxt->templTab[j]->name != NULL) - fprintf(stdout, "name %s ", ctxt->templTab[j]->name); + xsltGenericError(xsltGenericErrorContext, "name %s ", + ctxt->templTab[j]->name); if (ctxt->templTab[j]->match != NULL) - fprintf(stdout, "name %s ", ctxt->templTab[j]->match); + xsltGenericError(xsltGenericErrorContext, "name %s ", + ctxt->templTab[j]->match); if (ctxt->templTab[j]->mode != NULL) - fprintf(stdout, "name %s ", ctxt->templTab[j]->mode); - fprintf(stdout, "\n"); + xsltGenericError(xsltGenericErrorContext, "name %s ", + ctxt->templTab[j]->mode); + xsltGenericError(xsltGenericErrorContext, "\n"); } - fprintf(stdout, "Variables:\n"); + xsltGenericError(xsltGenericErrorContext, "Variables:\n"); for (i = 0, j = ctxt->varsNr - 1; ((i < 15) && (j >= 0)); i++, j--) { xsltStackElemPtr cur; if (ctxt->varsTab[j] == NULL) continue; - fprintf(stdout, "#%d\n", i); + xsltGenericError(xsltGenericErrorContext, "#%d\n", i); cur = ctxt->varsTab[j]; while (cur != NULL) { if (cur->comp == NULL) { - fprintf(stdout, "corrupted !!!\n"); + xsltGenericError(xsltGenericErrorContext, + "corrupted !!!\n"); } else if (cur->comp->type == XSLT_FUNC_PARAM) { - fprintf(stdout, "param "); + xsltGenericError(xsltGenericErrorContext, "param "); } else if (cur->comp->type == XSLT_FUNC_VARIABLE) { - fprintf(stdout, "var "); + xsltGenericError(xsltGenericErrorContext, "var "); } if (cur->name != NULL) - fprintf(stdout, "%s ", cur->name); + xsltGenericError(xsltGenericErrorContext, "%s ", + cur->name); else - fprintf(stdout, "noname !!!!"); + xsltGenericError(xsltGenericErrorContext, "noname !!!!"); #ifdef LIBXML_DEBUG_ENABLED if (cur->value != NULL) { xmlXPathDebugDumpObject(stdout, cur->value, 1); } else { - fprintf(stdout, "NULL !!!!"); + xsltGenericError(xsltGenericErrorContext, "NULL !!!!"); } #endif - fprintf(stdout, "\n"); + xsltGenericError(xsltGenericErrorContext, "\n"); cur = cur->next; } diff --git a/libxslt/transform.c b/libxslt/transform.c index a18cf33..2fa4eee 100644 --- a/libxslt/transform.c +++ b/libxslt/transform.c @@ -62,19 +62,11 @@ static int xsltGetHTMLIDs(const xmlChar *version, const xmlChar **publicID, #endif #ifdef WITH_DEBUGGER - -/* -- breakpoint code --- */ #include "../breakpoint/breakpoint.h" - int xslDebugStatus; - -/* -------- end ---------- */ #endif - - - -int xsltMaxDepth = 500; +int xsltMaxDepth = 5000; /* * Useful macros diff --git a/tests/namespaces/Makefile.am b/tests/namespaces/Makefile.am index be74b48..1e31b31 100644 --- a/tests/namespaces/Makefile.am +++ b/tests/namespaces/Makefile.am @@ -21,10 +21,13 @@ test tests: $(top_builddir)/xsltproc/xsltproc if [ -d $$j ] ; then continue ; fi ; \ name="`basename $$j .xsl`"; \ out=$(srcdir)/"$$name".out; \ + err=$(srcdir)/"$$name".err; \ echo $$j ; \ - $(top_builddir)/xsltproc/xsltproc $$j $$i > result.$$name;\ + $(top_builddir)/xsltproc/xsltproc $$j $$i > result.$$name 2>err.$$name;\ if [ ! -f $$out ] ; then cp result.$$name $$out ; \ else diff $$out result.$$name ; fi ; \ + if [ ! -f $$err ] ; then cp err.$$name $$err ; \ + else diff $$err err.$$name ; fi ; \ grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" || true;\ rm -f result.$$name ; \ done) diff --git a/tests/namespaces/extra.err b/tests/namespaces/extra.err new file mode 100644 index 0000000..e69de29 diff --git a/tests/namespaces/extra2.err b/tests/namespaces/extra2.err new file mode 100644 index 0000000..a1c21e5 --- /dev/null +++ b/tests/namespaces/extra2.err @@ -0,0 +1,3 @@ +Templates: +#0 name / +Variables: diff --git a/tests/namespaces/extra2.out b/tests/namespaces/extra2.out index a1c21e5..e69de29 100644 --- a/tests/namespaces/extra2.out +++ b/tests/namespaces/extra2.out @@ -1,3 +0,0 @@ -Templates: -#0 name / -Variables: diff --git a/tests/namespaces/tst.err b/tests/namespaces/tst.err new file mode 100644 index 0000000..e69de29 diff --git a/tests/namespaces/tst2.err b/tests/namespaces/tst2.err new file mode 100644 index 0000000..e69de29 diff --git a/tests/namespaces/tst3.err b/tests/namespaces/tst3.err new file mode 100644 index 0000000..e69de29 diff --git a/tests/namespaces/tst4.err b/tests/namespaces/tst4.err new file mode 100644 index 0000000..e69de29 -- 2.7.4