Enforce test tree hierarchy in TestNode.
authorJarkko Pöyry <jpoyry@google.com>
Thu, 5 Feb 2015 23:56:06 +0000 (15:56 -0800)
committerJarkko Pöyry <jpoyry@google.com>
Fri, 6 Feb 2015 20:18:14 +0000 (12:18 -0800)
- Disallow group to have both groups and tests as children. This makes
  internal test tree and test tree generated for CTS to have identical
  structure.
- Update tests to never generate illegal test tree structure.

Change-Id: I8da5cc75e398eb2a35f09cba03b0a5be170a184a

12 files changed:
framework/common/tcuTestCase.cpp
framework/common/tcuTestCase.hpp
modules/gles2/functional/es2fDrawTests.cpp
modules/gles2/functional/es2fUniformApiTests.cpp
modules/gles2/stress/es2sDrawTests.cpp
modules/gles3/accuracy/es3aTextureFilteringTests.cpp
modules/gles3/functional/es3fDrawTests.cpp
modules/gles3/functional/es3fUniformApiTests.cpp
modules/gles3/stress/es3sDrawTests.cpp
modules/gles31/functional/es31fProgramInterfaceQueryTests.cpp
modules/gles31/functional/es31fProgramUniformTests.cpp
modules/internal/ditFrameworkTests.cpp

index a8aeeb7..fb7a73f 100644 (file)
@@ -45,18 +45,18 @@ inline bool isValidCaseName (const char* name)
 
 TestNode::TestNode (TestContext& testCtx, TestNodeType nodeType, const char* name, const char* description)
        : m_testCtx             (testCtx)
-       , m_nodeType    (nodeType)
        , m_name                (name)
        , m_description (description)
+       , m_nodeType    (nodeType)
 {
        DE_ASSERT(isValidCaseName(name));
 }
 
 TestNode::TestNode (TestContext& testCtx, TestNodeType nodeType, const char* name, const char* description, const vector<TestNode*>& children)
        : m_testCtx             (testCtx)
-       , m_nodeType    (nodeType)
        , m_name                (name)
        , m_description (description)
+       , m_nodeType    (nodeType)
 {
        DE_ASSERT(isValidCaseName(name));
        for (int i = 0; i < (int)children.size(); i++)
@@ -68,7 +68,7 @@ TestNode::~TestNode (void)
        TestNode::deinit();
 }
 
-void TestNode::getChildren (vector<TestNode*>& res) const
+void TestNode::getChildren (vector<TestNode*>& res)
 {
        res.clear();
        for (int i = 0; i < (int)m_children.size(); i++)
@@ -87,6 +87,13 @@ void TestNode::addChild (TestNode* node)
        }
 #endif
 
+       // children only in group nodes
+       DE_ASSERT(getTestNodeTypeClass(m_nodeType) == NODECLASS_GROUP);
+
+       // children must have the same class
+       if (!m_children.empty())
+               DE_ASSERT(getTestNodeTypeClass(m_children.front()->getNodeType()) == getTestNodeTypeClass(node->getNodeType()));
+
        m_children.push_back(node);
 }
 
index 431f7d1..9ce5271 100644 (file)
@@ -43,12 +43,34 @@ enum TestNodeType
        NODETYPE_ACCURACY               //!< Accuracy test case -- can be executed
 };
 
+enum TestNodeClass
+{
+       NODECLASS_GROUP = 0,    //!< Root or non-leaf in the test hierarchy tree
+       NODECLASS_EXECUTABLE,   //!< Non-root leaf in the test hierarchy tree
+
+       NODECLASS_LAST
+};
+
+inline TestNodeClass getTestNodeTypeClass (TestNodeType type)
+{
+       switch (type)
+       {
+               case NODETYPE_ROOT:                             return NODECLASS_GROUP;
+               case NODETYPE_PACKAGE:                  return NODECLASS_GROUP;
+               case NODETYPE_GROUP:                    return NODECLASS_GROUP;
+               case NODETYPE_SELF_VALIDATE:    return NODECLASS_EXECUTABLE;
+               case NODETYPE_PERFORMANCE:              return NODECLASS_EXECUTABLE;
+               case NODETYPE_CAPABILITY:               return NODECLASS_EXECUTABLE;
+               case NODETYPE_ACCURACY:                 return NODECLASS_EXECUTABLE;
+               default:
+                       DE_ASSERT(false);
+                       return NODECLASS_LAST;
+       }
+}
+
 inline bool isTestNodeTypeExecutable (TestNodeType type)
 {
-       return type == NODETYPE_SELF_VALIDATE   ||
-                  type == NODETYPE_PERFORMANCE         ||
-                  type == NODETYPE_CAPABILITY          ||
-                  type == NODETYPE_ACCURACY;
+       return getTestNodeTypeClass(type) == NODECLASS_EXECUTABLE;
 }
 
 inline bool isValidTestCaseNameChar (char c)
@@ -90,7 +112,7 @@ public:
        TestContext&                    getTestContext  (void) const    { return m_testCtx;                             }
        const char*                             getName                 (void) const    { return m_name.c_str();                }
        const char*                             getDescription  (void) const    { return m_description.c_str(); }
-       void                                    getChildren             (std::vector<TestNode*>& children) const;
+       void                                    getChildren             (std::vector<TestNode*>& children);
        void                                    addChild                (TestNode* node);
 
        virtual void                    init                    (void);
@@ -99,11 +121,11 @@ public:
 
 protected:
        TestContext&                    m_testCtx;
-       TestNodeType                    m_nodeType;
        std::string                             m_name;
        std::string                             m_description;
 
 private:
+       const TestNodeType              m_nodeType;
        std::vector<TestNode*>  m_children;
 };
 
index 8219f0c..762b273 100644 (file)
@@ -323,8 +323,6 @@ void IndexGroup::init (void)
 
                { gls::DrawTestSpec::STORAGE_BUFFER,    gls::DrawTestSpec::INDEXTYPE_BYTE,      true,   { 0, 1, -1 } },
                { gls::DrawTestSpec::STORAGE_BUFFER,    gls::DrawTestSpec::INDEXTYPE_SHORT,     true,   { 0, 2, -1 } },
-
-               { gls::DrawTestSpec::STORAGE_BUFFER,    gls::DrawTestSpec::INDEXTYPE_SHORT,     false,  { 1, 3, -1 } },
        };
 
        gls::DrawTestSpec spec;
@@ -332,19 +330,19 @@ void IndexGroup::init (void)
        tcu::TestCaseGroup* userPtrGroup                        = new tcu::TestCaseGroup(m_testCtx, "user_ptr", "user pointer");
        tcu::TestCaseGroup* unalignedUserPtrGroup       = new tcu::TestCaseGroup(m_testCtx, "unaligned_user_ptr", "unaligned user pointer");
        tcu::TestCaseGroup* bufferGroup                         = new tcu::TestCaseGroup(m_testCtx, "buffer", "buffer");
-       tcu::TestCaseGroup* unalignedBufferGroup        = new tcu::TestCaseGroup(m_testCtx, "unaligned_buffer", "unaligned buffer");
 
        genBasicSpec(spec, m_method);
 
        this->addChild(userPtrGroup);
        this->addChild(unalignedUserPtrGroup);
        this->addChild(bufferGroup);
-       this->addChild(unalignedBufferGroup);
 
        for (int testNdx = 0; testNdx < DE_LENGTH_OF_ARRAY(tests); ++testNdx)
        {
                const IndexTest&                                indexTest       = tests[testNdx];
-               tcu::TestCaseGroup*                             group           = (indexTest.storage == gls::DrawTestSpec::STORAGE_USER) ? ((indexTest.aligned) ? (userPtrGroup) : (unalignedUserPtrGroup)) : ((indexTest.aligned) ? (bufferGroup) : (unalignedBufferGroup));
+               tcu::TestCaseGroup*                             group           = (indexTest.storage == gls::DrawTestSpec::STORAGE_USER)
+                                                                                                       ? ((indexTest.aligned) ? (userPtrGroup) : (unalignedUserPtrGroup))
+                                                                                                       : ((indexTest.aligned) ? (bufferGroup) : (DE_NULL));
 
                const std::string                               name            = std::string("index_") + gls::DrawTestSpec::indexTypeToString(indexTest.type);
                const std::string                               desc            = std::string("index ") + gls::DrawTestSpec::indexTypeToString(indexTest.type) + " in " + gls::DrawTestSpec::storageToString(indexTest.storage);
@@ -360,9 +358,9 @@ void IndexGroup::init (void)
                        test->addIteration(spec, iterationDesc.c_str());
                }
 
-               if (spec.isCompatibilityTest() != gls::DrawTestSpec::COMPATIBILITY_UNALIGNED_OFFSET &&
-                       spec.isCompatibilityTest() != gls::DrawTestSpec::COMPATIBILITY_UNALIGNED_STRIDE)
-                       group->addChild(test.release());
+               DE_ASSERT(spec.isCompatibilityTest() != gls::DrawTestSpec::COMPATIBILITY_UNALIGNED_OFFSET);
+               DE_ASSERT(spec.isCompatibilityTest() != gls::DrawTestSpec::COMPATIBILITY_UNALIGNED_STRIDE);
+               group->addChild(test.release());
        }
 }
 
index 4e184c2..6e64042 100644 (file)
@@ -2297,8 +2297,7 @@ void UniformApiTests::init (void)
                                                {
                                                        const UniformCollectionGroup&   collectionGroup                 = defaultUniformCollections[collectionGroupNdx];
                                                        const string                                    collectionGroupName             = collectionGroup.name + (referToFirstArrayElemWithoutIndexI == 0 ? "" : "_first_elem_without_brackets");
-                                                       TestCaseGroup* const                    collectionTestGroup             = new TestCaseGroup(m_context, collectionGroupName.c_str(), "");
-                                                       checkMethodGroup->addChild(collectionTestGroup);
+                                                       TestCaseGroup*                                  collectionTestGroup             = DE_NULL;
 
                                                        for (int collectionNdx = 0; collectionNdx < (int)collectionGroup.cases.size(); collectionNdx++)
                                                        {
@@ -2328,6 +2327,13 @@ void UniformApiTests::init (void)
                                                                                const string    name                                                    = nameWithMatrixType + getCaseShaderTypeName((CaseShaderType)shaderType);
                                                                                const deUint32  arrayFirstElemNameNoIndexFeat   = referToFirstArrayElemWithoutIndexI == 0 ? 0 : UniformCase::FEATURE_ARRAY_FIRST_ELEM_NAME_NO_INDEX;
 
+                                                                               // skip empty groups by creating groups on demand
+                                                                               if (!collectionTestGroup)
+                                                                               {
+                                                                                       collectionTestGroup = new TestCaseGroup(m_context, collectionGroupName.c_str(), "");
+                                                                                       checkMethodGroup->addChild(collectionTestGroup);
+                                                                               }
+
                                                                                collectionTestGroup->addChild(new UniformValueCase(m_context, name.c_str(), "", (CaseShaderType)shaderType, uniformCollection,
                                                                                                                                                                                        UniformValueCase::VALUETOCHECK_ASSIGNED, checkMethod, assignMethod,
                                                                                                                                                                                        booleanTypeFeat | arrayFirstElemNameNoIndexFeat));
index b6d8a66..cf7fea7 100644 (file)
@@ -114,35 +114,23 @@ void IndexGroup::init (void)
 
        const IndexTest tests[] =
        {
-               { gls::DrawTestSpec::STORAGE_USER,              gls::DrawTestSpec::INDEXTYPE_BYTE,      true,   { 0, 1, -1 } },
-               { gls::DrawTestSpec::STORAGE_USER,              gls::DrawTestSpec::INDEXTYPE_SHORT,     true,   { 0, 2, -1 } },
-
-               { gls::DrawTestSpec::STORAGE_USER,              gls::DrawTestSpec::INDEXTYPE_SHORT,     false,  { 1, 3, -1 } },
-
-               { gls::DrawTestSpec::STORAGE_BUFFER,    gls::DrawTestSpec::INDEXTYPE_BYTE,      true,   { 0, 1, -1 } },
-               { gls::DrawTestSpec::STORAGE_BUFFER,    gls::DrawTestSpec::INDEXTYPE_SHORT,     true,   { 0, 2, -1 } },
-
                { gls::DrawTestSpec::STORAGE_BUFFER,    gls::DrawTestSpec::INDEXTYPE_SHORT,     false,  { 1, 3, -1 } },
        };
 
        gls::DrawTestSpec spec;
 
-       tcu::TestCaseGroup* userPtrGroup                        = new tcu::TestCaseGroup(m_testCtx, "user_ptr", "user pointer");
-       tcu::TestCaseGroup* unalignedUserPtrGroup       = new tcu::TestCaseGroup(m_testCtx, "unaligned_user_ptr", "unaligned user pointer");
-       tcu::TestCaseGroup* bufferGroup                         = new tcu::TestCaseGroup(m_testCtx, "buffer", "buffer");
        tcu::TestCaseGroup* unalignedBufferGroup        = new tcu::TestCaseGroup(m_testCtx, "unaligned_buffer", "unaligned buffer");
 
        genBasicSpec(spec, m_method);
 
-       this->addChild(userPtrGroup);
-       this->addChild(unalignedUserPtrGroup);
-       this->addChild(bufferGroup);
        this->addChild(unalignedBufferGroup);
 
        for (int testNdx = 0; testNdx < DE_LENGTH_OF_ARRAY(tests); ++testNdx)
        {
                const IndexTest&                                indexTest       = tests[testNdx];
-               tcu::TestCaseGroup*                             group           = (indexTest.storage == gls::DrawTestSpec::STORAGE_USER) ? ((indexTest.aligned) ? (userPtrGroup) : (unalignedUserPtrGroup)) : ((indexTest.aligned) ? (bufferGroup) : (unalignedBufferGroup));
+               tcu::TestCaseGroup*                             group           = (indexTest.storage == gls::DrawTestSpec::STORAGE_USER)
+                                                                                                       ? ((indexTest.aligned) ? (DE_NULL) : (DE_NULL))
+                                                                                                       : ((indexTest.aligned) ? (DE_NULL) : (unalignedBufferGroup));
 
                const std::string                               name            = std::string("index_") + gls::DrawTestSpec::indexTypeToString(indexTest.type);
                const std::string                               desc            = std::string("index ") + gls::DrawTestSpec::indexTypeToString(indexTest.type) + " in " + gls::DrawTestSpec::storageToString(indexTest.storage);
@@ -158,9 +146,9 @@ void IndexGroup::init (void)
                        test->addIteration(spec, iterationDesc.c_str());
                }
 
-               if (spec.isCompatibilityTest() == gls::DrawTestSpec::COMPATIBILITY_UNALIGNED_OFFSET ||
-                       spec.isCompatibilityTest() == gls::DrawTestSpec::COMPATIBILITY_UNALIGNED_STRIDE)
-                       group->addChild(test.release());
+               DE_ASSERT(spec.isCompatibilityTest() == gls::DrawTestSpec::COMPATIBILITY_UNALIGNED_OFFSET ||
+                                 spec.isCompatibilityTest() == gls::DrawTestSpec::COMPATIBILITY_UNALIGNED_STRIDE);
+               group->addChild(test.release());
        }
 }
 
index 8fca97f..25fe515 100644 (file)
@@ -541,7 +541,7 @@ TextureCubeFilteringCase::IterateResult TextureCubeFilteringCase::iterate (void)
        tcu::TextureFormatInfo          fmtInfo                         = tcu::getTextureFormatInfo(texFmt);
 
        // Accuracy measurements are off unless viewport size is exactly as expected.
-       if (m_nodeType == tcu::NODETYPE_ACCURACY && (viewport.width < defViewportWidth || viewport.height < defViewportHeight))
+       if (getNodeType() == tcu::NODETYPE_ACCURACY && (viewport.width < defViewportWidth || viewport.height < defViewportHeight))
                throw tcu::NotSupportedError("Too small viewport", "", __FILE__, __LINE__);
 
        // Viewport is divided into 4 sections.
index ff9fbfc..bdf22dd 100644 (file)
@@ -424,9 +424,6 @@ void IndexGroup::init (void)
                { gls::DrawTestSpec::STORAGE_BUFFER,    gls::DrawTestSpec::INDEXTYPE_BYTE,      true,   { 0, 1, -1 } },
                { gls::DrawTestSpec::STORAGE_BUFFER,    gls::DrawTestSpec::INDEXTYPE_SHORT,     true,   { 0, 2, -1 } },
                { gls::DrawTestSpec::STORAGE_BUFFER,    gls::DrawTestSpec::INDEXTYPE_INT,       true,   { 0, 4, -1 } },
-
-               { gls::DrawTestSpec::STORAGE_BUFFER,    gls::DrawTestSpec::INDEXTYPE_SHORT,     false,  { 1, 3, -1 } },
-               { gls::DrawTestSpec::STORAGE_BUFFER,    gls::DrawTestSpec::INDEXTYPE_INT,       false,  { 2, 3, -1 } },
        };
 
        gls::DrawTestSpec spec;
@@ -434,19 +431,19 @@ void IndexGroup::init (void)
        tcu::TestCaseGroup* userPtrGroup                        = new tcu::TestCaseGroup(m_testCtx, "user_ptr", "user pointer");
        tcu::TestCaseGroup* unalignedUserPtrGroup       = new tcu::TestCaseGroup(m_testCtx, "unaligned_user_ptr", "unaligned user pointer");
        tcu::TestCaseGroup* bufferGroup                         = new tcu::TestCaseGroup(m_testCtx, "buffer", "buffer");
-       tcu::TestCaseGroup* unalignedBufferGroup        = new tcu::TestCaseGroup(m_testCtx, "unaligned_buffer", "unaligned buffer");
 
        genBasicSpec(spec, m_method);
 
        this->addChild(userPtrGroup);
        this->addChild(unalignedUserPtrGroup);
        this->addChild(bufferGroup);
-       this->addChild(unalignedBufferGroup);
 
        for (int testNdx = 0; testNdx < DE_LENGTH_OF_ARRAY(tests); ++testNdx)
        {
                const IndexTest&                                indexTest       = tests[testNdx];
-               tcu::TestCaseGroup*                             group           = (indexTest.storage == gls::DrawTestSpec::STORAGE_USER) ? ((indexTest.aligned) ? (userPtrGroup) : (unalignedUserPtrGroup)) : ((indexTest.aligned) ? (bufferGroup) : (unalignedBufferGroup));
+               tcu::TestCaseGroup*                             group           = (indexTest.storage == gls::DrawTestSpec::STORAGE_USER)
+                                                                                                       ? ((indexTest.aligned) ? (userPtrGroup) : (unalignedUserPtrGroup))
+                                                                                                       : ((indexTest.aligned) ? (bufferGroup) : (DE_NULL));
 
                const std::string                               name            = std::string("index_") + gls::DrawTestSpec::indexTypeToString(indexTest.type);
                const std::string                               desc            = std::string("index ") + gls::DrawTestSpec::indexTypeToString(indexTest.type) + " in " + gls::DrawTestSpec::storageToString(indexTest.storage);
@@ -462,9 +459,9 @@ void IndexGroup::init (void)
                        test->addIteration(spec, iterationDesc.c_str());
                }
 
-               if (spec.isCompatibilityTest() != gls::DrawTestSpec::COMPATIBILITY_UNALIGNED_OFFSET &&
-                       spec.isCompatibilityTest() != gls::DrawTestSpec::COMPATIBILITY_UNALIGNED_STRIDE)
-                       group->addChild(test.release());
+               DE_ASSERT(spec.isCompatibilityTest() != gls::DrawTestSpec::COMPATIBILITY_UNALIGNED_OFFSET);
+               DE_ASSERT(spec.isCompatibilityTest() != gls::DrawTestSpec::COMPATIBILITY_UNALIGNED_STRIDE);
+               group->addChild(test.release());
        }
 }
 
index 30245f4..3364d22 100644 (file)
@@ -2823,8 +2823,7 @@ void UniformApiTests::init (void)
                                                {
                                                        const UniformCollectionGroup&   collectionGroup                 = defaultUniformCollections[collectionGroupNdx];
                                                        const string                                    collectionGroupName             = collectionGroup.name + (referToFirstArrayElemWithoutIndexI == 0 ? "" : "_first_elem_without_brackets");
-                                                       TestCaseGroup* const                    collectionTestGroup             = new TestCaseGroup(m_context, collectionGroupName.c_str(), "");
-                                                       checkMethodGroup->addChild(collectionTestGroup);
+                                                       TestCaseGroup*                                  collectionTestGroup             = DE_NULL;
 
                                                        for (int collectionNdx = 0; collectionNdx < (int)collectionGroup.cases.size(); collectionNdx++)
                                                        {
@@ -2862,6 +2861,13 @@ void UniformApiTests::init (void)
                                                                                        const string    name                                                    = nameWithMatrixType + getCaseShaderTypeName((CaseShaderType)shaderType);
                                                                                        const deUint32  arrayFirstElemNameNoIndexFeat   = referToFirstArrayElemWithoutIndexI == 0 ? 0 : UniformCase::FEATURE_ARRAY_FIRST_ELEM_NAME_NO_INDEX;
 
+                                                                                       // skip empty groups by creating groups on demand
+                                                                                       if (!collectionTestGroup)
+                                                                                       {
+                                                                                               collectionTestGroup = new TestCaseGroup(m_context, collectionGroupName.c_str(), "");
+                                                                                               checkMethodGroup->addChild(collectionTestGroup);
+                                                                                       }
+
                                                                                        collectionTestGroup->addChild(new UniformValueCase(m_context, name.c_str(), "", (CaseShaderType)shaderType, uniformCollection,
                                                                                                                                                                                           UniformValueCase::VALUETOCHECK_ASSIGNED, checkMethod, assignMethod,
                                                                                                                                                                                           booleanTypeFeat | arrayFirstElemNameNoIndexFeat | (matrixTypeI == 1 ? UniformCase::FEATURE_MATRIXMODE_ROWMAJOR : 0)));
index 821ba92..21e0398 100644 (file)
@@ -295,40 +295,25 @@ void IndexGroup::init (void)
 
        const IndexTest tests[] =
        {
-               { gls::DrawTestSpec::STORAGE_USER,              gls::DrawTestSpec::INDEXTYPE_BYTE,      true,   { 0, 1, -1 } },
-               { gls::DrawTestSpec::STORAGE_USER,              gls::DrawTestSpec::INDEXTYPE_SHORT,     true,   { 0, 2, -1 } },
-               { gls::DrawTestSpec::STORAGE_USER,              gls::DrawTestSpec::INDEXTYPE_INT,       true,   { 0, 4, -1 } },
-
-               { gls::DrawTestSpec::STORAGE_USER,              gls::DrawTestSpec::INDEXTYPE_SHORT,     false,  { 1, 3, -1 } },
-               { gls::DrawTestSpec::STORAGE_USER,              gls::DrawTestSpec::INDEXTYPE_INT,       false,  { 2, 3, -1 } },
-
-               { gls::DrawTestSpec::STORAGE_BUFFER,    gls::DrawTestSpec::INDEXTYPE_BYTE,      true,   { 0, 1, -1 } },
-               { gls::DrawTestSpec::STORAGE_BUFFER,    gls::DrawTestSpec::INDEXTYPE_SHORT,     true,   { 0, 2, -1 } },
-               { gls::DrawTestSpec::STORAGE_BUFFER,    gls::DrawTestSpec::INDEXTYPE_INT,       true,   { 0, 4, -1 } },
-
                { gls::DrawTestSpec::STORAGE_BUFFER,    gls::DrawTestSpec::INDEXTYPE_SHORT,     false,  { 1, 3, -1 } },
                { gls::DrawTestSpec::STORAGE_BUFFER,    gls::DrawTestSpec::INDEXTYPE_INT,       false,  { 2, 3, -1 } },
        };
 
        gls::DrawTestSpec spec;
 
-       tcu::TestCaseGroup* const       userPtrGroup                    = new tcu::TestCaseGroup(m_testCtx, "user_ptr", "user pointer");
-       tcu::TestCaseGroup* const       unalignedUserPtrGroup   = new tcu::TestCaseGroup(m_testCtx, "unaligned_user_ptr", "unaligned user pointer");
-       tcu::TestCaseGroup* const       bufferGroup                             = new tcu::TestCaseGroup(m_testCtx, "buffer", "buffer");
        tcu::TestCaseGroup* const       unalignedBufferGroup    = new tcu::TestCaseGroup(m_testCtx, "unaligned_buffer", "unaligned buffer");
        const bool                                      isRangedMethod                  = (m_method == gls::DrawTestSpec::DRAWMETHOD_DRAWELEMENTS_RANGED || m_method == gls::DrawTestSpec::DRAWMETHOD_DRAWELEMENTS_RANGED_BASEVERTEX);
 
        genBasicSpec(spec, m_method);
 
-       this->addChild(userPtrGroup);
-       this->addChild(unalignedUserPtrGroup);
-       this->addChild(bufferGroup);
        this->addChild(unalignedBufferGroup);
 
        for (int testNdx = 0; testNdx < DE_LENGTH_OF_ARRAY(tests); ++testNdx)
        {
                const IndexTest&                                indexTest       = tests[testNdx];
-               tcu::TestCaseGroup*                             group           = (indexTest.storage == gls::DrawTestSpec::STORAGE_USER) ? ((indexTest.aligned) ? (userPtrGroup) : (unalignedUserPtrGroup)) : ((indexTest.aligned) ? (bufferGroup) : (unalignedBufferGroup));
+               tcu::TestCaseGroup*                             group           = (indexTest.storage == gls::DrawTestSpec::STORAGE_USER)
+                                                                                                       ? ((indexTest.aligned) ? (DE_NULL) : (DE_NULL))
+                                                                                                       : ((indexTest.aligned) ? (DE_NULL) : (unalignedBufferGroup));
 
                const std::string                               name            = std::string("index_") + gls::DrawTestSpec::indexTypeToString(indexTest.type);
                const std::string                               desc            = std::string("index ") + gls::DrawTestSpec::indexTypeToString(indexTest.type) + " in " + gls::DrawTestSpec::storageToString(indexTest.storage);
@@ -350,9 +335,9 @@ void IndexGroup::init (void)
                        test->addIteration(spec, iterationDesc.c_str());
                }
 
-               if (spec.isCompatibilityTest() == gls::DrawTestSpec::COMPATIBILITY_UNALIGNED_OFFSET ||
-                       spec.isCompatibilityTest() == gls::DrawTestSpec::COMPATIBILITY_UNALIGNED_STRIDE)
-                       group->addChild(test.release());
+               DE_ASSERT(spec.isCompatibilityTest() == gls::DrawTestSpec::COMPATIBILITY_UNALIGNED_OFFSET ||
+                                 spec.isCompatibilityTest() == gls::DrawTestSpec::COMPATIBILITY_UNALIGNED_STRIDE);
+               group->addChild(test.release());
        }
 }
 
index c55237a..0c10beb 100644 (file)
@@ -5080,7 +5080,7 @@ void ProgramInputTestGroup::init (void)
        {
                tcu::TestCaseGroup* const blockGroup = new tcu::TestCaseGroup(m_testCtx, "type", "Type");
                addChild(blockGroup);
-               generateProgramInputOutputShaderCaseBlocks(m_context, blockGroup, true, true, generateProgramInputTypeBlockContents);
+               generateProgramInputOutputShaderCaseBlocks(m_context, blockGroup, false, true, generateProgramInputTypeBlockContents);
        }
 }
 
@@ -5137,7 +5137,7 @@ void ProgramOutputTestGroup::init (void)
        {
                tcu::TestCaseGroup* const blockGroup = new tcu::TestCaseGroup(m_testCtx, "type", "Type");
                addChild(blockGroup);
-               generateProgramInputOutputShaderCaseBlocks(m_context, blockGroup, true, false, generateProgramOutputTypeBlockContents);
+               generateProgramInputOutputShaderCaseBlocks(m_context, blockGroup, false, false, generateProgramOutputTypeBlockContents);
        }
 }
 
index 02a4db3..c020b34 100644 (file)
@@ -1961,8 +1961,7 @@ void ProgramUniformTests::init (void)
                                {
                                        const UniformCollectionGroup&   collectionGroup                 = defaultUniformCollections[collectionGroupNdx];
                                        const string                                    collectionGroupName             = collectionGroup.name + (referToFirstArrayElemWithoutIndexI == 0 ? "" : "_first_elem_without_brackets");
-                                       TestCaseGroup* const                    collectionTestGroup             = new TestCaseGroup(m_context, collectionGroupName.c_str(), "");
-                                       checkMethodGroup->addChild(collectionTestGroup);
+                                       TestCaseGroup*                                  collectionTestGroup             = DE_NULL;
 
                                        for (int collectionNdx = 0; collectionNdx < (int)collectionGroup.cases.size(); collectionNdx++)
                                        {
@@ -2000,6 +1999,13 @@ void ProgramUniformTests::init (void)
                                                                        const string    name                                                    = nameWithMatrixType + getCaseShaderTypeName((CaseShaderType)shaderType);
                                                                        const deUint32  arrayFirstElemNameNoIndexFeat   = referToFirstArrayElemWithoutIndexI == 0 ? 0 : UniformCase::FEATURE_ARRAY_FIRST_ELEM_NAME_NO_INDEX;
 
+                                                                       // skip empty groups by creating groups on demand
+                                                                       if (!collectionTestGroup)
+                                                                       {
+                                                                               collectionTestGroup = new TestCaseGroup(m_context, collectionGroupName.c_str(), "");
+                                                                               checkMethodGroup->addChild(collectionTestGroup);
+                                                                       }
+
                                                                        collectionTestGroup->addChild(new UniformAssignCase(m_context, name.c_str(), "", (CaseShaderType)shaderType, uniformCollection,
                                                                                                                                                                                checkMethod, assignMethod,
                                                                                                                                                                                booleanTypeFeat | arrayFirstElemNameNoIndexFeat | (matrixTypeI == 1 ? UniformCase::FEATURE_MATRIXMODE_ROWMAJOR : 0)));
index 0b5b1b5..1061668 100644 (file)
@@ -556,7 +556,6 @@ public:
        {
                addChild(new SelfCheckCase(m_testCtx, "float_format","tcu::FloatFormat_selfTest()",
                                                                   tcu::FloatFormat_selfTest));
-               addChild(new CaseListParserTests(m_testCtx));
        }
 };
 
@@ -573,7 +572,8 @@ FrameworkTests::~FrameworkTests (void)
 
 void FrameworkTests::init (void)
 {
-       addChild(new CommonFrameworkTests(m_testCtx));
+       addChild(new CommonFrameworkTests       (m_testCtx));
+       addChild(new CaseListParserTests        (m_testCtx));
 }
 
 }