Changeset 9650 for code/branches
- Timestamp:
- Aug 14, 2013, 7:04:40 PM (11 years ago)
- Location:
- code/branches/core6
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core6/src/libraries/core/object/Context.cc
r9649 r9650 34 34 #include "Context.h" 35 35 #include "core/class/Identifier.h" 36 #include "core/CoreIncludes.h" 36 37 37 38 namespace orxonox 38 39 { 40 RegisterClass(Context); 41 39 42 Context* Context::rootContext_s = 0; 40 43 … … 46 49 // setContext(this) here). 47 50 this->setContext(this); 51 52 RegisterObject(Context); 48 53 } 49 54 -
code/branches/core6/test/core/object/ContextTest.cc
r9649 r9650 58 58 EXPECT_EQ(1u, context.getObjectList<SubclassContext>()->size()); 59 59 } 60 61 TEST_F(ContextTest, ContextIsAddedToItsOwnObjectList) 62 { 63 Context context(NULL); 64 ASSERT_EQ(1u, context.getObjectList<Context>()->size()); 65 EXPECT_TRUE(context.getObjectList<Context>()->begin()->objectBase_ == static_cast<Listable*>(&context)); 66 } 67 68 TEST_F(ContextTest, ContextIsAddedToObjectListOfBaseContext) 69 { 70 Context baseContext(NULL); 71 Context subContext(&baseContext); 72 73 ASSERT_EQ(1u, subContext.getObjectList<Context>()->size()); 74 EXPECT_TRUE(subContext.getObjectList<Context>()->begin()->objectBase_ == static_cast<Listable*>(&subContext)); 75 76 ASSERT_EQ(2u, baseContext.getObjectList<Context>()->size()); 77 EXPECT_TRUE(baseContext.getObjectList<Context>()->begin()->objectBase_ == static_cast<Listable*>(&baseContext)); 78 EXPECT_TRUE(baseContext.getObjectList<Context>()->begin()->next_->objectBase_ == static_cast<Listable*>(&subContext)); 79 } 60 80 }
Note: See TracChangeset
for help on using the changeset viewer.