[PATCH] Improve code coverage of network address functions

From: Aleksander Alekseev <aleksander(at)timescale(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: [PATCH] Improve code coverage of network address functions
Date: 2024-10-31 16:29:56
Message-ID: CAJ7c6TOyZ9bGNrDK6Z3Q0gr9ow8ZpOm+=+01mpE0dsdH4C+u9A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi hackers,

Recently I played with lcov [1]. In the process it was discovered that
the following functions are not executed by our tests:

- abbrev(inet)
- set_masklen(cidr,int4)
- netmask(inet)
- hostmask(inet)
- inet_client_addr()
- inet_client_port()
- inet_server_addr()
- inet_server_port()

The proposed patch fixes this. For the last four functions the return
values are not checked, only the fact that the functions are callable
and don't crash.

This improves code coverage of src/backend/utils/adt/network.c from
69.8% to 80.1%.

[1]: https://postgr.es/m/CAJ7c6TPYPF93%2ByWi%3DThKiOsnhqLpeTmctMrJWz3xRQobGSY6BA%40mail.gmail.com

--
Best regards,
Aleksander Alekseev

Attachment Content-Type Size
v1-0001-Improve-code-coverage-of-network-address-function.patch application/x-patch 5.3 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Aleksander Alekseev 2024-10-31 16:37:43 Re: Having problems generating a code coverage report
Previous Message Heikki Linnakangas 2024-10-31 16:29:13 Re: Relcache refactoring