Remove implied '[0]' check in XFB array element resource name tests.
authorJarkko Pöyry <jpoyry@google.com>
Wed, 19 Nov 2014 19:24:24 +0000 (11:24 -0800)
committerJarkko Pöyry <jpoyry@google.com>
Wed, 19 Nov 2014 19:24:24 +0000 (11:24 -0800)
- Remove check that "name" matches "name[0]" for XFB array element
  resources.
- Clarify log messages.

Bug: 18448008
Change-Id: Ia8d98161d6d42b13ec4b1c1869494729fff3142d

modules/gles31/functional/es31fProgramInterfaceQueryTests.cpp

index 1df5f89..c55237a 100644 (file)
@@ -953,45 +953,48 @@ bool ResourceListTestCase::verifyResourceIndexQuery (const std::vector<std::stri
 
                if (index == GL_INVALID_INDEX)
                {
-                       m_testCtx.getLog() << tcu::TestLog::Message << "Error, for active resource " << referenceResources[ndx] << " got index GL_INVALID_INDEX." << tcu::TestLog::EndMessage;
+                       m_testCtx.getLog() << tcu::TestLog::Message << "Error, for active resource \"" << referenceResources[ndx] << "\" got index GL_INVALID_INDEX." << tcu::TestLog::EndMessage;
                        error = true;
                }
                else if ((int)index >= (int)resourceList.size())
                {
-                       m_testCtx.getLog() << tcu::TestLog::Message << "Error, for active resource " << referenceResources[ndx] << " got index " << index << " (larger or equal to GL_ACTIVE_RESOURCES)." << tcu::TestLog::EndMessage;
+                       m_testCtx.getLog() << tcu::TestLog::Message << "Error, for active resource \"" << referenceResources[ndx] << "\" got index " << index << " (larger or equal to GL_ACTIVE_RESOURCES)." << tcu::TestLog::EndMessage;
                        error = true;
                }
                else if (resourceList[index] != referenceResources[ndx])
                {
-                       m_testCtx.getLog() << tcu::TestLog::Message << "Error, for active resource " << referenceResources[ndx] << " got index (index = " << index << ") of another resource (" << resourceList[index] << ")." << tcu::TestLog::EndMessage;
+                       m_testCtx.getLog() << tcu::TestLog::Message << "Error, for active resource \"" << referenceResources[ndx] << "\" got index (index = " << index << ") of another resource (" << resourceList[index] << ")." << tcu::TestLog::EndMessage;
                        error = true;
                }
        }
 
-       // Query for "name" should match "name[0]"
+       // Query for "name" should match "name[0]" except for XFB
 
-       for (int ndx = 0; ndx < (int)referenceResources.size(); ++ndx)
+       if (m_programInterface != PROGRAMINTERFACE_TRANSFORM_FEEDBACK_VARYING)
        {
-               if (stringEndsWith(referenceResources[ndx], "[0]"))
+               for (int ndx = 0; ndx < (int)referenceResources.size(); ++ndx)
                {
-                       const std::string       queryString     = referenceResources[ndx].substr(0, referenceResources[ndx].length()-3);
-                       const glw::GLuint       index           = gl.getProgramResourceIndex(program, programInterface, queryString.c_str());
-                       GLU_EXPECT_NO_ERROR(gl.getError(), "query resource index");
-
-                       if (index == GL_INVALID_INDEX)
-                       {
-                               m_testCtx.getLog() << tcu::TestLog::Message << "Error, query for " << queryString << " resulted in index GL_INVALID_INDEX." << tcu::TestLog::EndMessage;
-                               error = true;
-                       }
-                       else if ((int)index >= (int)resourceList.size())
-                       {
-                               m_testCtx.getLog() << tcu::TestLog::Message << "Error, query for " << queryString << " resulted in index " << index << " (larger or equal to GL_ACTIVE_RESOURCES)." << tcu::TestLog::EndMessage;
-                               error = true;
-                       }
-                       else if (resourceList[index] != queryString + "[0]")
+                       if (stringEndsWith(referenceResources[ndx], "[0]"))
                        {
-                               m_testCtx.getLog() << tcu::TestLog::Message << "Error, query for " << queryString << " got index (index = " << index << ") of another resource (" << resourceList[index] << ")." << tcu::TestLog::EndMessage;
-                               error = true;
+                               const std::string       queryString     = referenceResources[ndx].substr(0, referenceResources[ndx].length()-3);
+                               const glw::GLuint       index           = gl.getProgramResourceIndex(program, programInterface, queryString.c_str());
+                               GLU_EXPECT_NO_ERROR(gl.getError(), "query resource index");
+
+                               if (index == GL_INVALID_INDEX)
+                               {
+                                       m_testCtx.getLog() << tcu::TestLog::Message << "Error, query for \"" << queryString << "\" resulted in index GL_INVALID_INDEX." << tcu::TestLog::EndMessage;
+                                       error = true;
+                               }
+                               else if ((int)index >= (int)resourceList.size())
+                               {
+                                       m_testCtx.getLog() << tcu::TestLog::Message << "Error, query for \"" << queryString << "\" resulted in index " << index << " (larger or equal to GL_ACTIVE_RESOURCES)." << tcu::TestLog::EndMessage;
+                                       error = true;
+                               }
+                               else if (resourceList[index] != queryString + "[0]")
+                               {
+                                       m_testCtx.getLog() << tcu::TestLog::Message << "Error, query for \"" << queryString << "\" got index (index = " << index << ") of another resource (\"" << resourceList[index] << "\")." << tcu::TestLog::EndMessage;
+                                       error = true;
+                               }
                        }
                }
        }