Merge branch 'devel/master' into devel/new_mesh
[platform/core/uifw/dali-core.git] / automated-tests / src / dali / utc-Dali-Layer.cpp
index 5c6d1b8..ee8c51d 100644 (file)
@@ -250,7 +250,7 @@ int UtcDaliLayerGetClippingBox(void)
 
 static int gTestSortFunctionCalled;
 
-static float TestSortFunction(const Vector3& /*position*/, float /*sortModifier*/)
+static float TestSortFunction(const Vector3& /*position*/)
 {
   ++gTestSortFunctionCalled;
   return 0.0f;
@@ -441,9 +441,10 @@ int UtcDaliLayerDefaultProperties(void)
 
   Layer actor = Layer::New();
 
-  std::vector<Property::Index> indices ;
+  std::vector<Property::Index> indices;
   indices.push_back(Layer::Property::CLIPPING_ENABLE);
   indices.push_back(Layer::Property::CLIPPING_BOX);
+  indices.push_back(Layer::Property::BEHAVIOR);
 
   DALI_TEST_CHECK(actor.GetPropertyCount() == ( Actor::New().GetPropertyCount() + indices.size() ) );
 
@@ -463,7 +464,7 @@ int UtcDaliLayerDefaultProperties(void)
 
   actor.SetProperty(Layer::Property::CLIPPING_BOX, Property::Value(Rect<int>(testBox)));
 
-  DALI_TEST_CHECK(Property::RECTANGLE == actor.GetPropertyType(Layer::Property::CLIPPING_BOX)) ;
+  DALI_TEST_CHECK(Property::RECTANGLE == actor.GetPropertyType(Layer::Property::CLIPPING_BOX));
 
   Property::Value v = actor.GetProperty(Layer::Property::CLIPPING_BOX);
 
@@ -474,6 +475,10 @@ int UtcDaliLayerDefaultProperties(void)
 
   DALI_TEST_CHECK( actor.GetClippingBox() == testBox );
 
+
+  Property::Value behavior = actor.GetProperty(Layer::Property::BEHAVIOR);
+  DALI_TEST_CHECK( std::strcmp( behavior.Get<std::string>().c_str(), "LAYER_2D") );
+
   END_TEST;
 }
 
@@ -483,7 +488,9 @@ int UtcDaliLayerSetDepthTestDisabled(void)
   tet_infoline("Testing Dali::Layer::SetDepthTestDisabled() ");
 
   Layer actor = Layer::New();
+  DALI_TEST_CHECK( actor.IsDepthTestDisabled() );
 
+  actor.SetBehavior( Layer::LAYER_3D );
   DALI_TEST_CHECK( !actor.IsDepthTestDisabled() );
 
   actor.SetDepthTestDisabled( true );
@@ -508,8 +515,8 @@ int UtcDaliLayerPropertyIndices(void)
 
   Property::IndexContainer indices;
   layer.GetPropertyIndices( indices );
-  DALI_TEST_CHECK( indices.size() > basicActor.GetPropertyCount() );
-  DALI_TEST_EQUALS( indices.size(), layer.GetPropertyCount(), TEST_LOCATION );
+  DALI_TEST_CHECK( indices.Size() > basicActor.GetPropertyCount() );
+  DALI_TEST_EQUALS( indices.Size(), layer.GetPropertyCount(), TEST_LOCATION );
   END_TEST;
 }
 
@@ -561,3 +568,14 @@ int UtcDaliLayerClippingGLCalls(void)
   DALI_TEST_EQUALS( testBox.height, glScissorParams.height, TEST_LOCATION );
   END_TEST;
 }
+
+int UtcDaliLayerBehaviour(void)
+{
+  TestApplication application;
+  Layer layer = Layer::New();
+
+  DALI_TEST_EQUALS( layer.GetBehavior(), Dali::Layer::LAYER_2D, TEST_LOCATION );
+  layer.SetBehavior( Dali::Layer::LAYER_3D );
+  DALI_TEST_EQUALS( layer.GetBehavior(), Dali::Layer::LAYER_3D, TEST_LOCATION );
+  END_TEST;
+}