diff options
author | Jamie Gennis <jgennis@google.com> | 2013-04-23 15:00:45 -0700 |
---|---|---|
committer | Jamie Gennis <jgennis@google.com> | 2013-04-24 01:08:02 +0000 |
commit | ea2d942ddaea11ca5f136e27e0ab8bcd72bb0644 (patch) | |
tree | f6e3bea83d73664e67fe4855c94cad666177f25a /libs | |
parent | e692ab9a6be63193c5b52a6562d85d06c40463b8 (diff) | |
download | frameworks_native-ea2d942ddaea11ca5f136e27e0ab8bcd72bb0644.zip frameworks_native-ea2d942ddaea11ca5f136e27e0ab8bcd72bb0644.tar.gz frameworks_native-ea2d942ddaea11ca5f136e27e0ab8bcd72bb0644.tar.bz2 |
libgui_test: fix a couple minor test issues
This change fixes how the MultiTextureConsumerTest.EGLImageTargetWorks checks
for pixels. It removes the call to eglSwapBuffers so that the test does not
rely on EGL swap-preserve behavior, and it makes the test use checkPixel()
rather than doing glReadPixels itself.
Bug: 8349336
Change-Id: I0f446a0083eebd07af6fd208762878b4e367725a
Diffstat (limited to 'libs')
-rw-r--r-- | libs/gui/tests/SurfaceTexture_test.cpp | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/libs/gui/tests/SurfaceTexture_test.cpp b/libs/gui/tests/SurfaceTexture_test.cpp index 47f6df7..dd6c435 100644 --- a/libs/gui/tests/SurfaceTexture_test.cpp +++ b/libs/gui/tests/SurfaceTexture_test.cpp @@ -463,19 +463,12 @@ TEST_F(MultiTextureConsumerTest, EGLImageTargetWorks) { glVertexPointer(2, GL_FLOAT, 0, vertices); glDrawArrays(GL_TRIANGLE_FAN, 0, 4); - ASSERT_EQ( glGetError(), GL_NO_ERROR ); + ASSERT_EQ(GLenum(GL_NO_ERROR), glGetError()); } - ASSERT_TRUE( eglSwapBuffers(mEglDisplay, mEglSurface) ); - - uint32_t* pixels = new uint32_t[8*16*16]; - glReadPixels(0, 0, 8*16, 16, GL_RGBA, GL_UNSIGNED_BYTE, pixels); for (int i=0 ; i<8 ; i++) { - uint32_t p = pixels[i*16 + 8 + 8*(8*16)]; // center of each square - EXPECT_EQ(p, (i&7) * 0x10101010); + EXPECT_TRUE(checkPixel(i*16 + 8, 8, i*16, i*16, i*16, i*16, 0)); } - - delete [] pixels; } |