From: | Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com> |
---|---|
To: | pgsql-committers(at)lists(dot)postgresql(dot)org |
Subject: | pgsql: Convert src/tools/testint128.c into a test module. |
Date: | 2025-08-06 08:45:32 |
Message-ID: | E1ujZm8-0011Ak-1R@gemulon.postgresql.org |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers |
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(dot)a(dot)rasheed(at)gmail(dot)com>
Reviewed-by: John Naylor <johncnaylorls(at)gmail(dot)com>
Discussion: https://postgr.es/m/CAEZATCWgBMc9ZwKMYqQpaQz2X6gaamYRB+RnMsUNcdMcL2Mj_w@mail.gmail.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/8c7445a008109100f9784ea2d8e02cb6769dfb09
Modified Files
--------------
src/include/common/int128.h | 2 +-
src/test/modules/Makefile | 1 +
src/test/modules/meson.build | 1 +
src/test/modules/test_int128/.gitignore | 2 +
src/test/modules/test_int128/Makefile | 23 +++++++++
src/test/modules/test_int128/meson.build | 33 +++++++++++++
src/test/modules/test_int128/t/001_test_int128.pl | 27 +++++++++++
.../modules/test_int128/test_int128.c} | 54 +++++++++++++++-------
8 files changed, 125 insertions(+), 18 deletions(-)
From | Date | Subject | |
---|---|---|---|
Next Message | Peter Eisentraut | 2025-08-06 09:09:13 | pgsql: Remove INT64_HEX_FORMAT and UINT64_HEX_FORMAT |
Previous Message | Michael Paquier | 2025-08-06 08:30:43 | pgsql: Add regression test for short varlenas saved in TOAST relations |