From: Courtney Goeltzenleuchter Date: Tue, 12 Sep 2017 23:11:21 +0000 (-0600) Subject: Catch BAD_MATCH from createWindowSurface X-Git-Tag: upstream/1.3.5~1205^2^2~3^2~37 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c6b2df70ee3d8acd4d23da1116edcd6b3e5b26a0;p=platform%2Fupstream%2FVK-GL-CTS.git Catch BAD_MATCH from createWindowSurface On some platforms, it's possible to fail createWindowSurface for some attribute combinations. Catch that case and return NotSupported rather than a test failure. Test: adb -d shell am start \ -n com.drawelements.deqp/android.app.NativeActivity \ -e cmdLine '"deqp --deqp-case=dEQP-EGL.functional.wide_color.* \ --deqp-log-filename=/sdcard/dEQP-Log.qpa"' Bug: 65376495 Change-Id: I6546cbdfc011c7d26cfa3cdad7cc6f0df1b67122 (cherry picked from commit c35781eb8d47be8ab51b0891d1ab9bb62665488b) --- diff --git a/modules/egl/teglWideColorTests.cpp b/modules/egl/teglWideColorTests.cpp index b565fec..20d4fff 100644 --- a/modules/egl/teglWideColorTests.cpp +++ b/modules/egl/teglWideColorTests.cpp @@ -1161,7 +1161,18 @@ void WideColorSurfaceTest::executeTest (void) attribs.push_back(EGL_NONE); attribs.push_back(EGL_NONE); - const EGLSurface surface = eglu::createWindowSurface(nativeDisplay, *window, m_eglDisplay, m_eglConfig, attribs.data()); + EGLSurface surface; + try + { + surface = eglu::createWindowSurface(nativeDisplay, *window, m_eglDisplay, m_eglConfig, attribs.data()); + } + catch (const eglu::Error& error) + { + if (error.getError() == EGL_BAD_MATCH) + TCU_THROW(NotSupportedError, "createWindowSurface is not supported for this config"); + + throw; + } TCU_CHECK(surface != EGL_NO_SURFACE); EGLU_CHECK_MSG(egl, "eglCreateWindowSurface()");