Author: Hakan Ardo <[email protected]>
Branch: extradoc
Changeset: r4528:267e1be02959
Date: 2012-08-12 20:33 +0200
http://bitbucket.org/pypy/extradoc/changeset/267e1be02959/

Log:    test for ArrayList

diff --git a/talk/iwtc11/benchmarks/test_scimark.py 
b/talk/iwtc11/benchmarks/test_scimark.py
--- a/talk/iwtc11/benchmarks/test_scimark.py
+++ b/talk/iwtc11/benchmarks/test_scimark.py
@@ -1,4 +1,4 @@
-from scimark import SOR_execute, Array2D, Random, MonteCarlo_integrate
+from scimark import SOR_execute, Array2D, ArrayList, Random, 
MonteCarlo_integrate
 from cffi import FFI
 import os
 
@@ -22,15 +22,21 @@
     extra_objects=[os.path.join(os.getcwd(), 'scimark', f) 
                    for f in ['SOR.c', 'Random.c', 'MonteCarlo.c']])
 
-def test_SOR():
-    width, height = 5, 7
-    rnd = C.new_Random_seed(7)
-    a = C.RandomMatrix(height, width, rnd)
-    b = Array2D(width, height, data=a)
-    C.SOR_execute(height, width, 1.25, a, 42)
-    SOR_execute(1.25, b, 42)
-    for x, y in b.indexes():
-        assert a[y][x] == b[x, y]
+class TestWithArray2D(object):
+    Array = Array2D
+
+    def test_SOR(self):
+        width, height = 5, 7
+        rnd = C.new_Random_seed(7)
+        a = C.RandomMatrix(height, width, rnd)
+        b = self.Array(width, height, data=a)
+        C.SOR_execute(height, width, 1.25, a, 42)
+        SOR_execute(1.25, b, 42)
+        for x, y in b.indexes():
+            assert a[y][x] == b[x, y]
+
+class TestWithArrayList(TestWithArray2D):
+    Array = ArrayList
 
 def test_random():
     rnd_C = C.new_Random_seed(7)
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to