diff --git a/test/c/std/adler32.c b/test/c/std/adler32.c index 0c5a0442..767f948e 100644 --- a/test/c/std/adler32.c +++ b/test/c/std/adler32.c @@ -131,12 +131,12 @@ test_wuffs_adler32_golden() { }, }; - int i; - for (i = 0; i < WUFFS_TESTLIB_ARRAY_SIZE(test_cases); i++) { + int tc; + for (tc = 0; tc < WUFFS_TESTLIB_ARRAY_SIZE(test_cases); tc++) { wuffs_base__io_buffer src = ((wuffs_base__io_buffer){ .data = global_src_slice, }); - CHECK_STRING(read_file(&src, test_cases[i].filename)); + CHECK_STRING(read_file(&src, test_cases[tc].filename)); int j; for (j = 0; j < 2; j++) { @@ -163,10 +163,10 @@ test_wuffs_adler32_golden() { num_bytes += data.len; } while (num_bytes < src.meta.wi); - if (have != test_cases[i].want) { - RETURN_FAIL("i=%d, j=%d, filename=\"%s\": have 0x%08" PRIX32 + if (have != test_cases[tc].want) { + RETURN_FAIL("tc=%d, j=%d, filename=\"%s\": have 0x%08" PRIX32 ", want 0x%08" PRIX32 "\n", - i, j, test_cases[i].filename, have, test_cases[i].want); + tc, j, test_cases[tc].filename, have, test_cases[tc].want); } } } diff --git a/test/c/std/crc32.c b/test/c/std/crc32.c index 9a210c4e..2a4be10d 100644 --- a/test/c/std/crc32.c +++ b/test/c/std/crc32.c @@ -131,12 +131,12 @@ test_wuffs_crc32_ieee_golden() { }, }; - int i; - for (i = 0; i < WUFFS_TESTLIB_ARRAY_SIZE(test_cases); i++) { + int tc; + for (tc = 0; tc < WUFFS_TESTLIB_ARRAY_SIZE(test_cases); tc++) { wuffs_base__io_buffer src = ((wuffs_base__io_buffer){ .data = global_src_slice, }); - CHECK_STRING(read_file(&src, test_cases[i].filename)); + CHECK_STRING(read_file(&src, test_cases[tc].filename)); int j; for (j = 0; j < 2; j++) { @@ -163,10 +163,10 @@ test_wuffs_crc32_ieee_golden() { num_bytes += data.len; } while (num_bytes < src.meta.wi); - if (have != test_cases[i].want) { - RETURN_FAIL("i=%d, j=%d, filename=\"%s\": have 0x%08" PRIX32 + if (have != test_cases[tc].want) { + RETURN_FAIL("tc=%d, j=%d, filename=\"%s\": have 0x%08" PRIX32 ", want 0x%08" PRIX32, - i, j, test_cases[i].filename, have, test_cases[i].want); + tc, j, test_cases[tc].filename, have, test_cases[tc].want); } } } diff --git a/test/c/std/json.c b/test/c/std/json.c index efbed9f0..c5b9d581 100644 --- a/test/c/std/json.c +++ b/test/c/std/json.c @@ -103,15 +103,15 @@ test_strconv_parse_number_i64() { {.want = fail, .str = "9223372036854775808"}, // 1 << 63. }; - int i; - for (i = 0; i < WUFFS_TESTLIB_ARRAY_SIZE(test_cases); i++) { + int tc; + for (tc = 0; tc < WUFFS_TESTLIB_ARRAY_SIZE(test_cases); tc++) { wuffs_base__result_i64 r = wuffs_base__parse_number_i64(wuffs_base__make_slice_u8( - (void*)test_cases[i].str, strlen(test_cases[i].str))); + (void*)test_cases[tc].str, strlen(test_cases[tc].str))); int64_t have = (r.status.repr == NULL) ? r.value : fail; - if (have != test_cases[i].want) { + if (have != test_cases[tc].want) { RETURN_FAIL("\"%s\": have 0x%" PRIX64 ", want 0x%" PRIX64, - test_cases[i].str, have, test_cases[i].want); + test_cases[tc].str, have, test_cases[tc].want); } } @@ -183,15 +183,15 @@ test_strconv_parse_number_u64() { {.want = fail, .str = "x"}, }; - int i; - for (i = 0; i < WUFFS_TESTLIB_ARRAY_SIZE(test_cases); i++) { + int tc; + for (tc = 0; tc < WUFFS_TESTLIB_ARRAY_SIZE(test_cases); tc++) { wuffs_base__result_u64 r = wuffs_base__parse_number_u64(wuffs_base__make_slice_u8( - (void*)test_cases[i].str, strlen(test_cases[i].str))); + (void*)test_cases[tc].str, strlen(test_cases[tc].str))); uint64_t have = (r.status.repr == NULL) ? r.value : fail; - if (have != test_cases[i].want) { + if (have != test_cases[tc].want) { RETURN_FAIL("\"%s\": have 0x%" PRIX64 ", want 0x%" PRIX64, - test_cases[i].str, have, test_cases[i].want); + test_cases[tc].str, have, test_cases[tc].want); } }