summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsmutch <smutch@unimelb.edu.au>2020-05-21 04:57:03 +1000
committerGitHub <noreply@github.com>2020-05-20 20:57:03 +0200
commitb8d9708fef68149c5ec38b8b22e778b68d7bbe48 (patch)
tree529cc94461778269b1b20179860f6096bab55d79
parent89d2488f7bfd6010b2a5482daede5a26759e1e6d (diff)
downloadcython-b8d9708fef68149c5ec38b8b22e778b68d7bbe48.tar.gz
Use platform dependent test for "unpacked_struct_with_arrays" (GH-3621)
-rw-r--r--tests/buffers/buffmt.pyx6
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/buffers/buffmt.pyx b/tests/buffers/buffmt.pyx
index 5d015e4bf..0aa0cb325 100644
--- a/tests/buffers/buffmt.pyx
+++ b/tests/buffers/buffmt.pyx
@@ -1,4 +1,5 @@
from __future__ import unicode_literals
+import struct
# Tests buffer format string parsing.
@@ -442,7 +443,10 @@ def packed_struct_with_arrays(fmt):
@testcase
def unpacked_struct_with_arrays(fmt):
"""
- >>> unpacked_struct_with_arrays("T{i:a:(8)f:b:f:c:Q:d:(5)i:e:i:f:i:g:xxxx(4)d:h:i:i:}")
+ >>> if struct.calcsize('P') == 8: # 64 bit
+ ... unpacked_struct_with_arrays("T{i:a:(8)f:b:f:c:Q:d:(5)i:e:i:f:i:g:xxxx(4)d:h:i:i:}")
+ ... elif struct.calcsize('P') == 4: # 32 bit
+ ... unpacked_struct_with_arrays("T{i:a:(8)f:b:f:c:Q:d:(5)i:e:i:f:i:g:(4)d:h:i:i:}")
"""
cdef object[UnpackedStructWithArrays] buf = MockBuffer(