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.
This commit is contained in:
2017-05-31 21:37:42 -07:00
parent 7900ac28ff
commit e062a40571

View File

@@ -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;
}
}