[PATCH] Add tests for binaryheap.c

Started by Aleksander Alekseevover 1 year ago6 messageshackers
Jump to latest
#1Aleksander Alekseev
aleksander@timescale.com

Hi,

The proposed patch adds tests for binaryheap.c. This is similar to our
tests for RB-trees in test_rbtree.c.

--
Best regards,
Aleksander Alekseev

Attachments:

v1-0001-Add-tests-for-binaryheap.c.patchapplication/octet-stream; name=v1-0001-Add-tests-for-binaryheap.c.patchDownload+581-1
#2Nathan Bossart
nathandbossart@gmail.com
In reply to: Aleksander Alekseev (#1)
Re: [PATCH] Add tests for binaryheap.c

On Thu, Jun 26, 2025 at 06:16:10PM +0300, Aleksander Alekseev wrote:

The proposed patch adds tests for binaryheap.c. This is similar to our
tests for RB-trees in test_rbtree.c.

Adding some tests here seems like a good idea.

I'm not sure I see much point in testing both min-heaps and max-heaps. The
only difference between the two is in the comparator, so IMHO the extra
tests really only serve to test the test comparator.

--
nathan

#3Aleksander Alekseev
aleksander@timescale.com
In reply to: Nathan Bossart (#2)
Re: [PATCH] Add tests for binaryheap.c

Hi Nathan,

Adding some tests here seems like a good idea.

I'm not sure I see much point in testing both min-heaps and max-heaps. The
only difference between the two is in the comparator, so IMHO the extra
tests really only serve to test the test comparator.

Make sense. Here is the corrected patch.

--
Best regards,
Aleksander Alekseev

Attachments:

v2-0001-Add-tests-for-binaryheap.c.patchapplication/octet-stream; name=v2-0001-Add-tests-for-binaryheap.c.patchDownload+506-1
#4Nathan Bossart
nathandbossart@gmail.com
In reply to: Aleksander Alekseev (#3)
Re: [PATCH] Add tests for binaryheap.c

On Fri, Jun 27, 2025 at 02:02:22PM +0300, Aleksander Alekseev wrote:

I'm not sure I see much point in testing both min-heaps and max-heaps. The
only difference between the two is in the comparator, so IMHO the extra
tests really only serve to test the test comparator.

Make sense. Here is the corrected patch.

I trimmed this down some more while trying to keep the coverage the same.

--
nathan

Attachments:

v3-0001-Add-tests-for-binaryheap.c.patchtext/plain; charset=us-asciiDownload+345-1
#5Aleksander Alekseev
aleksander@tigerdata.com
In reply to: Nathan Bossart (#4)
Re: [PATCH] Add tests for binaryheap.c

Hi Nathan,

Make sense. Here is the corrected patch.

I trimmed this down some more while trying to keep the coverage the same.

LGTM except for a slight issue with double semicolons at
test_binaryheap.c:160. Here is the updated patch.

Attachments:

v4-0001-Add-tests-for-binaryheap.c.patchtext/x-patch; charset=US-ASCII; name=v4-0001-Add-tests-for-binaryheap.c.patchDownload+345-1
#6Nathan Bossart
nathandbossart@gmail.com
In reply to: Aleksander Alekseev (#5)
Re: [PATCH] Add tests for binaryheap.c

Committed after some further editorialization.

--
nathan