Convert src/tools/testint128.c into a test module.
Dean Rasheed <dean.a.rasheed@gmail.com>
Author:
Dean Rasheed <dean.a.rasheed@gmail.com>
Date: 2025-08-06T08:41:11Z
Releases:
19 (unreleased)
Convert src/tools/testint128.c into a test module. This creates a new test module src/test/modules/test_int128 and moves src/tools/testint128.c into it so that it can be built using the normal build system, allowing the 128-bit integer arithmetic functions in src/include/common/int128.h to be tested automatically. For now, the tests are skipped on platforms that don't have native int128 support. While at it, fix the test128 union in the test code: the "hl" member of test128 was incorrectly defined to be a union instead of a struct, which meant that the tests were only ever setting and checking half of each 128-bit integer value. Author: Dean Rasheed <dean.a.rasheed@gmail.com> Reviewed-by: John Naylor <johncnaylorls@gmail.com> Discussion: https://postgr.es/m/CAEZATCWgBMc9ZwKMYqQpaQz2X6gaamYRB+RnMsUNcdMcL2Mj_w@mail.gmail.com
Files
| Path | Change | +/− |
|---|---|---|
| src/include/common/int128.h | modified | +1 −1 |
| src/test/modules/Makefile | modified | +1 −0 |
| src/test/modules/meson.build | modified | +1 −0 |
| src/test/modules/test_int128/.gitignore | added | +2 −0 |
| src/test/modules/test_int128/Makefile | added | +23 −0 |
| src/test/modules/test_int128/meson.build | added | +33 −0 |
| src/test/modules/test_int128/t/001_test_int128.pl | added | +27 −0 |
| src/test/modules/test_int128/test_int128.c (from src/tools/testint128.c) | renamed | +37 −17 |
Discussion
- Improving and extending int128.h to more of numeric.c 20 messages · 2025-06-23 → 2025-10-25