Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Aug 14, 2013, 7:04:40 PM (11 years ago)
Author:
landauf
Message:

add context to objectlist

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core6/test/core/object/ContextTest.cc

    r9649 r9650  
    5858        EXPECT_EQ(1u, context.getObjectList<SubclassContext>()->size());
    5959    }
     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    }
    6080}
Note: See TracChangeset for help on using the changeset viewer.