[pypy-svn] r31606 - pypy/branch/no-zeroing-assumption/pypy/translator/c/test

mwh at codespeak.net mwh at codespeak.net
Thu Aug 24 15:22:50 CEST 2006


Author: mwh
Date: Thu Aug 24 15:22:49 2006
New Revision: 31606

Modified:
   pypy/branch/no-zeroing-assumption/pypy/translator/c/test/test_newgc.py
Log:
(mwh, ac)
add a test that fails when we fill raw_malloced memory with garbage 
(none of the others do!)


Modified: pypy/branch/no-zeroing-assumption/pypy/translator/c/test/test_newgc.py
==============================================================================
--- pypy/branch/no-zeroing-assumption/pypy/translator/c/test/test_newgc.py	(original)
+++ pypy/branch/no-zeroing-assumption/pypy/translator/c/test/test_newgc.py	Thu Aug 24 15:22:49 2006
@@ -849,6 +849,19 @@
         res = fn()
         assert res == 10
 
+    def test_framework_late_filling_pointers(self):
+        A = lltype.GcStruct('A', ('x', lltype.Signed))
+        B = lltype.GcStruct('B', ('a', lltype.Ptr(A)))
+
+        def f():
+            p = lltype.malloc(B)
+            llop.gc__collect(lltype.Void)
+            p.a = lltype.malloc(A)
+            return p.a.x
+        fn = self.getcompiled(f)
+        res = fn()
+        assert res == 123
+
 class TestUsingStacklessFramework(TestUsingFramework):
     from pypy.translator.c.gc import StacklessFrameworkGcPolicy as gcpolicy
 



More information about the Pypy-commit mailing list