+ DALI_TEST_EQUALS( 0u, name.size(), TEST_LOCATION );
+
+ END_TEST;
+}
+
+
+int UtcDaliTypeInfoGetCreatorP(void)
+{
+ TestApplication application;
+ TypeRegistry typeRegistry = TypeRegistry::Get();
+
+ TypeInfo typeInfo = typeRegistry.GetTypeInfo( "Actor" );
+ DALI_TEST_CHECK( typeInfo );
+
+ TypeInfo::CreateFunction createFn = typeInfo.GetCreator();
+ DALI_TEST_EQUALS( createFn != NULL, true, TEST_LOCATION );
+ if( createFn )
+ {
+ // try calling it:
+ BaseHandle handle = createFn();
+ DALI_TEST_EQUALS( (bool)handle, true, TEST_LOCATION );
+ }
+
+ END_TEST;
+}
+
+int UtcDaliTypeInfoGetCreatorN(void)
+{
+ TestApplication application;
+ TypeRegistry typeRegistry = TypeRegistry::Get();
+
+ TypeInfo typeInfo = typeRegistry.GetTypeInfo( "MyTestCustomActor3" );
+ DALI_TEST_CHECK( typeInfo );
+
+ TypeInfo::CreateFunction createFn = typeInfo.GetCreator();
+ DALI_TEST_EQUALS( createFn == NULL, true, TEST_LOCATION );
+
+ END_TEST;
+}
+
+int UtcDaliTypeInfoGetPropertyCountP1(void)
+{
+ TestApplication application;
+ TypeRegistry typeRegistry = TypeRegistry::Get();
+
+ TypeInfo typeInfo = typeRegistry.GetTypeInfo( "Actor" );
+ DALI_TEST_CHECK( typeInfo );
+ size_t actorPropertyCount = typeInfo.GetPropertyCount();
+
+ DALI_TEST_EQUALS( actorPropertyCount == 0 , true, TEST_LOCATION ); // No event only props
+ END_TEST;
+}
+
+int UtcDaliTypeInfoGetPropertyCountP2(void)
+{
+ TestApplication application;
+ TypeRegistry typeRegistry = TypeRegistry::Get();
+
+ TypeInfo typeInfo = typeRegistry.GetTypeInfo( "MyTestCustomActor2" );
+ DALI_TEST_CHECK( typeInfo );
+ size_t propertyCount = typeInfo.GetPropertyCount();
+ Property::IndexContainer indices;
+ typeInfo.GetPropertyIndices( indices );
+
+ DALI_TEST_EQUALS( propertyCount > 0 && propertyCount <= indices.Size(), true, TEST_LOCATION );
+ DALI_TEST_EQUALS( propertyCount == 2, true, TEST_LOCATION );
+
+ END_TEST;
+}
+
+int UtcDaliPropertyRegistrationPropertyAnimatableSynchronousSetGet01(void)
+{
+ TestApplication application;
+ TypeRegistry typeRegistry = TypeRegistry::Get();
+
+ tet_infoline( "Register a type registered animatable property and ensure set/get behaviour works synchronously" );
+
+ // Register animatable property
+ const int animatablePropertyIndex( ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX );
+ AnimatablePropertyRegistration animatableProperty( customType1, "animatableProp1", animatablePropertyIndex, Property::FLOAT );
+
+ // Check property count before property registration
+ TypeInfo typeInfo = typeRegistry.GetTypeInfo( typeid(MyTestCustomActor) );
+ DALI_TEST_CHECK( typeInfo );
+ BaseHandle handle = typeInfo.CreateInstance();
+ DALI_TEST_CHECK( handle );
+ Actor customActor = Actor::DownCast( handle );
+ DALI_TEST_CHECK( customActor );
+ Stage::GetCurrent().Add(customActor);
+
+ tet_infoline( "Set the value and ensure it changes straight away" );
+ DALI_TEST_EQUALS( customActor.GetProperty< float >( animatablePropertyIndex ), 0.0f, TEST_LOCATION );
+ customActor.SetProperty( animatablePropertyIndex, 25.0f );
+ DALI_TEST_EQUALS( customActor.GetProperty< float >( animatablePropertyIndex ), 25.0f, TEST_LOCATION );
+
+ tet_infoline( "Check latest scene-graph value is unchanged" );
+ DALI_TEST_EQUALS( customActor.GetCurrentProperty< float >( animatablePropertyIndex ), 0.0f, TEST_LOCATION );
+
+ // Render and notify
+ application.SendNotification();
+ application.Render();
+
+ tet_infoline( "Check values after rendering and both retrieval methods should return the latest" );
+
+ DALI_TEST_EQUALS( customActor.GetProperty< float >( animatablePropertyIndex ), 25.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( customActor.GetCurrentProperty< float >( animatablePropertyIndex ), 25.0f, TEST_LOCATION );
+
+ END_TEST;
+}
+
+int UtcDaliPropertyRegistrationPropertyAnimatableSynchronousSetGetWithComponentsVector2(void)
+{
+ TestApplication application;
+ TypeRegistry typeRegistry = TypeRegistry::Get();
+
+ tet_infoline( "Register a type registered animatable property that has component indices and ensure set/get behaviour works synchronously and is the same regardless of how the property is set" );
+
+ // Register the animatable propeties
+ const int basePropertyIndex( ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX );
+ const int componentZeroPropertyIndex( basePropertyIndex + 1 );
+ const int componentOnePropertyIndex( componentZeroPropertyIndex + 1 );
+ AnimatablePropertyRegistration baseAnimatableProperty( customType1, "baseProp", basePropertyIndex, Vector2( 13.0f, 24.0f ) );
+ AnimatablePropertyComponentRegistration componentZeroAnimatableProperty( customType1, "componentZeroProp", componentZeroPropertyIndex, basePropertyIndex, 0 );
+ AnimatablePropertyComponentRegistration componentOneAnimatableProperty( customType1, "componentOneProp", componentOnePropertyIndex, basePropertyIndex, 1 );
+
+ // Check property count before property registration
+ TypeInfo typeInfo = typeRegistry.GetTypeInfo( typeid(MyTestCustomActor) );
+ DALI_TEST_CHECK( typeInfo );
+ BaseHandle handle = typeInfo.CreateInstance();
+ DALI_TEST_CHECK( handle );
+ Actor customActor = Actor::DownCast( handle );
+ DALI_TEST_CHECK( customActor );
+ Stage::GetCurrent().Add(customActor);
+
+ tet_infoline( "Get the component values, they should be the default value of the base-property" );
+ DALI_TEST_EQUALS( customActor.GetProperty< float >( componentZeroPropertyIndex ), 13.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( customActor.GetProperty< float >( componentOnePropertyIndex ), 24.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( customActor.GetProperty< Vector2 >( basePropertyIndex ), Vector2( 13.0f, 24.0f ), TEST_LOCATION );
+
+ tet_infoline( "Set a component value and ensure it changes for the base property as well" );
+ customActor.SetProperty( componentZeroPropertyIndex, 125.0f );
+ DALI_TEST_EQUALS( customActor.GetProperty< float >( componentZeroPropertyIndex ), 125.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( customActor.GetProperty< Vector2 >( basePropertyIndex ), Vector2( 125.0f, 24.0f ), TEST_LOCATION );
+
+ customActor.SetProperty( componentOnePropertyIndex, 225.0f );
+ DALI_TEST_EQUALS( customActor.GetProperty< float >( componentOnePropertyIndex ), 225.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( customActor.GetProperty< Vector2 >( basePropertyIndex ), Vector2( 125.0f, 225.0f ), TEST_LOCATION );
+
+ tet_infoline( "Check latest scene-graph value is unchanged" );
+ DALI_TEST_EQUALS( customActor.GetCurrentProperty< Vector2 >( basePropertyIndex ), Vector2( 13.0f, 24.0f ), TEST_LOCATION );
+ DALI_TEST_EQUALS( customActor.GetCurrentProperty< float >( componentZeroPropertyIndex ), 13.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( customActor.GetCurrentProperty< float >( componentOnePropertyIndex ), 24.0f, TEST_LOCATION );
+
+ // Render and notify
+ application.SendNotification();
+ application.Render();
+
+ tet_infoline( "Check values after rendering and both retrieval methods should return the latest" );
+ DALI_TEST_EQUALS( customActor.GetProperty< Vector2 >( basePropertyIndex ), Vector2( 125.0f, 225.0f ), TEST_LOCATION );
+ DALI_TEST_EQUALS( customActor.GetProperty< float >( componentZeroPropertyIndex ), 125.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( customActor.GetProperty< float >( componentOnePropertyIndex ), 225.0f, TEST_LOCATION );
+
+ DALI_TEST_EQUALS( customActor.GetCurrentProperty< Vector2 >( basePropertyIndex ), Vector2( 125.0f, 225.0f ), TEST_LOCATION );
+ DALI_TEST_EQUALS( customActor.GetCurrentProperty< float >( componentZeroPropertyIndex ), 125.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( customActor.GetCurrentProperty< float >( componentOnePropertyIndex ), 225.0f, TEST_LOCATION );
+
+ tet_infoline( "Set the base property value and ensure the component values reflect the change" );
+ customActor.SetProperty( basePropertyIndex, Vector2( 1.0f, 2.0f ) );
+ DALI_TEST_EQUALS( customActor.GetProperty< float >( componentZeroPropertyIndex ), 1.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( customActor.GetProperty< float >( componentOnePropertyIndex ), 2.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( customActor.GetProperty< Vector2 >( basePropertyIndex ), Vector2( 1.0f, 2.0f ), TEST_LOCATION );
+
+ END_TEST;
+}
+
+int UtcDaliPropertyRegistrationPropertyAnimatableSynchronousSetGetWithComponentsVector3(void)
+{
+ TestApplication application;
+ TypeRegistry typeRegistry = TypeRegistry::Get();
+
+ tet_infoline( "Register a type registered animatable property that has component indices and ensure set/get behaviour works synchronously and is the same regardless of how the property is set" );
+
+ // Register the animatable propeties
+ const int basePropertyIndex( ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX );
+ const int componentZeroPropertyIndex( basePropertyIndex + 1 );
+ const int componentOnePropertyIndex( componentZeroPropertyIndex + 1 );
+ const int componentTwoPropertyIndex( componentOnePropertyIndex + 1 );
+ AnimatablePropertyRegistration baseAnimatableProperty( customType1, "baseProp", basePropertyIndex, Vector3( 13.0f, 24.0f, 35.0 ) );
+ AnimatablePropertyComponentRegistration componentZeroAnimatableProperty( customType1, "componentZeroProp", componentZeroPropertyIndex, basePropertyIndex, 0 );
+ AnimatablePropertyComponentRegistration componentOneAnimatableProperty( customType1, "componentOneProp", componentOnePropertyIndex, basePropertyIndex, 1 );
+ AnimatablePropertyComponentRegistration componentTwoAnimatableProperty( customType1, "componentTwoProp", componentTwoPropertyIndex, basePropertyIndex, 2 );
+
+ // Check property count before property registration
+ TypeInfo typeInfo = typeRegistry.GetTypeInfo( typeid(MyTestCustomActor) );
+ DALI_TEST_CHECK( typeInfo );
+ BaseHandle handle = typeInfo.CreateInstance();
+ DALI_TEST_CHECK( handle );
+ Actor customActor = Actor::DownCast( handle );
+ DALI_TEST_CHECK( customActor );
+ Stage::GetCurrent().Add(customActor);
+
+ tet_infoline( "Get the component values, they should be the default value of the base-property" );
+ DALI_TEST_EQUALS( customActor.GetProperty< float >( componentZeroPropertyIndex ), 13.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( customActor.GetProperty< float >( componentOnePropertyIndex ), 24.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( customActor.GetProperty< float >( componentTwoPropertyIndex ), 35.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( customActor.GetProperty< Vector3 >( basePropertyIndex ), Vector3( 13.0f, 24.0f, 35.0f ), TEST_LOCATION );
+
+ tet_infoline( "Set a component value and ensure it changes for the base property as well" );
+ customActor.SetProperty( componentZeroPropertyIndex, 125.0f );
+ DALI_TEST_EQUALS( customActor.GetProperty< float >( componentZeroPropertyIndex ), 125.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( customActor.GetProperty< Vector3 >( basePropertyIndex ), Vector3( 125.0f, 24.0f, 35.0f ), TEST_LOCATION );
+
+ customActor.SetProperty( componentOnePropertyIndex, 225.0f );
+ DALI_TEST_EQUALS( customActor.GetProperty< float >( componentOnePropertyIndex ), 225.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( customActor.GetProperty< Vector3 >( basePropertyIndex ), Vector3( 125.0f, 225.0f, 35.0f ), TEST_LOCATION );
+
+ customActor.SetProperty( componentTwoPropertyIndex, 325.0f );
+ DALI_TEST_EQUALS( customActor.GetProperty< float >( componentTwoPropertyIndex ), 325.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( customActor.GetProperty< Vector3 >( basePropertyIndex ), Vector3( 125.0f, 225.0f, 325.0f ), TEST_LOCATION );
+
+ tet_infoline( "Check latest scene-graph value is unchanged" );
+ DALI_TEST_EQUALS( customActor.GetCurrentProperty< Vector3 >( basePropertyIndex ), Vector3( 13.0f, 24.0f, 35.0f ), TEST_LOCATION );
+ DALI_TEST_EQUALS( customActor.GetCurrentProperty< float >( componentZeroPropertyIndex ), 13.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( customActor.GetCurrentProperty< float >( componentOnePropertyIndex ), 24.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( customActor.GetCurrentProperty< float >( componentTwoPropertyIndex ), 35.0f, TEST_LOCATION );
+
+ // Render and notify
+ application.SendNotification();
+ application.Render();
+
+ tet_infoline( "Check values after rendering and both retrieval methods should return the latest" );
+ DALI_TEST_EQUALS( customActor.GetProperty< Vector3 >( basePropertyIndex ), Vector3( 125.0f, 225.0f, 325.0f ), TEST_LOCATION );
+ DALI_TEST_EQUALS( customActor.GetProperty< float >( componentZeroPropertyIndex ), 125.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( customActor.GetProperty< float >( componentOnePropertyIndex ), 225.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( customActor.GetProperty< float >( componentTwoPropertyIndex ), 325.0f, TEST_LOCATION );
+
+ DALI_TEST_EQUALS( customActor.GetCurrentProperty< Vector3 >( basePropertyIndex ), Vector3( 125.0f, 225.0f, 325.0f ), TEST_LOCATION );
+ DALI_TEST_EQUALS( customActor.GetCurrentProperty< float >( componentZeroPropertyIndex ), 125.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( customActor.GetCurrentProperty< float >( componentOnePropertyIndex ), 225.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( customActor.GetCurrentProperty< float >( componentTwoPropertyIndex ), 325.0f, TEST_LOCATION );
+
+ tet_infoline( "Set the base property value and ensure the component values reflect the change" );
+ customActor.SetProperty( basePropertyIndex, Vector3( 1.0f, 2.0f, 3.0f ) );
+ DALI_TEST_EQUALS( customActor.GetProperty< float >( componentZeroPropertyIndex ), 1.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( customActor.GetProperty< float >( componentOnePropertyIndex ), 2.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( customActor.GetProperty< float >( componentTwoPropertyIndex ), 3.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( customActor.GetProperty< Vector3 >( basePropertyIndex ), Vector3( 1.0f, 2.0f, 3.0f ), TEST_LOCATION );
+
+ END_TEST;
+}
+
+int UtcDaliPropertyRegistrationPropertyAnimatableSynchronousSetGetWithComponentsVector4(void)
+{
+ TestApplication application;
+ TypeRegistry typeRegistry = TypeRegistry::Get();
+
+ tet_infoline( "Register a type registered animatable property that has component indices and ensure set/get behaviour works synchronously and is the same regardless of how the property is set" );
+
+ // Register the animatable propeties
+ const int basePropertyIndex( ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX );
+ const int componentZeroPropertyIndex( basePropertyIndex + 1 );
+ const int componentOnePropertyIndex( componentZeroPropertyIndex + 1 );
+ const int componentTwoPropertyIndex( componentOnePropertyIndex + 1 );
+ const int componentThreePropertyIndex( componentTwoPropertyIndex + 1 );
+ AnimatablePropertyRegistration baseAnimatableProperty( customType1, "baseProp", basePropertyIndex, Vector4( 13.0f, 24.0f, 35.0, 47.0f ) );
+ AnimatablePropertyComponentRegistration componentZeroAnimatableProperty( customType1, "componentZeroProp", componentZeroPropertyIndex, basePropertyIndex, 0 );
+ AnimatablePropertyComponentRegistration componentOneAnimatableProperty( customType1, "componentOneProp", componentOnePropertyIndex, basePropertyIndex, 1 );
+ AnimatablePropertyComponentRegistration componentTwoAnimatableProperty( customType1, "componentTwoProp", componentTwoPropertyIndex, basePropertyIndex, 2 );
+ AnimatablePropertyComponentRegistration componentThreeAnimatableProperty( customType1, "componentThreeProp", componentThreePropertyIndex, basePropertyIndex, 3 );
+
+ // Check property count before property registration
+ TypeInfo typeInfo = typeRegistry.GetTypeInfo( typeid(MyTestCustomActor) );
+ DALI_TEST_CHECK( typeInfo );
+ BaseHandle handle = typeInfo.CreateInstance();
+ DALI_TEST_CHECK( handle );
+ Actor customActor = Actor::DownCast( handle );
+ DALI_TEST_CHECK( customActor );
+ Stage::GetCurrent().Add(customActor);
+
+ tet_infoline( "Get the component values, they should be the default value of the base-property" );
+ DALI_TEST_EQUALS( customActor.GetProperty< float >( componentZeroPropertyIndex ), 13.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( customActor.GetProperty< float >( componentOnePropertyIndex ), 24.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( customActor.GetProperty< float >( componentTwoPropertyIndex ), 35.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( customActor.GetProperty< float >( componentThreePropertyIndex ), 47.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( customActor.GetProperty< Vector4 >( basePropertyIndex ), Vector4( 13.0f, 24.0f, 35.0f, 47.0f ), TEST_LOCATION );
+
+ tet_infoline( "Set a component value and ensure it changes for the base property as well" );
+ customActor.SetProperty( componentZeroPropertyIndex, 125.0f );
+ DALI_TEST_EQUALS( customActor.GetProperty< float >( componentZeroPropertyIndex ), 125.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( customActor.GetProperty< Vector4 >( basePropertyIndex ), Vector4( 125.0f, 24.0f, 35.0f, 47.0f ), TEST_LOCATION );
+
+ customActor.SetProperty( componentOnePropertyIndex, 225.0f );
+ DALI_TEST_EQUALS( customActor.GetProperty< float >( componentOnePropertyIndex ), 225.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( customActor.GetProperty< Vector4 >( basePropertyIndex ), Vector4( 125.0f, 225.0f, 35.0f, 47.0f ), TEST_LOCATION );
+
+ customActor.SetProperty( componentTwoPropertyIndex, 325.0f );
+ DALI_TEST_EQUALS( customActor.GetProperty< float >( componentTwoPropertyIndex ), 325.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( customActor.GetProperty< Vector4 >( basePropertyIndex ), Vector4( 125.0f, 225.0f, 325.0f, 47.0f ), TEST_LOCATION );
+
+ customActor.SetProperty( componentThreePropertyIndex, 435.0f );
+ DALI_TEST_EQUALS( customActor.GetProperty< float >( componentThreePropertyIndex ), 435.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( customActor.GetProperty< Vector4 >( basePropertyIndex ), Vector4( 125.0f, 225.0f, 325.0f, 435.0f ), TEST_LOCATION );
+
+ tet_infoline( "Check latest scene-graph value is unchanged" );
+ DALI_TEST_EQUALS( customActor.GetCurrentProperty< Vector4 >( basePropertyIndex ), Vector4( 13.0f, 24.0f, 35.0f, 47.0f ), TEST_LOCATION );
+ DALI_TEST_EQUALS( customActor.GetCurrentProperty< float >( componentZeroPropertyIndex ), 13.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( customActor.GetCurrentProperty< float >( componentOnePropertyIndex ), 24.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( customActor.GetCurrentProperty< float >( componentTwoPropertyIndex ), 35.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( customActor.GetCurrentProperty< float >( componentThreePropertyIndex ), 47.0f, TEST_LOCATION );
+
+ // Render and notify
+ application.SendNotification();
+ application.Render();
+
+ tet_infoline( "Check values after rendering and both retrieval methods should return the latest" );
+ DALI_TEST_EQUALS( customActor.GetProperty< Vector4 >( basePropertyIndex ), Vector4( 125.0f, 225.0f, 325.0f, 435.0f ), TEST_LOCATION );
+ DALI_TEST_EQUALS( customActor.GetProperty< float >( componentZeroPropertyIndex ), 125.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( customActor.GetProperty< float >( componentOnePropertyIndex ), 225.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( customActor.GetProperty< float >( componentTwoPropertyIndex ), 325.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( customActor.GetProperty< float >( componentThreePropertyIndex ), 435.0f, TEST_LOCATION );
+
+ DALI_TEST_EQUALS( customActor.GetCurrentProperty< Vector4 >( basePropertyIndex ), Vector4( 125.0f, 225.0f, 325.0f, 435.0f ), TEST_LOCATION );
+ DALI_TEST_EQUALS( customActor.GetCurrentProperty< float >( componentZeroPropertyIndex ), 125.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( customActor.GetCurrentProperty< float >( componentOnePropertyIndex ), 225.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( customActor.GetCurrentProperty< float >( componentTwoPropertyIndex ), 325.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( customActor.GetCurrentProperty< float >( componentThreePropertyIndex ), 435.0f, TEST_LOCATION );
+
+ tet_infoline( "Set the base property value and ensure the component values reflect the change" );
+ customActor.SetProperty( basePropertyIndex, Vector4( 1.0f, 2.0f, 3.0f, 4.0f ) );
+ DALI_TEST_EQUALS( customActor.GetProperty< float >( componentZeroPropertyIndex ), 1.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( customActor.GetProperty< float >( componentOnePropertyIndex ), 2.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( customActor.GetProperty< float >( componentTwoPropertyIndex ), 3.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( customActor.GetProperty< float >( componentThreePropertyIndex ), 4.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS( customActor.GetProperty< Vector4 >( basePropertyIndex ), Vector4( 1.0f, 2.0f, 3.0f, 4.0f ), TEST_LOCATION );
+
+ END_TEST;
+}
+
+
+int UtcDaliTypeInfoRegisterChildProperties01(void)
+{
+ TestApplication application;
+ TypeRegistry typeRegistry = TypeRegistry::Get();
+
+ tet_infoline( "Register child properties on a type via name" );
+
+ auto customActorTypeInfo = typeRegistry.GetTypeInfo( typeid(CustomActor) );
+ auto myCustomTypeInfo = typeRegistry.GetTypeInfo( typeid(MyTestCustomActor) );
+ DALI_TEST_CHECK( customActorTypeInfo );
+ DALI_TEST_CHECK( myCustomTypeInfo );
+
+ const Property::Index WIDTH_SPECIFICATION( CHILD_PROPERTY_REGISTRATION_START_INDEX );
+ const Property::Index HEIGHT_SPECIFICATION( CHILD_PROPERTY_REGISTRATION_START_INDEX + 1);
+ const Property::Index MARGIN_SPECIFICATION( CHILD_PROPERTY_REGISTRATION_START_INDEX + 100);
+
+ ChildPropertyRegistration( customActorTypeInfo.GetName(), "widthSpecification", WIDTH_SPECIFICATION, Property::INTEGER );
+ ChildPropertyRegistration( customActorTypeInfo.GetName(), "heightSpecification", HEIGHT_SPECIFICATION, Property::INTEGER );
+ ChildPropertyRegistration( myCustomTypeInfo.GetName(), "marginSpecification", MARGIN_SPECIFICATION, Property::EXTENTS );
+
+ auto customActor = MyTestCustomActor::New();
+ Stage::GetCurrent().Add( customActor );
+ auto child = Actor::New();
+ customActor.Add( child );
+
+ child.SetProperty( WIDTH_SPECIFICATION, 33 );
+
+ auto value = child.GetProperty( WIDTH_SPECIFICATION );
+ DALI_TEST_EQUALS( value, Property::Value(33), TEST_LOCATION );
+
+ child.SetProperty( HEIGHT_SPECIFICATION, 44 );
+ value = child.GetProperty( HEIGHT_SPECIFICATION );
+ DALI_TEST_EQUALS( value, Property::Value(44), TEST_LOCATION );
+
+ child.SetProperty( MARGIN_SPECIFICATION, Extents(10, 10, 10, 10) );
+ value = child.GetProperty( MARGIN_SPECIFICATION );
+ DALI_TEST_EQUALS( value, Property::Value(Extents(10,10,10,10)), TEST_LOCATION );
+
+ END_TEST;
+}
+
+
+int UtcDaliTypeInfoRegisterChildProperties02(void)
+{
+ TestApplication application;
+ TypeRegistry typeRegistry = TypeRegistry::Get();
+
+ tet_infoline( "Register child properties on a type via name" );
+
+ auto customActorTypeInfo = typeRegistry.GetTypeInfo( typeid(CustomActor) );
+ auto myCustomTypeInfo = typeRegistry.GetTypeInfo( typeid(MyTestCustomActor) );
+ DALI_TEST_CHECK( customActorTypeInfo );
+ DALI_TEST_CHECK( myCustomTypeInfo );
+
+ const Property::Index WIDTH_SPECIFICATION( CHILD_PROPERTY_REGISTRATION_START_INDEX );
+ const Property::Index HEIGHT_SPECIFICATION( CHILD_PROPERTY_REGISTRATION_START_INDEX + 1);
+ const Property::Index MARGIN_SPECIFICATION( CHILD_PROPERTY_REGISTRATION_START_INDEX + 100);
+
+ ChildPropertyRegistration( customActorTypeInfo.GetName(), "widthSpecification", WIDTH_SPECIFICATION, Property::INTEGER );
+ ChildPropertyRegistration( customActorTypeInfo.GetName(), "heightSpecification", HEIGHT_SPECIFICATION, Property::INTEGER );
+ ChildPropertyRegistration( myCustomTypeInfo.GetName(), "marginSpecification", MARGIN_SPECIFICATION, Property::EXTENTS );
+
+
+ auto index = customActorTypeInfo.GetChildPropertyIndex( "widthSpecification" );
+ DALI_TEST_EQUALS( index, WIDTH_SPECIFICATION, TEST_LOCATION );
+
+ index = customActorTypeInfo.GetChildPropertyIndex( "heightSpecification" );
+ DALI_TEST_EQUALS( index, HEIGHT_SPECIFICATION, TEST_LOCATION );
+
+ index = customActorTypeInfo.GetChildPropertyIndex( "marginSpecification" );
+ DALI_TEST_EQUALS( index, Property::INVALID_INDEX, TEST_LOCATION );
+
+ index = myCustomTypeInfo.GetChildPropertyIndex( "marginSpecification" );
+ DALI_TEST_EQUALS( index, MARGIN_SPECIFICATION, TEST_LOCATION );
+
+
+ auto name = customActorTypeInfo.GetChildPropertyName( WIDTH_SPECIFICATION );
+ DALI_TEST_EQUALS( name, "widthSpecification", TEST_LOCATION );
+
+ name = customActorTypeInfo.GetChildPropertyName( HEIGHT_SPECIFICATION );
+ DALI_TEST_EQUALS( name, "heightSpecification", TEST_LOCATION );
+
+ name = myCustomTypeInfo.GetChildPropertyName( MARGIN_SPECIFICATION );
+ DALI_TEST_EQUALS( name, "marginSpecification", TEST_LOCATION );
+
+
+ auto type = customActorTypeInfo.GetChildPropertyType( WIDTH_SPECIFICATION );
+ DALI_TEST_EQUALS( type, Property::INTEGER, TEST_LOCATION );
+
+ type = customActorTypeInfo.GetChildPropertyType( HEIGHT_SPECIFICATION );
+ DALI_TEST_EQUALS( type, Property::INTEGER, TEST_LOCATION );
+
+ type = myCustomTypeInfo.GetChildPropertyType( MARGIN_SPECIFICATION );
+ DALI_TEST_EQUALS( type, Property::EXTENTS, TEST_LOCATION );
+
+
+ END_TEST;
+}
+
+
+int UtcDaliTypeInfoRegisterChildProperties03(void)
+{
+ TestApplication application;
+ TypeRegistry typeRegistry = TypeRegistry::Get();
+
+ tet_infoline( "Check registered child properties can be retrieved" );
+
+ auto customActorTypeInfo = typeRegistry.GetTypeInfo( typeid(CustomActor) );
+ auto myCustomTypeInfo = typeRegistry.GetTypeInfo( typeid(MyTestCustomActor) );
+ DALI_TEST_CHECK( customActorTypeInfo );
+ DALI_TEST_CHECK( myCustomTypeInfo );
+
+ const Property::Index WIDTH_SPECIFICATION( CHILD_PROPERTY_REGISTRATION_START_INDEX );
+ const Property::Index HEIGHT_SPECIFICATION( CHILD_PROPERTY_REGISTRATION_START_INDEX + 1);
+ const Property::Index MARGIN_SPECIFICATION( CHILD_PROPERTY_REGISTRATION_START_INDEX + 100);
+
+ ChildPropertyRegistration( customActorTypeInfo.GetName(), "widthSpecification", WIDTH_SPECIFICATION, Property::INTEGER );
+ ChildPropertyRegistration( customActorTypeInfo.GetName(), "heightSpecification", HEIGHT_SPECIFICATION, Property::INTEGER );
+ ChildPropertyRegistration( myCustomTypeInfo.GetName(), "marginSpecification", MARGIN_SPECIFICATION, Property::EXTENTS );
+
+ Property::IndexContainer indices;
+ myCustomTypeInfo.GetChildPropertyIndices( indices );
+
+ auto result = std::find( indices.Begin(), indices.End(), WIDTH_SPECIFICATION );
+ DALI_TEST_EQUALS( result != indices.End(), true, TEST_LOCATION );
+
+ result = std::find( indices.Begin(), indices.End(), HEIGHT_SPECIFICATION );
+ DALI_TEST_EQUALS( result != indices.End(), true, TEST_LOCATION );
+
+ result = std::find( indices.Begin(), indices.End(), MARGIN_SPECIFICATION );
+ DALI_TEST_EQUALS( result != indices.End(), true, TEST_LOCATION );