[pypy-svn] r54926 - pypy/branch/win32port/pypy/translator/c/test

afa at codespeak.net afa at codespeak.net
Mon May 19 14:08:34 CEST 2008


Author: afa
Date: Mon May 19 14:08:33 2008
New Revision: 54926

Modified:
   pypy/branch/win32port/pypy/translator/c/test/test_newgc.py
Log:
Allow test_newgc to pass on win32


Modified: pypy/branch/win32port/pypy/translator/c/test/test_newgc.py
==============================================================================
--- pypy/branch/win32port/pypy/translator/c/test/test_newgc.py	(original)
+++ pypy/branch/win32port/pypy/translator/c/test/test_newgc.py	Mon May 19 14:08:33 2008
@@ -17,13 +17,14 @@
     from pypy.config.pypyoption import get_pypy_config
     config = get_pypy_config(translating=True)
     config.translation.gc = gcpolicy
+    config.translation.countmallocs = True
     if t is None:
         t = TranslationContext(config=config)
     if inputtypes is not None:
         t.buildannotator().build_types(fn, inputtypes)
         t.buildrtyper().specialize()
     builder = genc.CExtModuleBuilder(t, fn, config=config)
-    builder.generate_source(defines={'COUNT_OP_MALLOCS': 1})
+    builder.generate_source()
     builder.compile()
     if conftest.option.view:
         t.view()
@@ -817,11 +818,13 @@
     def test_callback_with_collect(self):
         from pypy.rlib.libffi import ffi_type_pointer, cast_type_to_ffitype,\
              CDLL, ffi_type_void, CallbackFuncPtr, ffi_type_sint
-        from pypy.rpython.lltypesystem import rffi
+        from pypy.rpython.lltypesystem import rffi, ll2ctypes
         from pypy.rlib import rgc
         import gc
         slong = cast_type_to_ffitype(rffi.LONG)
 
+        libc_name = ll2ctypes.get_libc_name()
+
         def callback(ll_args, ll_res, stuff):
             gc.collect()
             p_a1 = rffi.cast(rffi.VOIDPP, ll_args[0])[0]
@@ -835,7 +838,7 @@
                 res[0] = -1
 
         def f():
-            libc = CDLL('libc.so.6')
+            libc = CDLL(libc_name)
             qsort = libc.getpointer('qsort', [ffi_type_pointer, slong,
                                               slong, ffi_type_pointer],
                                 ffi_type_void)



More information about the Pypy-commit mailing list