From 542becc527aeb4e3c15b6b17c03a2b402fbddd7f Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Tue, 9 Jan 2024 11:12:22 +0000 Subject: [PATCH] evas test pixel diff with 9 patch plus render due to slightly different optimizations we need a big more delta inthe pixel compare. do it properly channel by channel too so we know whcih channel (a, r, g, b) is wrong --- src/tests/evas/evas_test_image.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/tests/evas/evas_test_image.c b/src/tests/evas/evas_test_image.c index 5753651f30..400915f5f5 100644 --- a/src/tests/evas/evas_test_image.c +++ b/src/tests/evas/evas_test_image.c @@ -1125,7 +1125,26 @@ EFL_START_TEST(evas_object_image_9patch) fail_if(r_w != 1024 || r_h != 1024); for (int i = 0; i < r_w * r_h; i++) - fail_if(((d[i] - r_d[i]) & 0xF8F8F8F8) != 0); + { + int pixa, pixr, pixg, pixb, refa, refr, refg, refb; + + pixa = (d[i] >> 24) & 0xff; + pixr = (d[i] >> 16) & 0xff; + pixg = (d[i] >> 8) & 0xff; + pixb = (d[i] ) & 0xff; + refa = (r_d[i] >> 24) & 0xff; + refr = (r_d[i] >> 16) & 0xff; + refg = (r_d[i] >> 8) & 0xff; + refb = (r_d[i] ) & 0xff; + pixa = abs(pixa - refa); + fail_if(pixa > 32); + pixr = abs(pixr - refr); + fail_if(pixr > 32); + pixg = abs(pixg - refg); + fail_if(pixg > 32); + pixb = abs(pixb - refb); + fail_if(pixb > 32); + } } evas_object_del(obj);