Revert "Imported Upstream version 7.53.1"
[platform/upstream/curl.git] / tests / libtest / libauthretry.c
index 139dab9..994f9de 100644 (file)
@@ -25,6 +25,7 @@
  */
 
 #include "test.h"
+#include "strequal.h"
 #include "memdebug.h"
 
 static CURLcode send_request(CURL *curl, const char *url, int seq,
@@ -32,7 +33,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);
+  charfull_url = malloc(len);
   if(!full_url) {
     fprintf(stderr, "Not enough memory for full url\n");
     return CURLE_OUT_OF_MEMORY;
@@ -71,11 +72,11 @@ static long parse_auth_name(const char *arg)
 {
   if(!arg)
     return CURLAUTH_NONE;
-  if(curl_strequal(arg, "basic"))
+  if(strequal(arg, "basic"))
     return CURLAUTH_BASIC;
-  if(curl_strequal(arg, "digest"))
+  if(strequal(arg, "digest"))
     return CURLAUTH_DIGEST;
-  if(curl_strequal(arg, "ntlm"))
+  if(strequal(arg, "ntlm"))
     return CURLAUTH_NTLM;
   return CURLAUTH_NONE;
 }
@@ -101,8 +102,7 @@ int test(char *url)
 
   /* Send wrong password, then right password */
 
-  curl = curl_easy_init();
-  if(!curl) {
+  if((curl = curl_easy_init()) == NULL) {
     fprintf(stderr, "curl_easy_init() failed\n");
     curl_global_cleanup();
     return TEST_ERR_MAJOR_BAD;
@@ -121,8 +121,8 @@ int test(char *url)
   curl_easy_cleanup(curl);
 
   /* Send wrong password twice, then right password */
-  curl = curl_easy_init();
-  if(!curl) {
+
+  if((curl = curl_easy_init()) == NULL) {
     fprintf(stderr, "curl_easy_init() failed\n");
     curl_global_cleanup();
     return TEST_ERR_MAJOR_BAD;