Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 4, 2015, 9:12:21 PM (9 years ago)
Author:
landauf
Message:

merged branch core7 back to trunk

Location:
code/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/test/core/command/CommandTest.cc

    r9603 r10624  
    11#include <gtest/gtest.h>
    2 #include "core/command/ConsoleCommand.h"
     2#include "core/class/Identifier.h"
     3#include "core/class/IdentifierManager.h"
     4#include "core/command/ConsoleCommandIncludes.h"
    35#include "core/command/CommandExecutor.h"
    46#include "core/object/Destroyable.h"
     7#include "core/module/ModuleInstance.h"
    58
    69namespace orxonox
     
    130133                ModifyConsoleCommand("test").popFunction();
    131134        }
     135
     136        // Fixture
     137        class CommandTest : public ::testing::Test
     138        {
     139            public:
     140                virtual void SetUp()
     141                {
     142                    new IdentifierManager();
     143                    new ConsoleCommandManager();
     144                    ModuleInstance::getCurrentModuleInstance()->loadAllStaticallyInitializedInstances(StaticInitialization::CONSOLE_COMMAND);
     145                    Context::setRootContext(new Context(NULL));
     146                    Identifier::initConfigValues_s = false; // TODO: hack!
     147                    IdentifierManager::getInstance().createClassHierarchy();
     148                }
     149
     150                virtual void TearDown()
     151                {
     152                    IdentifierManager::getInstance().destroyClassHierarchy();
     153                    Context::destroyRootContext();
     154                    ModuleInstance::getCurrentModuleInstance()->unloadAllStaticallyInitializedInstances(StaticInitialization::CONSOLE_COMMAND);
     155                    delete &ConsoleCommandManager::getInstance();
     156                    delete &IdentifierManager::getInstance();
     157                }
     158        };
    132159    }
    133160
     
    139166    }
    140167
    141     TEST(CommandTest, ModuleTest)
     168    TEST_F(CommandTest, ModuleTest)
    142169    {
    143170        test(0, 0, 0);
Note: See TracChangeset for help on using the changeset viewer.