Re: [PATCH] Add tests for Bitmapset

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: Greg Burd <greg@burd.me>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2025-09-24T23:28:02Z
Lists: pgsql-hackers
On Wed, Sep 24, 2025 at 07:39:59AM -0400, Greg Burd wrote:
> Thanks Michael, Tom, for the help getting this into shape and in the tree.

By the way, Greg, do you think that we should aim for a state where we
are closer to completion?  We have the module up to the point where we
are in pretty good shape, with most things and the infrastructure done
but it can be improved a bit more, as well. 

Based on the information provided by the coverage report at
https://coverage.postgresql.org/src/backend/nodes/bitmapset.c.gcov.html,
we still have the following things:
- bms_equal for different word counts
- bms_union, bms_nonempty_difference, bms_is_subset and bms_intersect
with shorter word counts.
- bms_different with different word counts
- A couple more cases with bms_subset_compare
- bms_member_index and word counts
- bms_overlap_list with negative number in input list.
- bms_singleton_member ERROR with empty input.
- bms_get_singleton_member with NULL input
- bms_del_member with word counts
- bms_replace_members and repalloc case
- bms_add_range, bms_join and bms_del_members, more word count cases
- bms_prev_member and the prevbit business

There is not much we can do with the random function, still we could
do something about the NULL paths in the internal functions:
https://coverage.postgresql.org/src/test/modules/test_bitmapset/test_bitmapset.c.gcov.html

The coverage of the latter matters less than the coverage of the
former, of course.
--
Michael

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Minor fixes for test_bitmapset.c

  2. test_bitmapset: Improve random function

  3. Add mem_exceeded_count column to pg_stat_replication_slots.

  4. Tidy-up unneeded NULL parameter checks from SQL function

  5. Remove check for NULL in STRICT function

  6. Fixes for comments in test_bitmapset

  7. Minor fixups of test_bitmapset.c

  8. test_bitmapset: Simplify code of the module

  9. test_bitmapset: Expand more the test coverage

  10. Fix compiler warnings in test_bitmapset

  11. Add a test module for Bitmapset