[pypy-svn] r46673 - pypy/dist/pypy/jit/codegen/i386/test
arigo at codespeak.net
arigo at codespeak.net
Sun Sep 16 11:52:58 CEST 2007
Author: arigo
Date: Sun Sep 16 11:52:57 2007
New Revision: 46673
Modified:
pypy/dist/pypy/jit/codegen/i386/test/test_codebuf.py
Log:
An extra test for 'free', which is otherwise only called by a __del__
(exceptions there are ignored and don't show up as test failures).
Modified: pypy/dist/pypy/jit/codegen/i386/test/test_codebuf.py
==============================================================================
--- pypy/dist/pypy/jit/codegen/i386/test/test_codebuf.py (original)
+++ pypy/dist/pypy/jit/codegen/i386/test/test_codebuf.py Sun Sep 16 11:52:57 2007
@@ -1,7 +1,16 @@
from pypy.jit.codegen.i386.ri386 import *
-from pypy.jit.codegen.i386.codebuf import MachineCodeBlock
+from pypy.jit.codegen.i386.codebuf import MachineCodeBlock, memhandler
+def test_alloc_free():
+ map_size = 65536
+ data = memhandler.alloc(map_size)
+ for i in range(0, map_size, 171):
+ data[i] = chr(i & 0xff)
+ for i in range(0, map_size, 171):
+ assert data[i] == chr(i & 0xff)
+ memhandler.free(data, map_size)
+
def test_machinecodeblock():
mc = MachineCodeBlock(4096)
mc.MOV(eax, mem(esp, 4))
More information about the Pypy-commit
mailing list