From: Daniel Stenberg Date: Wed, 19 Jun 2024 07:34:43 +0000 (+0200) Subject: unit2604: use 'unitfail' instead of 'error' variable X-Git-Tag: curl-8_9_0~216 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=df2fbc27775b30da6abd3daa2640042e1ed0dd88;p=thirdparty%2Fcurl.git unit2604: use 'unitfail' instead of 'error' variable Since the framework is already returning that variable by default. Avoids a warning for unreachable code. Reported-by: Tal Regev Fixes #13967 Closes #13973 --- diff --git a/tests/unit/unit2604.c b/tests/unit/unit2604.c index 82b7e56366..734827b0ea 100644 --- a/tests/unit/unit2604.c +++ b/tests/unit/unit2604.c @@ -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