summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2014-05-17 22:07:34 (GMT)
committerBenjamin Peterson <benjamin@python.org>2014-05-17 22:07:34 (GMT)
commitda89123bd6ab3e0e0eb311cee72fbed59293dd70 (patch)
tree2912f5fa8749718e159f8f5193c1360ea5e88aab /Lib
parent4915035e84a532fe4e67867d33a4ff9e48df72b6 (diff)
parent5eb6b392109d6407269cbb49f6b297eb2a19567c (diff)
downloadcpython-da89123bd6ab3e0e0eb311cee72fbed59293dd70.zip
cpython-da89123bd6ab3e0e0eb311cee72fbed59293dd70.tar.gz
cpython-da89123bd6ab3e0e0eb311cee72fbed59293dd70.tar.bz2
merge 3.4 (#10744)
Diffstat (limited to 'Lib')
-rw-r--r--Lib/ctypes/test/test_pep3118.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/Lib/ctypes/test/test_pep3118.py b/Lib/ctypes/test/test_pep3118.py
index ad13b01..32f802c 100644
--- a/Lib/ctypes/test/test_pep3118.py
+++ b/Lib/ctypes/test/test_pep3118.py
@@ -96,6 +96,9 @@ class EmptyStruct(Structure):
class aUnion(Union):
_fields_ = [("a", c_int)]
+class StructWithArrays(Structure):
+ _fields_ = [("x", c_long * 3 * 2), ("y", Point * 4)]
+
class Incomplete(Structure):
pass
@@ -145,10 +148,10 @@ native_types = [
## arrays and pointers
- (c_double * 4, "(4)<d", (4,), c_double),
- (c_float * 4 * 3 * 2, "(2,3,4)<f", (2,3,4), c_float),
- (POINTER(c_short) * 2, "(2)&<h", (2,), POINTER(c_short)),
- (POINTER(c_short) * 2 * 3, "(3,2)&<h", (3,2,), POINTER(c_short)),
+ (c_double * 4, "<d", (4,), c_double),
+ (c_float * 4 * 3 * 2, "<f", (2,3,4), c_float),
+ (POINTER(c_short) * 2, "&<h", (2,), POINTER(c_short)),
+ (POINTER(c_short) * 2 * 3, "&<h", (3,2,), POINTER(c_short)),
(POINTER(c_short * 2), "&(2)<h", (), POINTER(c_short)),
## structures and unions
@@ -160,6 +163,9 @@ native_types = [
(EmptyStruct, "T{}", (), EmptyStruct),
# the pep does't support unions
(aUnion, "B", (), aUnion),
+ # structure with sub-arrays
+ (StructWithArrays, "T{(2,3)<l:x:(4)T{<l:x:<l:y:}:y:}", (), StructWithArrays),
+ (StructWithArrays * 3, "T{(2,3)<l:x:(4)T{<l:x:<l:y:}:y:}", (3,), StructWithArrays),
## pointer to incomplete structure
(Incomplete, "B", (), Incomplete),