tidy-up: use CURL_ARRAYSIZE()

Follow-up to 13b2ea68f0 #16111

Closes #16381
This commit is contained in:
Viktor Szakats 2025-02-18 14:48:18 +01:00
parent 1b710381ca
commit 3fd1dfc829
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
35 changed files with 52 additions and 64 deletions

View file

@ -586,7 +586,6 @@ static const struct test_cs_entry test_cs_list[] = {
"RSA-PSK-CHACHA20-POLY1305" },
#endif
};
#define TEST_CS_LIST_LEN (sizeof(test_cs_list) / sizeof(test_cs_list[0]))
static const char *cs_test_string =
"TLS_AES_128_GCM_SHA256:TLS_AES_256_GCM_SHA384:"
@ -685,11 +684,10 @@ static const struct test_str_entry test_str_list[] = {
{ 0x0000, "GIBBERISH" },
{ 0x0000, "" },
};
#define TEST_STR_LIST_LEN (sizeof(test_str_list) / sizeof(test_str_list[0]))
UNITTEST_START
{
for(size_t i = 0; i < TEST_CS_LIST_LEN; i++) {
for(size_t i = 0; i < CURL_ARRAYSIZE(test_cs_list); i++) {
const struct test_cs_entry *test = &test_cs_list[i];
const char *expect;
char buf[64] = "";
@ -762,7 +760,7 @@ UNITTEST_START
for(ptr = cs_test_string; ptr[0] != '\0'; ptr = end) {
const struct test_str_entry *test = &test_str_list[i];
abort_if(i == TEST_STR_LIST_LEN, "should have been done");
abort_if(i == CURL_ARRAYSIZE(test_str_list), "should have been done");
id = Curl_cipher_suite_walk_str(&ptr, &end);
len = end - ptr;