From 26cf8d9cc7f8e18fb2671e05824df7a721e56b48 Mon Sep 17 00:00:00 2001 From: Bruce Merry Date: Mon, 30 Dec 2013 14:04:53 +0200 Subject: [PATCH] Add a test case for FDO bug 73144 --- tests/all.tests | 1 + tests/bugs/CMakeLists.gl.txt | 1 + tests/bugs/fdo73144.c | 69 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 71 insertions(+) create mode 100644 tests/bugs/fdo73144.c diff --git a/tests/all.tests b/tests/all.tests index 9bdb39f..2e01a39 100644 --- a/tests/all.tests +++ b/tests/all.tests @@ -577,6 +577,7 @@ add_plain_test(gl11, 'texture-al') add_concurrent_test(gl11, 'triangle-guardband-viewport') add_concurrent_test(gl11, 'getteximage-targets 1D') add_concurrent_test(gl11, 'getteximage-targets 2D') +add_plain_test(gl11, 'fdo73144') gl10 = Group() spec['!OpenGL 1.0'] = gl10 diff --git a/tests/bugs/CMakeLists.gl.txt b/tests/bugs/CMakeLists.gl.txt index c29a21d..3931f1f 100644 --- a/tests/bugs/CMakeLists.gl.txt +++ b/tests/bugs/CMakeLists.gl.txt @@ -31,5 +31,6 @@ 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) +piglit_add_executable (fdo73144 fdo73144.c) # vim: ft=cmake: diff --git a/tests/bugs/fdo73144.c b/tests/bugs/fdo73144.c new file mode 100644 index 0000000..7d1ca38 --- /dev/null +++ b/tests/bugs/fdo73144.c @@ -0,0 +1,69 @@ +/* + * 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 = 11; + + 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) +{ + GLint width = -1, border = -1; + bool pass = true; + + glTexImage1D(GL_TEXTURE_1D, 0, GL_RGBA8, 6, 1, + GL_RGBA, GL_UNSIGNED_BYTE, NULL); + + glGetTexLevelParameteriv( + GL_TEXTURE_1D, 0, GL_TEXTURE_WIDTH, &width); + glGetTexLevelParameteriv( + GL_TEXTURE_1D, 0, GL_TEXTURE_BORDER, &border); + + if (width != 6) { + printf("Expected width 6, actual width %d\n", (int) width); + pass = false; + } + if (border != 1) { + printf("Expected border 1, actual border %d\n", (int) border); + pass = false; + } + + if (!piglit_check_gl_error(GL_NO_ERROR)) + pass = false; + + piglit_report_result(pass ? PIGLIT_PASS : PIGLIT_FAIL); +} -- 1.8.3.2