[Piglit] [PATCH] arb_internalformat_query2: use PRIi64 instead of PRIu64 macro

Alejandro PiƱeiro apinheiro at igalia.com
Mon May 2 12:50:28 UTC 2016


As all the values we are printing are 64 bit integers, not unsigned integers.

In general this is not relevant, as no query for a supported combination
of pname,target and internalformat will return a negative value. But for
pnames like SAMPLES, if not supported, params should remain unmodified. So
if the buffer were initialized to a negative value for some reason, the
value would be wrongly printed.
---
 tests/spec/arb_internalformat_query2/common.c         | 6 +++---
 tests/spec/arb_internalformat_query2/max-dimensions.c | 2 +-
 tests/spec/arb_internalformat_query2/minmax.c         | 8 ++++----
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/tests/spec/arb_internalformat_query2/common.c b/tests/spec/arb_internalformat_query2/common.c
index 94268a7..1d60abb 100644
--- a/tests/spec/arb_internalformat_query2/common.c
+++ b/tests/spec/arb_internalformat_query2/common.c
@@ -252,10 +252,10 @@ void print_failing_case_full(const GLenum target, const GLenum internalformat,
                 piglit_get_gl_enum_name(internalformat));
 
         if (expected_value >= 0)
-                fprintf(stderr, "expected value = (%" PRIu64 "), ",
+                fprintf(stderr, "expected value = (%" PRIi64 "), ",
                         expected_value);
 
-        fprintf(stderr, "params[0] = (%" PRIu64 ",%s), "
+        fprintf(stderr, "params[0] = (%" PRIi64 ",%s), "
                 "supported=%i\n",
                 current_value,
                 piglit_get_gl_enum_name(current_value),
@@ -541,7 +541,7 @@ test_data_check_against_get_tex_level_parameter(test_data *data,
 
         if (!result) {
                 fprintf(stderr, "\tError comparing glGetInternalformat "
-                        "and glGetTexLevelParameter, params value=%" PRIu64 ", "
+                        "and glGetTexLevelParameter, params value=%" PRIi64 ", "
                         "expected value=%i\n",
                         test_data_value_at_index(data, 0), param);
         }
diff --git a/tests/spec/arb_internalformat_query2/max-dimensions.c b/tests/spec/arb_internalformat_query2/max-dimensions.c
index e3369be..7721c4e 100644
--- a/tests/spec/arb_internalformat_query2/max-dimensions.c
+++ b/tests/spec/arb_internalformat_query2/max-dimensions.c
@@ -424,7 +424,7 @@ check_params_against_dimension(test_data *data,
         result = test_data_equal_at_index(data, local_data, 0);
 
         if (!result)
-                fprintf(stderr, "%s value different to %s value (%" PRIu64 " != %" PRIu64 ")\n",
+                fprintf(stderr, "%s value different to %s value (%" PRIi64 " != %" PRIi64 ")\n",
                         piglit_get_gl_enum_name(GL_MAX_LAYERS),
                         piglit_get_gl_enum_name(dimension_pname),
                         test_data_value_at_index(data, 0),
diff --git a/tests/spec/arb_internalformat_query2/minmax.c b/tests/spec/arb_internalformat_query2/minmax.c
index 550ac44..680fc9c 100644
--- a/tests/spec/arb_internalformat_query2/minmax.c
+++ b/tests/spec/arb_internalformat_query2/minmax.c
@@ -170,7 +170,7 @@ real_try(GLenum target, GLenum format, GLint max_samples,
                 if (test_data_value_at_index(data_samples, i) <= 0) {
                         ERROR_HEADER(data_samples);
                         fprintf(stderr,
-                                "Invalid sample count [%u] = %" PRIu64 " returned "
+                                "Invalid sample count [%u] = %" PRIi64 " returned "
                                 "for %s/%s (num sample counts = %i)\n",
                                 i, test_data_value_at_index(data_samples, i),
                                 piglit_get_gl_enum_name(target),
@@ -182,7 +182,7 @@ real_try(GLenum target, GLenum format, GLint max_samples,
                 if (previous == test_data_value_at_index(data_samples, i)) {
                         ERROR_HEADER(data_samples);
                         fprintf(stderr,
-                                "Duplicate values [%u] = [%u] = %" PRIu64 " returned "
+                                "Duplicate values [%u] = [%u] = %" PRIi64 " returned "
                                 "for %s/%s (num sample counts = %i)\n",
                                 i - 1, i, test_data_value_at_index(data_samples, i),
                                 piglit_get_gl_enum_name(target),
@@ -195,7 +195,7 @@ real_try(GLenum target, GLenum format, GLint max_samples,
                         ERROR_HEADER(data_samples);
                         fprintf(stderr,
                                 "Values not in descending order "
-                                "([%u] = %d) < ([%u] = %" PRIu64 ") returned "
+                                "([%u] = %d) < ([%u] = %" PRIi64 ") returned "
                                 "for %s/%s (num sample counts = %i)\n",
                                 i - 1, previous,
                                 i, test_data_value_at_index(data_samples, i),
@@ -229,7 +229,7 @@ real_try(GLenum target, GLenum format, GLint max_samples,
         if (test_data_value_at_index(data_samples, 0) < max_samples) {
                 ERROR_HEADER(data_samples);
                 fprintf(stderr,
-                        "GL_SAMPLES (%" PRIu64 ") smaller than %s (%d) "
+                        "GL_SAMPLES (%" PRIi64 ") smaller than %s (%d) "
                         "for %s/%s\n",
                         test_data_value_at_index(data_samples, 0),
                         max_samples_name,
-- 
2.5.0



More information about the Piglit mailing list