diff options
author | Nicolai Hähnle <nhaehnle@gmail.com> | 2009-10-07 20:31:22 +0200 |
---|---|---|
committer | Nicolai Hähnle <nhaehnle@gmail.com> | 2009-10-07 20:31:22 +0200 |
commit | 40fdd42fa36f3681bd75f2ea45fe0a021f7f6a62 (patch) | |
tree | 7bcb51388f3602689c8b5c854b5a287c096dbf5a /tests/shaders/glsl-uniform-out-of-bounds.c | |
parent | e70502d11cccd96ec398dad10fb1b4e2a56a7894 (diff) |
glsl-uniform-out-of-bounds: Fail harder on Mesa with incorrect handling
Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
Diffstat (limited to 'tests/shaders/glsl-uniform-out-of-bounds.c')
-rw-r--r-- | tests/shaders/glsl-uniform-out-of-bounds.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/tests/shaders/glsl-uniform-out-of-bounds.c b/tests/shaders/glsl-uniform-out-of-bounds.c index c8752a26c..3d6d6afb7 100644 --- a/tests/shaders/glsl-uniform-out-of-bounds.c +++ b/tests/shaders/glsl-uniform-out-of-bounds.c @@ -34,6 +34,7 @@ #include <windows.h> #endif +#include <limits.h> #include <stdarg.h> #include <stdio.h> @@ -253,14 +254,6 @@ static void test_matrix(void) printf("locations: a: %i b: %i c: %i b[2]: %i\n", loc_a, loc_b, loc_c, loc_b); expect_error(GL_NO_ERROR, "Type %s: Sanity check", glsl_type); - glUniformMatrix4fvARB(loc_a, 0, GL_FALSE, lots_of_zeros); - expect_error(GL_NO_ERROR, "Type %s: Write count = 0 to a", glsl_type); - glUniformMatrix4fvARB(loc_a, 1, GL_FALSE, lots_of_zeros); - expect_error(GL_NO_ERROR, "Type %s: Write count = 1 to a", glsl_type); - glUniformMatrix4fvARB(loc_a, 2, GL_FALSE, lots_of_zeros); - expect_error(GL_INVALID_OPERATION, "Type %s: Write count = 2 to a", glsl_type); - glUniformMatrix4fvARB(loc_a, 1024, GL_FALSE, lots_of_zeros); - expect_error(GL_INVALID_OPERATION, "Type %s: Write count = 1024 to a", glsl_type); glUniformMatrix4fvARB(loc_b, 0, GL_FALSE, lots_of_zeros); expect_error(GL_NO_ERROR, "Type %s: Write count = 0 to b", glsl_type); @@ -290,9 +283,18 @@ static void test_matrix(void) expect_error(GL_NO_ERROR, "Type %s: Write count = 2 to b[2]", glsl_type); /* Out of bounds; see comment above */ - glUniformMatrix4fvARB(loc_b2, 1024, GL_FALSE, lots_of_zeros); + glUniformMatrix4fvARB(loc_b2, INT_MAX, GL_FALSE, lots_of_zeros); glGetError(); /* Eat generated error, if any */ + glUniformMatrix4fvARB(loc_a, 0, GL_FALSE, lots_of_zeros); + expect_error(GL_NO_ERROR, "Type %s: Write count = 0 to a", glsl_type); + glUniformMatrix4fvARB(loc_a, 1, GL_FALSE, lots_of_zeros); + expect_error(GL_NO_ERROR, "Type %s: Write count = 1 to a", glsl_type); + glUniformMatrix4fvARB(loc_a, 2, GL_FALSE, lots_of_zeros); + expect_error(GL_INVALID_OPERATION, "Type %s: Write count = 2 to a", glsl_type); + glUniformMatrix4fvARB(loc_a, INT_MAX, GL_FALSE, lots_of_zeros); + expect_error(GL_INVALID_OPERATION, "Type %s: Write count = INT_MAX to a", glsl_type); + glDeleteObjectARB(fs); glDeleteObjectARB(vs); glDeleteObjectARB(program); @@ -303,13 +305,13 @@ piglit_display(void) { piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE); + test_matrix(); + test_vector("float", ", 0, 0, 0", glUniform1fvARB); test_vector("vec2", ", 0, 0", glUniform2fvARB); test_vector("vec3", ", 0", glUniform3fvARB); test_vector("vec4", "", glUniform4fvARB); - test_matrix(); - return PIGLIT_SUCCESS; } |