[pypy-svn] r78649 - pypy/trunk/lib_pypy/pypy_test
afa at codespeak.net
afa at codespeak.net
Tue Nov 2 21:17:16 CET 2010
Author: afa
Date: Tue Nov 2 21:17:03 2010
New Revision: 78649
Modified:
pypy/trunk/lib_pypy/pypy_test/test_ctypes_support.py
Log:
Fix test on Windows
Modified: pypy/trunk/lib_pypy/pypy_test/test_ctypes_support.py
==============================================================================
--- pypy/trunk/lib_pypy/pypy_test/test_ctypes_support.py (original)
+++ pypy/trunk/lib_pypy/pypy_test/test_ctypes_support.py Tue Nov 2 21:17:03 2010
@@ -22,12 +22,11 @@
assert get_errno() == 0
def test_argument_conversion_and_checks():
- import ctypes
- libc = ctypes.cdll.LoadLibrary("libc.so.6")
- libc.strlen.argtypes = ctypes.c_char_p,
- libc.strlen.restype = ctypes.c_size_t
- assert libc.strlen("eggs") == 4
-
+ strlen = standard_c_lib.strlen
+ strlen.argtypes = [c_char_p]
+ strlen.restype = c_size_t
+ assert strlen("eggs") == 4
+
# Should raise ArgumentError, not segfault
- py.test.raises(ctypes.ArgumentError, libc.strlen, False)
+ py.test.raises(ArgumentError, strlen, False)
More information about the Pypy-commit
mailing list