pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Dean Rasheed <dean.a.rasheed@gmail.com>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Convert src/tools/testint128.c into a test module.
Date: Wed, 06 Aug 2025 08:45:32 +0000
Message-ID: <E1ujZm8-0011Ak-1R@gemulon.postgresql.org> (raw)

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

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(-)



Message-ID: <E1ujZm8-0011Ak-1R@gemulon.postgresql.org>
Permalink:  ../E1ujZm8-0011Ak-1R@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1ujZm8-0011Ak-1R@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: dean.a.rasheed@gmail.com, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Convert src/tools/testint128.c into a test module.
  In-Reply-To: <E1ujZm8-0011Ak-1R@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox