Re: [PATCH] Add tests for Bitmapset - Mailing list pgsql-hackers

From David Rowley
Subject Re: [PATCH] Add tests for Bitmapset
Date
Msg-id CAApHDvqghMnm_zgSNefto9oaEJ0S-3Cgb3gdsV7XvLC-hMS02Q@mail.gmail.com
Whole thread Raw
In response to Re: [PATCH] Add tests for Bitmapset  (Michael Paquier <michael@paquier.xyz>)
Responses Re: [PATCH] Add tests for Bitmapset
List pgsql-hackers
On Tue, 30 Sept 2025 at 12:40, Michael Paquier <michael@paquier.xyz> wrote:
> The only two code paths I'm seeing as not covered are:
> - test_bms_add_range() for a bms_free() case.

One question about that:  In cases like [1],  what's the reason that
many of the bms_free() calls check if the set is NULL before calling
the function?

NULL is a valid Bitmapset, so I don't really see the need to check for
an empty set before calling bms_free().  If those were removed, then
you'd not have to care about the coverage of that line.

David

[1] https://coverage.postgresql.org/src/test/modules/test_bitmapset/test_bitmapset.c.gcov.html#699



pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: Fix locking issue with fixed-size stats template in injection_points
Next
From: Michael Paquier
Date:
Subject: Re: Incorrect logic in XLogNeedsFlush()