コード例 #1
0
ファイル: utc-Dali-Stage.cpp プロジェクト: mettalla/dali
int UtcDaliStageGetObjectRegistryP(void)
{
  TestApplication app;
  Stage stage = Stage::GetCurrent();

  ObjectRegistry objectRegistry = stage.GetObjectRegistry();

  // Object registry tests are covered in their own module.
  // However we want a basic test to confirm the returned registry is valid and works.
  bool verified = false;
  ActorCreatedFunctor test( verified );
  objectRegistry.ObjectCreatedSignal().Connect( &app, test );

  Actor actor = Actor::New();
  DALI_TEST_CHECK( test.mSignalVerified );

  END_TEST;
}
コード例 #2
0
ファイル: utc-Dali-Stage.cpp プロジェクト: mettalla/dali
int UtcDaliStageGetObjectRegistryN(void)
{
  TestApplication app;
  Stage stage;

  // Check that getting the object registry with a bad stage instance DOES NOT cause an assert.
  // This is because GetCurrent() is used, always creating a stage if one does not exist.
  bool asserted = false;
  try
  {
    stage.GetObjectRegistry();
  }
  catch( Dali::DaliException& e )
  {
    DALI_TEST_PRINT_ASSERT( e );
    asserted = true;
  }
  DALI_TEST_CHECK( !asserted );

  END_TEST;
}