Skip to content

Improve unit tests and eliminate dead code/branches #69

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

sebhub
Copy link
Contributor

@sebhub sebhub commented Jun 6, 2025

No description provided.

sebhub added 3 commits June 6, 2025 04:18
Yields 100% line and branch coverage for the def.c module.
If LWIP_DHCP is disabled, IP packets with a source address of 0.0.0.0
are dropped.
@sebhub sebhub force-pushed the improve-unit-tests branch 5 times, most recently from 4c0d45b to 2d55c7b Compare June 6, 2025 02:42
sebhub added 6 commits June 6, 2025 05:15
Reset linkoutput_ctr and linkoutput_byte_ctr in test_netif_add().  This
fixes test errors if LWIP_ACD is disabled, since in this case
netif_set_up() sends a gratuitous ARP.
Use right API to convert from network to host byte order.  Address 0 is
not a valid netmask.
Use a default case with an assertion to get rid of dead code.
If <ctype.h> is not used, then lwip_in_range() is available.  Use it to
optimize the hexadecimal number case.  Here, the digit case is already
handled.  Check only for alphabet ranges and combine it with the case
selection.  This eliminates a couple of dead branches.
@sebhub sebhub force-pushed the improve-unit-tests branch from 2d55c7b to 7973e7a Compare June 6, 2025 03:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant