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
base: master
from

Conversation

Projects
None yet
4 participants
@bagder
Member

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.

test1521: test *all* curl_easy_setopt 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

This comment has been minimized.

coveralls commented Jun 5, 2017

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 Jun 5, 2017

@dfandrich

This comment has been minimized.

Collaborator

dfandrich commented Jun 5, 2017

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

This comment has been minimized.

Member

MarcelRaad commented Jun 5, 2017

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

@bagder

This comment has been minimized.

Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment