[Piglit] [PATCH] ext_unpack_subimage: Ensure piglit_probe_pixel_rgba is checked.

Vinson Lee vlee at freedesktop.org
Wed Aug 6 17:32:07 PDT 2014


Fixes Coverity "Unchecked return value" defects.

Signed-off-by: Vinson Lee <vlee at freedesktop.org>
---
 .../spec/ext_unpack_subimage/ext_unpack_subimage.c | 24 +++++++++++-----------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/tests/spec/ext_unpack_subimage/ext_unpack_subimage.c b/tests/spec/ext_unpack_subimage/ext_unpack_subimage.c
index e65f4be..3935d92 100644
--- a/tests/spec/ext_unpack_subimage/ext_unpack_subimage.c
+++ b/tests/spec/ext_unpack_subimage/ext_unpack_subimage.c
@@ -156,19 +156,19 @@ piglit_display(void)
 			     0, 0, 1, 1);
 
 	if (extension_supported) {
-		pass &= piglit_probe_pixel_rgba(piglit_width / 2,
-						piglit_height / 4,
-						blue);
-		pass &= piglit_probe_pixel_rgba(piglit_width / 2,
-						piglit_height * 3 / 4,
-						cyan);
+		pass = piglit_probe_pixel_rgba(piglit_width / 2,
+					       piglit_height / 4,
+					       blue) && pass;
+		pass = piglit_probe_pixel_rgba(piglit_width / 2,
+					       piglit_height * 3 / 4,
+					       cyan) && pass;
 	} else {
-		pass &= piglit_probe_pixel_rgba(piglit_width / 2,
-						piglit_height / 4,
-						red);
-		pass &= piglit_probe_pixel_rgba(piglit_width / 2,
-						piglit_height * 3 / 4,
-						green);
+		pass = piglit_probe_pixel_rgba(piglit_width / 2,
+					       piglit_height / 4,
+					       red) && pass;
+		pass = piglit_probe_pixel_rgba(piglit_width / 2,
+					       piglit_height * 3 / 4,
+					       green) && pass;
 	}
 
 	return pass ? PIGLIT_PASS : PIGLIT_FAIL;
-- 
1.9.3



More information about the Piglit mailing list