Accept both EGL_BAD_CONFIG and EGL_BAD_PARAMETER from
eglCreatePbufferFromClientBuffer when passing in both invalid config
and invalid client buffer.
Bug:
18290284
Change-Id: Ic3ccf69de650e48ffd0b847014790ef1bf44ed56
}
}
+void ApiCase::expectEitherError (EGLenum expectedA, EGLenum expectedB)
+{
+ EGLenum err = m_eglTestCtx.getLibrary().getError();
+ if (err != expectedA && err != expectedB)
+ {
+ m_testCtx.getLog() << TestLog::Message << "// ERROR expected: " << eglu::getErrorStr(expectedA) << " or " << eglu::getErrorStr(expectedB) << ", Got: " << eglu::getErrorStr(err) << TestLog::EndMessage;
+ if (m_testCtx.getTestResult() == QP_TEST_RESULT_PASS)
+ m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Got invalid error");
+ }
+}
+
void ApiCase::expectBoolean (EGLBoolean expected, EGLBoolean got)
{
if (expected != got)
virtual void test (void) = DE_NULL;
void expectError (eglw::EGLenum error);
+ void expectEitherError (eglw::EGLenum errorA, eglw::EGLenum errorB);
void expectBoolean (eglw::EGLBoolean expected, eglw::EGLBoolean got);
void expectNoContext (eglw::EGLContext got);
log << TestLog::EndSection;
- log << TestLog::Section("Test2", "EGL_BAD_CONFIG is generated if config is not an EGL frame buffer configuration");
+ log << TestLog::Section("Test2", "EGL_BAD_CONFIG or EGL_BAD_PARAMETER is generated if config is not an EGL frame buffer configuration and if buffer is not valid OpenVG image");
- expectNoSurface(eglCreatePbufferFromClientBuffer(display, EGL_OPENVG_IMAGE, 0, (EGLConfig)-1, DE_NULL));
- expectError(EGL_BAD_CONFIG);
+ expectNoSurface(eglCreatePbufferFromClientBuffer(display, EGL_OPENVG_IMAGE, (EGLClientBuffer)-1, (EGLConfig)-1, DE_NULL));
+ expectEitherError(EGL_BAD_CONFIG, EGL_BAD_PARAMETER);
log << TestLog::EndSection;