Fix error state leak in KHR_debug tests
authorPyry Haulos <phaulos@google.com>
Mon, 13 Oct 2014 17:26:44 +0000 (10:26 -0700)
committerPyry Haulos <phaulos@google.com>
Mon, 13 Oct 2014 17:26:44 +0000 (10:26 -0700)
Reset error state in KHR_debug callback and log test case variants
after expectError() call to avoid breaking code later in the test due
to lingering error state.

Change-Id: Iec4c67dc10d171a72a9faeb4af800fa8d6e20d79

modules/gles31/functional/es31fDebugTests.cpp

index de288d4..41218bc 100644 (file)
@@ -599,6 +599,9 @@ void CallbackErrorCase::expectMessage (GLenum source, GLenum type)
 {
        verifyMessage(m_lastMessage, source, type);
        m_lastMessage = MessageData();
+
+       // Reset error so that code afterwards doesn't break because of lingering error state
+       m_context.getRenderContext().getFunctions().getError();
 }
 
 void CallbackErrorCase::callback (GLenum source, GLenum type, GLuint id, GLenum severity, const string& message)
@@ -708,6 +711,9 @@ void LogErrorCase::expectMessage (GLenum source, GLenum type)
        log << TestLog::Message << "Driver says: \"" << lastMsg.message << "\"" << TestLog::EndMessage;
 
        verifyMessage(lastMsg, source, type);
+
+       // Reset error so that code afterwards doesn't break because of lingering error state
+       m_context.getRenderContext().getFunctions().getError();
 }
 
 // Generate errors, verify that calling glGetError afterwards produces desired result