test_bitmapset: Improve random function

test_random_operations() did not check the result returned by
bms_is_member() in its last phase, when checking that the contents of
the bitmap match with what is expected.  This was impacting the
reliability of the function and the coverage it could provide.

This commit improves the whole function, adding more checks based on
bms_is_member(), using a bitmap and a secondary array that tracks the
members added by random additions and deletions.

While on it, more comments are added to document the internals of the
function.

Reported-by: Ranier Vilela <[email protected]>
Author: Greg Burd <[email protected]>
Reviewed-by: Michael Paquier <[email protected]>
Reviewed-by: David Rowley <[email protected]>
Discussion: 
https://postgr.es/m/CAEudQAq_zOSA2NUQSWePTGV_=90uw0wcxxgownn-vwf046o...@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/9d46b86529e8337e34fb5a65b1a7dca9dc53938f

Modified Files
--------------
src/test/modules/test_bitmapset/test_bitmapset.c | 57 ++++++++++++++++++------
1 file changed, 44 insertions(+), 13 deletions(-)

Reply via email to