Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dcTuh-0007n5-B0 for pgsql-hackers@arkaria.postgresql.org; Tue, 01 Aug 2017 09:56:31 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dcTug-0005Le-U0 for pgsql-hackers@arkaria.postgresql.org; Tue, 01 Aug 2017 09:56:30 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dcTt7-0001wQ-CE for pgsql-hackers@postgresql.org; Tue, 01 Aug 2017 09:54:53 +0000 Received: from mail.postgrespro.ru ([93.174.131.138]) by magus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dcTt3-0000dh-Mb for pgsql-hackers@postgresql.org; Tue, 01 Aug 2017 09:54:52 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.postgrespro.ru (Postfix) with ESMTP id 4FB8021C0535; Tue, 1 Aug 2017 12:54:48 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at postgrespro.ru Received: from localhost (unknown [217.23.185.36]) by mail.postgrespro.ru (Postfix) with ESMTPSA id 0BC9421C04E7; Tue, 1 Aug 2017 12:54:48 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mail; t=1501581288; bh=F7WuH79f4+55S2+kxryZAS72jTq95yCA36x3+BQXO9Y=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=X1X1mwYuhqAnEAruzpRpYsvNDRtYKewski6VQeLlDhzGuOQ2VCg76f8xM0nlNwKeh 7UdAorEPNkbeHjC1NJtQ7UFzusABoa5W+VbHkWuH47VJzSeGBmAHgjyEVpBSLLEulF zRnGjA+O3kFXIGOQiIfrahenaYNKXq1Ah4DKttYM= Date: Tue, 1 Aug 2017 12:54:47 +0300 From: Aleksander Alekseev To: Victor Drobny Cc: Pgsql Hackers Subject: Re: Red-Black tree traversal tests Message-ID: <20170801095446.GA22764@e733.localdomain> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="UugvWAfsgieZRqgk" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.8.3 (2017-05-23) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org --UugvWAfsgieZRqgk Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Victor, > Postgres now has its own red-black tree implementation. This tree has 4 > types of traversals. In the attachment, you can find module test that > checks the correctness of tree traversal strategies. >=20 > I hope that someone can find it useful. Great job! However, according to lcov report, some procedures declared in rbtree.c are still not test covered even with your patch, particularly: * rb_find * rb_leftmost * rb_delete + dependencies (rb_delete_fixup, etc) You can generate a corresponding report using this script [1]. I must say, I was a little surprised that rb_find is not used anywhere in PostgreSQL code. Turned out that rbtree currently is used only by GIN and it uses a small subset of all procedures.=20 If it's not too much trouble perhaps you could write a few more test so we would have 100% test coverage for rbtree, could modify it safely and be sure that it actually works when someone will need the rest of its functionality? [1]: https://github.com/afiskon/pgscripts/blob/master/code-coverage.sh --=20 Best regards, Aleksander Alekseev --UugvWAfsgieZRqgk Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEECAokn0QZCoIHW4GpEEnCBLXCDtYFAlmAT+QACgkQEEnCBLXC DtY3LRAA2ttSWala8Rq4mTFhdyrNawn1cV0FY/4zgqtcIErSd4u2CAEivVQJPI7l g+mt9Jyk23i+ezmD1UOVv6e5CW7ubcIL/1yaPJmVFEEznq5YLYuz5faxgSjlmlK3 4GmiEc3f3wIOj81PNE7nkK+H17pZ29JxGd/sMTQCZ+rsnR3+QMumfZMrJej8j62+ t+I5eZfObiXUTGyINZ8CqkMUTbgr3Nd6ZfEl6K0ykA78w+tz9MpJdVxjR9U4vo/4 DQufhUlZ5MolDjlI2biVA2yz0DhSuyK2ZoVbPdAxxMAIB6EP3hdkM8SHkx7nHV7s gK1aM0VDhcTsWEXj2OBd79W8mo1Qd98CGRnMIOzeeyj2WCVm/i2K8l2d77R5N5VV o/QZHkfFGiPDLI+1wtO4xZ8ifjKxhfPU8DHhxtzJc+E01g0pNTIIRxqYiZqGKfQ/ efGsqAcfhGiznEowRGiGiBG6xB6Xa0vKdTYj5IQUDAzFo+YH87gtpghWyPqZSf9n HHzj0KKB3xsTKv3/LYnm8WUPnLMoDZSu+myj8XNWO2j5DEBfquX28FN+M5eQ7Piv NX/cuojNlM4uM1F+CSEnn4+ST/TjvkHdzKowoQ37fM98GUnpaXvv+o4wXOiw1sjC gDKd8vot3My4k3FP1bq+L1aHIGbSXHzQW8il7COQAA+XZe8oUxs= =wS9J -----END PGP SIGNATURE----- --UugvWAfsgieZRqgk--