Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(14)

Side by Side Diff: Lib/ctypes/test/test_functions.py

Issue 3871: cross and native build of python for mingw32 with distutils
Patch Set: Created 7 years, 2 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Lib/ctypes/test/test_as_parameter.py ('k') | Lib/ctypes/util.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 """ 1 """
2 Here is probably the place to write the docs, since the test-cases 2 Here is probably the place to write the docs, since the test-cases
3 show how the type behave. 3 show how the type behave.
4 4
5 Later... 5 Later...
6 """ 6 """
7 7
8 from ctypes import * 8 from ctypes import *
9 import sys, unittest 9 import sys, unittest
10 10
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 def test_struct_return_2H_stdcall(self): 352 def test_struct_return_2H_stdcall(self):
353 class S2H(Structure): 353 class S2H(Structure):
354 _fields_ = [("x", c_short), 354 _fields_ = [("x", c_short),
355 ("y", c_short)] 355 ("y", c_short)]
356 356
357 windll.s_ret_2h_func.restype = S2H 357 windll.s_ret_2h_func.restype = S2H
358 windll.s_ret_2h_func.argtypes = [S2H] 358 windll.s_ret_2h_func.argtypes = [S2H]
359 s2h = windll.s_ret_2h_func(S2H(99, 88)) 359 s2h = windll.s_ret_2h_func(S2H(99, 88))
360 self.assertEqual((s2h.x, s2h.y), (99*2, 88*3)) 360 self.assertEqual((s2h.x, s2h.y), (99*2, 88*3))
361 361
362 # This is known cdecl incompatibility between GCC
363 # and MSVC. It is addressed in GCC issue #36834.
364 # Python libffi detect it and complain.
365 @unittest.skipIf(sys.platform == "win32" and sys.version.find("GCC") >= 0, ' XFAIL GCC(mingw)')
362 def test_struct_return_8H(self): 366 def test_struct_return_8H(self):
363 class S8I(Structure): 367 class S8I(Structure):
364 _fields_ = [("a", c_int), 368 _fields_ = [("a", c_int),
365 ("b", c_int), 369 ("b", c_int),
366 ("c", c_int), 370 ("c", c_int),
367 ("d", c_int), 371 ("d", c_int),
368 ("e", c_int), 372 ("e", c_int),
369 ("f", c_int), 373 ("f", c_int),
370 ("g", c_int), 374 ("g", c_int),
371 ("h", c_int)] 375 ("h", c_int)]
(...skipping 27 matching lines...) Expand all
399 403
400 proto = CFUNCTYPE(c_int, RECT, POINT) 404 proto = CFUNCTYPE(c_int, RECT, POINT)
401 def callback(*args): 405 def callback(*args):
402 return 0 406 return 0
403 407
404 callback = proto(callback) 408 callback = proto(callback)
405 self.assertRaises(ArgumentError, lambda: callback((1, 2, 3, 4), POINT()) ) 409 self.assertRaises(ArgumentError, lambda: callback((1, 2, 3, 4), POINT()) )
406 410
407 if __name__ == '__main__': 411 if __name__ == '__main__':
408 unittest.main() 412 unittest.main()
OLDNEW
« no previous file with comments | « Lib/ctypes/test/test_as_parameter.py ('k') | Lib/ctypes/util.py » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+