Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 26, 2015, 4:16:49 PM (9 years ago)
Author:
landauf
Message:

added function to destroy the class hierarchy (i.e. reset all information about parents and children in Identifiers).
tests now use a fixture to create and destroy class hierarchy. this makes them independent of the order of execution (and also fixes the three *_NoFixture tests)

File:
1 edited

Legend:

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

    r10400 r10403  
    55#include "core/BaseObject.h"
    66#include "core/class/Super.h"
     7#include "core/module/ModuleInstance.h"
    78
    89namespace orxonox
     
    6566        RegisterClass(TestSubclass);
    6667
    67        // Fixture
     68        // Fixture
    6869        class SuperTest : public ::testing::Test
    6970        {
     
    7172                virtual void SetUp()
    7273                {
     74                    ModuleInstance::getCurrentModuleInstance()->loadAllStaticallyInitializedInstances();
     75                    ModuleInstance::setCurrentModuleInstance(new ModuleInstance()); // overwrite ModuleInstance because the old one is now loaded and shouln't be used anymore. TODO: better solution?
     76                    Identifier::initConfigValues_s = false; // TODO: hack!
     77                    IdentifierManager::getInstance().createClassHierarchy();
     78
    7379                    Context::setRootContext(new Context(NULL));
    7480                }
     
    7783                {
    7884                    Context::setRootContext(NULL);
     85
     86                    IdentifierManager::getInstance().destroyClassHierarchy();
    7987                }
    8088        };
Note: See TracChangeset for help on using the changeset viewer.