Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1v0gcr-00H05e-Vv for pgsql-hackers@arkaria.postgresql.org; Mon, 22 Sep 2025 13:30:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1v0gcq-000e6y-MJ for pgsql-hackers@arkaria.postgresql.org; Mon, 22 Sep 2025 13:30:40 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1v0gcp-000e6q-VP for pgsql-hackers@lists.postgresql.org; Mon, 22 Sep 2025 13:30:40 +0000 Received: from fhigh-a8-smtp.messagingengine.com ([103.168.172.159]) by makus.postgresql.org with smtp (Exim 4.96) (envelope-from ) id 1v0gcn-001lyV-2M for pgsql-hackers@lists.postgresql.org; Mon, 22 Sep 2025 13:30:39 +0000 Received: from phl-compute-06.internal (phl-compute-06.internal [10.202.2.46]) by mailfhigh.phl.internal (Postfix) with ESMTP id C788E14000B1; Mon, 22 Sep 2025 09:30:36 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-06.internal (MEProxy); Mon, 22 Sep 2025 09:30:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=burd.me; h=cc:cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1758547836; x=1758634236; bh=Y9E2AVE5+XnkvN+7qk4X9833sR7wbh26E3c/36jKa5g=; b= YzUn9rwpESr+zYI9qoa4PWxB52oHNs4iIh+fENjVl6faE4HBi8FOlJG5/VSpx0un angPqIKtwB1HRobQzvyCJkJ8gjHNXCMZZBIcLa0CTsKaHca5gwG/ompI7gOXn1Cj KVeN1MeJIyTRTJW58MRw8tbRbHPq75B/EZrzsgJVpGUEJvo/jMRiqrhsl6y/6cu5 ESmRktNtgodlj5u7wc2DA6ysY0fESzX5Iy6/VJcp0wEKx6uCimU7/md/XYzHkncN S7FEhWw0dbl5PKezyHCt7SXFyluGaGBOAim0iSksnq7GPYd0zKJRC1DyPXTr0Voe GIPUwhIiBBqZR3YkaqJXkA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1758547836; x= 1758634236; bh=Y9E2AVE5+XnkvN+7qk4X9833sR7wbh26E3c/36jKa5g=; b=H 98qXurjiHnZA5rZKoxmp+EzjQ6MuPaowqb21yN67ZpDn6WWZddKvXdwpMaFovS6V ulQDyHMVffjh+IoyRcXHz+Vc2Mq1yxcw0K4jYZTJ+Y9tjzlfXHVYDLyvD5A+8iZp C/aneh/l9CPfNRq3u2kCmNtX0rwK36wszYxLl78mDbqG3HRUY9r89UJVi8Vehwmq hlFNsPFF9zWqylsuH7fL7O4NIJWLk/2/qgiPS6Dzf6gjTTPSaDJizC9dP129kIBL PCzhKZLRYK0avgiXDpM8Nu6qHEc/sU8b7QJVo9/LIifSZNKHXa6HvewGT5HsCTak SqQ7vVwRpedKl6MlLSnYQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggdehjeeljecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjug hrpeffhffvvefkjghfuffogggtgfgusehtjehmtdertdejnecuhfhrohhmpefirhgvghcu uehurhguuceoghhrvghgsegsuhhrugdrmhgvqeenucggtffrrghtthgvrhhnpeegvdfftd elvdekteeljedvleduueevudfggeetudfgudejtdeikedtvefglefgieenucevlhhushht vghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehgrhgvghessghurhgurd hmvgdpnhgspghrtghpthhtohephedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohep mhhitghhrggvlhesphgrqhhuihgvrhdrgiihiidprhgtphhtthhopehpghhsqhhlqdhhrg gtkhgvrhhssehlihhsthhsrdhpohhsthhgrhgvshhqlhdrohhrghdprhgtphhtthhopehr ohgsvghrthhmhhgrrghssehgmhgrihhlrdgtohhmpdhrtghpthhtohepnhgrthhhrghnug gsohhsshgrrhhtsehgmhgrihhlrdgtohhmpdhrtghpthhtohepshgrfigruggrrdhmshhh khesghhmrghilhdrtghomh X-ME-Proxy: Feedback-ID: i675e48f3:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 22 Sep 2025 09:30:36 -0400 (EDT) Date: Mon, 22 Sep 2025 09:30:24 -0400 From: Greg Burd To: Michael Paquier Cc: PostgreSQL Hackers , Robert Haas , Nathan Bossart , Masahiko Sawada Message-ID: In-Reply-To: References: Subject: Re: [PATCH] Add tests for Bitmapset X-Mailer: Mailspring MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Sep 22 2025, at 3:57 am, Michael Paquier wrote: > On Fri, Sep 19, 2025 at 02:48:43PM -0400, Greg Burd wrote: >> I think I've incorporated your feedback which did indeed make the patch >> more readable/crisp and maintainable, thank you. >> >> coverage: HEAD v7 v8 >> lines......: 87.1 90.5 92.2 Michael, Thank you for your time and help. > bitmap_match() had some duplicated tests. > > bms_replace_members() was not covered, and a function was added to the > module. I get up to 93.4% for the lines, once added. > > +PG_FUNCTION_INFO_V1(test_bms_from_array); > +PG_FUNCTION_INFO_V1(test_bms_to_array); > These two were still declared, are not required. > > There were a couple of functions that acted as dead code in the > module, covered in the tree. As we are trying to cover the gap I > think that we should just do the whole thing. Here are the functions: > - is_empty > - subset_compare > - get_singleton_member > - nonempty_difference > - member_index > - join. The test C function had a mistake, because either input may > be modified or updated by bms_join(). The code was freeing the right > input, leading to errors in the node output function when tested. All great ideas, apologies for the oversights. > Mixing the CTEs and the UNION ALL would have been nice if the queries > in the UNIONs relied on more than one input value, but none of them > did that, so I have removed this part and made the tests leaner. That > feels easier for the eye. Agreed, thank you. > Testing on equality for the hash functions should be OK, so I have > kept these, including the NULL/0 cases. Sounds good to me. > A few incorrect things related to the style, fixed on the way, like an > incorrect copyright notice in meson.build, the top of test_bitmapset.c > was largely incorrect. It seems like these were copy-pasted from > elsewhere. Yes, copied from the radixtree test module. > Another thing was testing with -DREALLOCATE_BITMAPSETS, which I've > done. That seems like a good idea, I thought about doing that as well. > A couple of code paths related to the test C functions don't > test for NULL input, which is still OK as these don't impact the > internal tests or the backend coverage, so I've left these out. Fair. > The result I had was good enough, so applied. The CI was OK, the > buildfarm may have a different opinion. > -- > Michael Thanks for the help getting this done, I really appreciate it. So far the buildfarm seems okay. :) best. -greg