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

Side by Side Diff: Lib/ctypes/test/test_as_parameter.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 | « Include/pythonrun.h ('k') | Lib/ctypes/test/test_functions.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 import unittest 1 import unittest
2 from ctypes import * 2 from ctypes import *
3 import _ctypes_test 3 import _ctypes_test
4 import sys
4 5
5 dll = CDLL(_ctypes_test.__file__) 6 dll = CDLL(_ctypes_test.__file__)
6 7
7 try: 8 try:
8 CALLBACK_FUNCTYPE = WINFUNCTYPE 9 CALLBACK_FUNCTYPE = WINFUNCTYPE
9 except NameError: 10 except NameError:
10 # fake to enable this test on Linux 11 # fake to enable this test on Linux
11 CALLBACK_FUNCTYPE = CFUNCTYPE 12 CALLBACK_FUNCTYPE = CFUNCTYPE
12 13
13 class POINT(Structure): 14 class POINT(Structure):
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 def test_struct_return_2H(self): 165 def test_struct_return_2H(self):
165 class S2H(Structure): 166 class S2H(Structure):
166 _fields_ = [("x", c_short), 167 _fields_ = [("x", c_short),
167 ("y", c_short)] 168 ("y", c_short)]
168 dll.ret_2h_func.restype = S2H 169 dll.ret_2h_func.restype = S2H
169 dll.ret_2h_func.argtypes = [S2H] 170 dll.ret_2h_func.argtypes = [S2H]
170 inp = S2H(99, 88) 171 inp = S2H(99, 88)
171 s2h = dll.ret_2h_func(self.wrap(inp)) 172 s2h = dll.ret_2h_func(self.wrap(inp))
172 self.assertEqual((s2h.x, s2h.y), (99*2, 88*3)) 173 self.assertEqual((s2h.x, s2h.y), (99*2, 88*3))
173 174
175 # This is known cdecl incompatibility between GCC
176 # and MSVC. It is addressed in GCC issue #36834.
177 # Python libffi detect it and complain.
178 @unittest.skipIf(sys.platform == "win32" and sys.version.find("GCC") >= 0, ' XFAIL GCC(mingw)')
174 def test_struct_return_8H(self): 179 def test_struct_return_8H(self):
175 class S8I(Structure): 180 class S8I(Structure):
176 _fields_ = [("a", c_int), 181 _fields_ = [("a", c_int),
177 ("b", c_int), 182 ("b", c_int),
178 ("c", c_int), 183 ("c", c_int),
179 ("d", c_int), 184 ("d", c_int),
180 ("e", c_int), 185 ("e", c_int),
181 ("f", c_int), 186 ("f", c_int),
182 ("g", c_int), 187 ("g", c_int),
183 ("h", c_int)] 188 ("h", c_int)]
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 return self._param 224 return self._param
220 _as_parameter_ = property(getParameter) 225 _as_parameter_ = property(getParameter)
221 226
222 class AsParamPropertyWrapperTestCase(BasicWrapTestCase): 227 class AsParamPropertyWrapperTestCase(BasicWrapTestCase):
223 wrap = AsParamPropertyWrapper 228 wrap = AsParamPropertyWrapper
224 229
225 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 230 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
226 231
227 if __name__ == '__main__': 232 if __name__ == '__main__':
228 unittest.main() 233 unittest.main()
OLDNEW
« no previous file with comments | « Include/pythonrun.h ('k') | Lib/ctypes/test/test_functions.py » ('j') | no next file with comments »

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