[pypy-commit] pypy default: of course since the tests are not where one expects, somebody made a new file

cfbolz noreply at buildbot.pypy.org
Fri Apr 4 11:20:06 CEST 2014


Author: Carl Friedrich Bolz <cfbolz at gmx.de>
Branch: 
Changeset: r70430:9d0e73ee9419
Date: 2014-04-04 11:18 +0200
http://bitbucket.org/pypy/pypy/changeset/9d0e73ee9419/

Log:	of course since the tests are not where one expects, somebody made a
	new file

diff --git a/rpython/jit/metainterp/optimizeopt/test/test_intbound.py b/rpython/jit/metainterp/optimizeopt/test/test_intbound.py
--- a/rpython/jit/metainterp/optimizeopt/test/test_intbound.py
+++ b/rpython/jit/metainterp/optimizeopt/test/test_intbound.py
@@ -1,5 +1,7 @@
 from rpython.jit.metainterp.optimizeopt.intutils import IntBound, IntUpperBound, \
      IntLowerBound, IntUnbounded
+from rpython.jit.metainterp.optimizeopt.intbounds import next_pow2_m1
+
 from copy import copy
 import sys
 from rpython.rlib.rarithmetic import LONG_BIT
@@ -235,8 +237,8 @@
         for shift_count_bound in (IntBound(7, LONG_BIT), IntBound(-7, 7)):
             #assert not b.lshift_bound(shift_count_bound).has_upper
             assert not b.rshift_bound(shift_count_bound).has_upper
-        
-    
+
+
 def test_div_bound():
     for _, _, b1 in some_bounds():
         for _, _, b2 in some_bounds():
@@ -258,7 +260,6 @@
     assert a.contains(0)
 
 
-
 def test_sub_bound():
     for _, _, b1 in some_bounds():
         for _, _, b2 in some_bounds():
@@ -271,3 +272,14 @@
     a=bound(2, 4).sub_bound(bound(1, 2))
     assert not a.contains(-1)
     assert not a.contains(4)
+
+
+def test_next_pow2_m1():
+    assert next_pow2_m1(0) == 0
+    assert next_pow2_m1(1) == 1
+    assert next_pow2_m1(7) == 7
+    assert next_pow2_m1(256) == 511
+    assert next_pow2_m1(255) == 255
+    assert next_pow2_m1(80) == 127
+    assert next_pow2_m1((1 << 32) - 5) == (1 << 32) - 1
+    assert next_pow2_m1((1 << 64) - 1) == (1 << 64) - 1
diff --git a/rpython/jit/metainterp/optimizeopt/test/test_intbounds.py b/rpython/jit/metainterp/optimizeopt/test/test_intbounds.py
deleted file mode 100644
--- a/rpython/jit/metainterp/optimizeopt/test/test_intbounds.py
+++ /dev/null
@@ -1,12 +0,0 @@
-from rpython.jit.metainterp.optimizeopt.intbounds import next_pow2_m1
-
-
-def test_next_pow2_m1():
-    assert next_pow2_m1(0) == 0
-    assert next_pow2_m1(1) == 1
-    assert next_pow2_m1(7) == 7
-    assert next_pow2_m1(256) == 511
-    assert next_pow2_m1(255) == 255
-    assert next_pow2_m1(80) == 127
-    assert next_pow2_m1((1 << 32) - 5) == (1 << 32) - 1
-    assert next_pow2_m1((1 << 64) - 1) == (1 << 64) - 1


More information about the pypy-commit mailing list