src/core/component-manager.cc
changeset 2231 a5b898c1ee2c
parent 2230 9f13ac3291e0
child 2232 9abd038ee588
equal deleted inserted replaced
2230:9f13ac3291e0 2231:a5b898c1ee2c
   339 ComponentManagerTest::RunTests (void)
   339 ComponentManagerTest::RunTests (void)
   340 {
   340 {
   341   bool ok = true;
   341   bool ok = true;
   342 
   342 
   343   Ptr<A> a = 0;
   343   Ptr<A> a = 0;
   344   a = ComponentManager::Create<A> (A::cidZero, A::iid);
   344   a = ComponentManager::Create<A> (A::cidZero);
   345   if (a == 0 ||
   345   if (a == 0 ||
   346       !a->m_zeroInvoked)
   346       !a->m_zeroInvoked)
   347     {
   347     {
   348       ok = false;
   348       ok = false;
   349     }
   349     }
   350 
   350 
   351   a = ComponentManager::Create<A,bool> (A::cidOneBool, A::iid, true);
   351   a = ComponentManager::Create<A,bool> (A::cidOneBool, true);
   352   if (a == 0 ||
   352   if (a == 0 ||
   353       !a->m_oneBoolInvoked ||
   353       !a->m_oneBoolInvoked ||
   354       !a->m_bool)
   354       !a->m_bool)
   355     {
   355     {
   356       ok = false;
   356       ok = false;
   357     }
   357     }
   358 
   358 
   359   a = ComponentManager::Create<A,bool> (A::cidOneBool, A::iid, false);
   359   a = ComponentManager::Create<A,bool> (A::cidOneBool, false);
   360   if (a == 0 ||
   360   if (a == 0 ||
   361       !a->m_oneBoolInvoked ||
   361       !a->m_oneBoolInvoked ||
   362       a->m_bool)
   362       a->m_bool)
   363     {
   363     {
   364       ok = false;
   364       ok = false;
   365     }
   365     }
   366 
   366 
   367   a = ComponentManager::Create<A,uint32_t> (A::cidOneUi32, A::iid, 10);
   367   a = ComponentManager::Create<A,uint32_t> (A::cidOneUi32, 10);
   368   if (a == 0 ||
   368   if (a == 0 ||
   369       !a->m_oneUi32Invoked ||
   369       !a->m_oneUi32Invoked ||
   370       a->m_ui32 != 10)
   370       a->m_ui32 != 10)
   371     {
   371     {
   372       ok = false;
   372       ok = false;
   373     }
   373     }
   374 
   374 
   375   a = ComponentManager::Create<A> (A::cidOneUi32, A::iid, (uint32_t)10);
   375   a = ComponentManager::Create<A> (A::cidOneUi32, (uint32_t)10);
   376   if (a == 0 ||
   376   if (a == 0 ||
   377       !a->m_oneUi32Invoked ||
   377       !a->m_oneUi32Invoked ||
   378       a->m_ui32 != 10)
   378       a->m_ui32 != 10)
   379     {
   379     {
   380       ok = false;
   380       ok = false;
   381     }
   381     }
   382 
   382 
   383   Ptr<B> b = ComponentManager::Create<B,uint32_t> (A::cidOneUi32, B::iid, 10);
   383   Ptr<B> b = ComponentManager::Create<B,uint32_t> (A::cidOneUi32, 10);
   384   if (b == 0)
   384   if (b == 0)
   385     {
   385     {
   386       ok = false;
   386       ok = false;
   387     }
   387     }
   388 
   388