From: Colin Watson <cjwatson@debian.org>
Date: Mon, 28 Apr 2025 00:31:28 +0100
Subject: Fix PageJobTestCase.test_decode on big-endian systems

These parts of the test case are working with `array.array('I', ...)`
buffers, whose `tobytes()` serialization depends on the platform's byte
ordering.

Fixes: #17

Forwarded: https://github.com/FriedrichFroebel/python-djvulibre/pull/25
Bug: https://github.com/FriedrichFroebel/python-djvulibre/issues/17
Bug-Debian: https://bugs.debian.org/1103593
Last-Update: 2025-04-28
---
 tests/test_decode.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/test_decode.py b/tests/test_decode.py
index e32a27f..e13eb16 100644
--- a/tests/test_decode.py
+++ b/tests/test_decode.py
@@ -525,7 +525,7 @@ class PageJobsTestCase(TestCase):
         pixel_format = PixelFormatRgbMask(0xFF0000, 0xFF00, 0xFF, bpp=32)
         self.assertIs(page_job.render(RENDER_COLOR, (0, 0, 10, 10), (0, 0, 2, 2), pixel_format, 1, buffer), buffer)
         s = buffer.tobytes()
-        self.assertEqual(s, b'\xFF\xFF\xFF\x00' * 4)
+        self.assertEqual(s, (b'\x00\xFF\xFF\xFF' if sys.byteorder == 'big' else b'\xFF\xFF\xFF\x00') * 4)
 
         if sys.version_info >= (3, 3):
             buffer = bytearray(16)
@@ -535,7 +535,7 @@ class PageJobsTestCase(TestCase):
                 memview
             )
             s = bytes(buffer)
-            self.assertEqual(s, b'\xFF\xFF\xFF\x00' * 4)
+            self.assertEqual(s, (b'\x00\xFF\xFF\xFF' if sys.byteorder == 'big' else b'\xFF\xFF\xFF\x00') * 4)
 
 
 class ThumbnailsTestCase(TestCase):
