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

Delta Between Two Patch Sets: Lib/ctypes/test/test_pep3118.py

Issue 10744: ctypes arrays have incorrect buffer information (PEP-3118)
Left Patch Set: Created 5 years, 9 months ago
Right Patch Set: Created 5 years, 9 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:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | Modules/_ctypes/_ctypes.c » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 import unittest 1 import unittest
2 from ctypes import * 2 from ctypes import *
3 import re, struct, sys 3 import re, struct, sys
4 4
5 if sys.byteorder == "little": 5 if sys.byteorder == "little":
6 THIS_ENDIAN = "<" 6 THIS_ENDIAN = "<"
7 OTHER_ENDIAN = ">" 7 OTHER_ENDIAN = ">"
8 else: 8 else:
9 THIS_ENDIAN = ">" 9 THIS_ENDIAN = ">"
10 OTHER_ENDIAN = "<" 10 OTHER_ENDIAN = "<"
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 ## structures and unions 157 ## structures and unions
158 158
159 (Point, "T{<l:x:<l:y:}", (), Point), 159 (Point, "T{<l:x:<l:y:}", (), Point),
160 # packed structures do not implement the pep 160 # packed structures do not implement the pep
161 (PackedPoint, "B", (), PackedPoin t), 161 (PackedPoint, "B", (), PackedPoin t),
162 (Point2, "T{<l:x:<l:y:}", (), Point2), 162 (Point2, "T{<l:x:<l:y:}", (), Point2),
163 (EmptyStruct, "T{}", (), EmptyStruc t), 163 (EmptyStruct, "T{}", (), EmptyStruc t),
164 # the pep does't support unions 164 # the pep does't support unions
165 (aUnion, "B", (), aUnion), 165 (aUnion, "B", (), aUnion),
166 # structure with sub-arrays 166 # structure with sub-arrays
167 (StructWithArrays, "T{(2,3)<l:x:(4)T{<l:x:<l:y:}:y:}", None, Struc tWithArrays), 167 (StructWithArrays, "T{(2,3)<l:x:(4)T{<l:x:<l:y:}:y:}", (), StructW ithArrays),
168 (StructWithArrays * 3, "T{(2,3)<l:x:(4)T{<l:x:<l:y:}:y:}", (3,), Struc tWithArrays), 168 (StructWithArrays * 3, "T{(2,3)<l:x:(4)T{<l:x:<l:y:}:y:}", (3,), Struc tWithArrays),
169 169
170 ## pointer to incomplete structure 170 ## pointer to incomplete structure
171 (Incomplete, "B", (), Incomplete ), 171 (Incomplete, "B", (), Incomplete ),
172 (POINTER(Incomplete), "&B", (), POINTER(In complete)), 172 (POINTER(Incomplete), "&B", (), POINTER(In complete)),
173 173
174 # 'Complete' is a structure that starts incomplete, but is completed after t he 174 # 'Complete' is a structure that starts incomplete, but is completed after t he
175 # pointer type to it has been created. 175 # pointer type to it has been created.
176 (Complete, "T{<l:a:}", (), Complete), 176 (Complete, "T{<l:a:}", (), Complete),
177 # Unfortunately the pointer format string is not fixed... 177 # Unfortunately the pointer format string is not fixed...
(...skipping 19 matching lines...) Expand all
197 # 197 #
198 endian_types = [ 198 endian_types = [
199 (BEPoint, "T{>l:x:>l:y:}", (), BEPoint), 199 (BEPoint, "T{>l:x:>l:y:}", (), BEPoint),
200 (LEPoint, "T{<l:x:<l:y:}", (), LEPoint), 200 (LEPoint, "T{<l:x:<l:y:}", (), LEPoint),
201 (POINTER(BEPoint), "&T{>l:x:>l:y:}", (), POINTER(BE Point)), 201 (POINTER(BEPoint), "&T{>l:x:>l:y:}", (), POINTER(BE Point)),
202 (POINTER(LEPoint), "&T{<l:x:<l:y:}", (), POINTER(LE Point)), 202 (POINTER(LEPoint), "&T{<l:x:<l:y:}", (), POINTER(LE Point)),
203 ] 203 ]
204 204
205 if __name__ == "__main__": 205 if __name__ == "__main__":
206 unittest.main() 206 unittest.main()
LEFTRIGHT

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