support string_view in DALI_TEST_EQUALS
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit / utc-Dali-Visual.cpp
index e41565d..fde1197 100644 (file)
@@ -1775,8 +1775,8 @@ int UtcDaliVisualAnimateBorderVisual01(void)
   DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION);
 
   Renderer renderer = actor.GetRendererAt(0);
-  Property::Index borderColorIndex = DevelHandle::GetPropertyIndex( renderer, BorderVisual::Property::COLOR );
-  Property::Index mixColorIndex = DevelHandle::GetPropertyIndex( renderer, Visual::Property::MIX_COLOR );
+  Property::Index borderColorIndex = renderer.GetPropertyIndex( BorderVisual::Property::COLOR );
+  Property::Index mixColorIndex = renderer.GetPropertyIndex( Visual::Property::MIX_COLOR );
 
   Animation animation = dummyImpl.CreateTransition( transition );
 
@@ -1843,7 +1843,7 @@ int UtcDaliVisualAnimateBorderVisual02(void)
   DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION);
 
   Renderer renderer = actor.GetRendererAt(0);
-  Property::Index index = DevelHandle::GetPropertyIndex( renderer, BorderVisual::Property::SIZE );
+  Property::Index index = renderer.GetPropertyIndex( BorderVisual::Property::SIZE );
 
   Animation animation = Animation::New(4.0f);
   animation.AnimateTo( Property(renderer, index), 9.0f );
@@ -1887,7 +1887,7 @@ int UtcDaliVisualAnimateColorVisual(void)
   DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION);
 
   Renderer renderer = actor.GetRendererAt(0);
-  Property::Index mixColorIndex = DevelHandle::GetPropertyIndex( renderer, ColorVisual::Property::MIX_COLOR );
+  Property::Index mixColorIndex = renderer.GetPropertyIndex( ColorVisual::Property::MIX_COLOR );
 
   Property::Value blendModeValue = renderer.GetProperty( Renderer::Property::BLEND_MODE );
   DALI_TEST_EQUALS( blendModeValue.Get<int>(), (int)BlendMode::AUTO, TEST_LOCATION );
@@ -1943,7 +1943,7 @@ int UtcDaliVisualAnimatePrimitiveVisual(void)
     DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION);
 
     Renderer renderer = actor.GetRendererAt(0);
-    Property::Index index = DevelHandle::GetPropertyIndex( renderer, PrimitiveVisual::Property::MIX_COLOR );
+    Property::Index index = renderer.GetPropertyIndex( PrimitiveVisual::Property::MIX_COLOR );
 
     tet_infoline("Test that the renderer has the Primitive mix color");
     DALI_TEST_CHECK( index != Property::INVALID_INDEX );
@@ -1965,12 +1965,15 @@ int UtcDaliVisualAnimatePrimitiveVisual(void)
     Dali::Toolkit::TransitionData transition = TransitionData::New( map );
 
     Animation animation = dummyImpl.CreateTransition( transition );
-    Property::Value blendModeValue = renderer.GetProperty( Renderer::Property::BLEND_MODE );
-    DALI_TEST_EQUALS( blendModeValue.Get<int>(), (int)BlendMode::ON, TEST_LOCATION );
-
     animation.AnimateTo( Property(actor, Actor::Property::COLOR), Color::WHITE );
     animation.Play();
 
+    TestGlAbstraction& glAbstraction = application.GetGlAbstraction();
+    glAbstraction.EnableEnableDisableCallTrace( true );
+    TraceCallStack& glEnableStack = glAbstraction.GetEnableDisableTrace();
+    std::ostringstream blendStr;
+    blendStr << GL_BLEND;
+
     application.SendNotification();
     application.Render(0);
     application.Render(2000u); // halfway point
@@ -1980,6 +1983,10 @@ int UtcDaliVisualAnimatePrimitiveVisual(void)
     DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue<Vector4>("uColor", Vector4(0.5f, 0.5f, 0.5f, halfwayColor.a )), true, TEST_LOCATION );
     DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue<Vector3>("mixColor", Vector3(halfwayColor) ), true, TEST_LOCATION );
 
+    DALI_TEST_CHECK( glEnableStack.FindMethodAndParams( "Enable", blendStr.str().c_str() ) );
+
+    glEnableStack.Reset();
+
     application.Render(2001u); // go past end
     application.SendNotification(); // Trigger signals
 
@@ -1987,8 +1994,7 @@ int UtcDaliVisualAnimatePrimitiveVisual(void)
     DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue<Vector4>("uColor", Vector4( 1.0f, 1.0f, 1.0f, TARGET_MIX_COLOR.a ) ), true, TEST_LOCATION );
     DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue<Vector3>("mixColor", Vector3(TARGET_MIX_COLOR) ), true, TEST_LOCATION );
 
-    blendModeValue = renderer.GetProperty( Renderer::Property::BLEND_MODE );
-    DALI_TEST_EQUALS( blendModeValue.Get<int>(), (int)BlendMode::AUTO, TEST_LOCATION );
+    DALI_TEST_CHECK( glEnableStack.FindMethodAndParams( "Disable", blendStr.str().c_str() ) );
 
     actor.Unparent();
   }
@@ -2817,6 +2823,23 @@ static void TestTransform( ToolkitTestApplication& application, Visual::Base vis
   DALI_TEST_EQUALS( extraSize, Vector2(0.5f,0.5f), TEST_LOCATION );
 }
 
+int UtcDaliVisualSetTransform01(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline( "UtcDaliVisualSetTransform: ColorVisual" );
+
+  VisualFactory factory = VisualFactory::Get();
+  Property::Map propertyMap;
+  propertyMap.Insert(Visual::Property::TYPE, Visual::COLOR);
+  propertyMap.Insert(Visual::Property::OPACITY, 0.5f);
+  propertyMap.Insert(ColorVisual::Property::MIX_COLOR, Color::BLUE);
+  Visual::Base visual = factory.CreateVisual( propertyMap );
+  TestTransform( application, visual );
+  TestMixColor( visual, ColorVisual::Property::MIX_COLOR, Color::BLUE );
+
+  END_TEST;
+}
+
 int UtcDaliVisualSetTransform0(void)
 {
   ToolkitTestApplication application;