From 38314174219ed762309f837ec440a5837210239f Mon Sep 17 00:00:00 2001 From: Bruce Merry Date: Sat, 28 Dec 2013 11:35:09 +0200 Subject: [PATCH] Add a test that queries GL_RGBA_SIGNED_COMPONENTS_EXT --- tests/all.tests | 1 + tests/bugs/CMakeLists.gl.txt | 1 + tests/bugs/query-rgba-signed-components.c | 66 +++++++++++++++++++++++++++++++ 3 files changed, 68 insertions(+) create mode 100644 tests/bugs/query-rgba-signed-components.c diff --git a/tests/all.tests b/tests/all.tests index edf066b..9bdb39f 100644 --- a/tests/all.tests +++ b/tests/all.tests @@ -2242,6 +2242,7 @@ add_texwrap_format_tests(ext_packed_float, 'GL_EXT_packed_float') ext_packed_float['pack'] = concurrent_test('ext_packed_float-pack') ext_packed_float['getteximage-invalid-format-for-packed-type'] = concurrent_test('getteximage-invalid-format-for-packed-type') add_msaa_formats_tests(ext_packed_float, 'GL_EXT_packed_float') +add_plain_test(ext_packed_float, 'query-rgba-signed-components') arb_texture_float = Group() spec['ARB_texture_float'] = arb_texture_float diff --git a/tests/bugs/CMakeLists.gl.txt b/tests/bugs/CMakeLists.gl.txt index e24ec6b..c29a21d 100644 --- a/tests/bugs/CMakeLists.gl.txt +++ b/tests/bugs/CMakeLists.gl.txt @@ -30,5 +30,6 @@ piglit_add_executable (fdo28551 fdo28551.c) piglit_add_executable (fdo31934 fdo31934.c) piglit_add_executable (tri-tex-crash tri-tex-crash.c) piglit_add_executable (vbo-buffer-unmap vbo-buffer-unmap.c) +piglit_add_executable (query-rgba-signed-components query-rgba-signed-components.c) # vim: ft=cmake: diff --git a/tests/bugs/query-rgba-signed-components.c b/tests/bugs/query-rgba-signed-components.c new file mode 100644 index 0000000..7c352ec --- /dev/null +++ b/tests/bugs/query-rgba-signed-components.c @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2013 Bruce Merry + * + * 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 + * on the rights to use, copy, modify, merge, publish, distribute, sub + * license, 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 + * NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COYPRIGTH + * HOLDERS AND/OR THEIR SUPPLIERS 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-gl-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 + +enum piglit_result +piglit_display(void) +{ + /* Should never be reached */ + return PIGLIT_FAIL; +} + +void +piglit_init(int argc, char **argv) +{ + /* sentinel values, to make sure they're overwritten */ + GLint sign[4] = {2, 2, 2, 2}; + bool pass = true; + int i; + + piglit_require_extension("GL_EXT_packed_float"); + + glGetIntegerv(GL_RGBA_SIGNED_COMPONENTS_EXT, sign); + if (!piglit_check_gl_error(GL_NO_ERROR)) + piglit_report_result(PIGLIT_FAIL); + + /* With a normal window, all channels should be unsigned */ + for (i = 0; i < 4; i++) { + if (sign[i] != 0) { + printf("Channel %c: expected 0, received %d\n", + "RGBA"[i], sign[i]); + pass = false; + } + } + + piglit_report_result(pass ? PIGLIT_PASS : PIGLIT_FAIL); +} -- 1.8.3.2