[pypy-svn] r47649 - pypy/dist/pypy/rpython/memory/test

cfbolz at codespeak.net cfbolz at codespeak.net
Sat Oct 20 19:33:49 CEST 2007


Author: cfbolz
Date: Sat Oct 20 19:33:48 2007
New Revision: 47649

Modified:
   pypy/dist/pypy/rpython/memory/test/test_transformed_gc.py
Log:
same test (passing) for transformed GCs


Modified: pypy/dist/pypy/rpython/memory/test/test_transformed_gc.py
==============================================================================
--- pypy/dist/pypy/rpython/memory/test/test_transformed_gc.py	(original)
+++ pypy/dist/pypy/rpython/memory/test/test_transformed_gc.py	Sat Oct 20 19:33:48 2007
@@ -178,6 +178,21 @@
         heap_size = self.heap_usage(statistics)
         assert heap_size < 16000 * INT_SIZE / 4 # xxx
 
+    def test_nongc_static_root(self):
+        from pypy.rpython.lltypesystem import lltype
+        T1 = lltype.GcStruct("C", ('x', lltype.Signed))
+        T2 = lltype.Struct("C", ('p', lltype.Ptr(T1)))
+        static = lltype.malloc(T2, immortal=True)
+        def f():
+            t1 = lltype.malloc(T1)
+            t1.x = 42
+            static.p = t1
+            llop.gc__collect(lltype.Void)
+            return static.p.x
+        run = self.runner(f, nbargs=0)
+        res = run([])
+        assert res == 42
+
     def test_finalizer(self):
         class B(object):
             pass



More information about the Pypy-commit mailing list