[Piglit] [PATCH 03/21] arb_internalformat_query2: test for the most generic pname checks

Alejandro Piñeiro apinheiro at igalia.com
Tue Jan 19 09:04:34 PST 2016


The spec includes conditions for all the pnames. On most cases, it is
generic like this:

 "Possible values returned are <set>. If the resource is not
  supported, or if the operation is not supported, NONE is
  returned."

So this test checks that for those pnames:
 * If it is not supported (using INTERNALFORMAT_SUPPORTED), the
   returned value is zero.
 * If it is supported, and there is available a list of possible
   values, the returned value is among one of those values.

Tested on NVIDIA GeForce GTX 950 - NVIDIA 352.55: most of them passes,
except:

* IMAGE_TEXEL_SIZE
  From spec:
      The size of a texel when the resource when used as an image
      texture is returned in <params>.  This is the value from the
      /Size/ column in Table 3.22. If the resource is not supported
      for image textures, or if image textures are not supported, zero
      is returned.

  NVIDIA proprietary drivers returns 1, 2 or 4, a values not present on Table 3.22.

* IMAGE_PIXEL_TYPE:
  From spec:
      The pixel type of the resource when used as an image texture is
      returned in <params>.  This is the value from the /Pixel type/
      column in Table 3.22. If the resource is not supported for image
      textures, or if image textures are not supported, NONE is
      returned.

  NVIDIA proprietary drivers returns in some cases
  GL_UNSIGNED_INT_8_8_8_8_REV, that although defined on core spec 4.2,
  it is not included on Table 3.22

* IMAGE_PIXEL_FORMAT:
  From spec:
      The pixel format of the resource when used as an image texture
      is returned in <params>.  This is the value from the /Pixel
      format/ column in Table 3.22. If the resource is not supported
      for image textures, or if image textures are not supported, NONE
      is returned.

  NVIDIA proprietary drivers returns in some cases GL_R11F_G11F_B10F,
  that although defined on core spec 4.2, it is not included on Table
  3.22
---
 tests/all.py                                       |   1 +
 .../arb_internalformat_query2/CMakeLists.gl.txt    |   1 +
 tests/spec/arb_internalformat_query2/common.c      | 314 +++++++++++++++++++++
 tests/spec/arb_internalformat_query2/common.h      |  48 +++-
 .../generic-pname-checks.c                         | 235 +++++++++++++++
 5 files changed, 598 insertions(+), 1 deletion(-)
 create mode 100644 tests/spec/arb_internalformat_query2/common.c
 create mode 100644 tests/spec/arb_internalformat_query2/generic-pname-checks.c

diff --git a/tests/all.py b/tests/all.py
index 3911099..ff57f3b 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -3620,6 +3620,7 @@ with profile.group_manager(
         PiglitGLTest,
         grouptools.join('spec', 'arb_internalformat_query2')) as g:
     g(['arb_internalformat_query2-api-errors'], 'API error checks')
+    g(['arb_internalformat_query2-generic-pname-checks'], 'Individual most generic pname checks')
 
 with profile.group_manager(
         PiglitGLTest, grouptools.join('spec', 'arb_map_buffer_range')) as g:
diff --git a/tests/spec/arb_internalformat_query2/CMakeLists.gl.txt b/tests/spec/arb_internalformat_query2/CMakeLists.gl.txt
index 7a0e857..cd3b07e 100644
--- a/tests/spec/arb_internalformat_query2/CMakeLists.gl.txt
+++ b/tests/spec/arb_internalformat_query2/CMakeLists.gl.txt
@@ -9,5 +9,6 @@ link_libraries (
 )
 
 piglit_add_executable (arb_internalformat_query2-api-errors api-errors.c)
+piglit_add_executable (arb_internalformat_query2-generic-pname-checks generic-pname-checks.c common.c)
 
 # vim: ft=cmake:
diff --git a/tests/spec/arb_internalformat_query2/common.c b/tests/spec/arb_internalformat_query2/common.c
new file mode 100644
index 0000000..99ea485
--- /dev/null
+++ b/tests/spec/arb_internalformat_query2/common.c
@@ -0,0 +1,314 @@
+/*
+ * Copyright © 2015 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include "common.h"
+#include <inttypes.h>  /* for PRIu64 macro */
+
+/* Generic callback type, doing a cast of params to void*, to avoid
+ * having two paths (32 and 64) for each check */
+typedef void (*GetInternalformat)(GLenum target, GLenum internalformat,
+                                  GLenum pname, GLsizei bufsize,
+                                  void *params);
+
+/* This struct is intended to abstract the fact that there are two
+ * really similar methods, and two really similar params (just change
+ * the type). All the castings and decision about which method should
+ * be used would be done here, just to keep the code of the test
+ * cleaner.
+ */
+struct _test_data {
+        /* int instead of a bool to make easier iterate on the
+         * possible values. */
+        int testing64;
+        int params_size;
+        void *params;
+        GetInternalformat callback;
+};
+
+/* Updates the callback and params based on current values of
+ * testing64 and params_size */
+static void
+sync_test_data(test_data *data)
+{
+        if (data->params != NULL)
+                free(data->params);
+
+        if (data->testing64) {
+                data->callback = (GetInternalformat) glGetInternalformati64v;
+                data->params = malloc(sizeof(GLint64) * data->params_size);
+        } else {
+                data->callback = (GetInternalformat) glGetInternalformativ;
+                data->params = malloc(sizeof(GLint) * data->params_size);
+        }
+}
+
+test_data*
+test_data_new(int testing64,
+              int params_size)
+{
+        test_data *result;
+
+        result = (test_data*) malloc(sizeof(test_data));
+        result->testing64 = testing64;
+        result->params_size = params_size;
+        result->params = NULL;
+
+        sync_test_data(result);
+
+        return result;
+}
+
+/*
+ * Frees @data, and sets its value to NULL.
+ */
+void
+test_data_clear(test_data **data)
+{
+        test_data *_data = *data;
+
+        if (_data == NULL)
+                return;
+
+        free(_data->params);
+        _data->params = NULL;
+
+        *data = NULL;
+}
+
+void
+test_data_execute(test_data *data,
+                  const GLenum target,
+                  const GLenum internalformat,
+                  const GLenum pname)
+{
+        data->callback(target, internalformat, pname,
+                       data->params_size, data->params);
+}
+
+void
+test_data_set_testing64(test_data *data,
+                        const int testing64)
+{
+        if (data->testing64 == testing64)
+                return;
+
+        data->testing64 = testing64;
+        sync_test_data(data);
+}
+
+GLint64
+test_data_value_at_index(test_data *data,
+                         const int index)
+{
+        if (index > data->params_size || index < 0) {
+                fprintf(stderr, "ERROR: invalid index while retrieving"
+                        " data from auxiliar test data\n");
+                return -1;
+        }
+
+        return data->testing64 ?
+                ((GLint64*)data->params)[index] :
+                ((GLint*)data->params)[index];
+}
+
+/*
+ * Returns if @target/@internalformat is supported using
+ * INTERNALFORMAT_SUPPORTED for @target and @internalformat.
+ *
+ * @data is only used to known if we are testing the 32-bit or the
+ * 64-bit query, so the content of @data will not be modified due this
+ * call.
+ */
+bool
+test_data_check_supported(const test_data *data,
+                          const GLenum target,
+                          const GLenum internalformat)
+{
+        bool result;
+        test_data *local_data = test_data_new(data->testing64, 1);
+
+        test_data_execute(local_data, target, internalformat,
+                          GL_INTERNALFORMAT_SUPPORTED);
+
+        if (!piglit_check_gl_error(GL_NO_ERROR))
+                result = false;
+        else
+                result = !test_data_is_zero(local_data);
+
+        test_data_clear(&local_data);
+
+        return result;
+}
+
+bool
+test_data_is_zero(test_data *data)
+{
+        return test_data_value_at_index(data, 0) == 0;
+}
+
+/* Returns if @value is one of the values among @set */
+bool
+value_on_set(const GLint *set,
+       const unsigned set_size,
+       GLint value)
+{
+        unsigned i;
+
+        for (i = 0; i < set_size; i++) {
+                if (set[i] == value)
+                        return true;
+        }
+
+        return false;
+}
+
+bool
+test_data_check_possible_values(test_data *data,
+                                const GLint *possible_values,
+                                const unsigned num_possible_values)
+{
+        return value_on_set(possible_values, num_possible_values,
+                            test_data_value_at_index(data, 0));
+}
+
+/*
+ * Prints the info of a failing case for a given pname.
+ *
+ * Note that it tries to get the name of the value at @data as if it
+ * were a enum, as it is useful on that case. But there are several
+ * pnames that returns a value. A possible improvement would be that
+ * for those just printing the value.
+ */
+void
+print_failing_case(const GLenum target, const GLenum internalformat,
+                   const GLenum pname, test_data *data)
+{
+        print_failing_case_full(target, internalformat, pname, -1, data);
+}
+
+/*
+ * Prints the info of a failing case. If expected_value is smaller
+ * that 0, it is not printed.
+*/
+void print_failing_case_full(const GLenum target, const GLenum internalformat,
+                             const GLenum pname, GLint64 expected_value,
+                             test_data *data)
+{
+        /* Knowing if it is supported is interesting in order to know
+         * if the test is being too restrictive */
+        bool supported = test_data_check_supported(data, target, internalformat);
+        GLint64 current_value = test_data_value_at_index(data, 0);
+
+        if (data->testing64) {
+                fprintf(stderr,  "    64 bit failing case: ");
+        } else {
+                fprintf(stderr,  "    32 bit failing case: ");
+        }
+
+        fprintf(stderr, "pname = %s, "
+                "target = %s, internalformat = %s, ",
+                piglit_get_gl_enum_name(pname),
+                piglit_get_gl_enum_name(target),
+                piglit_get_gl_enum_name(internalformat));
+
+        if (expected_value >= 0)
+                fprintf(stderr, "expected value = (%" PRIu64 "), ",
+                        expected_value);
+
+        fprintf(stderr, "params[0] = (%" PRIu64 ",%s), "
+                "supported=%i\n",
+                current_value,
+                piglit_get_gl_enum_name(current_value),
+                supported);
+}
+
+/*
+ * The most basic condition. From spec, a lot of pnames has a
+ * condition like this:
+ *
+ * "Possible values returned are <set>. If the resource is not
+ *  supported, or if the operation is not supported, NONE is
+ *  returned."
+ *
+ * So this method, calls the callback defined at @data (that should be
+ * GetInternalformativ or GetInternalformati64v) using @pname, for all
+ * @num_targets at @targets, and all @num_internalformats at
+ * @internalformats, and checks the following conditions:
+ *
+ * * If @pname is not supported (calling INTERNALFORMAT_SUPPORTED),
+ *   checks that the value returned is zero
+ * * If @pname is supported, checks that the returned value is among
+ *   one of the values defined at @possible_values
+ *
+ * @possible_values, at num_possible_values is allowed to be NULL,0, for
+ * the cases where the set of returned values is not specified in
+ * detail by the spec (like INTERNALFORMAT_PREFERRED). On that case,
+ * it is not tested the returned value, and just tested that if not
+ * suppported, the returned value is zero.
+ *
+ */
+bool
+try_basic(const GLenum *targets, unsigned num_targets,
+          const GLenum *internalformats, unsigned num_internalformats,
+          const GLenum pname,
+          const GLint *possible_values, unsigned num_possible_values,
+          test_data *data)
+{
+        bool pass = true;
+        unsigned i;
+        unsigned j;
+
+	for (i = 0; i < num_targets; i++) {
+                for (j = 0; j < num_internalformats; j++) {
+                        bool error_test;
+                        bool value_test;
+                        bool supported;
+
+                        supported = test_data_check_supported(data, targets[i],
+                                                              internalformats[j]);
+
+                        if (supported && num_possible_values == 0)
+                                continue;
+
+                        test_data_execute(data, targets[i], internalformats[j], pname);
+
+                        error_test =
+                                piglit_check_gl_error(GL_NO_ERROR);
+
+                        value_test = supported ?
+                                test_data_check_possible_values(data, possible_values,
+                                                                num_possible_values) :
+                                test_data_is_zero(data);
+
+                        if (error_test && value_test)
+                                continue;
+
+                        print_failing_case(targets[i], internalformats[j],
+                                           pname, data);
+
+                        pass = false;
+                }
+        }
+
+	return pass;
+}
diff --git a/tests/spec/arb_internalformat_query2/common.h b/tests/spec/arb_internalformat_query2/common.h
index 2fddb2e..3b8e7b6 100644
--- a/tests/spec/arb_internalformat_query2/common.h
+++ b/tests/spec/arb_internalformat_query2/common.h
@@ -156,7 +156,10 @@ static const GLenum invalid_pnames[] = {
 
 /* From spec:
  *
- *  "<internalformats> that must be supported (in GL 4.2 or later)
+ *  "INTERNALFORMAT_SUPPORTED:
+ *  <skip>
+ *
+ * <internalformats> that must be supported (in GL 4.2 or later)
  *   include the following:
  *    - "sized internal formats" from Table 3.12, 3.13, and 3.15,
  *    - any specific "compressed internal format" from Table 3.14,
@@ -262,4 +265,47 @@ static const GLenum valid_internalformats[] = {
         GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT,
 };
 
+typedef struct _test_data test_data;
+
+test_data* test_data_new(int testing64,
+                         int params_size);
+
+void test_data_clear(test_data **data);
+
+void test_data_execute(test_data *data,
+                       const GLenum target,
+                       const GLenum internalformat,
+                       const GLenum pname);
+
+void test_data_set_testing64(test_data *data,
+                             const int testing64);
+
+bool test_data_check_supported(const test_data *data,
+                               const GLenum target,
+                               const GLenum internalformat);
+
+bool test_data_is_zero(test_data *data);
+
+bool test_data_check_possible_values(test_data *data,
+                                     const GLint *possible_values,
+                                     const unsigned num_possible_values);
+
+GLint64 test_data_value_at_index(test_data *data,
+                                 const int index);
+
+bool try_basic(const GLenum *targets, unsigned num_targets,
+               const GLenum *internalformats, unsigned num_internalformats,
+               const GLenum pname,
+               const GLint *possible_values, unsigned num_possible_values,
+               test_data *data);
+
+void print_failing_case(const GLenum target, const GLenum internalformat,
+                        const GLenum pname, test_data *data);
+
+void print_failing_case_full(const GLenum target, const GLenum internalformat,
+                             const GLenum pname, GLint64 expected_value,
+                             test_data *data);
 
+bool value_on_set(const GLint *set,
+                  const unsigned set_size,
+                  GLint value);
diff --git a/tests/spec/arb_internalformat_query2/generic-pname-checks.c b/tests/spec/arb_internalformat_query2/generic-pname-checks.c
new file mode 100644
index 0000000..ab37b4b
--- /dev/null
+++ b/tests/spec/arb_internalformat_query2/generic-pname-checks.c
@@ -0,0 +1,235 @@
+/*
+ * Copyright © 2015 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+/**
+ * \file gneric-pname-checks.c
+ *
+ * Verify a handful of conditions required by the spec for a set of
+ * pnames with the most generic conditions. Specifically it tests for the
+ * pnames that only require:
+ *
+ *  a) That if not supported, the returned value is zero
+ *  b) If supported, the returned value is among a fixed set of
+ *     possible values.
+ *
+ */
+
+#include "common.h"
+
+PIGLIT_GL_TEST_CONFIG_BEGIN
+
+	config.supports_gl_compat_version = 10;
+	config.window_visual = PIGLIT_GL_VISUAL_RGB;
+
+PIGLIT_GL_TEST_CONFIG_END
+
+static const GLenum pnames_common_outcome[] = {
+        GL_FRAMEBUFFER_RENDERABLE,
+        GL_FRAMEBUFFER_RENDERABLE_LAYERED,
+        GL_FRAMEBUFFER_BLEND,
+        GL_READ_PIXELS,
+        GL_MANUAL_GENERATE_MIPMAP,
+        GL_AUTO_GENERATE_MIPMAP,
+        GL_SRGB_READ,
+        GL_SRGB_WRITE,
+        GL_SRGB_DECODE_ARB,
+        GL_VERTEX_TEXTURE,
+        GL_TESS_CONTROL_TEXTURE,
+        GL_TESS_EVALUATION_TEXTURE,
+        GL_GEOMETRY_TEXTURE,
+        GL_FRAGMENT_TEXTURE,
+        GL_COMPUTE_TEXTURE,
+        GL_TEXTURE_SHADOW,
+        GL_TEXTURE_GATHER,
+        GL_TEXTURE_GATHER_SHADOW,
+        GL_SHADER_IMAGE_LOAD,
+        GL_SHADER_IMAGE_STORE,
+        GL_SHADER_IMAGE_ATOMIC,
+        GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_TEST,
+        GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_TEST,
+        GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_WRITE,
+        GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_WRITE,
+        GL_CLEAR_BUFFER,
+        GL_TEXTURE_VIEW,
+};
+
+static const GLint possible_values_common[] = {
+        GL_NONE,
+        GL_CAVEAT_SUPPORT,
+        GL_FULL_SUPPORT,
+};
+
+static const GLenum pnames_true_false[] = {
+        GL_COLOR_RENDERABLE,
+        GL_DEPTH_RENDERABLE,
+        GL_STENCIL_RENDERABLE,
+        GL_TEXTURE_COMPRESSED,
+};
+
+static const GLint possible_values_true_false[] = {
+        GL_TRUE,
+        GL_FALSE
+};
+
+static const GLint possible_values_image_texel_size[] = {
+        /* Not supported */
+        0,
+        /* From table 3.22 */
+        8, 16, 32, 64, 128 };
+
+static const GLint possible_values_image_compatibility_class[] = {
+        /* Not supported */
+        GL_NONE,
+        /* From table 3.22 */
+        GL_IMAGE_CLASS_4_X_32,
+        GL_IMAGE_CLASS_2_X_32,
+        GL_IMAGE_CLASS_1_X_32,
+        GL_IMAGE_CLASS_4_X_16,
+        GL_IMAGE_CLASS_2_X_16,
+        GL_IMAGE_CLASS_1_X_16,
+        GL_IMAGE_CLASS_4_X_8,
+        GL_IMAGE_CLASS_2_X_8,
+        GL_IMAGE_CLASS_1_X_8,
+        GL_IMAGE_CLASS_11_11_10,
+        GL_IMAGE_CLASS_10_10_10_2,
+};
+
+static const GLint possible_values_image_pixel_format[] = {
+        /* Not supported */
+        GL_NONE,
+        /* From table 3.22 */
+        GL_RG,
+        GL_RGB,
+        GL_RGBA,
+        GL_RED,
+        GL_RGBA_INTEGER,
+        GL_RG_INTEGER,
+        GL_RED_INTEGER,
+};
+
+static const GLint possible_values_image_pixel_type[] = {
+        /* Not supported */
+        GL_NONE,
+        /* From table 3.22 */
+        GL_FLOAT,
+        GL_HALF_FLOAT,
+        GL_UNSIGNED_INT_10F_11F_11F_REV,
+        GL_UNSIGNED_INT,
+        GL_UNSIGNED_SHORT,
+        GL_UNSIGNED_INT_2_10_10_10_REV,
+        GL_UNSIGNED_BYTE,
+        GL_UNSIGNED_SHORT,
+        GL_UNSIGNED_INT,
+        GL_INT,
+        GL_SHORT,
+        GL_BYTE,
+};
+
+enum piglit_result
+piglit_display(void)
+{
+	return PIGLIT_FAIL;
+}
+
+/*
+ * Executes try_basic on a list of pnames/possible values.
+ *
+ * check_basic and try_basic are splitted because for some pnames, we
+ * would need to check more than just try_basic.
+ */
+static bool
+check_basic(const GLenum *pnames, unsigned num_pnames,
+            const GLint *possible_values, unsigned num_possible_values)
+{
+        bool check_pass = true;
+        test_data *data = test_data_new(0, 1);
+        unsigned i;
+        int testing64;
+
+        for (i = 0; i < num_pnames; i++) {
+                bool pass = true;
+
+                for (testing64 = 0; testing64 <= 1; testing64++) {
+                        test_data_set_testing64(data, testing64);
+
+                        pass = try_basic(valid_targets, ARRAY_SIZE(valid_targets),
+                                         valid_internalformats, ARRAY_SIZE(valid_internalformats),
+                                         pnames[i],
+                                         possible_values, num_possible_values,
+                                         data)
+                                && pass;
+                }
+
+                piglit_report_subtest_result(pass ? PIGLIT_PASS : PIGLIT_FAIL,
+                                             "%s", piglit_get_gl_enum_name(pnames[i]));
+
+                check_pass = check_pass && pass;
+        }
+
+        test_data_clear(&data);
+
+        return check_pass;
+}
+
+void
+piglit_init(int argc, char **argv)
+{
+        bool pass = true;
+        GLenum pname;
+
+	piglit_require_extension("GL_ARB_framebuffer_object");
+	piglit_require_extension("GL_ARB_internalformat_query2");
+
+        pname = GL_INTERNALFORMAT_PREFERRED;
+        pass = check_basic(&pname, 1, NULL, 0) && pass;
+
+        pass = check_basic(pnames_common_outcome, ARRAY_SIZE(pnames_common_outcome),
+                           possible_values_common, ARRAY_SIZE(possible_values_common))
+                && pass;
+
+        pname = GL_IMAGE_TEXEL_SIZE;
+        pass = check_basic(&pname, 1, possible_values_image_texel_size,
+                           ARRAY_SIZE(possible_values_image_texel_size))
+                && pass;
+
+        pname = GL_IMAGE_COMPATIBILITY_CLASS;
+        pass = check_basic(&pname, 1, possible_values_image_compatibility_class,
+                           ARRAY_SIZE(possible_values_image_compatibility_class))
+                && pass;
+
+        pname = GL_IMAGE_PIXEL_FORMAT;
+        pass = check_basic(&pname, 1, possible_values_image_pixel_format,
+                           ARRAY_SIZE(possible_values_image_pixel_format))
+                && pass;
+
+        pname = GL_IMAGE_PIXEL_TYPE;
+        pass = check_basic(&pname, 1, possible_values_image_pixel_type,
+                           ARRAY_SIZE(possible_values_image_pixel_type))
+                && pass;
+
+        pass = check_basic(pnames_true_false, ARRAY_SIZE(pnames_true_false),
+                           possible_values_true_false, ARRAY_SIZE(possible_values_true_false))
+                && pass;
+
+        piglit_report_result(pass ? PIGLIT_PASS : PIGLIT_FAIL);
+}
-- 
2.1.4



More information about the Piglit mailing list