Seems overkill to write a brand new test just for this so add it to
the existing invalid-formats.c test.

See Bugzilla https://bugs.freedesktop.org/show_bug.cgi?id=104908
---
 .../spec/arb_texture_compression/invalid-formats.c | 26 ++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/tests/spec/arb_texture_compression/invalid-formats.c 
b/tests/spec/arb_texture_compression/invalid-formats.c
index a201f8f..cca35cc 100644
--- a/tests/spec/arb_texture_compression/invalid-formats.c
+++ b/tests/spec/arb_texture_compression/invalid-formats.c
@@ -412,6 +412,30 @@ try_formats(const struct format_list *t, GLenum 
*compressed_formats,
        return pass;
 }
 
+
+static bool
+test_hint(void)
+{
+       GLint hint = 0;
+       glGetIntegerv(GL_TEXTURE_COMPRESSION_HINT, &hint);
+       if (hint != GL_DONT_CARE) {
+               printf("Unexpected default GL_TEXTURE_COMPRESSION_HINT"
+                      " value: %s\n", piglit_get_gl_enum_name(hint));
+               return false;
+       }
+
+       glHint(GL_TEXTURE_COMPRESSION_HINT, GL_NICEST);
+       glGetIntegerv(GL_TEXTURE_COMPRESSION_HINT, &hint);
+       if (hint != GL_NICEST) {
+               printf("Unexpected GL_TEXTURE_COMPRESSION_HINT"
+                      " value: %s\n", piglit_get_gl_enum_name(hint));
+               return false;
+       }
+
+       return true;
+}
+
+
 void
 piglit_init(int argc, char **argv)
 {
@@ -593,5 +617,7 @@ piglit_init(int argc, char **argv)
                }
        }
 
+       pass = test_hint() && pass;
+
        piglit_report_result(pass ? PIGLIT_PASS : PIGLIT_FAIL);
 }
-- 
2.7.4

_______________________________________________
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit

Reply via email to