pgsql: Add a test module for Bitmapset

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Add a test module for Bitmapset
Date: 2025-09-22 07:55:24
Message-ID: E1v0bON-001uYi-27@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Add a test module for Bitmapset

Bitmapset has a complex set of APIs, defined in bitmapset.h, and it can
be hard to test edge cases with the backend core code only.

This test module is aimed at closing the gap, and implements a set of
SQL functions that act as wrappers of the low-level C functions of the
same names. These functions rely on text as data type for the input and
the output as Bitmapset as a node has support for these. An extra
function, named test_random_operations(), can be used to stress bitmaps
with random member values and a defined number of operations potentially
useful for other purposes than only tests.

The coverage increases from 85.2% to 93.4%. It should be possible to
cover more code paths, but at least it's a beginning.

Author: Greg Burd <greg(at)burd(dot)me>
Reviewed-by: Nathan Bossart <nathandbossart(at)gmail(dot)com>
Reviewed-by: Michael Paquier <michael(at)paquier(dot)xyz>
Discussion: https://postgr.es/m/7BD1ABDB-B03A-464A-9BA9-A73B55AD8A1F@getmailspring.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/00c3d87a5cab6e1b816658f15573ea4730c2f17b

Modified Files
--------------
src/test/modules/Makefile | 1 +
src/test/modules/meson.build | 1 +
src/test/modules/test_bitmapset/.gitignore | 4 +
src/test/modules/test_bitmapset/Makefile | 23 +
.../test_bitmapset/expected/test_bitmapset.out | 907 +++++++++++++++++
src/test/modules/test_bitmapset/meson.build | 33 +
.../modules/test_bitmapset/sql/test_bitmapset.sql | 257 +++++
.../modules/test_bitmapset/test_bitmapset--1.0.sql | 136 +++
src/test/modules/test_bitmapset/test_bitmapset.c | 1021 ++++++++++++++++++++
.../modules/test_bitmapset/test_bitmapset.control | 4 +
10 files changed, 2387 insertions(+)

Browse pgsql-committers by date

  From Date Subject
Next Message Daniel Gustafsson 2025-09-22 08:17:22 pgsql: doc: Remove trailing whitespace in xref
Previous Message David Rowley 2025-09-22 01:33:37 pgsql: Fix various incorrect filename references