This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 28229 - [QT3TS] misc-RandomNumberGenerator rnd-001
Summary: [QT3TS] misc-RandomNumberGenerator rnd-001
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XQuery 3 & XPath 3 Test Suite (show other bugs)
Version: Working drafts
Hardware: PC Windows NT
: P2 normal
Target Milestone: ---
Assignee: Loren Cahlander
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-03-16 17:30 UTC by Debbie Lockett
Modified: 2015-04-22 10:49 UTC (History)
2 users (show)

See Also:


Attachments

Description Debbie Lockett 2015-03-16 17:30:41 UTC
Firstly, this test could be moved to the fn-random-number-generator test set.

Secondly, the return statement of the test says:
return if (not(count(distinct-values($r)) > 0.5*count($r)))
         then fn:error(fn:random-number-generator, '')
         else if (not(not(deep-equal($r, fn:sort($r)))))
         then fn:error(fn:random-number-generator, '')
         else if (not(count($r[. lt 0.5]) > 0.2*count($r) and count($r[. gt 0.5]) > 0.2*count($r)))
         then fn:error(fn:random-number-generator, '')
         else fn:true()

But the arguments to fn:error() do not make sense. I'm not quite sure what the intention was. Should the test even be throwing errors if the spec says (last paragraph of 4.9.1. Notes):
"The specification does not place strong conformance requirements on the actual randomness of the result..."
Comment 1 Michael Kay 2015-03-16 18:07:32 UTC
I think the idea of testing for conditions that strongly suggest a very high probability of non-randomness is reasonable enough. The problems are in the execution.

The fn:error() paths would be better written to simply return false().

And yes, the test should be in test set fn-random-number-generator.
Comment 2 O'Neil Delpratt 2015-04-14 16:18:16 UTC
I am assigning this bug to Loren to resolve.
Comment 3 Loren Cahlander 2015-04-21 15:47:45 UTC
Test cases have been updated.
Comment 4 O'Neil Delpratt 2015-04-22 10:49:33 UTC
Confirmed that it has now been fixed