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/ContextTest.cc

    r9629 r9649  
    1313                SubclassContext() : Context(NULL) { RegisterRootObject(SubclassContext); }
    1414        };
     15
     16        // Fixture
     17        class ContextTest : public ::testing::Test
     18        {
     19            public:
     20                virtual void SetUp()
     21                {
     22                    Context::setRootContext(new Context(NULL));
     23                }
     24
     25                virtual void TearDown()
     26                {
     27                    Context::setRootContext(NULL);
     28                }
     29        };
    1530    }
    1631
    17     TEST(ContextTest, CanCreateContext)
     32    TEST_F(ContextTest, CanCreateContext)
    1833    {
    1934        Context context(NULL);
    2035    }
    2136
    22     TEST(ContextTest, CanCreateSubclassContext)
     37    TEST_F(ContextTest, CanCreateSubclassContext)
    2338    {
    2439        SubclassContext context;
    2540    }
    2641
    27     TEST(ContextTest, ContextIsItsOwnContext)
     42    TEST_F(ContextTest, ContextIsItsOwnContext)
    2843    {
    2944        Context context(NULL);
     
    3146    }
    3247
    33     TEST(ContextTest, SubclassContextIsItsOwnContext)
     48    TEST_F(ContextTest, SubclassContextIsItsOwnContext)
    3449    {
    3550        SubclassContext context;
     
    3752    }
    3853
    39     TEST(ContextTest, SubclassAddsToItsOwnObjectList)
     54    TEST_F(ContextTest, SubclassAddsToItsOwnObjectList)
    4055    {
    4156        SubclassContext context;
Note: See TracChangeset for help on using the changeset viewer.