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

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

Issue 23670: Modifications to support iOS as a development platform
Patch Set: Created 3 years, 8 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_checkretval.py ('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 os, unittest 1 import os, unittest
2 from ctypes import * 2 from ctypes import *
3 3
4 try: 4 try:
5 WINFUNCTYPE 5 WINFUNCTYPE
6 except NameError: 6 except NameError:
7 # fake to enable this test on Linux 7 # fake to enable this test on Linux
8 WINFUNCTYPE = CFUNCTYPE 8 WINFUNCTYPE = CFUNCTYPE
9 9
10 import _ctypes_test 10 import _ctypes_test
11 lib = CDLL(_ctypes_test.__file__) 11 lib = CDLL(getattr(_ctypes_test, '__file__', os.environ['TEST_EXECUTABLE']))
12 12
13 class CFuncPtrTestCase(unittest.TestCase): 13 class CFuncPtrTestCase(unittest.TestCase):
14 def test_basic(self): 14 def test_basic(self):
15 X = WINFUNCTYPE(c_int, c_int, c_int) 15 X = WINFUNCTYPE(c_int, c_int, c_int)
16 16
17 def func(*args): 17 def func(*args):
18 return len(args) 18 return len(args)
19 19
20 x = X(func) 20 x = X(func)
21 self.assertEqual(x.restype, c_int) 21 self.assertEqual(x.restype, c_int)
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 ## b.value = s 118 ## b.value = s
119 119
120 ## b = c_string(s) 120 ## b = c_string(s)
121 self.assertEqual(strtok(b, b"\n"), b"a") 121 self.assertEqual(strtok(b, b"\n"), b"a")
122 self.assertEqual(strtok(None, b"\n"), b"b") 122 self.assertEqual(strtok(None, b"\n"), b"b")
123 self.assertEqual(strtok(None, b"\n"), b"c") 123 self.assertEqual(strtok(None, b"\n"), b"c")
124 self.assertEqual(strtok(None, b"\n"), None) 124 self.assertEqual(strtok(None, b"\n"), None)
125 125
126 if __name__ == '__main__': 126 if __name__ == '__main__':
127 unittest.main() 127 unittest.main()
OLDNEW
« no previous file with comments | « Lib/ctypes/test/test_checkretval.py ('k') | Lib/ctypes/test/test_functions.py » ('j') | no next file with comments »

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