From e062a40571b6e9763f4bdbabf3d1c03abb0581b4 Mon Sep 17 00:00:00 2001 From: Max Regan Date: Wed, 31 May 2017 21:37:42 -0700 Subject: [PATCH] gbasm: return the position of the first differing byte This aids debugging failing tests by showing exactly where things failed in assertions that follow failed comparisons. --- src/gbasm/tests/test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gbasm/tests/test.c b/src/gbasm/tests/test.c index cc1834f..ec84523 100644 --- a/src/gbasm/tests/test.c +++ b/src/gbasm/tests/test.c @@ -21,7 +21,7 @@ static int cmp_mem(const uint8_t *test_data, const uint8_t *expected_data, size_ if (test_data[i] != expected_data[i]) { g_test_message("memory contents differed at index %zu, data=%x, expected=%x", i, test_data[i], expected_data[i]); - return -1; + return i; } }