mirror of
https://gitlab.freedesktop.org/libfprint/libfprint.git
synced 2025-11-15 07:38:12 +00:00
tests: Fix endianness issue in test suite
The test suite needs to compare greyscale images and was picking an undefined byte in the pixel data on big-endian. Select a byte that works on any endian instead. See: #200
This commit is contained in:
committed by
Marco Trevisan
parent
b9ff75c4e9
commit
a7541b1f76
@@ -48,7 +48,10 @@ def cmp_pngs(png_a, png_b):
|
||||
|
||||
for x in range(img_a.get_width()):
|
||||
for y in range(img_a.get_height()):
|
||||
assert(data_a[y * stride + x * 4] == data_b[y * stride + x * 4])
|
||||
# RGB24 format is endian dependent, using +1 means we test either
|
||||
# the G or B component, which works on any endian for the greyscale
|
||||
# test.
|
||||
assert(data_a[y * stride + x * 4 + 1] == data_b[y * stride + x * 4 + 1])
|
||||
|
||||
def get_umockdev_runner(ioctl_basename):
|
||||
ioctl = os.path.join(ddir, "{}.ioctl".format(ioctl_basename))
|
||||
|
||||
Reference in New Issue
Block a user