spiegel-keyman/core/tests/unit
Marc Durdin 57e0e6941d refactor(core): add support for header.version to Core LDML
This substantial refactor reorganizes the header data for sections in
the Core LDML processor. The change was substantial because of
assumptions made about the binary layout of sections. In order to make
the code easier to maintain, safer, and more resilient to future
changes, I opted to make a consistent helper for each section, and copy
header data so that it could be transparently reused.

The principal changes are:

1. Support the version field in the COMP_KMXPLUS_HEADER struct, and
   split it into COMP_KMXPLUS_HEADER_17 and COMP_KMXPLUS_HEADER_19
   versions.
2. Establish a corresponding COMP_KMXPLUS_XXXX_Helper clas for each
   section.
3. Refactor the majority of rawData accesses into using helper
   functions, which reduces direct pointer manipulation and adds extra
   boundary checks.

A special-case exists for BKSP - it is identical to TRAN, except for
its section ident. In order to avoid a complicated pattern for handling
it, I have special-cased it in one place, adding an overloaded
`get_section_from_sect` function for COMP_KMXPLUS_BKSP.

An opportunity exists to refactor a bit further - reduce direct access
to the binary data (through the COMP_KMXPLUS_XXXX structs, and instead
promote use of the COMP_KMXPLUS_XXXX_Helper classes). This indirection
would  reduce duplication of data access and make it cleaner when we
start doing multi-version code.

Next commit will add unit tests for v19 format files.
2025-10-22 05:48:23 +02:00
..
json chore(core): split flags into standard.meson.build 2023-03-09 11:34:54 +07:00
kmnkbd chore(core): Merge branch 'master' into fix/core/12619-disable-assertions-vcwin-release-build 2024-12-01 16:17:21 +07:00
kmx maint(core): batch build kmx in tests for performance 2025-04-30 06:02:59 +07:00
ldml refactor(core): add support for header.version to Core LDML 2025-10-22 05:48:23 +02:00
utftest chore(core): rename test files 2024-11-26 17:47:11 +01:00
emscripten_filesystem.cpp fix(core): rename assert() to test_assert() in unit tests 2024-11-28 09:46:01 +07:00
emscripten_filesystem.h feat(core): use kmc to build kmx tests 2023-03-24 06:22:40 +07:00
km_core_keyboard_api.tests.cpp fix(core): fix compile error 2025-01-08 17:08:57 +01:00
load_kmx_file.cpp feat(core): implement loading KMX from blob 2024-11-27 15:30:05 +01:00
load_kmx_file.hpp feat(core): implement loading KMX from blob 2024-11-27 15:30:05 +01:00
meson.build chore(core): build parameters 2024-12-02 07:21:30 +07:00