Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 18, 2015, 1:07:08 PM (10 years ago)
Author:
landauf
Message:

use lists instead of sets to store parent identifiers. this allows to store the exact order of initialization of parent classes.

Location:
code/branches/core7/test/core/class
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core7/test/core/class/IdentifierClassHierarchyTest.cc

    r10360 r10372  
    1919    namespace
    2020    {
    21         class BaseInterface1 : public OrxonoxInterface
     21        class BaseInterface1 : virtual public OrxonoxInterface
    2222        {
    2323            public:
     
    3030        };
    3131
    32         class BaseInterface2 : public OrxonoxInterface
     32        class BaseInterface2 : virtual public OrxonoxInterface
    3333        {
    3434            public:
     
    155155        };
    156156
     157        bool contains(const std::list<const Identifier*> identifiers, Identifier* identifier)
     158        {
     159            return std::find(identifiers.begin(), identifiers.end(), identifier) != identifiers.end();
     160        }
     161
    157162        bool contains(const std::set<const Identifier*> identifiers, Identifier* identifier)
    158163        {
  • code/branches/core7/test/core/class/IdentifierExternalClassHierarchyTest.cc

    r10360 r10372  
    5858                }
    5959        };
     60
     61        bool contains(const std::list<const Identifier*> identifiers, Identifier* identifier)
     62        {
     63            return std::find(identifiers.begin(), identifiers.end(), identifier) != identifiers.end();
     64        }
    6065
    6166        bool contains(const std::set<const Identifier*> identifiers, Identifier* identifier)
  • code/branches/core7/test/core/class/IdentifierNestedClassHierarchyTest.cc

    r10363 r10372  
    121121        };
    122122
     123        bool contains(const std::list<const Identifier*> identifiers, Identifier* identifier)
     124        {
     125            return std::find(identifiers.begin(), identifiers.end(), identifier) != identifiers.end();
     126        }
     127
    123128        bool contains(const std::set<const Identifier*> identifiers, Identifier* identifier)
    124129        {
  • code/branches/core7/test/core/class/IdentifierSimpleClassHierarchyTest.cc

    r10360 r10372  
    6363                }
    6464        };
     65
     66        bool contains(const std::list<const Identifier*> identifiers, Identifier* identifier)
     67        {
     68            return std::find(identifiers.begin(), identifiers.end(), identifier) != identifiers.end();
     69        }
    6570
    6671        bool contains(const std::set<const Identifier*> identifiers, Identifier* identifier)
  • code/branches/core7/test/core/class/SuperTest.cc

    r9659 r10372  
    9797
    9898            EXPECT_EQ(1u, identifier->getDirectParents().size());
    99             EXPECT_TRUE(identifier->getDirectParents().find(Class(TestClass)) != identifier->getDirectParents().end());
     99            EXPECT_TRUE(std::find(identifier->getDirectParents().begin(), identifier->getDirectParents().end(), Class(TestClass)) != identifier->getDirectParents().end());
    100100        }
    101101        {
     
    106106
    107107            EXPECT_EQ(1u, identifier->getDirectParents().size());
    108             EXPECT_TRUE(identifier->getDirectParents().find(Class(BaseObject)) != identifier->getDirectParents().end());
     108            EXPECT_TRUE(std::find(identifier->getDirectParents().begin(), identifier->getDirectParents().end(), Class(BaseObject)) != identifier->getDirectParents().end());
    109109        }
    110110    }
Note: See TracChangeset for help on using the changeset viewer.