Commits

Lenard Lindstrom committed 927d431

Add an Array test type to pygame.tests.test_utils.arrinter

Numpy arrays and BufferProxy surface views only support the system default
integer byte order. The new Array type supports a swapped byte order. It is
also available for Python 2.5, unlike the test array type in buftools.

Comments (0)

Files changed (1)

test/test_utils/arrinter.py

            'PAI_NOTSWAPPED', 'PAI_WRITEABLE', 'PAI_ARR_HAS_DESCR',
            'ArrayInterface',]
 
+try:
+    c_ssize_t  # Undefined in early Python versions
+except NameError:
+    if sizeof(c_uint) == sizeof(c_void_p):
+        c_size_t = c_uint
+        c_ssize_t = c_int
+    elif sizeof(c_ulong) == sizeof(c_void_p):
+        c_size_t = c_ulong
+        c_ssize_t = c_long
+    elif sizeof(c_ulonglong) == sizeof(c_void_p):
+        c_size_t = c_ulonglong
+        c_ssize_t = c_longlong
+
+
 PY3 = 0
 if sys.version_info >= (3,):
     PY3 = 1