From 365322b8bcf9efb6a361473d227b70f2032212ce Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sun, 3 Apr 2016 11:57:34 +0200 Subject: tests/libtest: follow our code style guidelines better ... checksrc of all test code is pending. --- tests/libtest/libauthretry.c | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'tests/libtest/libauthretry.c') diff --git a/tests/libtest/libauthretry.c b/tests/libtest/libauthretry.c index fac07fbee..994f9de06 100644 --- a/tests/libtest/libauthretry.c +++ b/tests/libtest/libauthretry.c @@ -34,7 +34,7 @@ static CURLcode send_request(CURL *curl, const char *url, int seq, CURLcode res; size_t len = strlen(url) + 4 + 1; char* full_url = malloc(len); - if (!full_url) { + if(!full_url) { fprintf(stderr, "Not enough memory for full url\n"); return CURLE_OUT_OF_MEMORY; } @@ -70,13 +70,13 @@ static CURLcode send_right_password(CURL *curl, const char *url, int seq, static long parse_auth_name(const char *arg) { - if (!arg) + if(!arg) return CURLAUTH_NONE; - if (strequal(arg, "basic")) + if(strequal(arg, "basic")) return CURLAUTH_BASIC; - if (strequal(arg, "digest")) + if(strequal(arg, "digest")) return CURLAUTH_DIGEST; - if (strequal(arg, "ntlm")) + if(strequal(arg, "ntlm")) return CURLAUTH_NTLM; return CURLAUTH_NONE; } @@ -89,58 +89,58 @@ int test(char *url) long main_auth_scheme = parse_auth_name(libtest_arg2); long fallback_auth_scheme = parse_auth_name(libtest_arg3); - if (main_auth_scheme == CURLAUTH_NONE || + if(main_auth_scheme == CURLAUTH_NONE || fallback_auth_scheme == CURLAUTH_NONE) { fprintf(stderr, "auth schemes not found on commandline\n"); return TEST_ERR_MAJOR_BAD; } - if (curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { + if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { fprintf(stderr, "curl_global_init() failed\n"); return TEST_ERR_MAJOR_BAD; } /* Send wrong password, then right password */ - if ((curl = curl_easy_init()) == NULL) { + if((curl = curl_easy_init()) == NULL) { fprintf(stderr, "curl_easy_init() failed\n"); curl_global_cleanup(); return TEST_ERR_MAJOR_BAD; } res = send_wrong_password(curl, url, 100, main_auth_scheme); - if (res != CURLE_OK) - goto test_cleanup; + if(res != CURLE_OK) + goto test_cleanup; curl_easy_reset(curl); res = send_right_password(curl, url, 200, fallback_auth_scheme); - if (res != CURLE_OK) - goto test_cleanup; + if(res != CURLE_OK) + goto test_cleanup; curl_easy_reset(curl); curl_easy_cleanup(curl); /* Send wrong password twice, then right password */ - if ((curl = curl_easy_init()) == NULL) { + if((curl = curl_easy_init()) == NULL) { fprintf(stderr, "curl_easy_init() failed\n"); curl_global_cleanup(); return TEST_ERR_MAJOR_BAD; } res = send_wrong_password(curl, url, 300, main_auth_scheme); - if (res != CURLE_OK) - goto test_cleanup; + if(res != CURLE_OK) + goto test_cleanup; curl_easy_reset(curl); res = send_wrong_password(curl, url, 400, fallback_auth_scheme); - if (res != CURLE_OK) - goto test_cleanup; + if(res != CURLE_OK) + goto test_cleanup; curl_easy_reset(curl); res = send_right_password(curl, url, 500, fallback_auth_scheme); - if (res != CURLE_OK) - goto test_cleanup; + if(res != CURLE_OK) + goto test_cleanup; curl_easy_reset(curl); test_cleanup: -- cgit v1.2.3