Skip to content
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

Tests for coverage of config.c #1600

Merged
merged 9 commits into from
Dec 21, 2023
Merged

Tests for coverage of config.c #1600

merged 9 commits into from
Dec 21, 2023

Conversation

huitema
Copy link
Collaborator

@huitema huitema commented Dec 20, 2023

No description provided.

@huitema
Copy link
Collaborator Author

huitema commented Dec 21, 2023

This PR was motivated by a first run of test coverage measurements using gcov. The focus is on the libraries picoquic-core, picohttp-core, and picoquic-log. The first measurements show generally good coverage, with exceptions. One of those was picoquic\config.c. The goal of this first PR was to assess how much time it would take to fix coverage for a moderately large file. Answer: about a day.

Test coverage, config.c Lines Branches
Before this PR 59.7% 51.0%
After this PR 92.8% 76.0%

As shown in the change log, this was done with a combination of writing new tests, adding negative test cases to existing tests, and removing unused code. The exercise did uncover a number of issues in some rarely used faulty input scenarios, proving that there is merit in measuring code coverage.

@huitema huitema merged commit a5acc71 into master Dec 21, 2023
11 checks passed
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.

None yet

1 participant