test1521: test *all* curl_easy_setopt options #1543
Conversation
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.
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. |
@dfandrich When built with GCC 4.3+ and optimization on, this tests the curl_easy_setopt macro in typecheck-gcc.h. |
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. |
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.