[Piglit] [PATCH v2 1/4] getteximage-simple: Fix the coordinate printf

Nanley Chery nanleychery at gmail.com
Mon Jun 18 18:57:52 UTC 2018


---
 tests/texturing/getteximage-simple.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tests/texturing/getteximage-simple.c b/tests/texturing/getteximage-simple.c
index 273f2b36c..e86e7b25e 100644
--- a/tests/texturing/getteximage-simple.c
+++ b/tests/texturing/getteximage-simple.c
@@ -32,8 +32,10 @@ static int test_getteximage(void)
 
 	for(i = 0; i < 4096; ++i) {
 		if (data[i] != compare[i]) {
+			const unsigned pixel = i / 4;
+			const unsigned channel = i % 4;
 			printf("GetTexImage() returns incorrect data in byte %i\n", i);
-			printf("    corresponding to (%i,%i) channel %i\n", i / 64, (i / 4) % 16, i % 4);
+			printf("    corresponding to (%i,%i) channel %i\n", pixel % 64, pixel / 64, channel);
 			printf("    expected: %i\n", data[i]);
 			printf("    got: %i\n", compare[i]);
 			return 0;
-- 
2.17.1



More information about the Piglit mailing list