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/class/OrxonoxInterfaceTest.cc

    r9601 r9649  
    22#include "core/class/OrxonoxInterface.h"
    33#include "core/class/OrxonoxClass.h"
     4#include "core/object/Context.h"
    45
    56namespace orxonox
     
    2425        {
    2526        };
     27
     28        // Fixture
     29        class OrxonoxInterfaceTest : public ::testing::Test
     30        {
     31            public:
     32                virtual void SetUp()
     33                {
     34                    Context::setRootContext(new Context(NULL));
     35                }
     36
     37                virtual void TearDown()
     38                {
     39                    Context::setRootContext(NULL);
     40                }
     41        };
    2642    }
    2743
    28     TEST(OrxonoxInterfaceTest, CanCreate1)
     44    TEST_F(OrxonoxInterfaceTest, CanCreate1)
    2945    {
    3046        TestClass1* test = new TestClass1();
     
    3349    }
    3450
    35     TEST(OrxonoxInterfaceTest, CanCreate2)
     51    TEST_F(OrxonoxInterfaceTest, CanCreate2)
    3652    {
    3753        TestClass2* test = new TestClass2();
Note: See TracChangeset for help on using the changeset viewer.