summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJelle Raaijmakers <jelle@gmta.nl>2021-10-25 00:19:10 +0200
committerBrian Gianforcaro <b.gianfo@gmail.com>2021-10-24 22:43:27 -0700
commite3f17401cbce8213ba5a1e56af6dee861a157877 (patch)
tree9a1af72423be32f49d3e539fca40042010cc7abc
parent65bcee3c62fa29ced22d68021be5de22e5031f63 (diff)
downloadserenity-e3f17401cbce8213ba5a1e56af6dee861a157877.zip
Tests: Use correct argument count for value conformance in TestScanf
-rw-r--r--Tests/LibC/TestScanf.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/Tests/LibC/TestScanf.cpp b/Tests/LibC/TestScanf.cpp
index cd6d9f27d6..50a64d0662 100644
--- a/Tests/LibC/TestScanf.cpp
+++ b/Tests/LibC/TestScanf.cpp
@@ -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);
}
}