all repos — mgba @ 481f0f0b0ea2fc0e27c2aa97e148d3cad10bd59e

mGBA Game Boy Advance Emulator

Test: Fix writing diffs
Vicki Pfau vi@endrift.com
Sat, 11 Jul 2020 13:45:08 -0700
commit

481f0f0b0ea2fc0e27c2aa97e148d3cad10bd59e

parent

faceb902c823411f8199705a02e196e8cf969337

1 files changed, 4 insertions(+), 4 deletions(-)

jump to
M src/platform/test/cinema-main.csrc/platform/test/cinema-main.c

@@ -715,7 +715,7 @@ int b = expectB - testB;

if (r | g | b) { failed = true; if (diffs && !diff) { - diff = calloc(expected.width * expected.height, BYTES_PER_PIXEL); + diff = calloc(expected.stride * expected.height, BYTES_PER_PIXEL); } CIlog(3, "Frame %u failed at pixel %" PRIz "ux%" PRIz "u with diff %i,%i,%i (expected %02x%02x%02x, got %02x%02x%02x)\n", frameCounter, x, y, r, g, b,

@@ -763,9 +763,9 @@ if (diff) {

if (failed) { struct CInemaImage outdiff = { .data = diff, - .width = image.width, - .height = image.height, - .stride = image.width, + .width = expected.width, + .height = expected.height, + .stride = expected.stride, }; _writeDiff(test->name, &image, frame, "result");