diff options
Diffstat (limited to 'tests/libtest/lib1569.c')
-rw-r--r-- | tests/libtest/lib1569.c | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/tests/libtest/lib1569.c b/tests/libtest/lib1569.c index b7da426eb..e24a387e3 100644 --- a/tests/libtest/lib1569.c +++ b/tests/libtest/lib1569.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 2021 - 2022, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -28,21 +28,24 @@ int test(char *URL) { - CURLcode ret; + CURLcode res = CURLE_OK; CURL *hnd; - curl_global_init(CURL_GLOBAL_ALL); + global_init(CURL_GLOBAL_ALL); - hnd = curl_easy_init(); - curl_easy_setopt(hnd, CURLOPT_URL, URL); - curl_easy_setopt(hnd, CURLOPT_VERBOSE, 1L); - curl_easy_setopt(hnd, CURLOPT_HEADER, 1L); + easy_init(hnd); + easy_setopt(hnd, CURLOPT_URL, URL); + easy_setopt(hnd, CURLOPT_VERBOSE, 1L); + easy_setopt(hnd, CURLOPT_HEADER, 1L); - ret = curl_easy_perform(hnd); + res = curl_easy_perform(hnd); + if(res) + goto test_cleanup; curl_easy_setopt(hnd, CURLOPT_URL, libtest_arg2); - ret = curl_easy_perform(hnd); - curl_easy_cleanup(hnd); + res = curl_easy_perform(hnd); +test_cleanup: + curl_easy_cleanup(hnd); curl_global_cleanup(); - return (int)ret; + return (int)res; } |