diff options
author | Mika Isojärvi <misojarvi@google.com> | 2016-02-18 11:57:21 -0800 |
---|---|---|
committer | Mika Isojärvi <misojarvi@google.com> | 2016-02-19 09:39:11 -0800 |
commit | 921259c6f01b9a70baf7b2d4701258fcdf53dd47 (patch) | |
tree | 1ec949e46ac316930da5525c69032eb89b6f9754 | |
parent | 54909d3e7c68ac173745cb060f60e223da671ba1 (diff) | |
download | VK-GL-CTS-921259c6f01b9a70baf7b2d4701258fcdf53dd47.tar.gz VK-GL-CTS-921259c6f01b9a70baf7b2d4701258fcdf53dd47.tar.bz2 VK-GL-CTS-921259c6f01b9a70baf7b2d4701258fcdf53dd47.zip |
Add timeout to eglClientWaitSync() tests.
Require that eglClientWaitSync() with timeout 0 and without rendering
anything finishes in 100us.
Bug: 18183346
Change-Id: Id1c8e9793cb96a95022f2d051a7b27ac03e92f53
-rw-r--r-- | modules/egl/teglSyncTests.cpp | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/modules/egl/teglSyncTests.cpp b/modules/egl/teglSyncTests.cpp index 97bc6542d..25a301613 100644 --- a/modules/egl/teglSyncTests.cpp +++ b/modules/egl/teglSyncTests.cpp @@ -38,6 +38,8 @@ #include "glwFunctions.hpp" #include "glwEnums.hpp" +#include "deClock.h" + #include <vector> #include <string> #include <sstream> @@ -461,14 +463,20 @@ public: IterateResult iterate (void) { - const Library& egl = m_eglTestCtx.getLibrary(); - TestLog& log = m_testCtx.getLog(); + const deUint64 timeoutUs = 100; + const Library& egl = m_eglTestCtx.getLibrary(); + TestLog& log = m_testCtx.getLog(); + deUint64 beginTimeUs; + deUint64 endTimeUs; m_sync = egl.createSyncKHR(m_eglDisplay, m_syncType, NULL); log << TestLog::Message << m_sync << " = eglCreateSyncKHR(" << m_eglDisplay << ", " << getSyncTypeName(m_syncType) << ", NULL)" << TestLog::EndMessage; EGLU_CHECK_MSG(egl, "eglCreateSyncKHR()"); + beginTimeUs = deGetMicroseconds(); EGLint status = egl.clientWaitSyncKHR(m_eglDisplay, m_sync, 0, 0); + endTimeUs = deGetMicroseconds(); + log << TestLog::Message << status << " = eglClientWaitSyncKHR(" << m_eglDisplay << ", " << m_sync << ", 0, 0)" << TestLog::EndMessage; if (m_syncType == EGL_SYNC_FENCE_KHR) @@ -478,6 +486,15 @@ public: else DE_ASSERT(DE_FALSE); + log << TestLog::Message << "eglClientWaitSyncKHR() took " << (endTimeUs - beginTimeUs) << "us to finish." << TestLog::EndMessage; + + if (endTimeUs - beginTimeUs > timeoutUs) + { + log << TestLog::Message << "Call without timeout should finish in less than: " << timeoutUs << "us." << TestLog::EndMessage; + m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "eglClientWaitSyncKHR(timeout=0) didn't finish fast enough"); + return STOP; + } + m_testCtx.setTestResult(QP_TEST_RESULT_PASS, "Pass"); return STOP; } |