Last change
on this file since 10276 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
|
Rev | Line | |
---|
[9601] | 1 | #include <gtest/gtest.h> |
---|
| 2 | #include "core/class/OrxonoxClass.h" |
---|
[9649] | 3 | #include "core/object/Context.h" |
---|
[9601] | 4 | |
---|
| 5 | namespace orxonox |
---|
| 6 | { |
---|
| 7 | namespace |
---|
| 8 | { |
---|
| 9 | class TestClass : public OrxonoxClass |
---|
| 10 | { |
---|
| 11 | }; |
---|
[9649] | 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 | }; |
---|
[9601] | 27 | } |
---|
| 28 | |
---|
[9649] | 29 | TEST_F(OrxonoxClassTest, CanCreate) |
---|
[9601] | 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.