[pypy-svn] r68757 - pypy/branch/gc-dump-heap/pypy/translator/c/test

fijal at codespeak.net fijal at codespeak.net
Mon Oct 26 16:24:42 CET 2009


Author: fijal
Date: Mon Oct 26 16:24:42 2009
New Revision: 68757

Modified:
   pypy/branch/gc-dump-heap/pypy/translator/c/test/test_newgc.py
Log:
fix the test


Modified: pypy/branch/gc-dump-heap/pypy/translator/c/test/test_newgc.py
==============================================================================
--- pypy/branch/gc-dump-heap/pypy/translator/c/test/test_newgc.py	(original)
+++ pypy/branch/gc-dump-heap/pypy/translator/c/test/test_newgc.py	Mon Oct 26 16:24:42 2009
@@ -902,14 +902,16 @@
 
     def define_gc_dump_heap(cls):
         S = lltype.GcStruct('S', ('x', lltype.Signed))
-        l = []
+        l1 = []
+        l2 = []
+        l3 = []
         
         def f():
-            fd = os.open("/tmp/x.log", os.O_WRONLY | os.O_CREAT, 0777)
             for i in range(10):
-                l.append(lltype.malloc(S))
-            rgc.dump_heap(fd)
-            os.close(fd)
+                s = lltype.malloc(S)
+                l1.append(s)
+                l2.append(s)
+                l3.append(s)
             tb = rgc._dump_heap()
             a = 0
             nr = 0
@@ -920,17 +922,17 @@
                     a += 1
                     nr = i
             for i in range(len(tb)):
-                if tb[i].count == 1:
+                if tb[i].count == 3:
                     b += 1
                     c += tb[i].links[nr]
             # we don't count b here since there can be more singletons,
             # important one is c, a is for check
-            return c * 10 + a
+            return c * 100 + b * 10 + a
         return f
 
     def test_gc_dump_heap(self):
         res = self.run("gc_dump_heap")
-        assert res == 101
+        assert res == 3011
 
     def definestr_string_builder(cls):
         def fn(_):



More information about the Pypy-commit mailing list