Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9648 for code/branches/core6


Ignore:
Timestamp:
Aug 14, 2013, 5:44:53 PM (11 years ago)
Author:
landauf
Message:

fixed test and added new test

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core6/test/core/class/SuperTest.cc

    r9647 r9648  
    6868                virtual void SetUp()
    6969                {
     70                    IdentifierManager::getInstance().destroyAllIdentifiers();
     71
    7072                    registerClass("OrxonoxClass", new ClassFactoryNoArgs<OrxonoxClass>());
    7173                    registerClass("BaseObject", new ClassFactoryWithContext<BaseObject>());
     
    8183                }
    8284        };
     85    }
     86
     87    TEST_F(SuperTest, ClassHierarchyIsCorrect)
     88    {
     89        {
     90            Identifier* identifier = Class(TestSubclass);
     91
     92            EXPECT_EQ(0u, identifier->getDirectChildren().size());
     93
     94            EXPECT_EQ(1u, identifier->getDirectParents().size());
     95            EXPECT_TRUE(identifier->getDirectParents().find(Class(TestClass)) != identifier->getDirectParents().end());
     96        }
     97        {
     98            Identifier* identifier = Class(TestClass);
     99
     100            EXPECT_EQ(1u, identifier->getDirectChildren().size());
     101            EXPECT_TRUE(identifier->getDirectChildren().find(Class(TestSubclass)) != identifier->getDirectChildren().end());
     102
     103            EXPECT_EQ(1u, identifier->getDirectParents().size());
     104            EXPECT_TRUE(identifier->getDirectParents().find(Class(BaseObject)) != identifier->getDirectParents().end());
     105        }
    83106    }
    84107
Note: See TracChangeset for help on using the changeset viewer.