示例#1
0
int UtcDaliStageRemoveN3(void)
{
  TestApplication application;

  Stage stage = Stage::GetCurrent();

  // Initially we have a default layer
  DALI_TEST_EQUALS( stage.GetLayerCount(), 1u, TEST_LOCATION );

  // Check we cannot remove the root layer from the stage.
  Layer layer = stage.GetRootLayer();
  bool asserted = true;
  try
  {
    stage.Remove( layer );
  }
  catch( Dali::DaliException& e )
  {
    DALI_TEST_PRINT_ASSERT( e );
    DALI_TEST_ASSERT( e, "this != &child && \"Cannot remove actor from itself\"", TEST_LOCATION );
    asserted = true;
  }

  DALI_TEST_CHECK( asserted );
  DALI_TEST_EQUALS( stage.GetLayerCount(), 1u, TEST_LOCATION );
  END_TEST;
}
示例#2
0
int UtcDaliStageGetLayerCountP(void)
{
  TestApplication application;

  Stage stage = Stage::GetCurrent();

  // Initially we have a default layer
  DALI_TEST_EQUALS( stage.GetLayerCount(), 1u, TEST_LOCATION );

  Layer layer = Layer::New();
  stage.Add( layer );

  DALI_TEST_EQUALS( stage.GetLayerCount(), 2u, TEST_LOCATION );
  END_TEST;
}