fn:format-number failures (at least 19)

Bug #1123164 reported by Sorin Marian Nasoi
32
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Zorba
Fix Released
High
Paul J. Lucas

Bug Description

The following 19 test cases fail in "fn-format-number" test set:
"numberformat14,numberformat15,numberformat34,numberformat38,numberformat40,numberformat41,numberformat42,numberformat60a,numberformat60m,numberformat60o,numberformat60q,numberformat63,numberformat64,numberformat70,numberformat71,numberformat81,numberformat83,numberformat87,numberformat88"

The attached report was generated using:
./zorba -f -q ../../test/fots_driver/cli.xq -e mode:=run-test-sets -e testSetPrefixes:=fn-format-number -e verbose:=true -o results_fn-format-number.xml --indent --disable-http-resolution

Related branches

Revision history for this message
Paul J. Lucas (paul-lucas) wrote :

paulbook<1>$ ./zorba -f -q ../../test/fots_driver/cli.xq -e mode:=run-test-sets -e testSetPrefixes:=fn-format-number -e verbose:=true -o results_fn-format-number.xml --indent --disable-http-resolution
'testSetPrefixes' was set to: [1]: fn-format-number
'testCasePrefixes' was set to: [1]:
'dependency' set to: [1]:
'verbose' set to: [1]: true
Cli command was set to: [1]: run-test-sets
Path to FOTS catalog.xml was set to: [1]: ../../build/test/fots/2011/QT3-test-suite/catalog.xml
Path to FOTSZorbaManifest set to : [1]: FOTSZorbaManifest.xml
Path to ExpectedFailures.xml set to: [1]:
</Users/pjl/src/flwor/zorba/repo/trunk/zorba/test/fots_driver/fots-driver.xq>:418,5: user-defined error [err:FODC0002]:
Please make sure the passed 'fotsPath' points to the exact location of the FOTS catalog.xml:
file:///Users/pjl/src/flwor/zorba/repo/trunk/zorba/build/test/fots/2011/QT3-test-suite/catalog.xml
 that the passed 'fotsZorbaManifestPath' points to a file in the same folder as cli.xq:
file:///Users/pjl/src/flwor/zorba/repo/trunk/zorba/test/fots_driver/FOTSZorbaManifest.xml
 that the passed 'expectedFailuresPath' points to the ExpectedFailures.xml file:
; raised at /Users/pjl/src/flwor/zorba/repo/trunk/zorba/src/runtime/errors_and_diagnostics/errors_and_diagnostics_impl.cpp:81

Revision history for this message
Sorin Marian Nasoi (sorin.marian.nasoi) wrote :

http://my.zorba-xquery.com/dokuwiki/doku.php?id=zorba_fots_testing

Beforehand please run:
make fots-import
make fots-activate-sets

Revision history for this message
Paul J. Lucas (paul-lucas) wrote :

I don't understand the results. For example, the output file says that the test "numberformat14" failed. First, it doesn't say what the expected test output is. Second, if I run the query by hand:

    xquery version "3.0";
    declare default decimal-format infinity="off-the-scale" ;

    format-number(1 div 0e0,'###############################')

I get the result:

    Infinity

which seems like it could be the correct answer.

Revision history for this message
Sorin Marian Nasoi (sorin.marian.nasoi) wrote :
Revision history for this message
Sorin Marian Nasoi (sorin.marian.nasoi) wrote :

Hi Paul,
first of all please read the thread "new FOTS bugs opened" on @zorba-dev.

Now, about your questions:
1) sry. but I uploaded the wrong report: that is fixed now
2) wrt. test "numberformat14"

Please check out the 'info' node in the detailed report:

<fots:info>
 <fots:query>[...]</fots:query>
 <fots:expected-result>
    <assert-string-value>off-the-scale</assert-string-value>
 </fots:expected-result>
 <fots:result>Infinity</fots:result>
 <fots:errors>'assert-string-value' returned: result different from expected result.</fots:errors>
</fots:info>

The 'expected-result' is an 'assert-string-value' with value 'off-the-scale'.
The actual result in inside 'result' node, meaning string 'Infinity' in this case.
The 'errors' node describes the errors returned when the assertions were run, in this case 'assert-string-value'.

Now, as you can see, the test case declares a decimal format (please see http://www.w3.org/TR/xquery-30/#id-decimal-format-decl).
In this case, this means that instead 'Infinity' one should return 'off-the-scale'.

Please send me an email if you have any more questions/remarks.

HTH.

Revision history for this message
Paul J. Lucas (paul-lucas) wrote :

Can you cite the spec that says that the expected result MUST be "off-the-scale"?

Revision history for this message
Sorin Marian Nasoi (sorin.marian.nasoi) wrote :

Paul I am not saying that the tests are correct, as already stated into one of the wiki's I created:
http://my.zorba-xquery.com/dokuwiki/doku.php?id=zorba_fots_driver#reporting_bugs

The test cases fail because one of the following 3 situations (or a combination of them):
- FOTS driver is wrong
- Zorba returns incorrect result
- test case in FOTS is wrong

I only triaged around 700 out of the 1011 failing FOTS tests and created some bugs assigned to the persons I thought know more about the code in question.

The bug was assigned to you because, IMHO, you know that code better than the rest, so you can make the decision.

In this particular case, if I am not missing something, Zorba returns incorrect result because:

According to:
http://www.w3.org/TR/xquery-30/#id-decimal-format-decl
"A decimal format declaration adds a decimal format to the statically known decimal formats, which define the properties used to format numbers using the fn:format-number() function"

and in
http://www.w3.org/TR/xquery-30/#dt-static-decimal-formats :
"[Definition: infinity specifies the string used for the infinity-symbol; the default value is the string "Infinity"]"

HTH

Revision history for this message
Paul J. Lucas (paul-lucas) wrote :

Your comment doesn't answer my question. I can not find anywhere in any XQuery specification where it says the result should be the literal string "off-the-scale". If I am correct and no such result MUST be returned, then I don't understand how you can think that Zorba returns the incorrect result.

Revision history for this message
Sorin Marian Nasoi (sorin.marian.nasoi) wrote :

The query in question is:

xquery version "3.0";
declare default decimal-format infinity="off-the-scale" ;
format-number(1 div 0e0,'###############################')

right?

The meaning of the second line:
declare default decimal-format infinity="off-the-scale" ;
according to the specs cited above is to replace the default value ("Infinity") used for the infinity-symbol with the string "off-the-scale".

What am I missing: are the cited specs optional ?

What do you mean by "I can not find anywhere in any XQuery specification where it says the result should be the literal string "off-the-scale""
I just pointed out the spec twice...

Revision history for this message
Paul J. Lucas (paul-lucas) wrote :

Never mind.

Revision history for this message
Sorin Marian Nasoi (sorin.marian.nasoi) wrote :

I do not get it ...

Please let me know: what did I miss ?

Changed in zorba:
status: New → In Progress
description: updated
summary: - FOTS: fn:format-number failures (at least 20 failures)
+ FOTS: fn:format-number failures (at least 19) failures)
Chris Hillery (ceejatec)
Changed in zorba:
milestone: none → 2.9
importance: Undecided → High
summary: - FOTS: fn:format-number failures (at least 19) failures)
+ fn:format-number failures (at least 19) failures)
summary: - fn:format-number failures (at least 19) failures)
+ fn:format-number failures (at least 19)
tags: added: function-library
Changed in zorba:
status: In Progress → Fix Committed
Changed in zorba:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.