blob: 701c020b57c614cf4600ab769d7f8df5297b569d [file] [log] [blame]
Jamie Madillf67115c2014-04-22 13:14:05 -04001#include "ANGLETest.h"
2
3class TextureTest : public ANGLETest
4{
5protected:
6 TextureTest()
7 {
8 setWindowWidth(128);
9 setWindowHeight(128);
10 setConfigRedBits(8);
11 setConfigGreenBits(8);
12 setConfigBlueBits(8);
13 setConfigAlphaBits(8);
14 }
15
16 virtual void SetUp()
17 {
18 ANGLETest::SetUp();
19 glGenTextures(1, &mTexture);
20
21 glBindTexture(GL_TEXTURE_2D, mTexture);
22 glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
23 EXPECT_GL_NO_ERROR();
24
25 ASSERT_GL_NO_ERROR();
26 }
27
28 virtual void TearDown()
29 {
30 glDeleteTextures(1, &mTexture);
31
32 ANGLETest::TearDown();
33 }
34
35 GLuint mTexture;
36};
37
38TEST_F(TextureTest, negative_api_subimage)
39{
40 glBindTexture(GL_TEXTURE_2D, mTexture);
41 EXPECT_GL_ERROR(GL_NO_ERROR);
42
43 const GLubyte *pixels[20] = { 0 };
44 glTexSubImage2D(GL_TEXTURE_2D, 0, 1, 1, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, pixels);
45 EXPECT_GL_ERROR(GL_INVALID_VALUE);
46}