Last change
on this file since 9632 was
9632,
checked in by landauf, 11 years ago
|
Factory::fabricate() returns an Identifiable
|
-
Property svn:eol-style set to
native
|
File size:
534 bytes
|
Line | |
---|
1 | #include <gtest/gtest.h> |
---|
2 | #include "core/object/ClassFactory.h" |
---|
3 | #include "core/BaseObject.h" |
---|
4 | |
---|
5 | namespace orxonox |
---|
6 | { |
---|
7 | TEST(ClassFactoryTest, CanFabricateObject) |
---|
8 | { |
---|
9 | Factory* factory = new ClassFactory<BaseObject>("BaseObject"); |
---|
10 | Identifiable* object = factory->fabricate(NULL); |
---|
11 | ASSERT_TRUE(object != NULL); |
---|
12 | BaseObject* baseObject = dynamic_cast<BaseObject*>(object); |
---|
13 | EXPECT_TRUE(baseObject != NULL); |
---|
14 | delete object; |
---|
15 | // don't delete factory - it remains in the identifier |
---|
16 | } |
---|
17 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.