Last change
on this file since 9637 was
9637,
checked in by landauf, 11 years ago
|
removed constructor arguments from ClassFactories. use the helper-function registerClass() to add the factory to the corresponding identifier
|
-
Property svn:eol-style set to
native
|
File size:
533 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 ClassFactoryWithContext<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.