[pypy-commit] pypy stm: (arigo, antocuni): fix test_getinteriorfield_all_sizes, and make sure we test both the cases of stm_getinteriorfield inside and outside a transaction

antocuni noreply at buildbot.pypy.org
Mon Jan 16 16:31:02 CET 2012


Author: Antonio Cuni <anto.cuni at gmail.com>
Branch: stm
Changeset: r51349:e7847828c029
Date: 2012-01-16 16:27 +0100
http://bitbucket.org/pypy/pypy/changeset/e7847828c029/

Log:	(arigo, antocuni): fix test_getinteriorfield_all_sizes, and make
	sure we test both the cases of stm_getinteriorfield inside and
	outside a transaction

diff --git a/pypy/translator/stm/test/test_funcgen.py b/pypy/translator/stm/test/test_funcgen.py
--- a/pypy/translator/stm/test/test_funcgen.py
+++ b/pypy/translator/stm/test/test_funcgen.py
@@ -212,11 +212,12 @@
         array[i].y = rffi.cast(lltype.typeOf(array).TO.OF.y, newvalues2[i])
 change2._annspecialcase_ = 'specialize:ll'
 
-def do_stm_getinteriorfield(argv):
+def _play_with_getinteriorfield(dummy_arg):
     check2(prebuilt_array_signed_signed, [1, -1, -50], [10, 20, -30])
     check2(prebuilt_array_char_char, [chr(1), chr(255), chr(206)],
                                      [chr(10), chr(20), chr(226)])
-    return 0
+    return NULL
+
 
 def do_stm_setinteriorfield(argv):
     change2(prebuilt_array_signed_signed, [500000, -10000000], [102101202])
@@ -320,9 +321,23 @@
         cbuilder.cmdexec('')
 
     def test_getinteriorfield_all_sizes(self):
+        def do_stm_getinteriorfield(argv):
+            _play_with_getinteriorfield(None)
+            return 0
         t, cbuilder = self.compile(do_stm_getinteriorfield)
         cbuilder.cmdexec('')
 
+    def test_getinteriorfield_all_sizes_inside_transaction(self):
+        def do_stm_getinteriorfield(argv):
+            callback = llhelper(CALLBACK, _play_with_getinteriorfield)
+            descriptor_init()
+            perform_transaction(callback, NULL)
+            descriptor_done()
+            return 0
+        t, cbuilder = self.compile(do_stm_getinteriorfield)
+        cbuilder.cmdexec('')
+
+
     def test_setinteriorfield_all_sizes(self):
         t, cbuilder = self.compile(do_stm_setinteriorfield)
         cbuilder.cmdexec('')


More information about the pypy-commit mailing list