Commit 08bf81d5 by Nico Weber

clang/win: Let EGLDeviceTest.cpp build with -Wextra on trunk too.

Like https://chromium-review.googlesource.com/317360, but for code that's in ANGLE trunk but not yet rolled in by Chromium. BUG=567877 Change-Id: I59b1568b134f57919eb333e99e7d185416d5d3b5 Reviewed-on: https://chromium-review.googlesource.com/317390Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Tryjob-Request: Jamie Madill <jmadill@chromium.org> Tested-by: 's avatarNico Weber <thakis@chromium.org>
parent 41ae31c4
...@@ -124,7 +124,7 @@ class EGLDeviceCreationTest : public testing::Test ...@@ -124,7 +124,7 @@ class EGLDeviceCreationTest : public testing::Test
void CreateWindowSurface() void CreateWindowSurface()
{ {
EGLint majorVersion, minorVersion; EGLint majorVersion, minorVersion;
ASSERT_EQ(EGL_TRUE, eglInitialize(mDisplay, &majorVersion, &minorVersion)); ASSERT_EGL_TRUE(eglInitialize(mDisplay, &majorVersion, &minorVersion));
eglBindAPI(EGL_OPENGL_ES_API); eglBindAPI(EGL_OPENGL_ES_API);
ASSERT_EGL_SUCCESS(); ASSERT_EGL_SUCCESS();
...@@ -132,7 +132,7 @@ class EGLDeviceCreationTest : public testing::Test ...@@ -132,7 +132,7 @@ class EGLDeviceCreationTest : public testing::Test
// Choose a config // Choose a config
const EGLint configAttributes[] = {EGL_NONE}; const EGLint configAttributes[] = {EGL_NONE};
EGLint configCount = 0; EGLint configCount = 0;
ASSERT_EQ(EGL_TRUE, eglChooseConfig(mDisplay, configAttributes, &mConfig, 1, &configCount)); ASSERT_EGL_TRUE(eglChooseConfig(mDisplay, configAttributes, &mConfig, 1, &configCount));
// Create an OS Window // Create an OS Window
mOSWindow = CreateOSWindow(); mOSWindow = CreateOSWindow();
...@@ -315,7 +315,7 @@ TEST_F(EGLDeviceCreationTest, D3D11DeviceRecovery) ...@@ -315,7 +315,7 @@ TEST_F(EGLDeviceCreationTest, D3D11DeviceRecovery)
// ANGLE's SwapChain11::initPassThroughResources doesn't handle device lost before // ANGLE's SwapChain11::initPassThroughResources doesn't handle device lost before
// eglSwapBuffers, so we must call eglSwapBuffers before we lose the device. // eglSwapBuffers, so we must call eglSwapBuffers before we lose the device.
ASSERT_EQ(EGL_TRUE, eglSwapBuffers(mDisplay, mSurface)); ASSERT_EGL_TRUE(eglSwapBuffers(mDisplay, mSurface));
// Trigger a lost device // Trigger a lost device
trigger9_3DeviceLost(); trigger9_3DeviceLost();
...@@ -337,8 +337,8 @@ TEST_F(EGLDeviceCreationTest, D3D11DeviceRecovery) ...@@ -337,8 +337,8 @@ TEST_F(EGLDeviceCreationTest, D3D11DeviceRecovery)
// Get the D3D11 device out of the EGLDisplay again. It should be the same one as above. // Get the D3D11 device out of the EGLDisplay again. It should be the same one as above.
EGLAttrib device = 0; EGLAttrib device = 0;
EGLAttrib newEglDevice = 0; EGLAttrib newEglDevice = 0;
ASSERT_EQ(EGL_TRUE, eglQueryDisplayAttribEXT(mDisplay, EGL_DEVICE_EXT, &newEglDevice)); ASSERT_EGL_TRUE(eglQueryDisplayAttribEXT(mDisplay, EGL_DEVICE_EXT, &newEglDevice));
ASSERT_EQ(EGL_TRUE, eglQueryDeviceAttribEXT(reinterpret_cast<EGLDeviceEXT>(newEglDevice), ASSERT_EGL_TRUE(eglQueryDeviceAttribEXT(reinterpret_cast<EGLDeviceEXT>(newEglDevice),
EGL_D3D11_DEVICE_ANGLE, &device)); EGL_D3D11_DEVICE_ANGLE, &device));
ID3D11Device *newDevice = reinterpret_cast<ID3D11Device *>(device); ID3D11Device *newDevice = reinterpret_cast<ID3D11Device *>(device);
...@@ -574,7 +574,7 @@ TEST_P(EGLDeviceQueryTest, QueryDeviceBadAttribute) ...@@ -574,7 +574,7 @@ TEST_P(EGLDeviceQueryTest, QueryDeviceBadAttribute)
TEST_P(EGLDeviceQueryTest, getPlatformDisplayDeviceReuse) TEST_P(EGLDeviceQueryTest, getPlatformDisplayDeviceReuse)
{ {
EGLAttrib eglDevice = 0; EGLAttrib eglDevice = 0;
EXPECT_EQ(EGL_TRUE, EXPECT_EGL_TRUE(
eglQueryDisplayAttribEXT(getEGLWindow()->getDisplay(), EGL_DEVICE_EXT, &eglDevice)); eglQueryDisplayAttribEXT(getEGLWindow()->getDisplay(), EGL_DEVICE_EXT, &eglDevice));
EGLDisplay display2 = eglGetPlatformDisplayEXT( EGLDisplay display2 = eglGetPlatformDisplayEXT(
......
...@@ -28,6 +28,8 @@ ...@@ -28,6 +28,8 @@
#define EXPECT_EGL_SUCCESS() EXPECT_EGL_ERROR(EGL_SUCCESS) #define EXPECT_EGL_SUCCESS() EXPECT_EGL_ERROR(EGL_SUCCESS)
// EGLBoolean is |unsigned int| but EGL_TRUE is 0, not 0u. // EGLBoolean is |unsigned int| but EGL_TRUE is 0, not 0u.
#define ASSERT_EGL_TRUE(a) ASSERT_EQ(static_cast<EGLBoolean>(EGL_TRUE), (a))
#define ASSERT_EGL_FALSE(a) ASSERT_EQ(static_cast<EGLBoolean>(EGL_FALSE), (a))
#define EXPECT_EGL_TRUE(a) EXPECT_EQ(static_cast<EGLBoolean>(EGL_TRUE), (a)) #define EXPECT_EGL_TRUE(a) EXPECT_EQ(static_cast<EGLBoolean>(EGL_TRUE), (a))
#define EXPECT_EGL_FALSE(a) EXPECT_EQ(static_cast<EGLBoolean>(EGL_FALSE), (a)) #define EXPECT_EGL_FALSE(a) EXPECT_EQ(static_cast<EGLBoolean>(EGL_FALSE), (a))
......
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