]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
unit2604: use 'unitfail' instead of 'error' variable
authorDaniel Stenberg <daniel@haxx.se>
Wed, 19 Jun 2024 07:34:43 +0000 (09:34 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 19 Jun 2024 11:37:36 +0000 (13:37 +0200)
Since the framework is already returning that variable by default.
Avoids a warning for unreachable code.

Reported-by: Tal Regev
Fixes #13967
Closes #13973

tests/unit/unit2604.c

index 82b7e563662b2571aa54ae8763abc60d6e715dca..734827b0ea174b494fdb01f686662618b16a3a20 100644 (file)
@@ -50,7 +50,6 @@ UNITTEST_START
 /* 540 a's */
 #define SA540 SA60 SA60 SA60 SA60 SA60 SA60 SA60 SA60 SA60
   int i;
-  int error = 0;
   size_t too_long = 90720;
   struct set list[] = {
     { "-too-long-", "", "", "", CURLE_TOO_LARGE},
@@ -85,18 +84,18 @@ UNITTEST_START
            list[i].cp, list[i].home, list[i].result);
     if(result != list[i].result) {
       printf("... returned %d\n", result);
-      error++;
+      unitfail++;
     }
     if(!result) {
       if(cp && strcmp(cp, list[i].next)) {
         printf("... cp points to '%s', not '%s' as expected \n",
                cp, list[i].next);
-        error++;
+        unitfail++;
       }
       if(path && strcmp(path, list[i].expect)) {
         printf("... gave '%s', not '%s' as expected \n",
                path, list[i].expect);
-        error++;
+        unitfail++;
       }
       curl_free(path);
 
@@ -104,7 +103,6 @@ UNITTEST_START
   }
 
   free((void *)list[0].cp);
-  return error == 0 ? CURLE_OK : TEST_ERR_FAILURE;
 }
 #endif