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/command/CommandTest.cc

    r10400 r10403  
    133133                ModifyConsoleCommand("test").popFunction();
    134134        }
     135
     136        // Fixture
     137        class CommandTest : public ::testing::Test
     138        {
     139            public:
     140                virtual void SetUp()
     141                {
     142                    ModuleInstance::getCurrentModuleInstance()->loadAllStaticallyInitializedInstances();
     143                    ModuleInstance::setCurrentModuleInstance(new ModuleInstance()); // overwrite ModuleInstance because the old one is now loaded and shouln't be used anymore. TODO: better solution?
     144                    Identifier::initConfigValues_s = false; // TODO: hack!
     145                    IdentifierManager::getInstance().createClassHierarchy();
     146                }
     147
     148                virtual void TearDown()
     149                {
     150                    IdentifierManager::getInstance().destroyClassHierarchy();
     151                }
     152        };
    135153    }
    136154
     
    142160    }
    143161
    144     TEST(CommandTest, ModuleTest)
     162    TEST_F(CommandTest, ModuleTest)
    145163    {
    146         ModuleInstance::getCurrentModuleInstance()->loadAllStaticallyInitializedInstances();
    147         Identifier::initConfigValues_s = false; // TODO: hack!
    148         IdentifierManager::getInstance().createClassHierarchy();
    149 
    150164        test(0, 0, 0);
    151165        CommandExecutor::execute("test 0", false);
Note: See TracChangeset for help on using the changeset viewer.