<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>19783</bug_id>
          
          <creation_ts>2012-10-30 16:06:14 +0000</creation_ts>
          <short_desc>Math tests that use namespace prefixes in the assertions</short_desc>
          <delta_ts>2012-11-14 12:18:31 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>XPath / XQuery / XSLT</product>
          <component>XQuery 3 &amp; XPath 3 Test Suite</component>
          <version>Working drafts</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Sorin Nasoi">spungi</reporter>
          <assigned_to name="O&apos;Neil Delpratt">oneil</assigned_to>
          <cc>mike</cc>
    
    <cc>tim</cc>
          
          <qa_contact name="Mailing list for public feedback on specs from XSL and XML Query WGs">public-qt-comments</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>77433</commentid>
    <comment_count>0</comment_count>
    <who name="Sorin Nasoi">spungi</who>
    <bug_when>2012-10-30 16:06:14 +0000</bug_when>
    <thetext>There are several test cases in the &apos;math&apos; folder where there are prefixes used in the assertions.
AFAIK the assertions are to be checked using an &apos;empty&apos;/&apos;default&apos; environment, not in the same environment where the actual test is run.

Something like:
&lt;result&gt;
  &lt;assert-eq&gt;math:pi()&lt;/assert-eq&gt;
&lt;/result&gt;
is wrong because the &apos;math&apos; namespace binding is not defined &apos;by default&apos;.


Below please find a test case example from &apos;math-atan2&apos; test set:

&lt;test-case name=&quot;math-atan2-003&quot;&gt;
 &lt;description&gt;Evaluate the function math:atan2() with the arguments +0.0e0 and -0.0e0&lt;/description&gt;
 &lt;created by=&quot;O&apos;Neil Delpratt, Saxonica&quot; on=&quot;2010-12-10&quot;/&gt;        
 &lt;environment ref=&quot;math&quot;/&gt;        
 &lt;test&gt;math:atan2(+0.0e0, -0.0e0)&lt;/test&gt;
 &lt;result&gt;
   &lt;assert-eq&gt;math:pi()&lt;/assert-eq&gt;
 &lt;/result&gt;
&lt;/test-case&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>77669</commentid>
    <comment_count>1</comment_count>
    <who name="Sorin Nasoi">spungi</who>
    <bug_when>2012-11-01 15:21:26 +0000</bug_when>
    <thetext>As discussed, here is a list of test cases that I propose for investigation:

- &quot;math-atan2&quot; test set, &quot;math-atan2-003&quot;,&quot;math-atan2-004&quot;,&quot;math-atan2-005&quot;,&quot;math-atan2-006&quot;,&quot;math-atan2-007&quot;,&quot;math-atan2-008&quot;

- &quot;math-pi&quot; test set,&quot;math-pi-002&quot;

- &quot;prod-CastExpr.schema&quot; test set, &quot;user-defined-1&quot;,&quot;user-defined-6&quot;,&quot;user-defined-8&quot;  the result is sizeType(1) but the sizeType is part of a schema that is not in the &quot;assert-eq&quot; environment

- &quot;prod-ModuleImport&quot; test set, &quot;errata6-003&quot; - the result, 8, is of type hatsize defined in the schema from the test environment. Assert-eq does not have access to that schema.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>78040</commentid>
    <comment_count>2</comment_count>
    <who name="O&apos;Neil Delpratt">oneil</who>
    <bug_when>2012-11-08 12:44:23 +0000</bug_when>
    <thetext>Bug fixes done and committed to cvs.

(In reply to comment #1)
&gt; As discussed, here is a list of test cases that I propose for investigation:
&gt; 
&gt; - &quot;math-atan2&quot; test set,
&gt; &quot;math-atan2-003&quot;,&quot;math-atan2-004&quot;,&quot;math-atan2-005&quot;,&quot;math-atan2-006&quot;,&quot;math-
&gt; atan2-007&quot;,&quot;math-atan2-008&quot;
&gt; - &quot;math-pi&quot; test set,&quot;math-pi-002&quot;

Made the change as suggested by Mike Kay, i.e.:
&lt;assert&gt;abs($result - 7.38905609893065e0) lt 1e-14&lt;/assert&gt;

&gt; - &quot;prod-CastExpr.schema&quot; test set,
&gt; &quot;user-defined-1&quot;,&quot;user-defined-6&quot;,&quot;user-defined-8&quot;  the result is
&gt; sizeType(1) but the sizeType is part of a schema that is not in the
&gt; &quot;assert-eq&quot; environment
&gt; - &quot;prod-ModuleImport&quot; test set, &quot;errata6-003&quot; - the result, 8, is of type
&gt; hatsize defined in the schema from the test environment. Assert-eq does not
&gt; have access to that schema.

Moved the assertion within the test cases using an eq operator.
Expected result for these tests is now &lt;assert-true/&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>78043</commentid>
    <comment_count>3</comment_count>
    <who name="Tim Mills">tim</who>
    <bug_when>2012-11-08 13:34:45 +0000</bug_when>
    <thetext>There is an error in math-atan2-004.

In

        &lt;test&gt;math:atan2(-0.0e0, -0.0e0)&lt;/test&gt;
        &lt;result&gt;
            &lt;assert&gt;abs($result - 3.141592653589793e0) lt 1e-14&lt;/assert&gt;
        &lt;/result&gt;

According to Wikipedia, atan2(−0, −0) = −π

So the assertion should be

&lt;assert&gt;abs($result + 3.141592653589793e0) lt 1e-14&lt;/assert&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>78045</commentid>
    <comment_count>4</comment_count>
    <who name="O&apos;Neil Delpratt">oneil</who>
    <bug_when>2012-11-08 14:21:17 +0000</bug_when>
    <thetext>(In reply to comment #3) 
&gt; &lt;assert&gt;abs($result + 3.141592653589793e0) lt 1e-14&lt;/assert&gt;

Change done accordingly to comment #3</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>78305</commentid>
    <comment_count>5</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2012-11-14 12:18:31 +0000</bug_when>
    <thetext>Please note that we take our specifications of trigonometrical functions from IEEE 754-2008, not from Wikipedia. In edge cases and at singularities, there are differences between different specifications of these functions. However, I have checked this one and IEEE also has atan2(-0, -0) = −π.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>