Last change
on this file since 12389 was
11071,
checked in by landauf, 9 years ago
|
merged branch cpp11_v3 back to trunk
|
-
Property svn:eol-style set to
native
|
File size:
1.5 KB
|
Rev | Line | |
---|
[9601] | 1 | #include <gtest/gtest.h> |
---|
| 2 | #include "core/class/OrxonoxInterface.h" |
---|
| 3 | #include "core/class/OrxonoxClass.h" |
---|
[10624] | 4 | #include "core/class/IdentifierManager.h" |
---|
[9649] | 5 | #include "core/object/Context.h" |
---|
[9601] | 6 | |
---|
| 7 | namespace orxonox |
---|
| 8 | { |
---|
| 9 | namespace |
---|
| 10 | { |
---|
| 11 | class Interface1 : virtual public OrxonoxInterface |
---|
| 12 | { |
---|
| 13 | }; |
---|
| 14 | class Interface2 : virtual public OrxonoxInterface |
---|
| 15 | { |
---|
| 16 | }; |
---|
| 17 | class Interface3 : virtual public OrxonoxInterface |
---|
| 18 | { |
---|
| 19 | }; |
---|
| 20 | |
---|
| 21 | class TestClass1 : public Interface1, public Interface2, public Interface3 |
---|
| 22 | { |
---|
| 23 | }; |
---|
| 24 | |
---|
| 25 | class TestClass2 : public OrxonoxClass, public Interface1, public Interface2, public Interface3 |
---|
| 26 | { |
---|
| 27 | }; |
---|
[9649] | 28 | |
---|
| 29 | // Fixture |
---|
| 30 | class OrxonoxInterfaceTest : public ::testing::Test |
---|
| 31 | { |
---|
| 32 | public: |
---|
[11071] | 33 | virtual void SetUp() override |
---|
[9649] | 34 | { |
---|
[10624] | 35 | new IdentifierManager(); |
---|
[11071] | 36 | Context::setRootContext(new Context(nullptr)); |
---|
[9649] | 37 | } |
---|
| 38 | |
---|
[11071] | 39 | virtual void TearDown() override |
---|
[9649] | 40 | { |
---|
[10624] | 41 | Context::destroyRootContext(); |
---|
| 42 | delete &IdentifierManager::getInstance(); |
---|
[9649] | 43 | } |
---|
| 44 | }; |
---|
[9601] | 45 | } |
---|
| 46 | |
---|
[9649] | 47 | TEST_F(OrxonoxInterfaceTest, CanCreate1) |
---|
[9601] | 48 | { |
---|
| 49 | TestClass1* test = new TestClass1(); |
---|
[11071] | 50 | ASSERT_TRUE(test != nullptr); |
---|
[9601] | 51 | delete test; |
---|
| 52 | } |
---|
| 53 | |
---|
[9649] | 54 | TEST_F(OrxonoxInterfaceTest, CanCreate2) |
---|
[9601] | 55 | { |
---|
| 56 | TestClass2* test = new TestClass2(); |
---|
[11071] | 57 | ASSERT_TRUE(test != nullptr); |
---|
[9601] | 58 | delete test; |
---|
| 59 | } |
---|
| 60 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.