Tests: Use correct argument count for value conformance in TestScanf

This commit is contained in:
Jelle Raaijmakers 2021-10-25 00:19:10 +02:00 committed by Brian Gianforcaro
parent 65bcee3c62
commit e3f17401cb
Notes: sideshowbarker 2024-07-18 01:55:01 +09:00

View File

@ -180,14 +180,14 @@ bool g_any_failed = false;
static bool check_value_conformance(const TestSuite& test)
{
bool fail = false;
for (int i = 0; i < test.expected_output; ++i) {
for (size_t i = 0; i < test.argument_count; ++i) {
auto& arg = test.arguments[i];
auto arg_value = arg_to_value_t(arg);
auto& value = test.expected_values[i];
if (arg_value != value) {
auto arg_ptr = (const u32*)arg_value.data();
auto value_ptr = (const u32*)value.data();
printf(" value %d FAIL, expected %04x%04x%04x%04x%04x%04x%04x%04x but got %04x%04x%04x%04x%04x%04x%04x%04x\n",
printf(" value %zu FAIL, expected %04x%04x%04x%04x%04x%04x%04x%04x but got %04x%04x%04x%04x%04x%04x%04x%04x\n",
i,
value_ptr[0], value_ptr[1], value_ptr[2], value_ptr[3],
value_ptr[4], value_ptr[5], value_ptr[6], value_ptr[7],
@ -195,7 +195,7 @@ static bool check_value_conformance(const TestSuite& test)
arg_ptr[4], arg_ptr[5], arg_ptr[6], arg_ptr[7]);
fail = true;
} else {
printf(" value %d PASS\n", i);
printf(" value %zu PASS\n", i);
}
}