[Piglit] [PATCH 2/4] arb_viewport_array: Move error detection closer to the causes

Ian Romanick idr at freedesktop.org
Fri Jan 10 14:05:55 PST 2014


From: Ian Romanick <ian.d.romanick at intel.com>

This made it a bit easier to notice which cases were actually failing.

Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
Cc: Jon Ashburn <jon at lunarg.com>
Cc: Courtney Goeltzenleuchter <courtney at LunarG.com>
---
 tests/spec/arb_viewport_array/minmax.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/tests/spec/arb_viewport_array/minmax.c b/tests/spec/arb_viewport_array/minmax.c
index d176d22..c2fdca0 100644
--- a/tests/spec/arb_viewport_array/minmax.c
+++ b/tests/spec/arb_viewport_array/minmax.c
@@ -83,6 +83,9 @@ piglit_init(int argc, char **argv)
 	 *    LAST_VERTEX_CONVENTION, PROVOKING_VERTEX, UNDEFINED_VERTEX."
 	 */
 	glGetIntegerv(GL_LAYER_PROVOKING_VERTEX, &layer);
+	piglit_minmax_pass = piglit_check_gl_error(GL_NO_ERROR)
+		&& piglit_minmax_pass;
+
 	switch (layer) {
 	case GL_FIRST_VERTEX_CONVENTION:
 	case GL_LAST_VERTEX_CONVENTION:
@@ -99,6 +102,9 @@ piglit_init(int argc, char **argv)
 	}
 
 	glGetIntegerv(GL_VIEWPORT_INDEX_PROVOKING_VERTEX, &index);
+	piglit_minmax_pass = piglit_check_gl_error(GL_NO_ERROR)
+		&& piglit_minmax_pass;
+
 	switch (index) {
 	case GL_FIRST_VERTEX_CONVENTION:
 	case GL_LAST_VERTEX_CONVENTION:
@@ -114,8 +120,5 @@ piglit_init(int argc, char **argv)
 		break;
 	}
 
-	if (!piglit_check_gl_error(GL_NO_ERROR))
-		piglit_report_result(PIGLIT_FAIL);
-
 	piglit_report_result(piglit_minmax_pass ? PIGLIT_PASS : PIGLIT_FAIL);
 }
-- 
1.8.1.4



More information about the Piglit mailing list