[ctypes-commit] ctypes/ctypes/test test_loading.py,1.11,1.12
Brought to you by:
theller
From: Thomas H. <th...@us...> - 2006-04-05 17:08:52
|
Update of /cvsroot/ctypes/ctypes/ctypes/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23770 Modified Files: test_loading.py Log Message: Try to fix this test. Index: test_loading.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/ctypes/test/test_loading.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** test_loading.py 5 Apr 2006 14:05:33 -0000 1.11 --- test_loading.py 5 Apr 2006 17:08:44 -0000 1.12 *************** *** 28,44 **** cdll.load(os.path.basename(libc_name)) self.assertRaises(OSError, cdll.load, self.unknowndll) - else: - print "Warning: libc not found" ! def test_load_version(self): ! version = "6" ! name = "c" ! if sys.platform == "linux2": ! cdll.load_version(name, version) # linux uses version, libc 9 should not exist self.assertRaises(OSError, cdll.load_version, name, "9") ! self.assertRaises(OSError, cdll.load_version, self.unknowndll, "") ! if os.name == "posix" and sys.platform != "sunos5": def test_find(self): name = "c" --- 28,40 ---- cdll.load(os.path.basename(libc_name)) self.assertRaises(OSError, cdll.load, self.unknowndll) ! if libc_name is not None and "libc.so.6" in libc_name: ! def test_load_version(self): ! cdll.load_version("c", "6") # linux uses version, libc 9 should not exist self.assertRaises(OSError, cdll.load_version, name, "9") ! self.assertRaises(OSError, cdll.load_version, self.unknowndll, "") ! ## if os.name == "posix" and sys.platform != "sunos5": def test_find(self): name = "c" *************** *** 46,61 **** self.assertRaises(OSError, cdll.find, self.unknowndll) ! def test_load_library(self): ! if os.name == "nt": ! windll.load_library("kernel32").GetModuleHandleW ! windll.LoadLibrary("kernel32").GetModuleHandleW ! WinDLL("kernel32").GetModuleHandleW ! elif os.name == "ce": ! windll.load_library("coredll").GetModuleHandleW ! windll.LoadLibrary("coredll").GetModuleHandleW ! WinDLL("coredll").GetModuleHandleW ! def test_load_ordinal_functions(self): ! if os.name in ("nt", "ce"): import _ctypes_test dll = WinDLL(_ctypes_test.__file__) --- 42,57 ---- self.assertRaises(OSError, cdll.find, self.unknowndll) ! if os.name in ("nt", "ce"): ! def test_load_library(self): ! if os.name == "nt": ! windll.load_library("kernel32").GetModuleHandleW ! windll.LoadLibrary("kernel32").GetModuleHandleW ! WinDLL("kernel32").GetModuleHandleW ! elif os.name == "ce": ! windll.load_library("coredll").GetModuleHandleW ! windll.LoadLibrary("coredll").GetModuleHandleW ! WinDLL("coredll").GetModuleHandleW ! def test_load_ordinal_functions(self): import _ctypes_test dll = WinDLL(_ctypes_test.__file__) |