Source: pysdl2
Version: 0.9.9+dfsg1-5
Severity: serious
Hello, as shown in e.g.
https://ci.debian.net/data/autopkgtest/unstable/s390x/p/pysdl2/30731752/log.gz
autopkgtests are failing probably due to a Big Endian issue
=== FAILURES ===
TestSDLPixels.test_SDL_MasksToPixelFormatEnum _
self =
def test_SDL_MasksToPixelFormatEnum(self):
if sys.byteorder == "little":
val = pixels.SDL_MasksToPixelFormatEnum(32,
0xFF00,
0x00FF,
0xFF00,
0x00FF)
else:
val = pixels.SDL_MasksToPixelFormatEnum(32,
0x00FF,
0xFF00,
0x00FF,
0xFF00)
assert val == pixels.SDL_PIXELFORMAT_RGBA
E assert 376840196 == 373694468
E+ where 373694468 = pixels.SDL_PIXELFORMAT_RGBA
sdl2/test/pixels_test.py:175: AssertionError
TestSDLPixels.test_SDL_PixelFormatEnumToMasks _
self =
def test_SDL_PixelFormatEnumToMasks(self):
bpp = c_int()
r, g, b, a = Uint32(), Uint32(), Uint32(), Uint32()
pixels.SDL_PixelFormatEnumToMasks(pixels.SDL_PIXELFORMAT_INDEX1LSB,
byref(bpp), byref(r), byref(g),
byref(b), byref(a))
assert (bpp.value, r.value, g.value, b.value, a.value) == \
(1, 0, 0, 0, 0)
pixels.SDL_PixelFormatEnumToMasks(pixels.SDL_PIXELFORMAT_INDEX1MSB,
byref(bpp), byref(r), byref(g),
byref(b), byref(a))
assert (bpp.value, r.value, g.value, b.value, a.value) == \
(1, 0, 0, 0, 0)
pixels.SDL_PixelFormatEnumToMasks(pixels.SDL_PIXELFORMAT_RGBA,
byref(bpp), byref(r), byref(g),
byref(b), byref(a))
if sys.byteorder == "little":
assert (bpp.value, r.value, g.value, b.value, a.value) == \
(32, 0xFF00, 0x00FF, 0xFF00, 0x00FF)
else:
assert (bpp.value, r.value, g.value, b.value, a.value) == \
(32, 0x00FF, 0xFF00, 0x00FF, 0xFF00)
E assert (32, 42781900...0, 65280, 255) == (32, 255, 652...0,
4278190080)
E At index 1 diff: 4278190080 != 255
E Full diff:
E - (32, 255, 65280, 16711680, 4278190080)
E + (32, 4278190080, 16711680, 65280, 255)
sdl2/test/pixels_test.py:217: AssertionError
TestSDL2ExtArray.test_CTypesView__doublebytes _
self =
def test_CTypesView__doublebytes(self):
buf1 = sdlextarray.CTypesView(doublebyteseq, USHORT_SIZE, docopy=True)
buf2 = sdlextarray.CTypesView(doublebytebuf, USHORT_SIZE, docopy=False)
for singlebytes, shared in ((buf1, False), (buf2, True)):
assert isinstance(singlebytes, sdlextarray.CTypesView)
assert singlebytes.is_shared == shared
assert singlebytes.bytesize == len(doublebyteseq) * 2
offset = 0
cnt = 0
for val in singlebytes.to_bytes():
if cnt > 0:
assert val == hibyte16(doublebyteseq[offset])
cnt = 0
offset += 1
else:
assert val == lobyte16(doublebyteseq[offset])
E assert 0 == 1
E+ where 1 = lobyte16(1)
sdl2/test/sdl2ext_array_test.py:199: AssertionError
_ TestSDL2ExtArray.test_CTypesView__quadbytes __
self =
def test_CTypesView__quadbytes(self):
buf1 = sdlextarray.CTypesView(quadbyteseq, UINT_SIZE, docopy=True)
buf2 = sdlextarray.CTypesView(quadbytebuf, UINT_SIZE, docopy=False)
for singlebytes, shared in ((buf1, False), (buf2, True)):
assert isinstance(singlebytes, sdlextarray.CTypesView)
assert singlebytes.is_shared == shared
assert singlebytes.bytesize == len(quadbyteseq) * 4
offset = 0
cnt = 0
for val in singlebytes.to_bytes():
assert val == ltrbyte32(quadbyteseq[offset], cnt)
if cnt == 3:
offset += 1
cnt = 0
else:
cnt += 1
cnt = 0
offset = 0
for val in singlebytes.to_uint16():
if cnt > 0: