[ctypes-commit] ctypes/unittests test_win32.py,1.9,1.10 test_values.py,1.12,1.13 test_slicing.py,1.3
Brought to you by:
theller
From: Thomas H. <th...@us...> - 2004-10-14 13:16:25
|
Update of /cvsroot/ctypes/ctypes/unittests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14923 Modified Files: test_win32.py test_values.py test_slicing.py test_returnfuncptrs.py test_refcounts.py test_prototypes.py test_pointers.py test_functions.py test_callbacks.py Log Message: Use the debug version of the test dll, when running a debug build. Index: test_win32.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/unittests/test_win32.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** test_win32.py 28 Jul 2004 12:56:55 -0000 1.9 --- test_win32.py 14 Oct 2004 13:16:13 -0000 1.10 *************** *** 5,17 **** def find_test_dll(): ! import sys, os ! if os.name == "nt": ! name = "_ctypes_test.pyd" ! else: ! name = "_ctypes_test.so" ! for p in sys.path: ! f = os.path.join(p, name) ! if os.path.isfile(f): ! return f if sys.platform == "win32": --- 5,10 ---- def find_test_dll(): ! import _ctypes_test ! return _ctypes_test.__file__ if sys.platform == "win32": Index: test_returnfuncptrs.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/unittests/test_returnfuncptrs.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** test_returnfuncptrs.py 16 Sep 2004 10:30:28 -0000 1.7 --- test_returnfuncptrs.py 14 Oct 2004 13:16:13 -0000 1.8 *************** *** 3,15 **** def find_test_dll(): ! import sys, os ! if os.name == "nt": ! name = "_ctypes_test.pyd" ! else: ! name = "_ctypes_test.so" ! for p in sys.path: ! f = os.path.join(p, name) ! if os.path.isfile(f): ! return f class ReturnFuncPtrTestCase(unittest.TestCase): --- 3,8 ---- def find_test_dll(): ! import _ctypes_test ! return _ctypes_test.__file__ class ReturnFuncPtrTestCase(unittest.TestCase): Index: test_refcounts.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/unittests/test_refcounts.py,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** test_refcounts.py 28 Jul 2004 12:56:55 -0000 1.15 --- test_refcounts.py 14 Oct 2004 13:16:13 -0000 1.16 *************** *** 6,20 **** OtherCallback = ctypes.CFUNCTYPE(ctypes.c_int, ctypes.c_int, ctypes.c_ulonglong) ! def find_test_dll(): ! import sys, os ! if os.name == "nt": ! name = "_ctypes_test.pyd" ! else: ! name = "_ctypes_test.so" ! for p in sys.path: ! f = os.path.join(p, name) ! if os.path.isfile(f): ! return f ! dll = ctypes.CDLL(find_test_dll()) class RefcountTestCase(unittest.TestCase): --- 6,11 ---- OtherCallback = ctypes.CFUNCTYPE(ctypes.c_int, ctypes.c_int, ctypes.c_ulonglong) ! import _ctypes_test ! dll = ctypes.CDLL(_ctypes_test.__file__) class RefcountTestCase(unittest.TestCase): Index: test_values.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/unittests/test_values.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** test_values.py 28 Jul 2004 12:56:55 -0000 1.12 --- test_values.py 14 Oct 2004 13:16:13 -0000 1.13 *************** *** 6,18 **** from ctypes import * def find_test_dll(): ! import sys, os ! if os.name == "nt": ! name = "_ctypes_test.pyd" ! else: ! name = "_ctypes_test.so" ! for p in sys.path: ! f = os.path.join(p, name) ! if os.path.isfile(f): ! return f class ValuesTestCase(unittest.TestCase): --- 6,11 ---- from ctypes import * def find_test_dll(): ! import _ctypes_test ! return _ctypes_test.__file__ class ValuesTestCase(unittest.TestCase): Index: test_slicing.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/unittests/test_slicing.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** test_slicing.py 12 Oct 2004 19:11:52 -0000 1.3 --- test_slicing.py 14 Oct 2004 13:16:13 -0000 1.4 *************** *** 3,15 **** def find_test_dll(): ! import sys, os ! if os.name == "nt": ! name = "_ctypes_test.pyd" ! else: ! name = "_ctypes_test.so" ! for p in sys.path: ! f = os.path.join(p, name) ! if os.path.isfile(f): ! return f class SlicesTestCase(unittest.TestCase): --- 3,8 ---- def find_test_dll(): ! import _ctypes_test ! return _ctypes_test.__file__ class SlicesTestCase(unittest.TestCase): Index: test_prototypes.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/unittests/test_prototypes.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** test_prototypes.py 16 Sep 2004 10:30:28 -0000 1.5 --- test_prototypes.py 14 Oct 2004 13:16:13 -0000 1.6 *************** *** 22,36 **** # In this case, there would have to be an additional reference to the argument... ! def find_test_dll(): ! import sys, os ! if os.name == "nt": ! name = "_ctypes_test.pyd" ! else: ! name = "_ctypes_test.so" ! for p in sys.path: ! f = os.path.join(p, name) ! if os.path.isfile(f): ! return f ! testdll = CDLL(find_test_dll()) def c_wbuffer(init): --- 22,27 ---- # In this case, there would have to be an additional reference to the argument... ! import _ctypes_test ! testdll = CDLL(_ctypes_test.__file__) def c_wbuffer(init): Index: test_pointers.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/unittests/test_pointers.py,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** test_pointers.py 28 Jul 2004 12:56:55 -0000 1.15 --- test_pointers.py 14 Oct 2004 13:16:13 -0000 1.16 *************** *** 3,15 **** from ctypes import * def find_test_dll(): ! import sys, os ! if os.name == "nt": ! name = "_ctypes_test.pyd" ! else: ! name = "_ctypes_test.so" ! for p in sys.path: ! f = os.path.join(p, name) ! if os.path.isfile(f): ! return f ctype_types = [c_byte, c_ubyte, c_short, c_ushort, c_int, c_uint, --- 3,8 ---- from ctypes import * def find_test_dll(): ! import _ctypes_test ! return _ctypes_test.__file__ ctype_types = [c_byte, c_ubyte, c_short, c_ushort, c_int, c_uint, Index: test_functions.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/unittests/test_functions.py,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** test_functions.py 16 Sep 2004 10:30:28 -0000 1.37 --- test_functions.py 14 Oct 2004 13:16:13 -0000 1.38 *************** *** 16,28 **** def find_test_dll(): ! import sys, os ! if os.name == "nt": ! name = "_ctypes_test.pyd" ! else: ! name = "_ctypes_test.so" ! for p in sys.path: ! f = os.path.join(p, name) ! if os.path.isfile(f): ! return f class FunctionTestCase(unittest.TestCase): --- 16,21 ---- def find_test_dll(): ! import _ctypes_test ! return _ctypes_test.__file__ class FunctionTestCase(unittest.TestCase): Index: test_callbacks.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/unittests/test_callbacks.py,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** test_callbacks.py 28 Jul 2004 12:56:55 -0000 1.19 --- test_callbacks.py 14 Oct 2004 13:16:13 -0000 1.20 *************** *** 1,4 **** --- 1,5 ---- import unittest from ctypes import * + import _ctypes_test class Callbacks(unittest.TestCase): *************** *** 106,125 **** ################################################################ - def find_test_dll(): - import sys, os - if os.name == "nt": - name = "_ctypes_test.pyd" - else: - name = "_ctypes_test.so" - for p in sys.path: - f = os.path.join(p, name) - if os.path.isfile(f): - return f - class SampleCallbacksTestCase(unittest.TestCase): def test_integrate(self): # Derived from some then non-working code, posted by David Foster ! dll = CDLL(find_test_dll()) # The function prototype called by 'integrate': double func(double); --- 107,115 ---- ################################################################ class SampleCallbacksTestCase(unittest.TestCase): def test_integrate(self): # Derived from some then non-working code, posted by David Foster ! dll = CDLL(_ctypes_test.__file__) # The function prototype called by 'integrate': double func(double); |