[Piglit] [PATCH 2/7] ARB_pipeline_statistics_query: Add range for expected results

Ben Widawsky benjamin.widawsky at intel.com
Fri Feb 13 22:54:33 PST 2015


From: Jordan Justen <jordan.l.justen at intel.com>

Ben: rebased for 64bit data types

Signed-off-by: Jordan Justen <jordan.l.justen at intel.com>
Signed-off-by: Ben Widawsky <ben at bwidawsk.net>
---
 tests/spec/arb_pipeline_statistics_query/pipeline_stats_vert.c |  6 +++---
 tests/spec/arb_pipeline_statistics_query/pipestat_help.c       | 10 +++++++---
 tests/spec/arb_pipeline_statistics_query/pipestat_help.h       |  3 ++-
 3 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/tests/spec/arb_pipeline_statistics_query/pipeline_stats_vert.c b/tests/spec/arb_pipeline_statistics_query/pipeline_stats_vert.c
index 7072b4e..969b76b 100644
--- a/tests/spec/arb_pipeline_statistics_query/pipeline_stats_vert.c
+++ b/tests/spec/arb_pipeline_statistics_query/pipeline_stats_vert.c
@@ -81,15 +81,15 @@ static struct query queries[] = {
 	{
 	 .query = GL_PRIMITIVES_SUBMITTED_ARB,
 	 .name = "GL_PRIMITIVES_SUBMITTED_ARB",
-	 .expected = NUM_PRIMS},
+	 .min = NUM_PRIMS},
 	{
 	 .query = GL_VERTICES_SUBMITTED_ARB,
 	 .name = "GL_VERTICES_SUBMITTED_ARB",
-	 .expected = NUM_VERTS},
+	 .min = NUM_VERTS},
 	{
 	 .query = GL_VERTEX_SHADER_INVOCATIONS_ARB,
 	 .name = "GL_VERTEX_SHADER_INVOCATIONS_ARB",
-	 .expected = NUM_VERTS}
+	 .min = NUM_VERTS}
 };
 
 /* Use DISPLAY for debug */
diff --git a/tests/spec/arb_pipeline_statistics_query/pipestat_help.c b/tests/spec/arb_pipeline_statistics_query/pipestat_help.c
index ab9630a..2f1444a 100644
--- a/tests/spec/arb_pipeline_statistics_query/pipestat_help.c
+++ b/tests/spec/arb_pipeline_statistics_query/pipestat_help.c
@@ -81,11 +81,15 @@ do_query(const struct query *queries, const int count)
 		end_query(&queries[i]);
 
 	for (i = 0; i < count; i++) {
+		const struct query *q = &queries[i];
+		GLuint64 max = q->max != 0 ? q->max : q->min;
 		GLuint64 params;
+
 		glGetQueryObjectui64v(queries[i].obj, GL_QUERY_RESULT, &params);
-		if (params != queries[i].expected) {
-			fprintf(stderr, "%s was %" PRIu64 "Expected %" PRIu64 "\n",
-				queries[i].name, params, queries[i].expected);
+		if (q->min > params || max < params) {
+			fprintf(stderr,
+					"%s value was invalid.\n  Expected: %" PRIu64 " - %" PRIu64 "\n  Observed: %" PRIu64 "\n",
+					q->name, q->min, max, params);
 			piglit_report_result(PIGLIT_FAIL);
 		}
 	}
diff --git a/tests/spec/arb_pipeline_statistics_query/pipestat_help.h b/tests/spec/arb_pipeline_statistics_query/pipestat_help.h
index 97cb3ca..ac5d13c 100644
--- a/tests/spec/arb_pipeline_statistics_query/pipestat_help.h
+++ b/tests/spec/arb_pipeline_statistics_query/pipestat_help.h
@@ -10,7 +10,8 @@ struct query {
 	GLuint obj;
 	GLuint query;
 	const char *name;
-	GLuint64 expected;
+	GLuint64 min;
+	GLuint64 max;
 };
 
 static inline void
-- 
2.3.0



More information about the Piglit mailing list