Re: [PATCH] Add tests for Bitmapset

From: David Rowley <dgrowleyml(at)gmail(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Greg Burd <greg(at)burd(dot)me>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: [PATCH] Add tests for Bitmapset
Date: 2025-09-30 00:19:05
Message-ID: CAApHDvqghMnm_zgSNefto9oaEJ0S-3Cgb3gdsV7XvLC-hMS02Q@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, 30 Sept 2025 at 12:40, Michael Paquier <michael(at)paquier(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2025-09-30 00:41:09 Re: Incorrect logic in XLogNeedsFlush()
Previous Message Michael Paquier 2025-09-30 00:08:32 Re: Fix locking issue with fixed-size stats template in injection_points