Added new property API to Button. Added Icon and color features. Deprecated old API
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit / utc-Dali-TextLabel.cpp
index 637907a..a44081d 100644 (file)
@@ -51,7 +51,7 @@ const char* const PROPERTY_NAME_UNDERLINE_ENABLED = "underline-enabled";
 const char* const PROPERTY_NAME_UNDERLINE_COLOR = "underline-color";
 const char* const PROPERTY_NAME_UNDERLINE_HEIGHT = "underline-height";
 
-const unsigned int DEFAULT_RENDERING_BACKEND = Dali::Toolkit::Text::DEFAULT_RENDERING_BACKEND;
+const int DEFAULT_RENDERING_BACKEND = Dali::Toolkit::Text::DEFAULT_RENDERING_BACKEND;
 
 } // namespace
 
@@ -161,24 +161,9 @@ int UtcDaliToolkitTextLabelSetPropertyP(void)
   TextLabel label = TextLabel::New();
   DALI_TEST_CHECK( label );
 
-  // Check defaults
-  DALI_TEST_EQUALS( label.GetProperty<unsigned int>( TextLabel::Property::RENDERING_BACKEND ), DEFAULT_RENDERING_BACKEND, TEST_LOCATION );
-  DALI_TEST_EQUALS( label.GetProperty<std::string>( TextLabel::Property::TEXT ), std::string(""), TEST_LOCATION );
-  DALI_TEST_EQUALS( label.GetProperty<std::string>( TextLabel::Property::FONT_FAMILY ), std::string(""), TEST_LOCATION );
-  DALI_TEST_EQUALS( label.GetProperty<std::string>( TextLabel::Property::FONT_STYLE ), std::string(""), TEST_LOCATION );
-  DALI_TEST_EQUALS( label.GetProperty<float>( TextLabel::Property::POINT_SIZE ), 0.f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
-  DALI_TEST_EQUALS( label.GetProperty<bool>( TextLabel::Property::MULTI_LINE ), false, TEST_LOCATION );
-  DALI_TEST_EQUALS( label.GetProperty<std::string>( TextLabel::Property::HORIZONTAL_ALIGNMENT ), "BEGIN", TEST_LOCATION );
-  DALI_TEST_EQUALS( label.GetProperty<std::string>( TextLabel::Property::VERTICAL_ALIGNMENT ), "TOP", TEST_LOCATION );
-  DALI_TEST_EQUALS( label.GetProperty<Vector4>( TextLabel::Property::TEXT_COLOR ), Color::BLACK, TEST_LOCATION );
-  DALI_TEST_EQUALS( label.GetProperty<Vector2>( TextLabel::Property::SHADOW_OFFSET ), Vector2::ZERO, TEST_LOCATION );
-  DALI_TEST_EQUALS( label.GetProperty<Vector4>( TextLabel::Property::SHADOW_COLOR ), Color::BLACK, TEST_LOCATION );
-  DALI_TEST_EQUALS( label.GetProperty<bool>( TextLabel::Property::UNDERLINE_ENABLED ), false, TEST_LOCATION );
-  DALI_TEST_EQUALS( label.GetProperty<Vector4>( TextLabel::Property::UNDERLINE_COLOR ), Color::BLACK, TEST_LOCATION );
-  DALI_TEST_EQUALS( label.GetProperty<float>( TextLabel::Property::UNDERLINE_HEIGHT ), 0.0f, TEST_LOCATION );
-
-  label.SetProperty( TextLabel::Property::RENDERING_BACKEND, Text::RENDERING_BASIC );
-  DALI_TEST_EQUALS( label.GetProperty<unsigned int>( TextLabel::Property::RENDERING_BACKEND ), Text::RENDERING_BASIC, TEST_LOCATION );
+  // Note - we can't check the defaults since the stylesheets are platform-specific
+  label.SetProperty( TextLabel::Property::RENDERING_BACKEND, Text::RENDERING_SHARED_ATLAS );
+  DALI_TEST_EQUALS( label.GetProperty<int>( TextLabel::Property::RENDERING_BACKEND ), Text::RENDERING_SHARED_ATLAS, TEST_LOCATION );
 
   // Check that text can be correctly reset
   label.SetProperty( TextLabel::Property::TEXT, "Setting Text" );
@@ -229,42 +214,13 @@ int UtcDaliToolkitTextLabelSetPropertyP(void)
   END_TEST;
 }
 
-int UtcDaliToolkitTextlabelBasicRenderP(void)
-{
-  ToolkitTestApplication application;
-  tet_infoline(" UtcDaliToolkitTextLabelBasicRenderP");
-  TextLabel label = TextLabel::New("Test Text");
-  DALI_TEST_CHECK( label );
-
-  // Avoid a crash when core load gl resources.
-  application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
-
-  Stage::GetCurrent().Add( label );
-
-  label.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "BEGIN" );
-  label.SetProperty( TextLabel::Property::MULTI_LINE, true );
-
-  try
-  {
-    // Render some text with the basic backend
-    label.SetProperty( TextLabel::Property::RENDERING_BACKEND, Text::RENDERING_BASIC );
-    //application.SendNotification();
-    //application.Render();
-  }
-  catch( ... )
-  {
-    tet_result(TET_FAIL);
-  }
-  END_TEST;
-}
-
 int UtcDaliToolkitTextlabelAtlasRenderP(void)
 {
   ToolkitTestApplication application;
   tet_infoline(" UtcDaliToolkitTextLabelAtlasRenderP");
   TextLabel label = TextLabel::New("Test Text");
   DALI_TEST_CHECK( label );
-/*
+
   // Avoid a crash when core load gl resources.
   application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
 
@@ -289,7 +245,7 @@ int UtcDaliToolkitTextlabelAtlasRenderP(void)
   {
     tet_result(TET_FAIL);
   }
-  */
+
   END_TEST;
 }