Beispiel #1
0
/*
 * This is not a true negative test, we are checking the DPI if it has not been set.
 * A test for setting negative DPI values would be part of the application core utc tests.
 */
int UtcDaliStageGetDpiN(void)
{
  TestApplication application; // Initializes core DPI to default values

  Stage stage = Stage::GetCurrent();
  Vector2 dpi = stage.GetDpi();

  DALI_TEST_EQUALS( dpi.x, 220.0f, TEST_LOCATION );
  DALI_TEST_EQUALS( dpi.y, 217.0f, TEST_LOCATION );
  END_TEST;
}
Beispiel #2
0
int UtcDaliStageGetDpiP3(void)
{
  TestApplication application( 480, 800, 72.0f, 120.0f ); // Initializes core DPI with specific values

  Stage stage = Stage::GetCurrent();

  // Test that setting core DPI explicitly also sets up the Stage's DPI.
  Vector2 dpi = stage.GetDpi();
  DALI_TEST_EQUALS( dpi.x, 72.0f, TEST_LOCATION );
  DALI_TEST_EQUALS( dpi.y, 120.0f, TEST_LOCATION) ;
  END_TEST;
}
Beispiel #3
0
int UtcDaliStageGetDpiP1(void)
{
  TestApplication application; // Initializes core DPI to default values

  Stage stage = Stage::GetCurrent();

  // Test the default DPI.
  Vector2 dpi = stage.GetDpi();
  DALI_TEST_EQUALS( dpi.x, static_cast<float>( TestApplication::DEFAULT_HORIZONTAL_DPI ), TEST_LOCATION );
  DALI_TEST_EQUALS( dpi.y, static_cast<float>( TestApplication::DEFAULT_VERTICAL_DPI ),   TEST_LOCATION );
  END_TEST;
}
Beispiel #4
0
int UtcDaliStageGetDpiP2(void)
{
  TestApplication application; // Initializes core DPI to default values

  // Test that setting core DPI explicitly also sets up the Stage's DPI.
  application.GetCore().SetDpi( 200, 180 );

  Stage stage = Stage::GetCurrent();
  Vector2 dpi = stage.GetDpi();
  DALI_TEST_EQUALS( dpi.x, 200.0f, TEST_LOCATION );
  DALI_TEST_EQUALS( dpi.y, 180.0f, TEST_LOCATION );
  END_TEST;
}