diff options
author | Marc-André Lemburg <mal@egenix.com> | 2001-01-17 19:11:13 (GMT) |
---|---|---|
committer | Marc-André Lemburg <mal@egenix.com> | 2001-01-17 19:11:13 (GMT) |
commit | 3661908a6ac75026e4504d9f62a6ac2e2fb2ec5e (patch) | |
tree | eea0f44df59aaaf014eb4580f1fad308e31601bf /Lib/test/test_long.py | |
parent | 8551dd60781f738e5e5ef4e22b6f071d27e20b50 (diff) | |
download | cpython-3661908a6ac75026e4504d9f62a6ac2e2fb2ec5e.zip cpython-3661908a6ac75026e4504d9f62a6ac2e2fb2ec5e.tar.gz cpython-3661908a6ac75026e4504d9f62a6ac2e2fb2ec5e.tar.bz2 |
This patch removes all uses of "assert" in the regression test suite
and replaces them with a new API verify(). As a result the regression
suite will also perform its tests in optimization mode.
Written by Marc-Andre Lemburg. Copyright assigned to Guido van Rossum.
Diffstat (limited to 'Lib/test/test_long.py')
-rw-r--r-- | Lib/test/test_long.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/test/test_long.py b/Lib/test/test_long.py index 5e0e001..1059ef6 100644 --- a/Lib/test/test_long.py +++ b/Lib/test/test_long.py @@ -1,4 +1,4 @@ -from test_support import TestFailed, verbose +from test_support import verify, verbose, TestFailed from string import join from random import random, randint @@ -41,7 +41,7 @@ def check(ok, *args): # The sign of the number is also random. def getran(ndigits): - assert ndigits > 0 + verify(ndigits > 0) nbits_hi = ndigits * SHIFT nbits_lo = nbits_hi - SHIFT + 1 answer = 0L @@ -50,13 +50,13 @@ def getran(ndigits): while nbits < nbits_lo: bits = (r >> 1) + 1 bits = min(bits, nbits_hi - nbits) - assert 1 <= bits <= SHIFT + verify(1 <= bits <= SHIFT) nbits = nbits + bits answer = answer << bits if r & 1: answer = answer | ((1 << bits) - 1) r = int(random() * (SHIFT * 2)) - assert nbits_lo <= nbits <= nbits_hi + verify(nbits_lo <= nbits <= nbits_hi) if random() < 0.5: answer = -answer return answer |