From: Mika Isojärvi Date: Fri, 24 Oct 2014 08:32:35 +0000 (+0300) Subject: Fix EGL_MIPMAP_LEVEL query checks. X-Git-Tag: upstream/0.1.0~1883^2~45 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=358d99cacdf7a16393046dedd1dafc7db0b0f703;p=platform%2Fupstream%2FVK-GL-CTS.git Fix EGL_MIPMAP_LEVEL query checks. Check that EGL_MIPMAP_LEVEL query returns 0 for pbuffers and doesn't modify return value pointer for other surfaces. Bug: 18329517 Change-Id: Iff769c93306821fa16889ba3298f28f061a4bfeb (cherry picked from commit ff0bd4ba2ffca5c910035fbc37074ead9b4f5b4c) --- diff --git a/modules/egl/teglQuerySurfaceTests.cpp b/modules/egl/teglQuerySurfaceTests.cpp index 4a993aa..0817e9e 100644 --- a/modules/egl/teglQuerySurfaceTests.cpp +++ b/modules/egl/teglQuerySurfaceTests.cpp @@ -476,14 +476,25 @@ void SurfaceAttribCase::testAttributes (tcu::egl::Surface& surface, const Config // Mipmap level if (info.renderableType & EGL_OPENGL_ES_BIT || info.renderableType & EGL_OPENGL_ES2_BIT) { - const EGLint value = surface.getAttribute(EGL_MIPMAP_LEVEL); + const EGLint initialValue = 0xDEADBAAD; + EGLint value = initialValue; + + TCU_CHECK_EGL_CALL(eglQuerySurface(surface.getDisplay().getEGLDisplay(), surface.getEGLSurface(), EGL_MIPMAP_LEVEL, &value)); logSurfaceAttribute(log, EGL_MIPMAP_LEVEL, value); - if (value != 0) + if (dynamic_cast(&surface)) + { + if (value != 0) + { + log << TestLog::Message << " Fail, initial mipmap level value should be 0, is " << value << TestLog::EndMessage; + m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Invalid default mipmap level"); + } + } + else if (value != initialValue) { - log << TestLog::Message << " Fail, initial mipmap level value should be 0, is " << value << TestLog::EndMessage; - m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Invalid default mipmap level"); + log << TestLog::Message << " Fail, eglQuerySurface changed value when querying EGL_MIPMAP_LEVEL for non-pbuffer surface. Result: " << value << ". Expected: " << initialValue << TestLog::EndMessage; + m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "EGL_MIPMAP_LEVEL query modified result for non-pbuffer surface."); } eglSurfaceAttrib(display.getEGLDisplay(), surface.getEGLSurface(), EGL_MIPMAP_LEVEL, 1);