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

test1521: test *all* curl_easy_setopt options #1543

Closed
wants to merge 1 commit into from

Conversation

bagder
Copy link
Member

@bagder bagder commented Jun 5, 2017

mk-lib1521.pl generates a test program (lib1521.c) that calls
curl_easy_setopt() for every known option with a few typical values to
make sure they work (ignoring the return codes).

Some small changes was necessary to avoid asserts and NULL accesses when
doing this.

The perl script is not automatically run but needs to be manually rerun
when we add new options.

mk-lib1521.pl generates a test program (lib1521.c) that calls
curl_easy_setopt() for every known option with a few typical values to
make sure they work (ignoring the return codes).

Some small changes was necessary to avoid asserts and NULL accesses when
doing this.

The perl script is not automatically run but needs to be manually rerun
when we add new options.
@coveralls
Copy link

Coverage Status

Coverage increased (+1.0%) to 73.233% when pulling 89d920e on bagder/test-all-setopts into b95a07e on master.

@bagder bagder closed this in cccac4f Jun 5, 2017
@bagder bagder deleted the bagder/test-all-setopts branch June 5, 2017 13:12
@dfandrich
Copy link
Contributor

I don't quite see the point of this test. Yes, it increases code coverage, but does it really test anything useful? It doesn't test that the values are passed in properly, or translated properly, or used properly. It doesn't even check that the return code is as expected. If at least the return code was checked, then I could see some marginal utility.

@MarcelRaad
Copy link
Member

@dfandrich When built with GCC 4.3+ and optimization on, this tests the curl_easy_setopt macro in typecheck-gcc.h.

@bagder
Copy link
Member Author

bagder commented Jun 5, 2017

Exactly, and with #1544 the typecheck-gcc.h rules will be verfied by travis CI for all commits and PRs.

I had to fix several code issues (including one typecheck fix) to get test 1521 to run ok, so I think it has already proven itself worth the effort. I wanted to make sure that all numerical options can handle extreme values and for pointers that they can get set to NULL just fine etc.

I certainly agree that there's still room for improvement of this test to also check the return codes, but due to different build combinations and setups which causes different return codes it is much harder to do this.

@lock lock bot locked as resolved and limited conversation to collaborators Jan 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants