From 357c960e4035ee2fb40d0072bb7bde4533be76f8 Mon Sep 17 00:00:00 2001 From: Daniel Veillard Date: Thu, 3 May 2001 10:49:20 +0000 Subject: [PATCH] - xpath.c result/XPath/expr/floats : clarified and cleanup printing of abnormal floats in tests. Daniel --- ChangeLog | 5 +++++ Makefile.am | 17 +++++++++-------- configure.in | 3 +-- result/XPath/expr/floats | 6 +++--- xpath.c | 15 ++++++++++++++- 5 files changed, 32 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index a73a6395..d658c57c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Thu May 3 12:47:46 CEST 2001 Daniel Veillard + + * xpath.c result/XPath/expr/floats : clarified and cleanup + printing of abnormal floats in tests. + Thu May 3 10:25:19 CEST 2001 Daniel Veillard * HTMLparser.c: trying to fix the problem reported by Jonas Borgström diff --git a/Makefile.am b/Makefile.am index 84858bd2..c0823f25 100644 --- a/Makefile.am +++ b/Makefile.am @@ -83,7 +83,7 @@ testall : tests SVGtests SAXtests tests: XMLtests XMLenttests HTMLtests Validtests URItests XPathtests XPtrtests XIncludetests HTMLtests : testHTML - @(rm -f .memdump ; touch .memdump) + @(echo > .memdump) @echo "##" @echo "## HTML regression tests" @echo "##" @@ -159,7 +159,7 @@ HTMLtests : testHTML XMLtests : xmllint - @(rm -f .memdump ; touch .memdump) + @(echo > .memdump) @echo "##" @echo "## XML regression tests" @echo "##" @@ -201,7 +201,7 @@ XMLtests : xmllint fi ; fi ; done) XMLenttests : xmllint - @(rm -f .memdump ; touch .memdump) + @(echo > .memdump) @echo "##" @echo "## XML entity subst regression tests" @echo "##" @@ -221,7 +221,7 @@ XMLenttests : xmllint fi ; fi ; done) URItests : testURI - @(rm -f .memdump ; touch .memdump) + @(echo > .memdump) @echo "##" @echo "## URI module regression tests" @echo "##" @@ -253,7 +253,7 @@ URItests : testURI fi ; fi ; done) XPathtests : testXPath - @(rm -f .memdump ; touch .memdump) + @(echo > .memdump) @echo "##" @echo "## XPath regression tests" @echo "##" @@ -291,7 +291,7 @@ XPathtests : testXPath fi ; fi ; done ; fi ; done) XPtrtests : testXPath - @(rm -f .memdump ; touch .memdump) + @(echo > .memdump) @echo "##" @echo "## XPointer regression tests" @echo "##" @@ -314,7 +314,7 @@ XPtrtests : testXPath fi ; fi ; done ; fi ; done) XIncludetests : xmllint - @(rm -f .memdump ; touch .memdump) + @(echo > .memdump) @echo "##" @echo "## XInclude regression tests" @echo "##" @@ -352,6 +352,7 @@ SVGtests : xmllint fi ; fi ; done) SAXtests : testSAX + @(echo > .memdump) @echo "##" @echo "## SAX callbacks regression tests" @echo "##" @@ -370,7 +371,7 @@ SAXtests : testSAX Validtests : xmllint - @(rm -f .memdump ; touch .memdump) + @(echo > .memdump) @echo "##" @echo "## Valid documents regression tests" @echo "##" diff --git a/configure.in b/configure.in index bc90bbc3..64775d2c 100644 --- a/configure.in +++ b/configure.in @@ -155,6 +155,7 @@ dnl dnl Extra flags dnl XML_CFLAGS="" +RDL_LIBS="" dnl dnl Workaround for native compilers @@ -230,8 +231,6 @@ else fi LDFLAGS=${_ldflags} -AC_SUBST(RDL_LIBS) - dnl dnl specific tests to setup DV's devel environment with debug etc ... dnl diff --git a/result/XPath/expr/floats b/result/XPath/expr/floats index 7d1e750b..c121b8e9 100644 --- a/result/XPath/expr/floats +++ b/result/XPath/expr/floats @@ -25,15 +25,15 @@ Object is a number : 0.00123 ======================== Expression: 1 div 0 -Object is a number : inf +Object is a number : +Infinity ======================== Expression: -1 div 0 -Object is a number : -inf +Object is a number : -Infinity ======================== Expression: 0 div 0 -Object is a number : nan +Object is a number : NaN ======================== Expression: (1 div 0) > 0 diff --git a/xpath.c b/xpath.c index 5c83a8d8..910e2cc3 100644 --- a/xpath.c +++ b/xpath.c @@ -597,7 +597,20 @@ xmlXPathDebugDumpObject(FILE *output, xmlXPathObjectPtr cur, int depth) { else fprintf(output, "false\n"); break; case XPATH_NUMBER: - fprintf(output, "Object is a number : %0g\n", cur->floatval); + switch (isinf(cur->floatval)) { + case 1: + fprintf(output, "Object is a number : +Infinity\n"); + break; + case -1: + fprintf(output, "Object is a number : -Infinity\n"); + break; + default: + if (isnan(cur->floatval)) { + fprintf(output, "Object is a number : NaN\n"); + } else { + fprintf(output, "Object is a number : %0g\n", cur->floatval); + } + } break; case XPATH_STRING: fprintf(output, "Object is a string : ");