composetable test fails on big-endian architectures
Steps to reproduce
Build GTK on Debian s390x, or on the unofficial powerpc and powerpc64 ports.
Current behavior
--- command ---
11:20:25 G_TEST_BUILDDIR='/<<PKGBUILDDIR>>/debian/build/deb/testsuite/gtk' GTK_A11Y='test' GTK_CSD='1' G_ENABLE_DIAGNOSTIC='0' GDK_BACKEND='x11' GSETTINGS_SCHEMA_DIR='/<<PKGBUILDDIR>>/debian/build/deb/gtk' G_TEST_SRCDIR='/<<PKGBUILDDIR>>/testsuite/gtk' GSK_RENDERER='cairo' GSETTINGS_BACKEND='memory' TEST_OUTPUT_SUBDIR='x11' /<<PKGBUILDDIR>>/debian/build/deb/testsuite/gtk/composetable --tap -k
--- stdout ---
# random seed: R02S203fee5d8296c4f06f555674fcebfb63
1..14
# Start of compose-table tests
# GLib-GIO-DEBUG: _g_io_module_get_default: Found default implementation local (GLocalVfs) for ‘gio-vfs’
ok 1 /compose-table/basic
ok 2 /compose-table/long
ok 3 /compose-table/octal
ok 4 /compose-table/hex
ok 5 /compose-table/codepoint
ok 6 /compose-table/multi
ok 7 /compose-table/strings
ok 8 /compose-table/include
Bail out! Gtk:ERROR:../../../gtk/gtkcomposetable.c:1419:gtk_compose_table_foreach: assertion failed: (seq_index[i + 1] <= table->data_size)
--- stderr ---
**
Gtk:ERROR:../../../gtk/gtkcomposetable.c:1419:gtk_compose_table_foreach: assertion failed: (seq_index[i + 1] <= table->data_size)
(test program exited with status code -6)
-------
Expected outcome
The test passes
Version information
GTK 4.4.0
Additional information
I think this is because the pregenerated sequences
file embedded via GResource is little-endian, and GtkIMContextSimple uses it as though it was native-endian. The easiest solution seems to be to generate two sequences files, big- and little-endian, and embed the correct one for the host architecture.
I'll send a merge request when I have tested this solution on s390x.