Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Aug 14, 2013, 6:42:28 PM (11 years ago)
Author:
landauf
Message:

added ability to set the root-context explicitly (and also to destroy it before the class-hierarchy is destroyed).
currently it's not possible to set the root context explicitly during startup of the game because it is already used by static initialization

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core6/test/core/object/ClassFactoryTest.cc

    r9637 r9649  
    22#include "core/object/ClassFactory.h"
    33#include "core/BaseObject.h"
     4#include "core/object/Context.h"
    45
    56namespace orxonox
    67{
    7     TEST(ClassFactoryTest, CanFabricateObject)
     8    namespace
     9    {
     10        // Fixture
     11        class ClassFactoryTest : public ::testing::Test
     12        {
     13            public:
     14                virtual void SetUp()
     15                {
     16                    Context::setRootContext(new Context(NULL));
     17                }
     18
     19                virtual void TearDown()
     20                {
     21                    Context::setRootContext(NULL);
     22                }
     23        };
     24    }
     25
     26    TEST_F(ClassFactoryTest, CanFabricateObject)
    827    {
    928        Factory* factory = new ClassFactoryWithContext<BaseObject>();
Note: See TracChangeset for help on using the changeset viewer.