Skip to content

Commit

Permalink
tests: Adapt to CURL without NTLM support
Browse files Browse the repository at this point in the history
If CURL is built without NTLM support (e.g. if libcurl-minimal RPM
package is installed instead of libcurl on Fedora),
tests/test_handle.c failed:

    /home/test/librepo/tests/test_handle.c:61:F:Main:test_handle:0: Assertion 'lr_handle_setopt(h, ((void *)0), LRO_HTTPAUTHMETHODS, LR_AUTH_NTLM)' failed

The cause is that the test exhibing NTLM authentication also checks that
lr_handle_setopt() succeeds.

This patch stops checking a return value of lr_handle_setopt() in case
of LR_AUTH_NTLM because a meaning of the test is checking for memory
leaks.
  • Loading branch information
ppisar committed Jul 11, 2024
1 parent cdfdbb6 commit e1965a0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/test_handle.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ START_TEST(test_handle)
ck_assert(lr_handle_setopt(h, NULL, LRO_PROXY_SSLCLIENTCERT, "/etc/proxy_cert.pem"));
ck_assert(lr_handle_setopt(h, NULL, LRO_PROXY_SSLCLIENTKEY, "/etc/proxy_cert.key"));
ck_assert(lr_handle_setopt(h, NULL, LRO_PROXY_SSLCACERT, "/etc/proxy_ca.pem"));
ck_assert(lr_handle_setopt(h, NULL, LRO_HTTPAUTHMETHODS, LR_AUTH_NTLM));
(void)lr_handle_setopt(h, NULL, LRO_HTTPAUTHMETHODS, LR_AUTH_NTLM);
ck_assert(lr_handle_setopt(h, NULL, LRO_PROXYAUTHMETHODS, LR_AUTH_DIGEST));
lr_handle_free(h);
}
Expand Down

0 comments on commit e1965a0

Please sign in to comment.