Commit 0a05df48 by Jeff Gilbert Committed by Commit Bot

Add TextureUploadFormatTest for texture unpack/upload behavior checks.

Also force ANGLE_SKIP_TEST_IF() to require a semicolon. BUG=angleproject:2220 TEST=angle_end2end_tests Change-Id: I2dc777ec75babb8fbb1a2dd8949636c5c05c5767 Reviewed-on: https://chromium-review.googlesource.com/754337 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent a3106c58
...@@ -85,6 +85,7 @@ ...@@ -85,6 +85,7 @@
'<(angle_path)/src/tests/gl_tests/TextureMultisampleTest.cpp', '<(angle_path)/src/tests/gl_tests/TextureMultisampleTest.cpp',
'<(angle_path)/src/tests/gl_tests/TextureRectangleTest.cpp', '<(angle_path)/src/tests/gl_tests/TextureRectangleTest.cpp',
'<(angle_path)/src/tests/gl_tests/TextureTest.cpp', '<(angle_path)/src/tests/gl_tests/TextureTest.cpp',
'<(angle_path)/src/tests/gl_tests/TextureUploadFormatTest.cpp',
'<(angle_path)/src/tests/gl_tests/TimerQueriesTest.cpp', '<(angle_path)/src/tests/gl_tests/TimerQueriesTest.cpp',
'<(angle_path)/src/tests/gl_tests/TransformFeedbackTest.cpp', '<(angle_path)/src/tests/gl_tests/TransformFeedbackTest.cpp',
'<(angle_path)/src/tests/gl_tests/UniformBufferTest.cpp', '<(angle_path)/src/tests/gl_tests/UniformBufferTest.cpp',
......
...@@ -364,7 +364,7 @@ TEST_P(RobustResourceInitTest, BufferData) ...@@ -364,7 +364,7 @@ TEST_P(RobustResourceInitTest, BufferData)
// Regression test for passing a zero size init buffer with the extension. // Regression test for passing a zero size init buffer with the extension.
TEST_P(RobustResourceInitTest, BufferDataZeroSize) TEST_P(RobustResourceInitTest, BufferDataZeroSize)
{ {
ANGLE_SKIP_TEST_IF(!hasGLExtension()) ANGLE_SKIP_TEST_IF(!hasGLExtension());
GLBuffer buffer; GLBuffer buffer;
glBindBuffer(GL_ARRAY_BUFFER, buffer); glBindBuffer(GL_ARRAY_BUFFER, buffer);
......
...@@ -127,6 +127,18 @@ GLColor::GLColor(GLuint colorValue) : R(0), G(0), B(0), A(0) ...@@ -127,6 +127,18 @@ GLColor::GLColor(GLuint colorValue) : R(0), G(0), B(0), A(0)
memcpy(&R, &colorValue, sizeof(GLuint)); memcpy(&R, &colorValue, sizeof(GLuint));
} }
testing::AssertionResult GLColor::ExpectNear(const GLColor &expected, const GLColor &err) const
{
testing::AssertionResult result(
abs(int(expected.R) - this->R) <= err.R && abs(int(expected.G) - this->G) <= err.G &&
abs(int(expected.B) - this->B) <= err.B && abs(int(expected.A) - this->A) <= err.A);
if (!bool(result))
{
result << "Expected " << expected << "+/-" << err << ", was " << *this;
}
return result;
}
angle::Vector4 GLColor::toNormalizedVector() const angle::Vector4 GLColor::toNormalizedVector() const
{ {
return angle::Vector4(ColorNorm(R), ColorNorm(G), ColorNorm(B), ColorNorm(A)); return angle::Vector4(ColorNorm(R), ColorNorm(G), ColorNorm(B), ColorNorm(A));
......
...@@ -82,6 +82,8 @@ struct GLColor ...@@ -82,6 +82,8 @@ struct GLColor
const GLubyte &operator[](size_t index) const { return (&R)[index]; } const GLubyte &operator[](size_t index) const { return (&R)[index]; }
testing::AssertionResult ExpectNear(const GLColor &expected, const GLColor &err) const;
GLubyte R, G, B, A; GLubyte R, G, B, A;
static const GLColor black; static const GLColor black;
...@@ -451,6 +453,6 @@ if(COND) \ ...@@ -451,6 +453,6 @@ if(COND) \
std::cout << "Test skipped: " #COND "." << std::endl; \ std::cout << "Test skipped: " #COND "." << std::endl; \
return; \ return; \
\ \
} } ANGLE_EMPTY_STATEMENT
#endif // ANGLE_TESTS_ANGLE_TEST_H_ #endif // ANGLE_TESTS_ANGLE_TEST_H_
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment