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

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


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

Log:	(arigo, antocuni): fix test_setinteriorfield_all_sizes, and make
	sure we test both the cases of stm_setinteriorfield 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
@@ -219,21 +219,21 @@
     return NULL
 
 
-def do_stm_setinteriorfield(argv):
+def _play_with_setinteriorfield_1(dummy_arg):
     change2(prebuilt_array_signed_signed, [500000, -10000000], [102101202])
     check2(prebuilt_array_signed_signed, [500000, -10000000, -50],
                                          [102101202, 20, -30])
     change2(prebuilt_array_char_char, ['a'], ['b'])
     check2(prebuilt_array_char_char, ['a', chr(255), chr(206)],
                                      ['b', chr(20), chr(226)])
-    #
-    rstm.transaction_boundary()
-    #
+    return NULL
+
+def _play_with_setinteriorfield_2(dummy_arg):
     check2(prebuilt_array_signed_signed, [500000, -10000000, -50],
                                          [102101202, 20, -30])
     check2(prebuilt_array_char_char, ['a', chr(255), chr(206)],
                                      ['b', chr(20), chr(226)])
-    return 0
+    return NULL
 
 
 # ____________________________________________________________
@@ -339,5 +339,22 @@
 
 
     def test_setinteriorfield_all_sizes(self):
+        def do_stm_setinteriorfield(argv):
+            _play_with_setinteriorfield_1(None)
+            _play_with_setinteriorfield_2(None)
+            return 0
         t, cbuilder = self.compile(do_stm_setinteriorfield)
         cbuilder.cmdexec('')
+
+    def test_setinteriorfield_all_sizes_inside_transaction(self):
+        def do_stm_setinteriorfield(argv):
+            callback1 = llhelper(CALLBACK, _play_with_setinteriorfield_1)
+            callback2 = llhelper(CALLBACK, _play_with_setinteriorfield_2)
+            #
+            descriptor_init()
+            perform_transaction(callback1, NULL)
+            perform_transaction(callback2, NULL)
+            descriptor_done()
+            return 0
+        t, cbuilder = self.compile(do_stm_setinteriorfield)
+        cbuilder.cmdexec('')


More information about the pypy-commit mailing list