[Piglit] [PATCH 2/2] teximage-errors: fix a couple mistakes, add two new test cases
Brian Paul
brian.e.paul at gmail.com
Thu Sep 27 07:10:28 PDT 2012
From: Brian Paul <brianp at vmware.com>
Fix incorrect texture height (16, not 15).
Fix incorrect width, height for glCopyTexSubImage2D() test.
Add two new SubImage tests for non-existant mipmap levels.
---
tests/texturing/teximage-errors.c | 15 +++++++++++++--
1 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/tests/texturing/teximage-errors.c b/tests/texturing/teximage-errors.c
index a5acc56..bc6bc59 100644
--- a/tests/texturing/teximage-errors.c
+++ b/tests/texturing/teximage-errors.c
@@ -131,7 +131,7 @@ test_pos_and_sizes(void)
/* setup valid 2D texture for subsequent TexSubImage calls */
- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 16, 15, 0, GL_RGBA, GL_FLOAT, NULL);
+ glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 16, 16, 0, GL_RGBA, GL_FLOAT, NULL);
glTexSubImage2D(GL_TEXTURE_2D, 0, 6, 6, 100, 100, GL_RGBA, GL_FLOAT, NULL);
@@ -147,10 +147,21 @@ test_pos_and_sizes(void)
if (!piglit_check_gl_error(GL_INVALID_VALUE))
return GL_FALSE;
- glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 6, 6, 200, 200, 10, 10);
+ glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 6, 6, 2, 2, 200, 200);
if (!piglit_check_gl_error(GL_INVALID_VALUE))
return GL_FALSE;
+ /* mipmap level 1 doesn't exist */
+ glTexSubImage2D(GL_TEXTURE_2D, 1, 0, 0, 8, 8, GL_RGBA, GL_FLOAT, NULL);
+ if (!piglit_check_gl_error(GL_INVALID_OPERATION))
+ return GL_FALSE;
+
+ /* mipmap level 2 doesn't exist */
+ glCopyTexSubImage2D(GL_TEXTURE_2D, 2, 0, 0, 0, 0, 4, 4);
+ if (!piglit_check_gl_error(GL_INVALID_OPERATION))
+ return GL_FALSE;
+
+
return GL_TRUE;
}
--
1.7.4.1
More information about the Piglit
mailing list