[Python-checkins] python/nondist/sandbox/twister test_random.py,1.2,1.3

rhettinger@users.sourceforge.net rhettinger@users.sourceforge.net
Sat, 28 Dec 2002 18:15:59 -0800


Update of /cvsroot/python/python/nondist/sandbox/twister
In directory sc8-pr-cvs1:/tmp/cvs-serv6717

Modified Files:
	test_random.py 
Log Message:
Reverted back to high precision testing against the reference implemenation.
GvR pointed out that my single precision fears were unfounded.  After all,
a C double is a C double.  Still, I only go out to 14 places in case
something weird happens to the LSB.  The point of the test is to assure
that the generator matches the reference implementation.  Any agreement
at all (high or low precision) indicates fidelity to the original.



Index: test_random.py
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/twister/test_random.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** test_random.py	28 Dec 2002 21:18:08 -0000	1.2
--- test_random.py	29 Dec 2002 02:15:56 -0000	1.3
***************
*** 102,106 ****
          actual = self.randomlist(2000)[-10:]
          for a, e in zip(actual, expected):
!             self.assertEqual(round(a-e, 7), 0)
  
  class TestModule(unittest.TestCase):
--- 102,106 ----
          actual = self.randomlist(2000)[-10:]
          for a, e in zip(actual, expected):
!             self.assertEqual(round(a-e, 14), 0)
  
  class TestModule(unittest.TestCase):