summaryrefslogtreecommitdiff
path: root/tests/general/geterror-invalid-enum.c
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2010-12-02 11:40:23 -0800
committerIan Romanick <ian.d.romanick@intel.com>2010-12-03 10:50:11 -0800
commitbf958cc359f00caad4c58608a8573b61f972ef66 (patch)
treec6aaccfd83fb94b4ef7d5751ad5e41423ab71f82 /tests/general/geterror-invalid-enum.c
parentc42393f06d8255bda9c787ed5690f1f23aa84258 (diff)
Verify that glGetBooleanv generates GL_INVALID_ENUM
Reproduces bugzilla #31987.
Diffstat (limited to 'tests/general/geterror-invalid-enum.c')
-rw-r--r--tests/general/geterror-invalid-enum.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/tests/general/geterror-invalid-enum.c b/tests/general/geterror-invalid-enum.c
new file mode 100644
index 000000000..0cea01a6d
--- /dev/null
+++ b/tests/general/geterror-invalid-enum.c
@@ -0,0 +1,42 @@
+/*
+ * Copyright © 2010 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 "piglit-util.h"
+
+int piglit_width = 10, piglit_height = 10;
+int piglit_window_mode = GLUT_RGB | GLUT_DOUBLE;
+
+enum piglit_result
+piglit_display(void)
+{
+ return PIGLIT_FAILURE;
+}
+
+void
+piglit_init(int argc, char **argv)
+{
+ GLboolean params;
+
+ glGetBooleanv(GL_NONE, &params);
+ piglit_report_result(glGetError() == GL_INVALID_ENUM
+ ? PIGLIT_SUCCESS : PIGLIT_FAILURE);
+}