Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/archive/tutorial5/test/core/class/OrxonoxClassTest.cc @ 11663

Last change on this file since 11663 was 9649, checked in by landauf, 11 years ago

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

  • Property svn:eol-style set to native
File size: 745 bytes
Line 
1#include <gtest/gtest.h>
2#include "core/class/OrxonoxClass.h"
3#include "core/object/Context.h"
4
5namespace orxonox
6{
7    namespace
8    {
9        class TestClass : public OrxonoxClass
10        {
11        };
12
13        // Fixture
14        class OrxonoxClassTest : public ::testing::Test
15        {
16            public:
17                virtual void SetUp()
18                {
19                    Context::setRootContext(new Context(NULL));
20                }
21
22                virtual void TearDown()
23                {
24                    Context::setRootContext(NULL);
25                }
26        };
27    }
28
29    TEST_F(OrxonoxClassTest, CanCreate)
30    {
31        TestClass* test = new TestClass();
32        ASSERT_TRUE(test != NULL);
33        delete test;
34    }
35}
Note: See TracBrowser for help on using the repository browser.