X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=automated-tests%2Fsrc%2Fdali%2Futc-Dali-TypeRegistry.cpp;h=7c7f8759088344dadcf5c2817cff4286e10066dc;hb=955b4d7a108b1fd39990c859e83cb201639edae5;hp=f6ca243e7a9aca7678a04085118aed9304a6d9de;hpb=3b7a66c180683cc940f33a061891dcbdaf35765d;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/automated-tests/src/dali/utc-Dali-TypeRegistry.cpp b/automated-tests/src/dali/utc-Dali-TypeRegistry.cpp index f6ca243..7c7f875 100644 --- a/automated-tests/src/dali/utc-Dali-TypeRegistry.cpp +++ b/automated-tests/src/dali/utc-Dali-TypeRegistry.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 Samsung Electronics Co., Ltd. + * Copyright (c) 2021 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,60 +15,61 @@ * */ -#include -#include -#include -#include #include -#include -#include #include -#include +#include +#include +#include +#include +#include -using namespace Dali; +#include +#include +using namespace Dali; namespace { - // Stores data that is populated in the callback and will be read by the Test cases struct SignalData { SignalData() - : functorCalled( false ), - voidFunctorCalled( false ), - receivedGesture( Gesture::Clear ), + : functorCalled(false), + voidFunctorCalled(false), + receivedGesture(), pressedActor() - {} + { + } void Reset() { - functorCalled = false; + functorCalled = false; voidFunctorCalled = false; - receivedGesture.numberOfTouches = 0u; - receivedGesture.screenPoint = Vector2(0.0f, 0.0f); - receivedGesture.localPoint = Vector2(0.0f, 0.0f); + receivedGesture.Reset(); pressedActor.Reset(); } - bool functorCalled; - bool voidFunctorCalled; + bool functorCalled; + bool voidFunctorCalled; LongPressGesture receivedGesture; - Actor pressedActor; + Actor pressedActor; }; // Functor that sets the data when called struct GestureReceivedFunctor { - GestureReceivedFunctor(SignalData& data) : signalData(data) { } + GestureReceivedFunctor(SignalData& data) + : signalData(data) + { + } void operator()(Actor actor, LongPressGesture longPress) { - signalData.functorCalled = true; + signalData.functorCalled = true; signalData.receivedGesture = longPress; - signalData.pressedActor = actor; + signalData.pressedActor = actor; } void operator()() @@ -83,37 +84,35 @@ struct GestureReceivedFunctor // Create function as Init function called // static bool CreateCustomInitCalled = false; -BaseHandle CreateCustomInit(void) +BaseHandle CreateCustomInit(void) { CreateCustomInitCalled = true; return BaseHandle(); } static bool CreateCustomNamedInitCalled = false; -BaseHandle CreateCustomNamedInit(void) +BaseHandle CreateCustomNamedInit(void) { CreateCustomNamedInitCalled = true; return BaseHandle(); } -const std::string scriptedName("PopupStyle"); -static TypeRegistration scriptedType( scriptedName, typeid(Dali::CustomActor), CreateCustomNamedInit ); +const std::string scriptedName("PopupStyle"); +static TypeRegistration scriptedType(scriptedName, typeid(Dali::CustomActor), CreateCustomNamedInit); // Property Registration bool setPropertyCalled = false; bool getPropertyCalled = false; -void SetProperty( BaseObject* object, Property::Index propertyIndex, const Property::Value& value ) +void SetProperty(BaseObject* object, Property::Index propertyIndex, const Property::Value& value) { setPropertyCalled = true; } -Property::Value GetProperty( BaseObject* object, Property::Index propertyIndex ) +Property::Value GetProperty(BaseObject* object, Property::Index propertyIndex) { getPropertyCalled = true; - return Property::Value( true ); + return Property::Value(true); } - - /******************************************************************************* * * Custom Actor @@ -123,21 +122,24 @@ namespace Impl { struct MyTestCustomActor : public CustomActorImpl { - typedef Signal< void ()> SignalType; - typedef Signal< void (float)> SignalTypeFloat; + typedef Signal SignalType; + typedef Signal SignalTypeFloat; - MyTestCustomActor() : CustomActorImpl( ActorFlags( REQUIRES_TOUCH_EVENTS ) ) - { } + MyTestCustomActor() + : CustomActorImpl(ActorFlags()) + { + } virtual ~MyTestCustomActor() - { } + { + } void ResetCallStack() { } // From CustomActorImpl - virtual void OnSceneConnection( int depth ) + virtual void OnSceneConnection(int depth) { } virtual void OnSceneDisconnection() @@ -155,18 +157,6 @@ struct MyTestCustomActor : public CustomActorImpl virtual void OnSizeAnimation(Animation& animation, const Vector3& targetSize) { } - virtual bool OnHoverEvent(const HoverEvent& event) - { - return true; - } - virtual bool OnWheelEvent(const WheelEvent& event) - { - return true; - } - virtual bool OnKeyEvent(const KeyEvent& event) - { - return true; - } virtual void OnKeyInputFocusGained() { } @@ -175,47 +165,46 @@ struct MyTestCustomActor : public CustomActorImpl } virtual Vector3 GetNaturalSize() { - return Vector3( 0.0f, 0.0f, 0.0f ); + return Vector3(0.0f, 0.0f, 0.0f); } - virtual float GetHeightForWidth( float width ) + virtual float GetHeightForWidth(float width) { return 0.0f; } - virtual float GetWidthForHeight( float height ) + virtual float GetWidthForHeight(float height) { return 0.0f; } - virtual void OnRelayout( const Vector2& size, RelayoutContainer& container ) + virtual void OnRelayout(const Vector2& size, RelayoutContainer& container) { } - virtual void OnSetResizePolicy( ResizePolicy::Type policy, Dimension::Type dimension ) + virtual void OnSetResizePolicy(ResizePolicy::Type policy, Dimension::Type dimension) { } - virtual void OnCalculateRelayoutSize( Dimension::Type dimension ) + virtual void OnCalculateRelayoutSize(Dimension::Type dimension) { } - virtual float CalculateChildSize( const Dali::Actor& child, Dimension::Type dimension ) + virtual float CalculateChildSize(const Dali::Actor& child, Dimension::Type dimension) { return 0.0f; } - virtual void OnLayoutNegotiated( float size, Dimension::Type dimension ) + virtual void OnLayoutNegotiated(float size, Dimension::Type dimension) { } - virtual bool RelayoutDependentOnChildren( Dimension::Type dimension = Dimension::ALL_DIMENSIONS ) + virtual bool RelayoutDependentOnChildren(Dimension::Type dimension = Dimension::ALL_DIMENSIONS) { return false; } public: - SignalType mSignal; }; @@ -224,9 +213,8 @@ public: class MyTestCustomActor : public CustomActor { public: - - typedef Signal< void ()> SignalType; - typedef Signal< void (float)> SignalTypeFloat; + typedef Signal SignalType; + typedef Signal SignalTypeFloat; MyTestCustomActor() { @@ -235,25 +223,25 @@ public: static MyTestCustomActor New() { Impl::MyTestCustomActor* p = new Impl::MyTestCustomActor; - return MyTestCustomActor( *p ); // takes ownership + return MyTestCustomActor(*p); // takes ownership } virtual ~MyTestCustomActor() { } - static MyTestCustomActor DownCast( BaseHandle handle ) + static MyTestCustomActor DownCast(BaseHandle handle) { MyTestCustomActor result; - CustomActor custom = Dali::CustomActor::DownCast( handle ); - if ( custom ) + CustomActor custom = Dali::CustomActor::DownCast(handle); + if(custom) { CustomActorImpl& customImpl = custom.GetImplementation(); Impl::MyTestCustomActor* impl = dynamic_cast(&customImpl); - if (impl) + if(impl) { result = MyTestCustomActor(customImpl.GetOwner()); } @@ -265,37 +253,33 @@ public: SignalType& GetCustomSignal() { Dali::RefObject& obj = GetImplementation(); - return static_cast( obj ).mSignal; + return static_cast(obj).mSignal; } private: - MyTestCustomActor(Internal::CustomActor* internal) : CustomActor(internal) { } - MyTestCustomActor( Impl::MyTestCustomActor& impl ) - : CustomActor( impl ) + MyTestCustomActor(Impl::MyTestCustomActor& impl) + : CustomActor(impl) { } }; - class MyTestCustomActor2 : public CustomActor { public: - struct Property { enum { - P1=Dali::PROPERTY_REGISTRATION_START_INDEX, + P1 = Dali::PROPERTY_REGISTRATION_START_INDEX, P2 }; }; - MyTestCustomActor2() { } @@ -309,18 +293,18 @@ public: { } - static MyTestCustomActor2 DownCast( BaseHandle handle ) + static MyTestCustomActor2 DownCast(BaseHandle handle) { MyTestCustomActor2 result; - CustomActor custom = Dali::CustomActor::DownCast( handle ); - if ( custom ) + CustomActor custom = Dali::CustomActor::DownCast(handle); + if(custom) { CustomActorImpl& customImpl = custom.GetImplementation(); Impl::MyTestCustomActor* impl = dynamic_cast(&customImpl); - if (impl) + if(impl) { result = MyTestCustomActor2(customImpl.GetOwner()); } @@ -330,23 +314,21 @@ public: } private: - MyTestCustomActor2(Internal::CustomActor* internal) : CustomActor(internal) { } - MyTestCustomActor2( Impl::MyTestCustomActor& impl ) - : CustomActor( impl ) + MyTestCustomActor2(Impl::MyTestCustomActor& impl) + : CustomActor(impl) { } }; -static TypeRegistration customTypeInit( typeid(MyTestCustomActor2), typeid(Dali::CustomActor), CreateCustomInit, true ); - -PropertyRegistration P1( customTypeInit, "propertyOne", MyTestCustomActor2::Property::P1, Property::INTEGER, &SetProperty, &GetProperty ); -PropertyRegistration P2( customTypeInit, "propertyTwo", MyTestCustomActor2::Property::P2, Property::STRING, &SetProperty, &GetProperty ); +static TypeRegistration customTypeInit(typeid(MyTestCustomActor2), typeid(Dali::CustomActor), CreateCustomInit, true); +PropertyRegistration P1(customTypeInit, "propertyOne", MyTestCustomActor2::Property::P1, Property::INTEGER, &SetProperty, &GetProperty); +PropertyRegistration P2(customTypeInit, "propertyTwo", MyTestCustomActor2::Property::P2, Property::STRING, &SetProperty, &GetProperty); class MyTestCustomActor3 : public CustomActor { @@ -364,18 +346,18 @@ public: { } - static MyTestCustomActor3 DownCast( BaseHandle handle ) + static MyTestCustomActor3 DownCast(BaseHandle handle) { MyTestCustomActor3 result; - CustomActor custom = Dali::CustomActor::DownCast( handle ); - if ( custom ) + CustomActor custom = Dali::CustomActor::DownCast(handle); + if(custom) { CustomActorImpl& customImpl = custom.GetImplementation(); Impl::MyTestCustomActor* impl = dynamic_cast(&customImpl); - if (impl) + if(impl) { result = MyTestCustomActor3(customImpl.GetOwner()); } @@ -385,19 +367,18 @@ public: } private: - MyTestCustomActor3(Internal::CustomActor* internal) : CustomActor(internal) { } - MyTestCustomActor3( Impl::MyTestCustomActor& impl ) - : CustomActor( impl ) + MyTestCustomActor3(Impl::MyTestCustomActor& impl) + : CustomActor(impl) { } }; -static TypeRegistration customTypeBadInit( typeid(MyTestCustomActor3), typeid(Dali::CustomActor), NULL, false ); +static TypeRegistration customTypeBadInit(typeid(MyTestCustomActor3), typeid(Dali::CustomActor), NULL, false); BaseHandle CreateCustom(void) { @@ -406,18 +387,18 @@ BaseHandle CreateCustom(void) static std::string lastSignalConnectionCustom; -bool DoConnectSignalCustom( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor ) +bool DoConnectSignalCustom(BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor) { lastSignalConnectionCustom = signalName; - bool connected( true ); + bool connected(true); - Dali::BaseHandle handle(object); + Dali::BaseHandle handle(object); MyTestCustomActor customActor = MyTestCustomActor::DownCast(handle); - if( "sig1" == signalName ) + if("sig1" == signalName) { - customActor.GetCustomSignal().Connect( tracker, functor ); + customActor.GetCustomSignal().Connect(tracker, functor); } else { @@ -428,7 +409,7 @@ bool DoConnectSignalCustom( BaseObject* object, ConnectionTrackerInterface* trac return connected; } -bool DoConnectSignalCustomFailure( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor ) +bool DoConnectSignalCustomFailure(BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor) { lastSignalConnectionCustom = "failed"; @@ -443,7 +424,7 @@ struct CustomTestFunctor ++mCurrentInstanceCount; } - CustomTestFunctor( const CustomTestFunctor& copyMe ) + CustomTestFunctor(const CustomTestFunctor& copyMe) { ++mTotalInstanceCount; ++mCurrentInstanceCount; @@ -464,9 +445,9 @@ struct CustomTestFunctor static int mCallbackCount; }; -int CustomTestFunctor::mTotalInstanceCount = 0; +int CustomTestFunctor::mTotalInstanceCount = 0; int CustomTestFunctor::mCurrentInstanceCount = 0; -int CustomTestFunctor::mCallbackCount = 0; +int CustomTestFunctor::mCallbackCount = 0; static void ResetFunctorCounts() { @@ -476,28 +457,27 @@ static void ResetFunctorCounts() } static std::string lastActionCustom; -bool DoActionCustom(BaseObject* object, const std::string& actionName, const Property::Map& /*attributes*/) +bool DoActionCustom(BaseObject* object, const std::string& actionName, const Property::Map& /*attributes*/) { lastActionCustom = actionName; return true; } // Custom type registration -static TypeRegistration customType1( typeid(MyTestCustomActor), typeid(Dali::CustomActor), CreateCustom ); +static TypeRegistration customType1(typeid(MyTestCustomActor), typeid(Dali::CustomActor), CreateCustom); // Custom signals -static SignalConnectorType customSignalConnector1( customType1, "sig1", DoConnectSignalCustom ); -static SignalConnectorType customSignalConnector2( customType1, "sig2", DoConnectSignalCustomFailure ); -static const int TEST_SIGNAL_COUNT = 2; +static SignalConnectorType customSignalConnector1(customType1, "sig1", DoConnectSignalCustom); +static SignalConnectorType customSignalConnector2(customType1, "sig2", DoConnectSignalCustomFailure); +static const int TEST_SIGNAL_COUNT = 2; // Custom actions -static TypeAction customAction1( customType1, "act1", DoActionCustom); -static const int TEST_ACTION_COUNT = 1; +static TypeAction customAction1(customType1, "act1", DoActionCustom); +static const int TEST_ACTION_COUNT = 1; class TestConnectionTracker : public ConnectionTracker { public: - TestConnectionTracker() { } @@ -506,12 +486,12 @@ public: BaseHandle CreateNamedActorType() { Actor actor = Actor::New(); - actor.SetProperty( Actor::Property::NAME, "NamedActor" ); + actor.SetProperty(Actor::Property::NAME, "NamedActor"); return actor; } -TypeRegistration namedActorType( "MyNamedActor", typeid(Dali::Actor), CreateNamedActorType ); -PropertyRegistration namedActorPropertyOne( namedActorType, "propName", PROPERTY_REGISTRATION_START_INDEX, Property::BOOLEAN, &SetProperty, &GetProperty ); +TypeRegistration namedActorType("MyNamedActor", typeid(Dali::Actor), CreateNamedActorType); +PropertyRegistration namedActorPropertyOne(namedActorType, "propName", PROPERTY_REGISTRATION_START_INDEX, Property::BOOLEAN, &SetProperty, &GetProperty); } // Anonymous namespace @@ -521,7 +501,7 @@ int UtcDaliTypeRegistryGetP(void) TestApplication application; TypeRegistry registry = TypeRegistry::Get(); - DALI_TEST_CHECK( registry ); + DALI_TEST_CHECK(registry); END_TEST; } @@ -532,7 +512,7 @@ int UtcDaliTypeRegistryConstructorP(void) TestApplication application; TypeRegistry registry; - DALI_TEST_CHECK( !registry ); + DALI_TEST_CHECK(!registry); END_TEST; } @@ -542,12 +522,12 @@ int UtcDaliTypeRegistryCopyConstructorP(void) TestApplication application; TypeRegistry registry = TypeRegistry::Get(); - DALI_TEST_CHECK( registry ); + DALI_TEST_CHECK(registry); - TypeRegistry copy( registry ); - DALI_TEST_CHECK( copy ); + TypeRegistry copy(registry); + DALI_TEST_CHECK(copy); - DALI_TEST_CHECK( registry.GetTypeInfo( "Actor" ).GetName() == copy.GetTypeInfo( "Actor" ).GetName() ); + DALI_TEST_CHECK(registry.GetTypeInfo("Actor").GetName() == copy.GetTypeInfo("Actor").GetName()); END_TEST; } @@ -558,13 +538,13 @@ int UtcDaliTypeRegistryAssignmentOperatorP(void) TestApplication application; TypeRegistry registry = TypeRegistry::Get(); - DALI_TEST_CHECK( registry ); + DALI_TEST_CHECK(registry); TypeRegistry copy = registry; - DALI_TEST_CHECK( copy ); - DALI_TEST_CHECK( registry == copy ); + DALI_TEST_CHECK(copy); + DALI_TEST_CHECK(registry == copy); - DALI_TEST_CHECK( registry.GetTypeInfo( "Actor" ).GetName() == copy.GetTypeInfo( "Actor" ).GetName() ); + DALI_TEST_CHECK(registry.GetTypeInfo("Actor").GetName() == copy.GetTypeInfo("Actor").GetName()); END_TEST; } @@ -574,26 +554,26 @@ int UtcDaliTypeRegistryMoveConstructor(void) TestApplication application; TypeRegistry registry = TypeRegistry::Get(); - DALI_TEST_CHECK( registry ); - DALI_TEST_EQUALS( 16, registry.GetBaseObject().ReferenceCount(), TEST_LOCATION ); - DALI_TEST_CHECK( registry.GetTypeInfo( "Actor" ).GetName() == "Actor" ); + DALI_TEST_CHECK(registry); + DALI_TEST_EQUALS(16, registry.GetBaseObject().ReferenceCount(), TEST_LOCATION); + DALI_TEST_CHECK(registry.GetTypeInfo("Actor").GetName() == "Actor"); - TypeRegistry movedRegistry = std::move( registry ); - DALI_TEST_CHECK( movedRegistry ); - DALI_TEST_EQUALS( 16, movedRegistry.GetBaseObject().ReferenceCount(), TEST_LOCATION ); - DALI_TEST_CHECK( movedRegistry.GetTypeInfo( "Actor" ).GetName() == "Actor" ); - DALI_TEST_CHECK( !registry ); + TypeRegistry movedRegistry = std::move(registry); + DALI_TEST_CHECK(movedRegistry); + DALI_TEST_EQUALS(16, movedRegistry.GetBaseObject().ReferenceCount(), TEST_LOCATION); + DALI_TEST_CHECK(movedRegistry.GetTypeInfo("Actor").GetName() == "Actor"); + DALI_TEST_CHECK(!registry); - Dali::TypeInfo info = movedRegistry.GetTypeInfo( "Actor" ); - DALI_TEST_CHECK( info ); - DALI_TEST_EQUALS( 2, info.GetBaseObject().ReferenceCount(), TEST_LOCATION ); - DALI_TEST_CHECK( info.GetName() == "Actor" ); + Dali::TypeInfo info = movedRegistry.GetTypeInfo("Actor"); + DALI_TEST_CHECK(info); + DALI_TEST_EQUALS(2, info.GetBaseObject().ReferenceCount(), TEST_LOCATION); + DALI_TEST_CHECK(info.GetName() == "Actor"); - Dali::TypeInfo movedInfo = std::move( info ); - DALI_TEST_CHECK( movedInfo ); - DALI_TEST_EQUALS( 2, movedInfo.GetBaseObject().ReferenceCount(), TEST_LOCATION ); - DALI_TEST_CHECK( movedInfo.GetName() == "Actor" ); - DALI_TEST_CHECK( !info ); + Dali::TypeInfo movedInfo = std::move(info); + DALI_TEST_CHECK(movedInfo); + DALI_TEST_EQUALS(2, movedInfo.GetBaseObject().ReferenceCount(), TEST_LOCATION); + DALI_TEST_CHECK(movedInfo.GetName() == "Actor"); + DALI_TEST_CHECK(!info); END_TEST; } @@ -603,28 +583,28 @@ int UtcDaliTypeRegistryMoveAssignment(void) TestApplication application; TypeRegistry registry = TypeRegistry::Get(); - DALI_TEST_CHECK( registry ); - DALI_TEST_EQUALS( 16, registry.GetBaseObject().ReferenceCount(), TEST_LOCATION ); - DALI_TEST_CHECK( registry.GetTypeInfo( "Actor" ).GetName() == "Actor" ); + DALI_TEST_CHECK(registry); + DALI_TEST_EQUALS(16, registry.GetBaseObject().ReferenceCount(), TEST_LOCATION); + DALI_TEST_CHECK(registry.GetTypeInfo("Actor").GetName() == "Actor"); TypeRegistry movedRegistry; - movedRegistry = std::move( registry ); - DALI_TEST_CHECK( movedRegistry ); - DALI_TEST_EQUALS( 16, movedRegistry.GetBaseObject().ReferenceCount(), TEST_LOCATION ); - DALI_TEST_CHECK( movedRegistry.GetTypeInfo( "Actor" ).GetName() == "Actor" ); - DALI_TEST_CHECK( !registry ); + movedRegistry = std::move(registry); + DALI_TEST_CHECK(movedRegistry); + DALI_TEST_EQUALS(16, movedRegistry.GetBaseObject().ReferenceCount(), TEST_LOCATION); + DALI_TEST_CHECK(movedRegistry.GetTypeInfo("Actor").GetName() == "Actor"); + DALI_TEST_CHECK(!registry); - Dali::TypeInfo info = movedRegistry.GetTypeInfo( "Actor" ); - DALI_TEST_CHECK( info ); - DALI_TEST_EQUALS( 2, info.GetBaseObject().ReferenceCount(), TEST_LOCATION ); - DALI_TEST_CHECK( info.GetName() == "Actor" ); + Dali::TypeInfo info = movedRegistry.GetTypeInfo("Actor"); + DALI_TEST_CHECK(info); + DALI_TEST_EQUALS(2, info.GetBaseObject().ReferenceCount(), TEST_LOCATION); + DALI_TEST_CHECK(info.GetName() == "Actor"); Dali::TypeInfo movedInfo; - movedInfo = std::move( info ); - DALI_TEST_CHECK( movedInfo ); - DALI_TEST_EQUALS( 2, movedInfo.GetBaseObject().ReferenceCount(), TEST_LOCATION ); - DALI_TEST_CHECK( movedInfo.GetName() == "Actor" ); - DALI_TEST_CHECK( !info ); + movedInfo = std::move(info); + DALI_TEST_CHECK(movedInfo); + DALI_TEST_EQUALS(2, movedInfo.GetBaseObject().ReferenceCount(), TEST_LOCATION); + DALI_TEST_CHECK(movedInfo.GetName() == "Actor"); + DALI_TEST_CHECK(!info); END_TEST; } @@ -636,9 +616,9 @@ int UtcDaliTypeRegistryAssignP(void) TypeRegistry registry = TypeRegistry::Get(); TypeRegistry registry2; registry2 = registry; - DALI_TEST_CHECK( registry2 ); + DALI_TEST_CHECK(registry2); - DALI_TEST_CHECK( registry2.GetTypeInfo( "Actor" ).GetName() == registry2.GetTypeInfo( "Actor" ).GetName() ); + DALI_TEST_CHECK(registry2.GetTypeInfo("Actor").GetName() == registry2.GetTypeInfo("Actor").GetName()); END_TEST; } @@ -652,18 +632,18 @@ int UtcDaliTypeRegistryGetTypeInfoFromTypeNameP(void) TypeInfo type; // camera actor - type = registry.GetTypeInfo( "CameraActor" ); - DALI_TEST_CHECK( type ); + type = registry.GetTypeInfo("CameraActor"); + DALI_TEST_CHECK(type); CameraActor ca = CameraActor::DownCast(type.CreateInstance()); - DALI_TEST_CHECK( ca ); - application.GetScene().Add( ca ); + DALI_TEST_CHECK(ca); + application.GetScene().Add(ca); application.Render(); // animations - type = registry.GetTypeInfo( "Animation" ); - DALI_TEST_CHECK( type ); + type = registry.GetTypeInfo("Animation"); + DALI_TEST_CHECK(type); Animation an = Animation::DownCast(type.CreateInstance()); - DALI_TEST_CHECK( an ); + DALI_TEST_CHECK(an); an.Play(); application.Render(); @@ -678,25 +658,25 @@ int UtcDaliTypeRegistryGetTypeInfoFromTypeNameN(void) TypeInfo type; - type = registry.GetTypeInfo( "MyDummyActor" ); - DALI_TEST_CHECK( !type ); + type = registry.GetTypeInfo("MyDummyActor"); + DALI_TEST_CHECK(!type); END_TEST; } int UtcDaliTypeRegistryGetTypeInfoFromTypeIdP(void) { - TypeInfo named_type = TypeRegistry::Get().GetTypeInfo( "CameraActor" ); - TypeInfo typeinfo_type = TypeRegistry::Get().GetTypeInfo( typeid(Dali::CameraActor) ); + TypeInfo named_type = TypeRegistry::Get().GetTypeInfo("CameraActor"); + TypeInfo typeinfo_type = TypeRegistry::Get().GetTypeInfo(typeid(Dali::CameraActor)); - DALI_TEST_CHECK( named_type ); - DALI_TEST_CHECK( typeinfo_type ); + DALI_TEST_CHECK(named_type); + DALI_TEST_CHECK(typeinfo_type); // Check named and typeid are equivalent - DALI_TEST_CHECK( named_type == typeinfo_type ); + DALI_TEST_CHECK(named_type == typeinfo_type); - DALI_TEST_CHECK( named_type.GetName() == typeinfo_type.GetName() ); - DALI_TEST_CHECK( named_type.GetBaseName() == typeinfo_type.GetBaseName() ); + DALI_TEST_CHECK(named_type.GetName() == typeinfo_type.GetName()); + DALI_TEST_CHECK(named_type.GetBaseName() == typeinfo_type.GetBaseName()); END_TEST; } @@ -704,10 +684,10 @@ int UtcDaliTypeRegistryGetTypeInfoFromTypeIdP(void) int UtcDaliTypeRegistryGetTypeInfoFromTypeIdN(void) { TestApplication application; - TypeRegistry typeRegistry = TypeRegistry::Get(); + TypeRegistry typeRegistry = TypeRegistry::Get(); - TypeInfo typeInfo = typeRegistry.GetTypeInfo( typeid(Vector2) ); - DALI_TEST_CHECK( !typeInfo ); + TypeInfo typeInfo = typeRegistry.GetTypeInfo(typeid(Vector2)); + DALI_TEST_CHECK(!typeInfo); END_TEST; } @@ -715,35 +695,33 @@ int UtcDaliTypeRegistryGetTypeInfoFromTypeIdN(void) int UtcDaliTypeRegistryGetTypeNameCountP(void) { TestApplication application; - TypeRegistry typeRegistry = TypeRegistry::Get(); - TypeInfo type; + TypeRegistry typeRegistry = TypeRegistry::Get(); + TypeInfo type; for(size_t i = 0; i < typeRegistry.GetTypeNameCount(); i++) { - type = typeRegistry.GetTypeInfo( typeRegistry.GetTypeName(i) ); - DALI_TEST_CHECK( type ); + type = typeRegistry.GetTypeInfo(typeRegistry.GetTypeName(i)); + DALI_TEST_CHECK(type); } END_TEST; } - int UtcDaliTypeRegistryGetTypeNamesP(void) { TestApplication application; - TypeRegistry typeRegistry = TypeRegistry::Get(); - TypeInfo type; + TypeRegistry typeRegistry = TypeRegistry::Get(); + TypeInfo type; for(size_t i = 0; i < typeRegistry.GetTypeNameCount(); i++) { - type = typeRegistry.GetTypeInfo( typeRegistry.GetTypeName(i) ); - DALI_TEST_CHECK( type ); + type = typeRegistry.GetTypeInfo(typeRegistry.GetTypeName(i)); + DALI_TEST_CHECK(type); } END_TEST; } - // Note: No negative test case for UtcDaliTypeRegistryTypeRegistration can be implemented. int UtcDaliTypeRegistryTypeRegistrationNotCallingCreateOnInitP(void) { @@ -751,51 +729,51 @@ int UtcDaliTypeRegistryTypeRegistrationNotCallingCreateOnInitP(void) TestApplication application; - TypeInfo type = TypeRegistry::Get().GetTypeInfo( "MyTestCustomActor" ); - DALI_TEST_CHECK( type ); + TypeInfo type = TypeRegistry::Get().GetTypeInfo("MyTestCustomActor"); + DALI_TEST_CHECK(type); - TypeInfo baseType = TypeRegistry::Get().GetTypeInfo( "CustomActor" ); - DALI_TEST_CHECK( baseType ); + TypeInfo baseType = TypeRegistry::Get().GetTypeInfo("CustomActor"); + DALI_TEST_CHECK(baseType); BaseHandle handle = type.CreateInstance(); - DALI_TEST_CHECK( handle ); + DALI_TEST_CHECK(handle); - MyTestCustomActor customHandle = MyTestCustomActor::DownCast( handle ); - DALI_TEST_CHECK( customHandle ); + MyTestCustomActor customHandle = MyTestCustomActor::DownCast(handle); + DALI_TEST_CHECK(customHandle); - DALI_TEST_EQUALS( type.GetActionCount(), TEST_ACTION_COUNT + baseType.GetActionCount(), TEST_LOCATION ); + DALI_TEST_EQUALS(type.GetActionCount(), TEST_ACTION_COUNT + baseType.GetActionCount(), TEST_LOCATION); - DALI_TEST_EQUALS( type.GetSignalCount(), TEST_SIGNAL_COUNT + baseType.GetSignalCount(), TEST_LOCATION ); + DALI_TEST_EQUALS(type.GetSignalCount(), TEST_SIGNAL_COUNT + baseType.GetSignalCount(), TEST_LOCATION); { TestConnectionTracker tracker; - bool connected = handle.ConnectSignal( &tracker, "sig1", CustomTestFunctor() ); - DALI_TEST_EQUALS( connected, true, TEST_LOCATION ); - DALI_TEST_CHECK( lastSignalConnectionCustom == "sig1" ); - DALI_TEST_EQUALS( CustomTestFunctor::mTotalInstanceCount, 2/*temporary copy + FunctorDelegate copy*/, TEST_LOCATION ); - DALI_TEST_EQUALS( CustomTestFunctor::mCurrentInstanceCount, 1, TEST_LOCATION ); + bool connected = handle.ConnectSignal(&tracker, "sig1", CustomTestFunctor()); + DALI_TEST_EQUALS(connected, true, TEST_LOCATION); + DALI_TEST_CHECK(lastSignalConnectionCustom == "sig1"); + DALI_TEST_EQUALS(CustomTestFunctor::mTotalInstanceCount, 2 /*temporary copy + FunctorDelegate copy*/, TEST_LOCATION); + DALI_TEST_EQUALS(CustomTestFunctor::mCurrentInstanceCount, 1, TEST_LOCATION); - DALI_TEST_EQUALS( CustomTestFunctor::mCallbackCount, 0, TEST_LOCATION ); + DALI_TEST_EQUALS(CustomTestFunctor::mCallbackCount, 0, TEST_LOCATION); customHandle.GetCustomSignal().Emit(); - DALI_TEST_EQUALS( CustomTestFunctor::mCallbackCount, 1, TEST_LOCATION ); - DALI_TEST_EQUALS( CustomTestFunctor::mTotalInstanceCount, 2/*temporary copy + FunctorDelegate copy*/, TEST_LOCATION ); - DALI_TEST_EQUALS( CustomTestFunctor::mCurrentInstanceCount, 1, TEST_LOCATION ); + DALI_TEST_EQUALS(CustomTestFunctor::mCallbackCount, 1, TEST_LOCATION); + DALI_TEST_EQUALS(CustomTestFunctor::mTotalInstanceCount, 2 /*temporary copy + FunctorDelegate copy*/, TEST_LOCATION); + DALI_TEST_EQUALS(CustomTestFunctor::mCurrentInstanceCount, 1, TEST_LOCATION); } // tracker should automatically disconnect here - DALI_TEST_EQUALS( CustomTestFunctor::mTotalInstanceCount, 2/*temporary copy + FunctorDelegate copy*/, TEST_LOCATION ); - DALI_TEST_EQUALS( CustomTestFunctor::mCurrentInstanceCount, 0, TEST_LOCATION ); + DALI_TEST_EQUALS(CustomTestFunctor::mTotalInstanceCount, 2 /*temporary copy + FunctorDelegate copy*/, TEST_LOCATION); + DALI_TEST_EQUALS(CustomTestFunctor::mCurrentInstanceCount, 0, TEST_LOCATION); // Test that functor is disconnected - DALI_TEST_EQUALS( CustomTestFunctor::mCallbackCount, 1, TEST_LOCATION ); + DALI_TEST_EQUALS(CustomTestFunctor::mCallbackCount, 1, TEST_LOCATION); customHandle.GetCustomSignal().Emit(); - DALI_TEST_EQUALS( CustomTestFunctor::mCallbackCount, 1/*not incremented*/, TEST_LOCATION ); - DALI_TEST_EQUALS( CustomTestFunctor::mTotalInstanceCount, 2/*temporary copy + FunctorDelegate copy*/, TEST_LOCATION ); - DALI_TEST_EQUALS( CustomTestFunctor::mCurrentInstanceCount, 0, TEST_LOCATION ); + DALI_TEST_EQUALS(CustomTestFunctor::mCallbackCount, 1 /*not incremented*/, TEST_LOCATION); + DALI_TEST_EQUALS(CustomTestFunctor::mTotalInstanceCount, 2 /*temporary copy + FunctorDelegate copy*/, TEST_LOCATION); + DALI_TEST_EQUALS(CustomTestFunctor::mCurrentInstanceCount, 0, TEST_LOCATION); Property::Map attributes; handle.DoAction("act1", attributes); - DALI_TEST_CHECK( lastActionCustom == "act1" ); + DALI_TEST_CHECK(lastActionCustom == "act1"); END_TEST; } @@ -804,11 +782,11 @@ int UtcDaliTypeRegistryTypeRegistrationCallingCreateOnInitP(void) { TestApplication application; - DALI_TEST_CHECK( "MyTestCustomActor2" == customTypeInit.RegisteredName() ); + DALI_TEST_CHECK("MyTestCustomActor2" == customTypeInit.RegisteredName()); - DALI_TEST_CHECK( true == CreateCustomInitCalled ); - TypeInfo type = TypeRegistry::Get().GetTypeInfo( "MyTestCustomActor2" ); - DALI_TEST_CHECK( type ); + DALI_TEST_CHECK(true == CreateCustomInitCalled); + TypeInfo type = TypeRegistry::Get().GetTypeInfo("MyTestCustomActor2"); + DALI_TEST_CHECK(type); END_TEST; } @@ -818,17 +796,17 @@ int UtcDaliTypeRegistryTypeRegistrationForNamedTypeP(void) TestApplication application; // Create Named Actor Type - TypeInfo type = TypeRegistry::Get().GetTypeInfo( "MyNamedActor" ); - DALI_TEST_CHECK( type ); + TypeInfo type = TypeRegistry::Get().GetTypeInfo("MyNamedActor"); + DALI_TEST_CHECK(type); BaseHandle namedHandle = type.CreateInstance(); - DALI_TEST_CHECK( namedHandle ); - Actor namedActor( Actor::DownCast( namedHandle ) ); - DALI_TEST_CHECK( namedActor ); + DALI_TEST_CHECK(namedHandle); + Actor namedActor(Actor::DownCast(namedHandle)); + DALI_TEST_CHECK(namedActor); - DALI_TEST_CHECK( namedActor.GetProperty< std::string >( Actor::Property::NAME ) == "NamedActor" ); - DALI_TEST_CHECK( type.GetName() == "MyNamedActor" ); - DALI_TEST_CHECK( type.GetBaseName() == "Actor" ); + DALI_TEST_CHECK(namedActor.GetProperty(Actor::Property::NAME) == "NamedActor"); + DALI_TEST_CHECK(type.GetName() == "MyNamedActor"); + DALI_TEST_CHECK(type.GetBaseName() == "Actor"); END_TEST; } @@ -837,85 +815,83 @@ int UtcDaliTypeRegistryRegisteredNameP(void) { TestApplication application; - DALI_TEST_CHECK( scriptedName == scriptedType.RegisteredName() ); + DALI_TEST_CHECK(scriptedName == scriptedType.RegisteredName()); - TypeInfo baseType = TypeRegistry::Get().GetTypeInfo( scriptedName ); - DALI_TEST_CHECK( baseType ); + TypeInfo baseType = TypeRegistry::Get().GetTypeInfo(scriptedName); + DALI_TEST_CHECK(baseType); BaseHandle handle = baseType.CreateInstance(); - DALI_TEST_CHECK( true == CreateCustomNamedInitCalled ); - TypeInfo type = TypeRegistry::Get().GetTypeInfo( scriptedName ); - DALI_TEST_CHECK( type ); + DALI_TEST_CHECK(true == CreateCustomNamedInitCalled); + TypeInfo type = TypeRegistry::Get().GetTypeInfo(scriptedName); + DALI_TEST_CHECK(type); END_TEST; } - int UtcDaliTypeRegistryRegisteredNameN(void) { TestApplication application; - DALI_TEST_CHECK( scriptedName == scriptedType.RegisteredName() ); + DALI_TEST_CHECK(scriptedName == scriptedType.RegisteredName()); - TypeInfo baseType = TypeRegistry::Get().GetTypeInfo( scriptedName ); - DALI_TEST_CHECK( baseType ); + TypeInfo baseType = TypeRegistry::Get().GetTypeInfo(scriptedName); + DALI_TEST_CHECK(baseType); // should cause an assert because we're registering same type twice // once statically at the start of this file, then again now try { - TypeRegistration scriptedType( scriptedName, typeid(Dali::CustomActor), CreateCustomNamedInit ); - tet_result( TET_FAIL ); + TypeRegistration scriptedType(scriptedName, typeid(Dali::CustomActor), CreateCustomNamedInit); + tet_result(TET_FAIL); } - catch ( DaliException& e ) + catch(DaliException& e) { - DALI_TEST_ASSERT( e, "Duplicate type name in Type Registration", TEST_LOCATION ); + DALI_TEST_ASSERT(e, "Duplicate type name in Type Registration", TEST_LOCATION); } END_TEST; } - int UtcDaliTypeRegistrySignalConnectorTypeP(void) { ResetFunctorCounts(); TestApplication application; - TypeInfo type = TypeRegistry::Get().GetTypeInfo( "MyTestCustomActor" ); - DALI_TEST_CHECK( type ); + TypeInfo type = TypeRegistry::Get().GetTypeInfo("MyTestCustomActor"); + DALI_TEST_CHECK(type); BaseHandle handle = type.CreateInstance(); - DALI_TEST_CHECK( handle ); + DALI_TEST_CHECK(handle); - MyTestCustomActor customHandle = MyTestCustomActor::DownCast( handle ); - DALI_TEST_CHECK( customHandle ); + MyTestCustomActor customHandle = MyTestCustomActor::DownCast(handle); + DALI_TEST_CHECK(customHandle); { TestConnectionTracker tracker; - bool connected = handle.ConnectSignal( &tracker, "sig1", CustomTestFunctor() ); - DALI_TEST_EQUALS( connected, true, TEST_LOCATION ); - DALI_TEST_CHECK( lastSignalConnectionCustom == "sig1" ); - DALI_TEST_EQUALS( CustomTestFunctor::mTotalInstanceCount, 2/*temporary copy + FunctorDelegate copy*/, TEST_LOCATION ); - DALI_TEST_EQUALS( CustomTestFunctor::mCurrentInstanceCount, 1, TEST_LOCATION ); + bool connected = handle.ConnectSignal(&tracker, "sig1", CustomTestFunctor()); + DALI_TEST_EQUALS(connected, true, TEST_LOCATION); + DALI_TEST_CHECK(lastSignalConnectionCustom == "sig1"); + DALI_TEST_EQUALS(CustomTestFunctor::mTotalInstanceCount, 2 /*temporary copy + FunctorDelegate copy*/, TEST_LOCATION); + DALI_TEST_EQUALS(CustomTestFunctor::mCurrentInstanceCount, 1, TEST_LOCATION); - DALI_TEST_EQUALS( CustomTestFunctor::mCallbackCount, 0, TEST_LOCATION ); + DALI_TEST_EQUALS(CustomTestFunctor::mCallbackCount, 0, TEST_LOCATION); customHandle.GetCustomSignal().Emit(); - DALI_TEST_EQUALS( CustomTestFunctor::mCallbackCount, 1, TEST_LOCATION ); - DALI_TEST_EQUALS( CustomTestFunctor::mTotalInstanceCount, 2/*temporary copy + FunctorDelegate copy*/, TEST_LOCATION ); - DALI_TEST_EQUALS( CustomTestFunctor::mCurrentInstanceCount, 1, TEST_LOCATION ); + DALI_TEST_EQUALS(CustomTestFunctor::mCallbackCount, 1, TEST_LOCATION); + DALI_TEST_EQUALS(CustomTestFunctor::mTotalInstanceCount, 2 /*temporary copy + FunctorDelegate copy*/, TEST_LOCATION); + DALI_TEST_EQUALS(CustomTestFunctor::mCurrentInstanceCount, 1, TEST_LOCATION); } // tracker should automatically disconnect here - DALI_TEST_EQUALS( CustomTestFunctor::mTotalInstanceCount, 2/*temporary copy + FunctorDelegate copy*/, TEST_LOCATION ); - DALI_TEST_EQUALS( CustomTestFunctor::mCurrentInstanceCount, 0, TEST_LOCATION ); + DALI_TEST_EQUALS(CustomTestFunctor::mTotalInstanceCount, 2 /*temporary copy + FunctorDelegate copy*/, TEST_LOCATION); + DALI_TEST_EQUALS(CustomTestFunctor::mCurrentInstanceCount, 0, TEST_LOCATION); // Test that functor is disconnected - DALI_TEST_EQUALS( CustomTestFunctor::mCallbackCount, 1, TEST_LOCATION ); + DALI_TEST_EQUALS(CustomTestFunctor::mCallbackCount, 1, TEST_LOCATION); customHandle.GetCustomSignal().Emit(); - DALI_TEST_EQUALS( CustomTestFunctor::mCallbackCount, 1/*not incremented*/, TEST_LOCATION ); - DALI_TEST_EQUALS( CustomTestFunctor::mTotalInstanceCount, 2/*temporary copy + FunctorDelegate copy*/, TEST_LOCATION ); - DALI_TEST_EQUALS( CustomTestFunctor::mCurrentInstanceCount, 0, TEST_LOCATION ); + DALI_TEST_EQUALS(CustomTestFunctor::mCallbackCount, 1 /*not incremented*/, TEST_LOCATION); + DALI_TEST_EQUALS(CustomTestFunctor::mTotalInstanceCount, 2 /*temporary copy + FunctorDelegate copy*/, TEST_LOCATION); + DALI_TEST_EQUALS(CustomTestFunctor::mCurrentInstanceCount, 0, TEST_LOCATION); END_TEST; } @@ -928,42 +904,42 @@ int UtcDaliTypeRegistrySignalConnectorTypeN(void) TestApplication application; - TypeInfo type = TypeRegistry::Get().GetTypeInfo( "MyTestCustomActor" ); - DALI_TEST_CHECK( type ); + TypeInfo type = TypeRegistry::Get().GetTypeInfo("MyTestCustomActor"); + DALI_TEST_CHECK(type); - TypeInfo baseType = TypeRegistry::Get().GetTypeInfo( "CustomActor" ); - DALI_TEST_CHECK( baseType ); + TypeInfo baseType = TypeRegistry::Get().GetTypeInfo("CustomActor"); + DALI_TEST_CHECK(baseType); BaseHandle handle = type.CreateInstance(); - DALI_TEST_CHECK( handle ); + DALI_TEST_CHECK(handle); - MyTestCustomActor customHandle = MyTestCustomActor::DownCast( handle ); - DALI_TEST_CHECK( customHandle ); + MyTestCustomActor customHandle = MyTestCustomActor::DownCast(handle); + DALI_TEST_CHECK(customHandle); - DALI_TEST_EQUALS( type.GetActionCount(), TEST_ACTION_COUNT + baseType.GetActionCount(), TEST_LOCATION ); + DALI_TEST_EQUALS(type.GetActionCount(), TEST_ACTION_COUNT + baseType.GetActionCount(), TEST_LOCATION); - DALI_TEST_EQUALS( type.GetSignalCount(), TEST_SIGNAL_COUNT + baseType.GetSignalCount(), TEST_LOCATION ); + DALI_TEST_EQUALS(type.GetSignalCount(), TEST_SIGNAL_COUNT + baseType.GetSignalCount(), TEST_LOCATION); { TestConnectionTracker tracker; - bool connected = handle.ConnectSignal( &tracker, "sig2", CustomTestFunctor() ); - DALI_TEST_EQUALS( connected, false/*This is supposed to fail*/, TEST_LOCATION ); - DALI_TEST_CHECK( lastSignalConnectionCustom == "failed" ); - DALI_TEST_EQUALS( CustomTestFunctor::mTotalInstanceCount, 2/*temporary copy + FunctorDelegate copy*/, TEST_LOCATION ); - DALI_TEST_EQUALS( CustomTestFunctor::mCurrentInstanceCount, 0/*deleted along with FunctorDelegate*/, TEST_LOCATION ); + bool connected = handle.ConnectSignal(&tracker, "sig2", CustomTestFunctor()); + DALI_TEST_EQUALS(connected, false /*This is supposed to fail*/, TEST_LOCATION); + DALI_TEST_CHECK(lastSignalConnectionCustom == "failed"); + DALI_TEST_EQUALS(CustomTestFunctor::mTotalInstanceCount, 2 /*temporary copy + FunctorDelegate copy*/, TEST_LOCATION); + DALI_TEST_EQUALS(CustomTestFunctor::mCurrentInstanceCount, 0 /*deleted along with FunctorDelegate*/, TEST_LOCATION); // Should be a NOOP - DALI_TEST_EQUALS( CustomTestFunctor::mCallbackCount, 0, TEST_LOCATION ); + DALI_TEST_EQUALS(CustomTestFunctor::mCallbackCount, 0, TEST_LOCATION); customHandle.GetCustomSignal().Emit(); - DALI_TEST_EQUALS( CustomTestFunctor::mCallbackCount, 0/*never called*/, TEST_LOCATION ); + DALI_TEST_EQUALS(CustomTestFunctor::mCallbackCount, 0 /*never called*/, TEST_LOCATION); } // tracker should have nothing to disconnect here // Should be a NOOP - DALI_TEST_EQUALS( CustomTestFunctor::mCallbackCount, 0, TEST_LOCATION ); + DALI_TEST_EQUALS(CustomTestFunctor::mCallbackCount, 0, TEST_LOCATION); customHandle.GetCustomSignal().Emit(); - DALI_TEST_EQUALS( CustomTestFunctor::mCallbackCount, 0/*never called*/, TEST_LOCATION ); + DALI_TEST_EQUALS(CustomTestFunctor::mCallbackCount, 0 /*never called*/, TEST_LOCATION); END_TEST; } @@ -973,15 +949,15 @@ int UtcDaliTypeRegistryTypeActionP(void) TestApplication application; - TypeInfo type = TypeRegistry::Get().GetTypeInfo( "MyTestCustomActor" ); - DALI_TEST_CHECK( type ); + TypeInfo type = TypeRegistry::Get().GetTypeInfo("MyTestCustomActor"); + DALI_TEST_CHECK(type); BaseHandle handle = type.CreateInstance(); - DALI_TEST_CHECK( handle ); + DALI_TEST_CHECK(handle); Property::Map attributes; - DALI_TEST_CHECK( handle.DoAction("act1", attributes) ); - DALI_TEST_CHECK( lastActionCustom == "act1" ); + DALI_TEST_CHECK(handle.DoAction("act1", attributes)); + DALI_TEST_CHECK(lastActionCustom == "act1"); END_TEST; } @@ -992,14 +968,14 @@ int UtcDaliTypeRegistryTypeActionN(void) TestApplication application; - TypeInfo type = TypeRegistry::Get().GetTypeInfo( "MyTestCustomActor" ); - DALI_TEST_CHECK( type ); + TypeInfo type = TypeRegistry::Get().GetTypeInfo("MyTestCustomActor"); + DALI_TEST_CHECK(type); BaseHandle handle = type.CreateInstance(); - DALI_TEST_CHECK( handle ); + DALI_TEST_CHECK(handle); Property::Map attributes; - DALI_TEST_CHECK( !handle.DoAction( "unknownAction", attributes ) ); + DALI_TEST_CHECK(!handle.DoAction("unknownAction", attributes)); END_TEST; } @@ -1007,100 +983,100 @@ int UtcDaliTypeRegistryTypeActionN(void) int UtcDaliTypeRegistryPropertyRegistrationP(void) { TestApplication application; - TypeRegistry typeRegistry = TypeRegistry::Get(); + TypeRegistry typeRegistry = TypeRegistry::Get(); // Check property count before property registration - TypeInfo typeInfo = typeRegistry.GetTypeInfo( typeid(MyTestCustomActor) ); - DALI_TEST_CHECK( typeInfo ); + 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 ); - unsigned int initialPropertyCount( customActor.GetPropertyCount() ); + DALI_TEST_CHECK(handle); + Actor customActor = Actor::DownCast(handle); + DALI_TEST_CHECK(customActor); + unsigned int initialPropertyCount(customActor.GetPropertyCount()); - std::string propertyName( "prop1" ); - int propertyIndex( PROPERTY_REGISTRATION_START_INDEX ); - Property::Type propertyType( Property::BOOLEAN ); - PropertyRegistration property1( customType1, propertyName, propertyIndex, propertyType, &SetProperty, &GetProperty ); + std::string propertyName("prop1"); + int propertyIndex(PROPERTY_REGISTRATION_START_INDEX); + Property::Type propertyType(Property::BOOLEAN); + PropertyRegistration property1(customType1, propertyName, propertyIndex, propertyType, &SetProperty, &GetProperty); // Check property count after registration - unsigned int postRegistrationPropertyCount( customActor.GetPropertyCount() ); - DALI_TEST_EQUALS( initialPropertyCount + 1u, postRegistrationPropertyCount, TEST_LOCATION ); + unsigned int postRegistrationPropertyCount(customActor.GetPropertyCount()); + DALI_TEST_EQUALS(initialPropertyCount + 1u, postRegistrationPropertyCount, TEST_LOCATION); // Add custom property and check property count - customActor.RegisterProperty( "customProp1", true ); - unsigned int customPropertyCount( customActor.GetPropertyCount() ); - DALI_TEST_EQUALS( postRegistrationPropertyCount + 1u, customPropertyCount, TEST_LOCATION ); + customActor.RegisterProperty("customProp1", true); + unsigned int customPropertyCount(customActor.GetPropertyCount()); + DALI_TEST_EQUALS(postRegistrationPropertyCount + 1u, customPropertyCount, TEST_LOCATION); // Set the property, ensure SetProperty called - DALI_TEST_CHECK( !setPropertyCalled ); - customActor.SetProperty( propertyIndex, false ); - DALI_TEST_CHECK( setPropertyCalled ); + DALI_TEST_CHECK(!setPropertyCalled); + customActor.SetProperty(propertyIndex, false); + DALI_TEST_CHECK(setPropertyCalled); // Get the property, ensure GetProperty called - DALI_TEST_CHECK( !getPropertyCalled ); - (void)customActor.GetProperty< bool >( propertyIndex ); - DALI_TEST_CHECK( getPropertyCalled ); + DALI_TEST_CHECK(!getPropertyCalled); + (void)customActor.GetProperty(propertyIndex); + DALI_TEST_CHECK(getPropertyCalled); // Get the property using GetCurrentProperty and ensure GetProperty is called getPropertyCalled = false; - DALI_TEST_CHECK( !getPropertyCalled ); - customActor.GetCurrentProperty< bool >( propertyIndex ); - DALI_TEST_CHECK( getPropertyCalled ); + DALI_TEST_CHECK(!getPropertyCalled); + customActor.GetCurrentProperty(propertyIndex); + DALI_TEST_CHECK(getPropertyCalled); // Check the property name - DALI_TEST_EQUALS( customActor.GetPropertyName( propertyIndex ), propertyName, TEST_LOCATION ); - DALI_TEST_EQUALS( typeInfo.GetPropertyName( propertyIndex ), propertyName, TEST_LOCATION ); + DALI_TEST_EQUALS(customActor.GetPropertyName(propertyIndex), propertyName, TEST_LOCATION); + DALI_TEST_EQUALS(typeInfo.GetPropertyName(propertyIndex), propertyName, TEST_LOCATION); // Check the property index - DALI_TEST_EQUALS( customActor.GetPropertyIndex( propertyName ), propertyIndex, TEST_LOCATION ); + DALI_TEST_EQUALS(customActor.GetPropertyIndex(propertyName), propertyIndex, TEST_LOCATION); // Check the property type - DALI_TEST_EQUALS( customActor.GetPropertyType( propertyIndex ), propertyType, TEST_LOCATION ); + DALI_TEST_EQUALS(customActor.GetPropertyType(propertyIndex), propertyType, TEST_LOCATION); // Check property count of type-info is 1 Property::IndexContainer indices; - typeInfo.GetPropertyIndices( indices ); + typeInfo.GetPropertyIndices(indices); size_t typePropertyCount = typeInfo.GetPropertyCount(); - DALI_TEST_EQUALS( indices.Size(), Actor::New().GetPropertyCount() + 1u, TEST_LOCATION ); - DALI_TEST_EQUALS( indices.Size(), typePropertyCount, TEST_LOCATION ); + DALI_TEST_EQUALS(indices.Size(), Actor::New().GetPropertyCount() + 1u, TEST_LOCATION); + DALI_TEST_EQUALS(indices.Size(), typePropertyCount, TEST_LOCATION); // Ensure indices returned from actor and customActor differ by two Actor actor = Actor::New(); - actor.GetPropertyIndices( indices ); + actor.GetPropertyIndices(indices); unsigned int actorIndices = indices.Size(); - customActor.GetPropertyIndices( indices ); + customActor.GetPropertyIndices(indices); unsigned int customActorIndices = indices.Size(); - DALI_TEST_EQUALS( actorIndices + 2u, customActorIndices, TEST_LOCATION ); // Custom property + registered property + DALI_TEST_EQUALS(actorIndices + 2u, customActorIndices, TEST_LOCATION); // Custom property + registered property END_TEST; } int UtcDaliTypeRegistryPropertyRegistrationN(void) { TestApplication application; - TypeRegistry typeRegistry = TypeRegistry::Get(); + TypeRegistry typeRegistry = TypeRegistry::Get(); // Attempt to register a property type out-of-bounds index (less than) try { - PropertyRegistration property1( customType1, "propName", PROPERTY_REGISTRATION_START_INDEX - 1, Property::BOOLEAN, &SetProperty, &GetProperty ); - tet_result( TET_FAIL ); + PropertyRegistration property1(customType1, "propName", PROPERTY_REGISTRATION_START_INDEX - 1, Property::BOOLEAN, &SetProperty, &GetProperty); + tet_result(TET_FAIL); } - catch ( DaliException& e ) + catch(DaliException& e) { - DALI_TEST_ASSERT( e, "( index >= PROPERTY_REGISTRATION_START_INDEX ) && ( index <= PROPERTY_REGISTRATION_MAX_INDEX )", TEST_LOCATION ); + DALI_TEST_ASSERT(e, "(index >= PROPERTY_REGISTRATION_START_INDEX) && (index <= PROPERTY_REGISTRATION_MAX_INDEX)", TEST_LOCATION); } // Attempt to register a property type out-of-bounds index (greater than) try { - PropertyRegistration property1( customType1, "propName", PROPERTY_REGISTRATION_MAX_INDEX + 1, Property::BOOLEAN, &SetProperty, &GetProperty ); - tet_result( TET_FAIL ); + PropertyRegistration property1(customType1, "propName", PROPERTY_REGISTRATION_MAX_INDEX + 1, Property::BOOLEAN, &SetProperty, &GetProperty); + tet_result(TET_FAIL); } - catch ( DaliException& e ) + catch(DaliException& e) { - DALI_TEST_ASSERT( e, "( index >= PROPERTY_REGISTRATION_START_INDEX ) && ( index <= PROPERTY_REGISTRATION_MAX_INDEX )", TEST_LOCATION ); + DALI_TEST_ASSERT(e, "(index >= PROPERTY_REGISTRATION_START_INDEX) && (index <= PROPERTY_REGISTRATION_MAX_INDEX)", TEST_LOCATION); } END_TEST; @@ -1109,79 +1085,79 @@ int UtcDaliTypeRegistryPropertyRegistrationN(void) int UtcDaliTypeRegistryAnimatablePropertyRegistrationP(void) { TestApplication application; - TypeRegistry typeRegistry = TypeRegistry::Get(); + TypeRegistry typeRegistry = TypeRegistry::Get(); // Check property count before property registration - TypeInfo typeInfo = typeRegistry.GetTypeInfo( typeid(MyTestCustomActor) ); - DALI_TEST_CHECK( typeInfo ); + 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 ); + DALI_TEST_CHECK(handle); + Actor customActor = Actor::DownCast(handle); + DALI_TEST_CHECK(customActor); application.GetScene().Add(customActor); - unsigned int customPropertyCount( customActor.GetPropertyCount() ); + unsigned int customPropertyCount(customActor.GetPropertyCount()); // Register animatable property - std::string animatablePropertyName( "animatableProp1" ); - int animatablePropertyIndex( ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX ); - Property::Type animatablePropertyType( Property::FLOAT ); - AnimatablePropertyRegistration animatableProperty( customType1, animatablePropertyName, animatablePropertyIndex, animatablePropertyType ); + std::string animatablePropertyName("animatableProp1"); + int animatablePropertyIndex(ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX); + Property::Type animatablePropertyType(Property::FLOAT); + AnimatablePropertyRegistration animatableProperty(customType1, animatablePropertyName, animatablePropertyIndex, animatablePropertyType); // Check property count after registration - DALI_TEST_EQUALS( customPropertyCount + 1u, customActor.GetPropertyCount(), TEST_LOCATION ); + DALI_TEST_EQUALS(customPropertyCount + 1u, customActor.GetPropertyCount(), TEST_LOCATION); // Set the animatable property value - customActor.SetProperty( animatablePropertyIndex, 25.0f ); + customActor.SetProperty(animatablePropertyIndex, 25.0f); // Render and notify application.SendNotification(); application.Render(); // Check the animatable property value - DALI_TEST_EQUALS( customActor.GetProperty< float >( animatablePropertyIndex ), 25.f, TEST_LOCATION ); + DALI_TEST_EQUALS(customActor.GetProperty(animatablePropertyIndex), 25.f, TEST_LOCATION); // Check the animatable property name - DALI_TEST_EQUALS( customActor.GetPropertyName( animatablePropertyIndex ), animatablePropertyName, TEST_LOCATION ); + DALI_TEST_EQUALS(customActor.GetPropertyName(animatablePropertyIndex), animatablePropertyName, TEST_LOCATION); // Check the animatable property index - DALI_TEST_EQUALS( customActor.GetPropertyIndex( animatablePropertyName ), animatablePropertyIndex, TEST_LOCATION ); + DALI_TEST_EQUALS(customActor.GetPropertyIndex(animatablePropertyName), animatablePropertyIndex, TEST_LOCATION); // Check the animatable property type - DALI_TEST_EQUALS( customActor.GetPropertyType( animatablePropertyIndex ), animatablePropertyType, TEST_LOCATION ); + DALI_TEST_EQUALS(customActor.GetPropertyType(animatablePropertyIndex), animatablePropertyType, TEST_LOCATION); // Check property count of type-info is 1 Property::IndexContainer indices; - typeInfo.GetPropertyIndices( indices ); - DALI_TEST_EQUALS( indices.Size(), customActor.GetPropertyCount(), TEST_LOCATION ); + typeInfo.GetPropertyIndices(indices); + DALI_TEST_EQUALS(indices.Size(), customActor.GetPropertyCount(), TEST_LOCATION); // Ensure indices returned from actor and customActor differ by one Actor actor = Actor::New(); - actor.GetPropertyIndices( indices ); + actor.GetPropertyIndices(indices); unsigned int actorIndices = indices.Size(); - customActor.GetPropertyIndices( indices ); + customActor.GetPropertyIndices(indices); unsigned int customActorIndices = indices.Size(); - DALI_TEST_EQUALS( actorIndices + 1u, customActorIndices, TEST_LOCATION ); // Custom property + registered property + DALI_TEST_EQUALS(actorIndices + 1u, customActorIndices, TEST_LOCATION); // Custom property + registered property // check that the property is animatable Animation animation = Animation::New(0.2f); - animation.AnimateTo( Property( customActor, animatablePropertyIndex ), 15.f, AlphaFunction::LINEAR ); + animation.AnimateTo(Property(customActor, animatablePropertyIndex), 15.f, AlphaFunction::LINEAR); animation.Play(); // Target value should change straight away - DALI_TEST_EQUALS( customActor.GetProperty< float >( animatablePropertyIndex ), 15.0f, TEST_LOCATION ); + DALI_TEST_EQUALS(customActor.GetProperty(animatablePropertyIndex), 15.0f, TEST_LOCATION); // Render and notify, animation play for 0.05 seconds application.SendNotification(); application.Render(50); - DALI_TEST_EQUALS( 0.25f, animation.GetCurrentProgress(), TEST_LOCATION ); - DALI_TEST_EQUALS( customActor.GetCurrentProperty< float >( animatablePropertyIndex ), 22.5f, TEST_LOCATION ); + DALI_TEST_EQUALS(0.25f, animation.GetCurrentProgress(), TEST_LOCATION); + DALI_TEST_EQUALS(customActor.GetCurrentProperty(animatablePropertyIndex), 22.5f, TEST_LOCATION); // Render and notify, animation play for another 0.1 seconds application.SendNotification(); application.Render(100); - DALI_TEST_EQUALS( 0.75f, animation.GetCurrentProgress(), TEST_LOCATION ); - DALI_TEST_EQUALS( customActor.GetCurrentProperty< float >( animatablePropertyIndex ), 17.5f, TEST_LOCATION ); + DALI_TEST_EQUALS(0.75f, animation.GetCurrentProgress(), TEST_LOCATION); + DALI_TEST_EQUALS(customActor.GetCurrentProperty(animatablePropertyIndex), 17.5f, TEST_LOCATION); END_TEST; } @@ -1189,28 +1165,28 @@ int UtcDaliTypeRegistryAnimatablePropertyRegistrationP(void) int UtcDaliTypeRegistryAnimatablePropertyRegistrationN(void) { TestApplication application; - TypeRegistry typeRegistry = TypeRegistry::Get(); + TypeRegistry typeRegistry = TypeRegistry::Get(); // Attempt to register an animatable property type out-of-bounds index (less than) try { - AnimatablePropertyRegistration property1( customType1, "animPropName", ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX - 1, Property::BOOLEAN ); - tet_result( TET_FAIL ); + AnimatablePropertyRegistration property1(customType1, "animPropName", ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX - 1, Property::BOOLEAN); + tet_result(TET_FAIL); } - catch ( DaliException& e ) + catch(DaliException& e) { - DALI_TEST_ASSERT( e, "( index >= ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX ) && ( index <= ANIMATABLE_PROPERTY_REGISTRATION_MAX_INDEX )", TEST_LOCATION ); + DALI_TEST_ASSERT(e, "(index >= ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX) && (index <= ANIMATABLE_PROPERTY_REGISTRATION_MAX_INDEX)", TEST_LOCATION); } // Attempt to register an animatable property type out-of-bounds index (greater than) try { - AnimatablePropertyRegistration property1( customType1, "animPropName", ANIMATABLE_PROPERTY_REGISTRATION_MAX_INDEX + 1, Property::BOOLEAN ); - tet_result( TET_FAIL ); + AnimatablePropertyRegistration property1(customType1, "animPropName", ANIMATABLE_PROPERTY_REGISTRATION_MAX_INDEX + 1, Property::BOOLEAN); + tet_result(TET_FAIL); } - catch ( DaliException& e ) + catch(DaliException& e) { - DALI_TEST_ASSERT( e, "( index >= ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX ) && ( index <= ANIMATABLE_PROPERTY_REGISTRATION_MAX_INDEX )", TEST_LOCATION ); + DALI_TEST_ASSERT(e, "(index >= ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX) && (index <= ANIMATABLE_PROPERTY_REGISTRATION_MAX_INDEX)", TEST_LOCATION); } END_TEST; @@ -1219,75 +1195,75 @@ int UtcDaliTypeRegistryAnimatablePropertyRegistrationN(void) int UtcDaliTypeRegistryAnimatablePropertyRegistrationWithDefaultP(void) { TestApplication application; - TypeRegistry typeRegistry = TypeRegistry::Get(); + TypeRegistry typeRegistry = TypeRegistry::Get(); // Check property count before property registration - TypeInfo typeInfo = typeRegistry.GetTypeInfo( typeid(MyTestCustomActor) ); - DALI_TEST_CHECK( typeInfo ); + 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 ); + DALI_TEST_CHECK(handle); + Actor customActor = Actor::DownCast(handle); + DALI_TEST_CHECK(customActor); application.GetScene().Add(customActor); - unsigned int customPropertyCount( customActor.GetPropertyCount() ); + unsigned int customPropertyCount(customActor.GetPropertyCount()); // Register animatable property - std::string animatablePropertyName( "animatableProp1" ); - int animatablePropertyIndex( ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX ); - AnimatablePropertyRegistration animatableProperty1( customType1, animatablePropertyName, animatablePropertyIndex, 10.f ); + std::string animatablePropertyName("animatableProp1"); + int animatablePropertyIndex(ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX); + AnimatablePropertyRegistration animatableProperty1(customType1, animatablePropertyName, animatablePropertyIndex, 10.f); // Check property count after registration - DALI_TEST_EQUALS( customPropertyCount + 1u, customActor.GetPropertyCount(), TEST_LOCATION ); + DALI_TEST_EQUALS(customPropertyCount + 1u, customActor.GetPropertyCount(), TEST_LOCATION); // Render and notify application.SendNotification(); application.Render(); // Check the animatable property value - DALI_TEST_EQUALS( customActor.GetProperty< float >( animatablePropertyIndex ), 10.f, TEST_LOCATION ); + DALI_TEST_EQUALS(customActor.GetProperty(animatablePropertyIndex), 10.f, TEST_LOCATION); // Check the animatable property name - DALI_TEST_EQUALS( customActor.GetPropertyName( animatablePropertyIndex ), animatablePropertyName, TEST_LOCATION ); + DALI_TEST_EQUALS(customActor.GetPropertyName(animatablePropertyIndex), animatablePropertyName, TEST_LOCATION); // Check the animatable property index - DALI_TEST_EQUALS( customActor.GetPropertyIndex( animatablePropertyName ), animatablePropertyIndex, TEST_LOCATION ); + DALI_TEST_EQUALS(customActor.GetPropertyIndex(animatablePropertyName), animatablePropertyIndex, TEST_LOCATION); // Check the animatable property type - DALI_TEST_EQUALS( customActor.GetPropertyType( animatablePropertyIndex ), Property::FLOAT, TEST_LOCATION ); + DALI_TEST_EQUALS(customActor.GetPropertyType(animatablePropertyIndex), Property::FLOAT, TEST_LOCATION); // Check property count of type-info Property::IndexContainer indices; - typeInfo.GetPropertyIndices( indices ); - DALI_TEST_EQUALS( indices.Size(), customActor.GetPropertyCount(), TEST_LOCATION ); + typeInfo.GetPropertyIndices(indices); + DALI_TEST_EQUALS(indices.Size(), customActor.GetPropertyCount(), TEST_LOCATION); // Ensure indices returned from actor and customActor differ by one Actor actor = Actor::New(); - actor.GetPropertyIndices( indices ); + actor.GetPropertyIndices(indices); unsigned int actorIndices = indices.Size(); - customActor.GetPropertyIndices( indices ); + customActor.GetPropertyIndices(indices); unsigned int customActorIndices = indices.Size(); - DALI_TEST_EQUALS( actorIndices + 1u, customActorIndices, TEST_LOCATION ); // Custom property + registered property + DALI_TEST_EQUALS(actorIndices + 1u, customActorIndices, TEST_LOCATION); // Custom property + registered property // check that the property is animatable Animation animation = Animation::New(0.2f); - animation.AnimateTo( Property( customActor, animatablePropertyIndex ), 20.f, AlphaFunction::LINEAR ); + animation.AnimateTo(Property(customActor, animatablePropertyIndex), 20.f, AlphaFunction::LINEAR); animation.Play(); // Target value should change straight away - DALI_TEST_EQUALS( customActor.GetProperty< float >( animatablePropertyIndex ), 20.0f, TEST_LOCATION ); + DALI_TEST_EQUALS(customActor.GetProperty(animatablePropertyIndex), 20.0f, TEST_LOCATION); // Render and notify, animation play for 0.05 seconds application.SendNotification(); application.Render(50); - DALI_TEST_EQUALS( 0.25f, animation.GetCurrentProgress(), TEST_LOCATION ); - DALI_TEST_EQUALS( customActor.GetCurrentProperty< float >( animatablePropertyIndex ), 12.5f, TEST_LOCATION ); + DALI_TEST_EQUALS(0.25f, animation.GetCurrentProgress(), TEST_LOCATION); + DALI_TEST_EQUALS(customActor.GetCurrentProperty(animatablePropertyIndex), 12.5f, TEST_LOCATION); // Render and notify, animation play for another 0.1 seconds application.SendNotification(); application.Render(100); - DALI_TEST_EQUALS( 0.75f, animation.GetCurrentProgress(), TEST_LOCATION ); - DALI_TEST_EQUALS( customActor.GetCurrentProperty< float >( animatablePropertyIndex ), 17.5f, TEST_LOCATION ); + DALI_TEST_EQUALS(0.75f, animation.GetCurrentProgress(), TEST_LOCATION); + DALI_TEST_EQUALS(customActor.GetCurrentProperty(animatablePropertyIndex), 17.5f, TEST_LOCATION); END_TEST; } @@ -1295,28 +1271,28 @@ int UtcDaliTypeRegistryAnimatablePropertyRegistrationWithDefaultP(void) int UtcDaliTypeRegistryAnimatablePropertyRegistrationWithDefaultN(void) { TestApplication application; - TypeRegistry typeRegistry = TypeRegistry::Get(); + TypeRegistry typeRegistry = TypeRegistry::Get(); // Attempt to register an animatable property type out-of-bounds index (less than) try { - AnimatablePropertyRegistration property1( customType1, "animPropName", ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX - 1, false ); - tet_result( TET_FAIL ); + AnimatablePropertyRegistration property1(customType1, "animPropName", ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX - 1, false); + tet_result(TET_FAIL); } - catch ( DaliException& e ) + catch(DaliException& e) { - DALI_TEST_ASSERT( e, "( index >= ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX ) && ( index <= ANIMATABLE_PROPERTY_REGISTRATION_MAX_INDEX )", TEST_LOCATION ); + DALI_TEST_ASSERT(e, "(index >= ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX) && (index <= ANIMATABLE_PROPERTY_REGISTRATION_MAX_INDEX)", TEST_LOCATION); } // Attempt to register an animatable property type out-of-bounds index (greater than) try { - AnimatablePropertyRegistration property1( customType1, "animPropName", ANIMATABLE_PROPERTY_REGISTRATION_MAX_INDEX + 1, true ); - tet_result( TET_FAIL ); + AnimatablePropertyRegistration property1(customType1, "animPropName", ANIMATABLE_PROPERTY_REGISTRATION_MAX_INDEX + 1, true); + tet_result(TET_FAIL); } - catch ( DaliException& e ) + catch(DaliException& e) { - DALI_TEST_ASSERT( e, "( index >= ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX ) && ( index <= ANIMATABLE_PROPERTY_REGISTRATION_MAX_INDEX )", TEST_LOCATION ); + DALI_TEST_ASSERT(e, "(index >= ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX) && (index <= ANIMATABLE_PROPERTY_REGISTRATION_MAX_INDEX)", TEST_LOCATION); } END_TEST; @@ -1325,108 +1301,110 @@ int UtcDaliTypeRegistryAnimatablePropertyRegistrationWithDefaultN(void) int UtcDaliTypeRegistryAnimatablePropertyComponentRegistrationP(void) { TestApplication application; - TypeRegistry typeRegistry = TypeRegistry::Get(); + TypeRegistry typeRegistry = TypeRegistry::Get(); // Check property count before property registration - TypeInfo typeInfo = typeRegistry.GetTypeInfo( typeid(MyTestCustomActor) ); - DALI_TEST_CHECK( typeInfo ); + 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 ); + DALI_TEST_CHECK(handle); + Actor customActor = Actor::DownCast(handle); + DALI_TEST_CHECK(customActor); - unsigned int customPropertyCount( customActor.GetPropertyCount() ); + unsigned int customPropertyCount(customActor.GetPropertyCount()); // Register animatable property - std::string animatablePropertyName( "animatableProp1" ); - int animatablePropertyIndex( ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX ); - Property::Type animatablePropertyType( Property::VECTOR2 ); - AnimatablePropertyRegistration animatableProperty1( customType1, animatablePropertyName, animatablePropertyIndex, animatablePropertyType ); + std::string animatablePropertyName("animatableProp1"); + int animatablePropertyIndex(ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX); + Property::Type animatablePropertyType(Property::VECTOR2); + AnimatablePropertyRegistration animatableProperty1(customType1, animatablePropertyName, animatablePropertyIndex, animatablePropertyType); // Check property count after registration - DALI_TEST_EQUALS( customPropertyCount + 1u, customActor.GetPropertyCount(), TEST_LOCATION ); + DALI_TEST_EQUALS(customPropertyCount + 1u, customActor.GetPropertyCount(), TEST_LOCATION); // Set the animatable property value - customActor.SetProperty( animatablePropertyIndex, Vector2(25.0f, 50.0f) ); + customActor.SetProperty(animatablePropertyIndex, Vector2(25.0f, 50.0f)); // Render and notify application.SendNotification(); application.Render(); // Check the animatable property value - DALI_TEST_EQUALS( customActor.GetProperty< Vector2 >( animatablePropertyIndex ), Vector2(25.0f, 50.0f), TEST_LOCATION ); + DALI_TEST_EQUALS(customActor.GetProperty(animatablePropertyIndex), Vector2(25.0f, 50.0f), TEST_LOCATION); // Check the animatable property name - DALI_TEST_EQUALS( customActor.GetPropertyName( animatablePropertyIndex ), animatablePropertyName, TEST_LOCATION ); + DALI_TEST_EQUALS(customActor.GetPropertyName(animatablePropertyIndex), animatablePropertyName, TEST_LOCATION); // Check the animatable property index - DALI_TEST_EQUALS( customActor.GetPropertyIndex( animatablePropertyName ), animatablePropertyIndex, TEST_LOCATION ); + DALI_TEST_EQUALS(customActor.GetPropertyIndex(animatablePropertyName), animatablePropertyIndex, TEST_LOCATION); // Check the animatable property type - DALI_TEST_EQUALS( customActor.GetPropertyType( animatablePropertyIndex ), animatablePropertyType, TEST_LOCATION ); + DALI_TEST_EQUALS(customActor.GetPropertyType(animatablePropertyIndex), animatablePropertyType, TEST_LOCATION); // Check property count of type-info Property::IndexContainer indices; - typeInfo.GetPropertyIndices( indices ); - DALI_TEST_EQUALS( indices.Size(), customActor.GetPropertyCount(), TEST_LOCATION ); + typeInfo.GetPropertyIndices(indices); + DALI_TEST_EQUALS(indices.Size(), customActor.GetPropertyCount(), TEST_LOCATION); // Register animatable property components - std::string animatablePropertyComponentName1( "animatableProp1X" ); - int animatablePropertyComponentIndex1( ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX + 1 ); - AnimatablePropertyComponentRegistration animatablePropertyComponent1( customType1, animatablePropertyComponentName1, animatablePropertyComponentIndex1, animatablePropertyIndex, 0 ); + std::string animatablePropertyComponentName1("animatableProp1X"); + int animatablePropertyComponentIndex1(ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX + 1); + AnimatablePropertyComponentRegistration animatablePropertyComponent1(customType1, animatablePropertyComponentName1, animatablePropertyComponentIndex1, animatablePropertyIndex, 0); - std::string animatablePropertyComponentName2( "animatableProp1Y" ); - int animatablePropertyComponentIndex2( ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX + 2 ); - AnimatablePropertyComponentRegistration animatablePropertyComponent2( customType1, animatablePropertyComponentName2, animatablePropertyComponentIndex2, animatablePropertyIndex, 1 ); + std::string animatablePropertyComponentName2("animatableProp1Y"); + int animatablePropertyComponentIndex2(ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX + 2); + AnimatablePropertyComponentRegistration animatablePropertyComponent2(customType1, animatablePropertyComponentName2, animatablePropertyComponentIndex2, animatablePropertyIndex, 1); // Check property count after registration - DALI_TEST_EQUALS( customPropertyCount + 3u, customActor.GetPropertyCount(), TEST_LOCATION ); + DALI_TEST_EQUALS(customPropertyCount + 3u, customActor.GetPropertyCount(), TEST_LOCATION); // Check the animatable property component value - DALI_TEST_EQUALS( customActor.GetCurrentProperty< float >( animatablePropertyComponentIndex1 ), 25.0f, TEST_LOCATION ); - DALI_TEST_EQUALS( customActor.GetCurrentProperty< float >( animatablePropertyComponentIndex2 ), 50.0f, TEST_LOCATION ); + DALI_TEST_EQUALS(customActor.GetCurrentProperty(animatablePropertyComponentIndex1), 25.0f, TEST_LOCATION); + DALI_TEST_EQUALS(customActor.GetCurrentProperty(animatablePropertyComponentIndex2), 50.0f, TEST_LOCATION); // Set the animatable property component value - customActor.SetProperty( animatablePropertyComponentIndex1, 150.0f ); + customActor.SetProperty(animatablePropertyComponentIndex1, 150.0f); // Render and notify application.SendNotification(); application.Render(); // Check the animatable property value - DALI_TEST_EQUALS( customActor.GetCurrentProperty< Vector2 >( animatablePropertyIndex ), Vector2(150.0f, 50.0f), TEST_LOCATION ); - DALI_TEST_EQUALS( customActor.GetCurrentProperty< float >( animatablePropertyComponentIndex1 ), 150.0f, TEST_LOCATION ); - DALI_TEST_EQUALS( customActor.GetCurrentProperty< float >( animatablePropertyComponentIndex2 ), 50.0f, TEST_LOCATION ); + DALI_TEST_EQUALS(customActor.GetCurrentProperty(animatablePropertyIndex), Vector2(150.0f, 50.0f), TEST_LOCATION); + DALI_TEST_EQUALS(customActor.GetCurrentProperty(animatablePropertyComponentIndex1), 150.0f, TEST_LOCATION); + DALI_TEST_EQUALS(customActor.GetCurrentProperty(animatablePropertyComponentIndex2), 50.0f, TEST_LOCATION); // Set the animatable property component value - customActor.SetProperty( animatablePropertyComponentIndex2, 225.0f ); + customActor.SetProperty(animatablePropertyComponentIndex2, 225.0f); // Render and notify application.SendNotification(); application.Render(); // Check the animatable property value - DALI_TEST_EQUALS( customActor.GetCurrentProperty< Vector2 >( animatablePropertyIndex ), Vector2(150.0f, 225.0f), TEST_LOCATION ); - DALI_TEST_EQUALS( customActor.GetCurrentProperty< float >( animatablePropertyComponentIndex1 ), 150.0f, TEST_LOCATION ); - DALI_TEST_EQUALS( customActor.GetCurrentProperty< float >( animatablePropertyComponentIndex2 ), 225.0f, TEST_LOCATION ); + DALI_TEST_EQUALS(customActor.GetCurrentProperty(animatablePropertyIndex), Vector2(150.0f, 225.0f), TEST_LOCATION); + DALI_TEST_EQUALS(customActor.GetCurrentProperty(animatablePropertyComponentIndex1), 150.0f, TEST_LOCATION); + DALI_TEST_EQUALS(customActor.GetCurrentProperty(animatablePropertyComponentIndex2), 225.0f, TEST_LOCATION); // Ensure indices returned from actor and customActor differ by three Actor actor = Actor::New(); - actor.GetPropertyIndices( indices ); + actor.GetPropertyIndices(indices); unsigned int actorIndices = indices.Size(); - customActor.GetPropertyIndices( indices ); + customActor.GetPropertyIndices(indices); unsigned int customActorIndices = indices.Size(); - DALI_TEST_EQUALS( actorIndices + 3u, customActorIndices, TEST_LOCATION ); // Custom property + registered property + DALI_TEST_EQUALS(actorIndices + 3u, customActorIndices, TEST_LOCATION); // Custom property + registered property + + application.GetScene().Add(customActor); // Attempt to animate component property, it should not crash - Animation animation = Animation::New( 1.0f ); - animation.AnimateTo( Property( customActor, animatablePropertyComponentIndex1 ), 200.0f ); + Animation animation = Animation::New(1.0f); + animation.AnimateTo(Property(customActor, animatablePropertyComponentIndex1), 200.0f); animation.Play(); // Check the property value - DALI_TEST_EQUALS( customActor.GetProperty< Vector2 >( animatablePropertyIndex ), Vector2(200.0f, 225.0f), TEST_LOCATION ); - DALI_TEST_EQUALS( customActor.GetProperty< float >( animatablePropertyComponentIndex1 ), 200.0f, TEST_LOCATION ); - DALI_TEST_EQUALS( customActor.GetProperty< float >( animatablePropertyComponentIndex2 ), 225.0f, TEST_LOCATION ); + DALI_TEST_EQUALS(customActor.GetProperty(animatablePropertyIndex), Vector2(200.0f, 225.0f), TEST_LOCATION); + DALI_TEST_EQUALS(customActor.GetProperty(animatablePropertyComponentIndex1), 200.0f, TEST_LOCATION); + DALI_TEST_EQUALS(customActor.GetProperty(animatablePropertyComponentIndex2), 225.0f, TEST_LOCATION); END_TEST; } @@ -1434,52 +1412,53 @@ int UtcDaliTypeRegistryAnimatablePropertyComponentRegistrationP(void) int UtcDaliTypeRegistryAnimatablePropertyComponentRegistrationVector2AnimateByP(void) { TestApplication application; - TypeRegistry typeRegistry = TypeRegistry::Get(); + TypeRegistry typeRegistry = TypeRegistry::Get(); - TypeInfo typeInfo = typeRegistry.GetTypeInfo( typeid(MyTestCustomActor) ); - DALI_TEST_CHECK( typeInfo ); + 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 ); + DALI_TEST_CHECK(handle); + Actor customActor = Actor::DownCast(handle); + application.GetScene().Add(customActor); + DALI_TEST_CHECK(customActor); - const unsigned int index = ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX; + const unsigned int index = ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX; const unsigned int xComponentIndex = index + 1; const unsigned int yComponentIndex = index + 2; - const Vector2 initialValue( 20.0f, 40.0f ); + const Vector2 initialValue(20.0f, 40.0f); // Register animatable property & its components - AnimatablePropertyRegistration animatableProperty1( customType1, "animatableProp1", index, initialValue ); - AnimatablePropertyComponentRegistration animatablePropertyComponent1( customType1, "animatableProp1X", xComponentIndex, index, 0 ); - AnimatablePropertyComponentRegistration animatablePropertyComponent2( customType1, "animatableProp1Y", yComponentIndex, index, 1 ); + AnimatablePropertyRegistration animatableProperty1(customType1, "animatableProp1", index, initialValue); + AnimatablePropertyComponentRegistration animatablePropertyComponent1(customType1, "animatableProp1X", xComponentIndex, index, 0); + AnimatablePropertyComponentRegistration animatablePropertyComponent2(customType1, "animatableProp1Y", yComponentIndex, index, 1); // Check the animatable property value - DALI_TEST_EQUALS( customActor.GetProperty< Vector2 >( index ), initialValue, TEST_LOCATION ); - DALI_TEST_EQUALS( customActor.GetProperty< float >( xComponentIndex ), initialValue.x, TEST_LOCATION ); - DALI_TEST_EQUALS( customActor.GetProperty< float >( yComponentIndex ), initialValue.y, TEST_LOCATION ); + DALI_TEST_EQUALS(customActor.GetProperty(index), initialValue, TEST_LOCATION); + DALI_TEST_EQUALS(customActor.GetProperty(xComponentIndex), initialValue.x, TEST_LOCATION); + DALI_TEST_EQUALS(customActor.GetProperty(yComponentIndex), initialValue.y, TEST_LOCATION); // Render and notify application.SendNotification(); application.Render(); // Check the animatable property current value - DALI_TEST_EQUALS( customActor.GetCurrentProperty< Vector2 >( index ), initialValue, TEST_LOCATION ); - DALI_TEST_EQUALS( customActor.GetCurrentProperty< float >( xComponentIndex ), initialValue.x, TEST_LOCATION ); - DALI_TEST_EQUALS( customActor.GetCurrentProperty< float >( yComponentIndex ), initialValue.y, TEST_LOCATION ); + DALI_TEST_EQUALS(customActor.GetCurrentProperty(index), initialValue, TEST_LOCATION); + DALI_TEST_EQUALS(customActor.GetCurrentProperty(xComponentIndex), initialValue.x, TEST_LOCATION); + DALI_TEST_EQUALS(customActor.GetCurrentProperty(yComponentIndex), initialValue.y, TEST_LOCATION); // Do an AnimateBy - const Vector2 targetValue( 45.0f, 53.0f ); - const Vector2 relativeValue( targetValue - initialValue ); + const Vector2 targetValue(45.0f, 53.0f); + const Vector2 relativeValue(targetValue - initialValue); - Animation animation = Animation::New( 1.0f ); - animation.AnimateBy( Property( customActor, xComponentIndex ), relativeValue.x ); - animation.AnimateBy( Property( customActor, yComponentIndex ), relativeValue.y ); + Animation animation = Animation::New(1.0f); + animation.AnimateBy(Property(customActor, xComponentIndex), relativeValue.x); + animation.AnimateBy(Property(customActor, yComponentIndex), relativeValue.y); animation.Play(); // Target values should change straight away - DALI_TEST_EQUALS( customActor.GetProperty< Vector2 >( index ), targetValue, TEST_LOCATION ); - DALI_TEST_EQUALS( customActor.GetProperty< float >( xComponentIndex ), targetValue.x, TEST_LOCATION ); - DALI_TEST_EQUALS( customActor.GetProperty< float >( yComponentIndex ), targetValue.y, TEST_LOCATION ); + DALI_TEST_EQUALS(customActor.GetProperty(index), targetValue, TEST_LOCATION); + DALI_TEST_EQUALS(customActor.GetProperty(xComponentIndex), targetValue.x, TEST_LOCATION); + DALI_TEST_EQUALS(customActor.GetProperty(yComponentIndex), targetValue.y, TEST_LOCATION); END_TEST; } @@ -1487,58 +1466,59 @@ int UtcDaliTypeRegistryAnimatablePropertyComponentRegistrationVector2AnimateByP( int UtcDaliTypeRegistryAnimatablePropertyComponentRegistrationVector3AnimateByP(void) { TestApplication application; - TypeRegistry typeRegistry = TypeRegistry::Get(); + TypeRegistry typeRegistry = TypeRegistry::Get(); - TypeInfo typeInfo = typeRegistry.GetTypeInfo( typeid(MyTestCustomActor) ); - DALI_TEST_CHECK( typeInfo ); + 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 ); + DALI_TEST_CHECK(handle); + Actor customActor = Actor::DownCast(handle); + application.GetScene().Add(customActor); + DALI_TEST_CHECK(customActor); - const unsigned int index = ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX; + const unsigned int index = ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX; const unsigned int xComponentIndex = index + 1; const unsigned int yComponentIndex = index + 2; const unsigned int zComponentIndex = index + 3; - const Vector3 initialValue( 20.0f, 40.0f, 50.0f ); + const Vector3 initialValue(20.0f, 40.0f, 50.0f); // Register animatable property & its components - AnimatablePropertyRegistration animatableProperty1( customType1, "animatableProp1", index, initialValue ); - AnimatablePropertyComponentRegistration animatablePropertyComponent1( customType1, "animatableProp1X", xComponentIndex, index, 0 ); - AnimatablePropertyComponentRegistration animatablePropertyComponent2( customType1, "animatableProp1Y", yComponentIndex, index, 1 ); - AnimatablePropertyComponentRegistration animatablePropertyComponent3( customType1, "animatableProp1Z", zComponentIndex, index, 2 ); + AnimatablePropertyRegistration animatableProperty1(customType1, "animatableProp1", index, initialValue); + AnimatablePropertyComponentRegistration animatablePropertyComponent1(customType1, "animatableProp1X", xComponentIndex, index, 0); + AnimatablePropertyComponentRegistration animatablePropertyComponent2(customType1, "animatableProp1Y", yComponentIndex, index, 1); + AnimatablePropertyComponentRegistration animatablePropertyComponent3(customType1, "animatableProp1Z", zComponentIndex, index, 2); // Check the animatable property value - DALI_TEST_EQUALS( customActor.GetProperty< Vector3 >( index ), initialValue, TEST_LOCATION ); - DALI_TEST_EQUALS( customActor.GetProperty< float >( xComponentIndex ), initialValue.x, TEST_LOCATION ); - DALI_TEST_EQUALS( customActor.GetProperty< float >( yComponentIndex ), initialValue.y, TEST_LOCATION ); - DALI_TEST_EQUALS( customActor.GetProperty< float >( zComponentIndex ), initialValue.z, TEST_LOCATION ); + DALI_TEST_EQUALS(customActor.GetProperty(index), initialValue, TEST_LOCATION); + DALI_TEST_EQUALS(customActor.GetProperty(xComponentIndex), initialValue.x, TEST_LOCATION); + DALI_TEST_EQUALS(customActor.GetProperty(yComponentIndex), initialValue.y, TEST_LOCATION); + DALI_TEST_EQUALS(customActor.GetProperty(zComponentIndex), initialValue.z, TEST_LOCATION); // Render and notify application.SendNotification(); application.Render(); // Check the animatable property current value - DALI_TEST_EQUALS( customActor.GetCurrentProperty< Vector3 >( index ), initialValue, TEST_LOCATION ); - DALI_TEST_EQUALS( customActor.GetCurrentProperty< float >( xComponentIndex ), initialValue.x, TEST_LOCATION ); - DALI_TEST_EQUALS( customActor.GetCurrentProperty< float >( yComponentIndex ), initialValue.y, TEST_LOCATION ); - DALI_TEST_EQUALS( customActor.GetCurrentProperty< float >( zComponentIndex ), initialValue.z, TEST_LOCATION ); + DALI_TEST_EQUALS(customActor.GetCurrentProperty(index), initialValue, TEST_LOCATION); + DALI_TEST_EQUALS(customActor.GetCurrentProperty(xComponentIndex), initialValue.x, TEST_LOCATION); + DALI_TEST_EQUALS(customActor.GetCurrentProperty(yComponentIndex), initialValue.y, TEST_LOCATION); + DALI_TEST_EQUALS(customActor.GetCurrentProperty(zComponentIndex), initialValue.z, TEST_LOCATION); // Do an AnimateBy - const Vector3 targetValue( 45.0f, 53.0f, 25.0f ); - const Vector3 relativeValue( targetValue - initialValue ); + const Vector3 targetValue(45.0f, 53.0f, 25.0f); + const Vector3 relativeValue(targetValue - initialValue); - Animation animation = Animation::New( 1.0f ); - animation.AnimateBy( Property( customActor, xComponentIndex ), relativeValue.x ); - animation.AnimateBy( Property( customActor, yComponentIndex ), relativeValue.y ); - animation.AnimateBy( Property( customActor, zComponentIndex ), relativeValue.z ); + Animation animation = Animation::New(1.0f); + animation.AnimateBy(Property(customActor, xComponentIndex), relativeValue.x); + animation.AnimateBy(Property(customActor, yComponentIndex), relativeValue.y); + animation.AnimateBy(Property(customActor, zComponentIndex), relativeValue.z); animation.Play(); // Target values should change straight away - DALI_TEST_EQUALS( customActor.GetProperty< Vector3 >( index ), targetValue, TEST_LOCATION ); - DALI_TEST_EQUALS( customActor.GetProperty< float >( xComponentIndex ), targetValue.x, TEST_LOCATION ); - DALI_TEST_EQUALS( customActor.GetProperty< float >( yComponentIndex ), targetValue.y, TEST_LOCATION ); - DALI_TEST_EQUALS( customActor.GetProperty< float >( zComponentIndex ), targetValue.z, TEST_LOCATION ); + DALI_TEST_EQUALS(customActor.GetProperty(index), targetValue, TEST_LOCATION); + DALI_TEST_EQUALS(customActor.GetProperty(xComponentIndex), targetValue.x, TEST_LOCATION); + DALI_TEST_EQUALS(customActor.GetProperty(yComponentIndex), targetValue.y, TEST_LOCATION); + DALI_TEST_EQUALS(customActor.GetProperty(zComponentIndex), targetValue.z, TEST_LOCATION); END_TEST; } @@ -1546,64 +1526,65 @@ int UtcDaliTypeRegistryAnimatablePropertyComponentRegistrationVector3AnimateByP( int UtcDaliTypeRegistryAnimatablePropertyComponentRegistrationVector4AnimateByP(void) { TestApplication application; - TypeRegistry typeRegistry = TypeRegistry::Get(); + TypeRegistry typeRegistry = TypeRegistry::Get(); - TypeInfo typeInfo = typeRegistry.GetTypeInfo( typeid(MyTestCustomActor) ); - DALI_TEST_CHECK( typeInfo ); + 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 ); + DALI_TEST_CHECK(handle); + Actor customActor = Actor::DownCast(handle); + application.GetScene().Add(customActor); + DALI_TEST_CHECK(customActor); - const unsigned int index = ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX; + const unsigned int index = ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX; const unsigned int xComponentIndex = index + 1; const unsigned int yComponentIndex = index + 2; const unsigned int zComponentIndex = index + 3; const unsigned int wComponentIndex = index + 4; - const Vector4 initialValue( 20.0f, 40.0f, 50.0f, 60.0f ); + const Vector4 initialValue(20.0f, 40.0f, 50.0f, 60.0f); // Register animatable property & its components - AnimatablePropertyRegistration animatableProperty1( customType1, "animatableProp1", index, initialValue ); - AnimatablePropertyComponentRegistration animatablePropertyComponent1( customType1, "animatableProp1X", xComponentIndex, index, 0 ); - AnimatablePropertyComponentRegistration animatablePropertyComponent2( customType1, "animatableProp1Y", yComponentIndex, index, 1 ); - AnimatablePropertyComponentRegistration animatablePropertyComponent3( customType1, "animatableProp1Z", zComponentIndex, index, 2 ); - AnimatablePropertyComponentRegistration animatablePropertyComponent4( customType1, "animatableProp1W", wComponentIndex, index, 3 ); + AnimatablePropertyRegistration animatableProperty1(customType1, "animatableProp1", index, initialValue); + AnimatablePropertyComponentRegistration animatablePropertyComponent1(customType1, "animatableProp1X", xComponentIndex, index, 0); + AnimatablePropertyComponentRegistration animatablePropertyComponent2(customType1, "animatableProp1Y", yComponentIndex, index, 1); + AnimatablePropertyComponentRegistration animatablePropertyComponent3(customType1, "animatableProp1Z", zComponentIndex, index, 2); + AnimatablePropertyComponentRegistration animatablePropertyComponent4(customType1, "animatableProp1W", wComponentIndex, index, 3); // Check the animatable property value - DALI_TEST_EQUALS( customActor.GetProperty< Vector4 >( index ), initialValue, TEST_LOCATION ); - DALI_TEST_EQUALS( customActor.GetProperty< float >( xComponentIndex ), initialValue.x, TEST_LOCATION ); - DALI_TEST_EQUALS( customActor.GetProperty< float >( yComponentIndex ), initialValue.y, TEST_LOCATION ); - DALI_TEST_EQUALS( customActor.GetProperty< float >( zComponentIndex ), initialValue.z, TEST_LOCATION ); - DALI_TEST_EQUALS( customActor.GetProperty< float >( wComponentIndex ), initialValue.w, TEST_LOCATION ); + DALI_TEST_EQUALS(customActor.GetProperty(index), initialValue, TEST_LOCATION); + DALI_TEST_EQUALS(customActor.GetProperty(xComponentIndex), initialValue.x, TEST_LOCATION); + DALI_TEST_EQUALS(customActor.GetProperty(yComponentIndex), initialValue.y, TEST_LOCATION); + DALI_TEST_EQUALS(customActor.GetProperty(zComponentIndex), initialValue.z, TEST_LOCATION); + DALI_TEST_EQUALS(customActor.GetProperty(wComponentIndex), initialValue.w, TEST_LOCATION); // Render and notify application.SendNotification(); application.Render(); // Check the animatable property current value - DALI_TEST_EQUALS( customActor.GetCurrentProperty< Vector4 >( index ), initialValue, TEST_LOCATION ); - DALI_TEST_EQUALS( customActor.GetCurrentProperty< float >( xComponentIndex ), initialValue.x, TEST_LOCATION ); - DALI_TEST_EQUALS( customActor.GetCurrentProperty< float >( yComponentIndex ), initialValue.y, TEST_LOCATION ); - DALI_TEST_EQUALS( customActor.GetCurrentProperty< float >( zComponentIndex ), initialValue.z, TEST_LOCATION ); - DALI_TEST_EQUALS( customActor.GetCurrentProperty< float >( wComponentIndex ), initialValue.w, TEST_LOCATION ); + DALI_TEST_EQUALS(customActor.GetCurrentProperty(index), initialValue, TEST_LOCATION); + DALI_TEST_EQUALS(customActor.GetCurrentProperty(xComponentIndex), initialValue.x, TEST_LOCATION); + DALI_TEST_EQUALS(customActor.GetCurrentProperty(yComponentIndex), initialValue.y, TEST_LOCATION); + DALI_TEST_EQUALS(customActor.GetCurrentProperty(zComponentIndex), initialValue.z, TEST_LOCATION); + DALI_TEST_EQUALS(customActor.GetCurrentProperty(wComponentIndex), initialValue.w, TEST_LOCATION); // Do an AnimateBy - const Vector4 targetValue( 45.0f, 53.0f, 25.0f, 13.0f ); - const Vector4 relativeValue( targetValue - initialValue ); - - Animation animation = Animation::New( 1.0f ); - animation.AnimateBy( Property( customActor, xComponentIndex ), relativeValue.x ); - animation.AnimateBy( Property( customActor, yComponentIndex ), relativeValue.y ); - animation.AnimateBy( Property( customActor, zComponentIndex ), relativeValue.z ); - animation.AnimateBy( Property( customActor, wComponentIndex ), relativeValue.w ); + const Vector4 targetValue(45.0f, 53.0f, 25.0f, 13.0f); + const Vector4 relativeValue(targetValue - initialValue); + + Animation animation = Animation::New(1.0f); + animation.AnimateBy(Property(customActor, xComponentIndex), relativeValue.x); + animation.AnimateBy(Property(customActor, yComponentIndex), relativeValue.y); + animation.AnimateBy(Property(customActor, zComponentIndex), relativeValue.z); + animation.AnimateBy(Property(customActor, wComponentIndex), relativeValue.w); animation.Play(); // Target values should change straight away - DALI_TEST_EQUALS( customActor.GetProperty< Vector4 >( index ), targetValue, TEST_LOCATION ); - DALI_TEST_EQUALS( customActor.GetProperty< float >( xComponentIndex ), targetValue.x, TEST_LOCATION ); - DALI_TEST_EQUALS( customActor.GetProperty< float >( yComponentIndex ), targetValue.y, TEST_LOCATION ); - DALI_TEST_EQUALS( customActor.GetProperty< float >( zComponentIndex ), targetValue.z, TEST_LOCATION ); - DALI_TEST_EQUALS( customActor.GetProperty< float >( wComponentIndex ), targetValue.w, TEST_LOCATION ); + DALI_TEST_EQUALS(customActor.GetProperty(index), targetValue, TEST_LOCATION); + DALI_TEST_EQUALS(customActor.GetProperty(xComponentIndex), targetValue.x, TEST_LOCATION); + DALI_TEST_EQUALS(customActor.GetProperty(yComponentIndex), targetValue.y, TEST_LOCATION); + DALI_TEST_EQUALS(customActor.GetProperty(zComponentIndex), targetValue.z, TEST_LOCATION); + DALI_TEST_EQUALS(customActor.GetProperty(wComponentIndex), targetValue.w, TEST_LOCATION); END_TEST; } @@ -1611,61 +1592,61 @@ int UtcDaliTypeRegistryAnimatablePropertyComponentRegistrationVector4AnimateByP( int UtcDaliTypeRegistryAnimatablePropertyComponentRegistrationN(void) { TestApplication application; - TypeRegistry typeRegistry = TypeRegistry::Get(); + TypeRegistry typeRegistry = TypeRegistry::Get(); // Register animatable property with the type of Vector2 - int animatablePropertyIndex1( ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX ); - AnimatablePropertyRegistration animatableProperty1( customType1, "animatableProp1", animatablePropertyIndex1, Property::VECTOR2 ); + int animatablePropertyIndex1(ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX); + AnimatablePropertyRegistration animatableProperty1(customType1, "animatableProp1", animatablePropertyIndex1, Property::VECTOR2); // Attempt to register an animatable property component out-of-bounds index (less than) try { - AnimatablePropertyComponentRegistration propertyComponent1( customType1, "animatableProp1X", ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX - 1, animatablePropertyIndex1, 0 ); - tet_result( TET_FAIL ); + AnimatablePropertyComponentRegistration propertyComponent1(customType1, "animatableProp1X", ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX - 1, animatablePropertyIndex1, 0); + tet_result(TET_FAIL); } - catch ( DaliException& e ) + catch(DaliException& e) { - DALI_TEST_ASSERT( e, "( index >= ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX ) && ( index <= ANIMATABLE_PROPERTY_REGISTRATION_MAX_INDEX )", TEST_LOCATION ); + DALI_TEST_ASSERT(e, "(index >= ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX) && (index <= ANIMATABLE_PROPERTY_REGISTRATION_MAX_INDEX)", TEST_LOCATION); } // Attempt to register an animatable property component out-of-bounds index (greater than) try { - AnimatablePropertyComponentRegistration propertyComponent1( customType1, "animatableProp1X", ANIMATABLE_PROPERTY_REGISTRATION_MAX_INDEX + 1, animatablePropertyIndex1, 0 ); - tet_result( TET_FAIL ); + AnimatablePropertyComponentRegistration propertyComponent1(customType1, "animatableProp1X", ANIMATABLE_PROPERTY_REGISTRATION_MAX_INDEX + 1, animatablePropertyIndex1, 0); + tet_result(TET_FAIL); } - catch ( DaliException& e ) + catch(DaliException& e) { - DALI_TEST_ASSERT( e, "( index >= ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX ) && ( index <= ANIMATABLE_PROPERTY_REGISTRATION_MAX_INDEX )", TEST_LOCATION ); + DALI_TEST_ASSERT(e, "(index >= ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX) && (index <= ANIMATABLE_PROPERTY_REGISTRATION_MAX_INDEX)", TEST_LOCATION); } // Register an animatable property component - AnimatablePropertyComponentRegistration propertyComponent1( customType1, "animatableProp1X", ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX + 1, animatablePropertyIndex1, 0 ); + AnimatablePropertyComponentRegistration propertyComponent1(customType1, "animatableProp1X", ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX + 1, animatablePropertyIndex1, 0); // Attempt to register another animatable property component with the same component index try { - AnimatablePropertyComponentRegistration propertyComponent2( customType1, "animatableProp1Y", ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX + 2, animatablePropertyIndex1, 0 ); - tet_result( TET_FAIL ); + AnimatablePropertyComponentRegistration propertyComponent2(customType1, "animatableProp1Y", ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX + 2, animatablePropertyIndex1, 0); + tet_result(TET_FAIL); } - catch ( DaliException& e ) + catch(DaliException& e) { - DALI_TEST_ASSERT( e, "Property component already registered", TEST_LOCATION ); + DALI_TEST_ASSERT(e, "Property component already registered", TEST_LOCATION); } // Register animatable property with the type of boolean - int animatablePropertyIndex2( ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX + 2 ); - AnimatablePropertyRegistration animatableProperty2( customType1, "animatableProp2", animatablePropertyIndex2, Property::BOOLEAN ); + int animatablePropertyIndex2(ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX + 2); + AnimatablePropertyRegistration animatableProperty2(customType1, "animatableProp2", animatablePropertyIndex2, Property::BOOLEAN); // Attempt to register an animatable property component for the above property with boolean type try { - AnimatablePropertyComponentRegistration propertyComponent1( customType1, "animatableProp2X", animatablePropertyIndex2 + 1, animatablePropertyIndex2, 0 ); - tet_result( TET_FAIL ); + AnimatablePropertyComponentRegistration propertyComponent1(customType1, "animatableProp2X", animatablePropertyIndex2 + 1, animatablePropertyIndex2, 0); + tet_result(TET_FAIL); } - catch ( DaliException& e ) + catch(DaliException& e) { - DALI_TEST_ASSERT( e, "Base property does not support component", TEST_LOCATION ); + DALI_TEST_ASSERT(e, "Base property does not support component", TEST_LOCATION); } END_TEST; @@ -1674,208 +1655,207 @@ int UtcDaliTypeRegistryAnimatablePropertyComponentRegistrationN(void) int UtcDaliTypeRegistryChildPropertyRegistrationP(void) { TestApplication application; - TypeRegistry typeRegistry = TypeRegistry::Get(); + TypeRegistry typeRegistry = TypeRegistry::Get(); // Check property count before property registration - TypeInfo typeInfo = typeRegistry.GetTypeInfo( typeid(MyTestCustomActor) ); - DALI_TEST_CHECK( typeInfo ); + 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 ); - unsigned int initialPropertyCount( customActor.GetPropertyCount() ); + DALI_TEST_CHECK(handle); + Actor customActor = Actor::DownCast(handle); + DALI_TEST_CHECK(customActor); + unsigned int initialPropertyCount(customActor.GetPropertyCount()); // Register child properties to the parent - std::string propertyName( "childProp1" ); - int propertyIndex( CHILD_PROPERTY_REGISTRATION_START_INDEX ); - Property::Type propertyType( Property::BOOLEAN ); - ChildPropertyRegistration childProperty1( customType1, propertyName, propertyIndex, propertyType ); - - std::string propertyName2( "childProp2" ); - int propertyIndex2( CHILD_PROPERTY_REGISTRATION_START_INDEX + 1 ); - Property::Type propertyType2( Property::INTEGER ); - ChildPropertyRegistration childProperty2( customType1, propertyName2, propertyIndex2, propertyType2 ); - - std::string propertyName3( "childProp3" ); - int propertyIndex3( CHILD_PROPERTY_REGISTRATION_START_INDEX + 2 ); - Property::Type propertyType3( Property::FLOAT ); - ChildPropertyRegistration childProperty3( customType1, propertyName3, propertyIndex3, propertyType3 ); - - std::string propertyName4( "childProp4" ); - int propertyIndex4( CHILD_PROPERTY_REGISTRATION_START_INDEX + 3 ); - Property::Type propertyType4( Property::INTEGER ); - ChildPropertyRegistration childProperty4( customType1, propertyName4, propertyIndex4, propertyType4 ); + std::string propertyName("childProp1"); + int propertyIndex(CHILD_PROPERTY_REGISTRATION_START_INDEX); + Property::Type propertyType(Property::BOOLEAN); + ChildPropertyRegistration childProperty1(customType1, propertyName, propertyIndex, propertyType); + + std::string propertyName2("childProp2"); + int propertyIndex2(CHILD_PROPERTY_REGISTRATION_START_INDEX + 1); + Property::Type propertyType2(Property::INTEGER); + ChildPropertyRegistration childProperty2(customType1, propertyName2, propertyIndex2, propertyType2); + + std::string propertyName3("childProp3"); + int propertyIndex3(CHILD_PROPERTY_REGISTRATION_START_INDEX + 2); + Property::Type propertyType3(Property::FLOAT); + ChildPropertyRegistration childProperty3(customType1, propertyName3, propertyIndex3, propertyType3); + + std::string propertyName4("childProp4"); + int propertyIndex4(CHILD_PROPERTY_REGISTRATION_START_INDEX + 3); + Property::Type propertyType4(Property::INTEGER); + ChildPropertyRegistration childProperty4(customType1, propertyName4, propertyIndex4, propertyType4); // Check property count are not changed because the child properties will not be created for the parent - DALI_TEST_EQUALS( initialPropertyCount, customActor.GetPropertyCount(), TEST_LOCATION ); + DALI_TEST_EQUALS(initialPropertyCount, customActor.GetPropertyCount(), TEST_LOCATION); // check the child property type - Internal::TypeInfo& typeInfoImpl = GetImplementation( typeInfo ); - Property::Type type = typeInfoImpl.GetChildPropertyType( typeInfoImpl.GetChildPropertyIndex("childProp4") ); - DALI_TEST_EQUALS( type, Property::INTEGER, TEST_LOCATION ); + Internal::TypeInfo& typeInfoImpl = GetImplementation(typeInfo); + Property::Type type = typeInfoImpl.GetChildPropertyType(typeInfoImpl.GetChildPropertyIndex(Dali::Internal::ConstString("childProp4"))); + DALI_TEST_EQUALS(type, Property::INTEGER, TEST_LOCATION); - std::string unRegisteredChildName( typeInfoImpl.GetChildPropertyName( CHILD_PROPERTY_REGISTRATION_START_INDEX + 4 ) ); - DALI_TEST_EQUALS( unRegisteredChildName, "", TEST_LOCATION ); + std::string unRegisteredChildName(typeInfoImpl.GetChildPropertyName(CHILD_PROPERTY_REGISTRATION_START_INDEX + 4)); + DALI_TEST_EQUALS(unRegisteredChildName, "", TEST_LOCATION); // Create a child actor Actor childActor = Actor::New(); - DALI_TEST_CHECK( childActor ); - unsigned int initialChildActorPropertyCount( childActor.GetPropertyCount() ); + DALI_TEST_CHECK(childActor); + unsigned int initialChildActorPropertyCount(childActor.GetPropertyCount()); // The type of child properties should be Property::None as the child hasn't registered any child property yet. - DALI_TEST_EQUALS( childActor.GetPropertyType( propertyIndex ), Property::NONE, TEST_LOCATION ); - DALI_TEST_EQUALS( childActor.GetPropertyType( propertyIndex2 ), Property::NONE, TEST_LOCATION ); - DALI_TEST_EQUALS( childActor.GetPropertyType( propertyIndex3 ), Property::NONE, TEST_LOCATION ); - DALI_TEST_EQUALS( childActor.GetPropertyType( propertyIndex4 ), Property::NONE, TEST_LOCATION ); + DALI_TEST_EQUALS(childActor.GetPropertyType(propertyIndex), Property::NONE, TEST_LOCATION); + DALI_TEST_EQUALS(childActor.GetPropertyType(propertyIndex2), Property::NONE, TEST_LOCATION); + DALI_TEST_EQUALS(childActor.GetPropertyType(propertyIndex3), Property::NONE, TEST_LOCATION); + DALI_TEST_EQUALS(childActor.GetPropertyType(propertyIndex4), Property::NONE, TEST_LOCATION); // Set the value for the first child property when the child actor doesn't have a parent yet childActor.SetProperty(propertyIndex, true); // Check that the first child property is dynamically created - DALI_TEST_EQUALS( initialChildActorPropertyCount + 1u, childActor.GetPropertyCount(), TEST_LOCATION ); + DALI_TEST_EQUALS(initialChildActorPropertyCount + 1u, childActor.GetPropertyCount(), TEST_LOCATION); // Check the first child property value - DALI_TEST_EQUALS( childActor.GetProperty< bool >( propertyIndex ), true, TEST_LOCATION ); + DALI_TEST_EQUALS(childActor.GetProperty(propertyIndex), true, TEST_LOCATION); // Check the first child property type - DALI_TEST_EQUALS( childActor.GetPropertyType( propertyIndex ), propertyType, TEST_LOCATION ); + DALI_TEST_EQUALS(childActor.GetPropertyType(propertyIndex), propertyType, TEST_LOCATION); // Check that the first child property have no name, as it doesn't have a parent yet. - DALI_TEST_EQUALS( childActor.GetPropertyName( propertyIndex ), "", TEST_LOCATION ); + DALI_TEST_EQUALS(childActor.GetPropertyName(propertyIndex), "", TEST_LOCATION); // Check that the first property can't be accessed through its name, as it doesn't have a parent yet. - DALI_TEST_EQUALS( childActor.GetPropertyIndex( propertyName ), Property::INVALID_INDEX, TEST_LOCATION ); + DALI_TEST_EQUALS(childActor.GetPropertyIndex(propertyName), Property::INVALID_INDEX, TEST_LOCATION); // Create a custom property for the child with the same name as the second child property registered to the parent Property::Index customPropertyIndex = childActor.RegisterProperty(propertyName2, 100, Property::READ_WRITE); // Check that the custom property is created - DALI_TEST_EQUALS( initialChildActorPropertyCount + 2u, childActor.GetPropertyCount(), TEST_LOCATION ); + DALI_TEST_EQUALS(initialChildActorPropertyCount + 2u, childActor.GetPropertyCount(), TEST_LOCATION); // Check the property value - DALI_TEST_EQUALS( childActor.GetProperty< int >( customPropertyIndex ), 100, TEST_LOCATION ); + DALI_TEST_EQUALS(childActor.GetProperty(customPropertyIndex), 100, TEST_LOCATION); // Check the property index - DALI_TEST_EQUALS( childActor.GetPropertyIndex( propertyName2 ), customPropertyIndex, TEST_LOCATION ); + DALI_TEST_EQUALS(childActor.GetPropertyIndex(propertyName2), customPropertyIndex, TEST_LOCATION); // Check the property type - DALI_TEST_EQUALS( childActor.GetPropertyType( customPropertyIndex ), propertyType2, TEST_LOCATION ); + DALI_TEST_EQUALS(childActor.GetPropertyType(customPropertyIndex), propertyType2, TEST_LOCATION); // Check the property name - DALI_TEST_EQUALS( childActor.GetPropertyName( customPropertyIndex ), propertyName2, TEST_LOCATION ); + DALI_TEST_EQUALS(childActor.GetPropertyName(customPropertyIndex), propertyName2, TEST_LOCATION); // Now add the child actor to the parent - customActor.Add( childActor ); + customActor.Add(childActor); // Check that the first child property now has the correct name as previously registered to the parent - DALI_TEST_EQUALS( childActor.GetPropertyName( propertyIndex ), propertyName, TEST_LOCATION ); + DALI_TEST_EQUALS(childActor.GetPropertyName(propertyIndex), propertyName, TEST_LOCATION); // Check that the child property index for the first child property can now be retrieved through its child property name - DALI_TEST_EQUALS( childActor.GetPropertyIndex( propertyName ), propertyIndex, TEST_LOCATION ); + DALI_TEST_EQUALS(childActor.GetPropertyIndex(propertyName), propertyIndex, TEST_LOCATION); // Check that the second child property now has the correct index as previously registered to the parent - DALI_TEST_EQUALS( childActor.GetPropertyName( propertyIndex2 ), propertyName2, TEST_LOCATION ); + DALI_TEST_EQUALS(childActor.GetPropertyName(propertyIndex2), propertyName2, TEST_LOCATION); // Check that the second child property can be accessed through both its custom property index and its child property index - DALI_TEST_EQUALS( childActor.GetProperty< int >( customPropertyIndex ), 100, TEST_LOCATION ); - DALI_TEST_EQUALS( childActor.GetProperty< int >( propertyIndex2 ), 100, TEST_LOCATION ); - DALI_TEST_EQUALS( childActor.GetPropertyType( customPropertyIndex ), propertyType2, TEST_LOCATION ); - DALI_TEST_EQUALS( childActor.GetPropertyType( propertyIndex2 ), propertyType2, TEST_LOCATION ); + DALI_TEST_EQUALS(childActor.GetProperty(customPropertyIndex), 100, TEST_LOCATION); + DALI_TEST_EQUALS(childActor.GetProperty(propertyIndex2), 100, TEST_LOCATION); + DALI_TEST_EQUALS(childActor.GetPropertyType(customPropertyIndex), propertyType2, TEST_LOCATION); + DALI_TEST_EQUALS(childActor.GetPropertyType(propertyIndex2), propertyType2, TEST_LOCATION); // Check that the child property index for the second child property can now be retrieved through its child property name - DALI_TEST_EQUALS( childActor.GetPropertyIndex( propertyName2 ), propertyIndex2, TEST_LOCATION ); + DALI_TEST_EQUALS(childActor.GetPropertyIndex(propertyName2), propertyIndex2, TEST_LOCATION); // Set the value for the third child property when the child actor is already added to the parent childActor.SetProperty(propertyIndex3, 0.15f); // Check that the third child property is dynamically created - DALI_TEST_EQUALS( initialChildActorPropertyCount + 3u, childActor.GetPropertyCount(), TEST_LOCATION ); + DALI_TEST_EQUALS(initialChildActorPropertyCount + 3u, childActor.GetPropertyCount(), TEST_LOCATION); // Check the third child property value - DALI_TEST_EQUALS( childActor.GetProperty< float >( propertyIndex3 ), 0.15f, TEST_LOCATION ); + DALI_TEST_EQUALS(childActor.GetProperty(propertyIndex3), 0.15f, TEST_LOCATION); // Check the third child property type - DALI_TEST_EQUALS( childActor.GetPropertyType( propertyIndex3 ), propertyType3, TEST_LOCATION ); + DALI_TEST_EQUALS(childActor.GetPropertyType(propertyIndex3), propertyType3, TEST_LOCATION); // Check the third child property name - DALI_TEST_EQUALS( childActor.GetPropertyName( propertyIndex3 ), propertyName3, TEST_LOCATION ); + DALI_TEST_EQUALS(childActor.GetPropertyName(propertyIndex3), propertyName3, TEST_LOCATION); // Check the third child property index. - DALI_TEST_EQUALS( childActor.GetPropertyIndex( propertyName3 ), propertyIndex3, TEST_LOCATION ); + DALI_TEST_EQUALS(childActor.GetPropertyIndex(propertyName3), propertyIndex3, TEST_LOCATION); // Create a custom property for the child with the same name as the fourth child property registered to the parent Property::Index customPropertyIndex2 = childActor.RegisterProperty(propertyName4, 20, Property::READ_WRITE); // Check that the custom property is created - DALI_TEST_EQUALS( initialChildActorPropertyCount + 4u, childActor.GetPropertyCount(), TEST_LOCATION ); + DALI_TEST_EQUALS(initialChildActorPropertyCount + 4u, childActor.GetPropertyCount(), TEST_LOCATION); // Check the fourth child property value - DALI_TEST_EQUALS( childActor.GetProperty< int >( propertyIndex4 ), 20, TEST_LOCATION ); - DALI_TEST_EQUALS( childActor.GetProperty< int >( customPropertyIndex2 ), 20, TEST_LOCATION ); + DALI_TEST_EQUALS(childActor.GetProperty(propertyIndex4), 20, TEST_LOCATION); + DALI_TEST_EQUALS(childActor.GetProperty(customPropertyIndex2), 20, TEST_LOCATION); // Check the fourth child property type - DALI_TEST_EQUALS( childActor.GetPropertyType( propertyIndex4 ), propertyType4, TEST_LOCATION ); - DALI_TEST_EQUALS( childActor.GetPropertyType( customPropertyIndex2 ), propertyType4, TEST_LOCATION ); + DALI_TEST_EQUALS(childActor.GetPropertyType(propertyIndex4), propertyType4, TEST_LOCATION); + DALI_TEST_EQUALS(childActor.GetPropertyType(customPropertyIndex2), propertyType4, TEST_LOCATION); // Check the fourth child property name - DALI_TEST_EQUALS( childActor.GetPropertyName( propertyIndex4 ), propertyName4, TEST_LOCATION ); - DALI_TEST_EQUALS( childActor.GetPropertyName( customPropertyIndex2 ), propertyName4, TEST_LOCATION ); + DALI_TEST_EQUALS(childActor.GetPropertyName(propertyIndex4), propertyName4, TEST_LOCATION); + DALI_TEST_EQUALS(childActor.GetPropertyName(customPropertyIndex2), propertyName4, TEST_LOCATION); // Check the fourth child property index. - DALI_TEST_EQUALS( childActor.GetPropertyIndex( propertyName4 ), propertyIndex4, TEST_LOCATION ); + DALI_TEST_EQUALS(childActor.GetPropertyIndex(propertyName4), propertyIndex4, TEST_LOCATION); // Now create another parent actor with different child properties registered - TypeInfo typeInfo2 = typeRegistry.GetTypeInfo( "MyNamedActor" ); - DALI_TEST_CHECK( typeInfo2 ); + TypeInfo typeInfo2 = typeRegistry.GetTypeInfo("MyNamedActor"); + DALI_TEST_CHECK(typeInfo2); BaseHandle handle2 = typeInfo2.CreateInstance(); - DALI_TEST_CHECK( handle2 ); - Actor customActor2 = Actor::DownCast( handle2 ); - DALI_TEST_CHECK( customActor2 ); + DALI_TEST_CHECK(handle2); + Actor customActor2 = Actor::DownCast(handle2); + DALI_TEST_CHECK(customActor2); // Register child properties to the new parent - std::string newPropertyName( "newChildProp" ); - int newPropertyIndex( CHILD_PROPERTY_REGISTRATION_START_INDEX ); // The same index as the first child property "childProp1" in the old parent - Property::Type newPropertyType( Property::VECTOR2 ); - ChildPropertyRegistration newChildProperty( namedActorType, newPropertyName, newPropertyIndex, newPropertyType ); + std::string newPropertyName("newChildProp"); + int newPropertyIndex(CHILD_PROPERTY_REGISTRATION_START_INDEX); // The same index as the first child property "childProp1" in the old parent + Property::Type newPropertyType(Property::VECTOR2); + ChildPropertyRegistration newChildProperty(namedActorType, newPropertyName, newPropertyIndex, newPropertyType); - std::string newPropertyName2( "childProp3" ); // The same name as the third child property in the old parent - int newPropertyIndex2( CHILD_PROPERTY_REGISTRATION_START_INDEX + 1 ); // The same index as the second child property "childProp2" in the old parent - Property::Type newPropertyType2( Property::FLOAT ); // The same type as the third child property in the old parent - ChildPropertyRegistration newChildProperty2( namedActorType, newPropertyName2, newPropertyIndex2, newPropertyType2 ); + std::string newPropertyName2("childProp3"); // The same name as the third child property in the old parent + int newPropertyIndex2(CHILD_PROPERTY_REGISTRATION_START_INDEX + 1); // The same index as the second child property "childProp2" in the old parent + Property::Type newPropertyType2(Property::FLOAT); // The same type as the third child property in the old parent + ChildPropertyRegistration newChildProperty2(namedActorType, newPropertyName2, newPropertyIndex2, newPropertyType2); // Now move the child actor to the new parent - customActor2.Add( childActor ); + customActor2.Add(childActor); // "childProp1" is not a valid child property supported by the new parent, so nothing changed - DALI_TEST_EQUALS( childActor.GetPropertyType( propertyIndex ), propertyType, TEST_LOCATION ); - DALI_TEST_EQUALS( childActor.GetPropertyName( propertyIndex ), propertyName, TEST_LOCATION ); - DALI_TEST_EQUALS( childActor.GetPropertyIndex( propertyName ), propertyIndex, TEST_LOCATION ); + DALI_TEST_EQUALS(childActor.GetPropertyType(propertyIndex), propertyType, TEST_LOCATION); + DALI_TEST_EQUALS(childActor.GetPropertyName(propertyIndex), propertyName, TEST_LOCATION); + DALI_TEST_EQUALS(childActor.GetPropertyIndex(propertyName), propertyIndex, TEST_LOCATION); // "childProp3" is a valid child property supported by the new parent // So it should get its new child property index and should just work - DALI_TEST_EQUALS( childActor.GetPropertyType( newPropertyIndex2 ), newPropertyType2, TEST_LOCATION ); - DALI_TEST_EQUALS( childActor.GetPropertyName( newPropertyIndex2 ), newPropertyName2, TEST_LOCATION ); - DALI_TEST_EQUALS( childActor.GetPropertyIndex( newPropertyName2 ), newPropertyIndex2, TEST_LOCATION ); - DALI_TEST_EQUALS( childActor.GetProperty< float >( newPropertyIndex2 ), 0.15f, TEST_LOCATION ); + DALI_TEST_EQUALS(childActor.GetPropertyType(newPropertyIndex2), newPropertyType2, TEST_LOCATION); + DALI_TEST_EQUALS(childActor.GetPropertyName(newPropertyIndex2), newPropertyName2, TEST_LOCATION); + DALI_TEST_EQUALS(childActor.GetPropertyIndex(newPropertyName2), newPropertyIndex2, TEST_LOCATION); + DALI_TEST_EQUALS(childActor.GetProperty(newPropertyIndex2), 0.15f, TEST_LOCATION); // Now register a custom property called "newChildProp" - Property::Index customPropertyIndex3 = childActor.RegisterProperty("newChildProp", Vector2( 10.0f, 10.0f ), Property::READ_WRITE); + Property::Index customPropertyIndex3 = childActor.RegisterProperty("newChildProp", Vector2(10.0f, 10.0f), Property::READ_WRITE); // Check that the custom property is created - DALI_TEST_EQUALS( initialChildActorPropertyCount + 5u, childActor.GetPropertyCount(), TEST_LOCATION ); + DALI_TEST_EQUALS(initialChildActorPropertyCount + 5u, childActor.GetPropertyCount(), TEST_LOCATION); // This is a valid child property registered to the new parent // So should be able to access it through both its custom property index and its registered child property index - DALI_TEST_EQUALS( childActor.GetPropertyType( newPropertyIndex ), newPropertyType, TEST_LOCATION ); - DALI_TEST_EQUALS( childActor.GetPropertyType( customPropertyIndex3 ), newPropertyType, TEST_LOCATION ); - DALI_TEST_EQUALS( childActor.GetPropertyName( newPropertyIndex ), newPropertyName, TEST_LOCATION ); // This should return the new name, although the child property index remains the same - DALI_TEST_EQUALS( childActor.GetPropertyName( customPropertyIndex3 ), newPropertyName, TEST_LOCATION ); - DALI_TEST_EQUALS( childActor.GetProperty< Vector2 >( newPropertyIndex ), Vector2( 10.0f, 10.0f ), TEST_LOCATION ); - DALI_TEST_EQUALS( childActor.GetProperty< Vector2 >( customPropertyIndex3 ), Vector2( 10.0f, 10.0f ), TEST_LOCATION ); + DALI_TEST_EQUALS(childActor.GetPropertyType(newPropertyIndex), newPropertyType, TEST_LOCATION); + DALI_TEST_EQUALS(childActor.GetPropertyType(customPropertyIndex3), newPropertyType, TEST_LOCATION); + DALI_TEST_EQUALS(childActor.GetPropertyName(newPropertyIndex), newPropertyName, TEST_LOCATION); // This should return the new name, although the child property index remains the same + DALI_TEST_EQUALS(childActor.GetPropertyName(customPropertyIndex3), newPropertyName, TEST_LOCATION); + DALI_TEST_EQUALS(childActor.GetProperty(newPropertyIndex), Vector2(10.0f, 10.0f), TEST_LOCATION); + DALI_TEST_EQUALS(childActor.GetProperty(customPropertyIndex3), Vector2(10.0f, 10.0f), TEST_LOCATION); // Should return the child property index by given its name - DALI_TEST_EQUALS( childActor.GetPropertyIndex( newPropertyName ), newPropertyIndex, TEST_LOCATION ); - + DALI_TEST_EQUALS(childActor.GetPropertyIndex(newPropertyName), newPropertyIndex, TEST_LOCATION); END_TEST; } @@ -1883,34 +1863,33 @@ int UtcDaliTypeRegistryChildPropertyRegistrationP(void) int UtcDaliTypeRegistryChildPropertyRegistrationN(void) { TestApplication application; - TypeRegistry typeRegistry = TypeRegistry::Get(); + TypeRegistry typeRegistry = TypeRegistry::Get(); // Attempt to register a child property type out-of-bounds index (less than) try { - ChildPropertyRegistration property1( customType1, "propName", CHILD_PROPERTY_REGISTRATION_START_INDEX - 1, Property::BOOLEAN ); - tet_result( TET_FAIL ); + ChildPropertyRegistration property1(customType1, "propName", CHILD_PROPERTY_REGISTRATION_START_INDEX - 1, Property::BOOLEAN); + tet_result(TET_FAIL); } - catch ( DaliException& e ) + catch(DaliException& e) { - DALI_TEST_ASSERT( e, "( index >= CHILD_PROPERTY_REGISTRATION_START_INDEX ) && ( index <= CHILD_PROPERTY_REGISTRATION_MAX_INDEX )", TEST_LOCATION ); + DALI_TEST_ASSERT(e, "(index >= CHILD_PROPERTY_REGISTRATION_START_INDEX) && (index <= CHILD_PROPERTY_REGISTRATION_MAX_INDEX)", TEST_LOCATION); } // Attempt to register a child property type out-of-bounds index (greater than) try { - ChildPropertyRegistration property1( customType1, "propName", CHILD_PROPERTY_REGISTRATION_MAX_INDEX + 1, Property::BOOLEAN ); - tet_result( TET_FAIL ); + ChildPropertyRegistration property1(customType1, "propName", CHILD_PROPERTY_REGISTRATION_MAX_INDEX + 1, Property::BOOLEAN); + tet_result(TET_FAIL); } - catch ( DaliException& e ) + catch(DaliException& e) { - DALI_TEST_ASSERT( e, "( index >= CHILD_PROPERTY_REGISTRATION_START_INDEX ) && ( index <= CHILD_PROPERTY_REGISTRATION_MAX_INDEX )", TEST_LOCATION ); + DALI_TEST_ASSERT(e, "(index >= CHILD_PROPERTY_REGISTRATION_START_INDEX) && (index <= CHILD_PROPERTY_REGISTRATION_MAX_INDEX)", TEST_LOCATION); } END_TEST; } - /******************************************************************************* * * Action through the base handle @@ -1922,20 +1901,20 @@ int UtcDaliTypeRegistryActionViaBaseHandle(void) TypeInfo type; - type = TypeRegistry::Get().GetTypeInfo( "Actor" ); - DALI_TEST_CHECK( type ); + type = TypeRegistry::Get().GetTypeInfo("Actor"); + DALI_TEST_CHECK(type); BaseHandle hdl = type.CreateInstance(); - DALI_TEST_CHECK( hdl ); + DALI_TEST_CHECK(hdl); Actor a = Actor::DownCast(hdl); - DALI_TEST_CHECK( a ); + DALI_TEST_CHECK(a); - a.SetProperty( Actor::Property::VISIBLE,false); + a.SetProperty(Actor::Property::VISIBLE, false); application.SendNotification(); application.Render(0); - DALI_TEST_CHECK(!a.GetCurrentProperty< bool >( Actor::Property::VISIBLE )); + DALI_TEST_CHECK(!a.GetCurrentProperty(Actor::Property::VISIBLE)); Property::Map attributes; @@ -1943,37 +1922,37 @@ int UtcDaliTypeRegistryActionViaBaseHandle(void) application.SendNotification(); application.Render(0); - DALI_TEST_CHECK(a.GetCurrentProperty< bool >( Actor::Property::VISIBLE )); + DALI_TEST_CHECK(a.GetCurrentProperty(Actor::Property::VISIBLE)); - DALI_TEST_CHECK(!hdl.DoAction("unknownAction", attributes)); + DALI_TEST_CHECK(!hdl.DoAction("unknownAction", attributes)); END_TEST; } int UtcDaliPropertyRegistrationFunctions(void) { TestApplication application; - int propertyIndex = PROPERTY_REGISTRATION_START_INDEX + 10; + int propertyIndex = PROPERTY_REGISTRATION_START_INDEX + 10; // Attempt to register a property without a setter try { - PropertyRegistration property1( customType1, "propName", propertyIndex++, Property::BOOLEAN, NULL, &GetProperty ); - tet_result( TET_PASS ); + PropertyRegistration property1(customType1, "propName", propertyIndex++, Property::BOOLEAN, NULL, &GetProperty); + tet_result(TET_PASS); } - catch ( DaliException& e ) + catch(DaliException& e) { - tet_result( TET_FAIL ); + tet_result(TET_FAIL); } // Attempt to register a property without a getter try { - PropertyRegistration property1( customType1, "propName", propertyIndex++, Property::BOOLEAN, NULL, NULL ); - tet_result( TET_FAIL ); + PropertyRegistration property1(customType1, "propName", propertyIndex++, Property::BOOLEAN, NULL, NULL); + tet_result(TET_FAIL); } - catch ( DaliException& e ) + catch(DaliException& e) { - DALI_TEST_ASSERT( e, "! \"GetProperty", TEST_LOCATION ); + DALI_TEST_ASSERT(e, "!\"GetProperty", TEST_LOCATION); } END_TEST; } @@ -1981,34 +1960,34 @@ int UtcDaliPropertyRegistrationFunctions(void) int UtcDaliPropertyRegistrationAddSameIndex(void) { TestApplication application; - int propertyIndex = PROPERTY_REGISTRATION_START_INDEX + 100; + int propertyIndex = PROPERTY_REGISTRATION_START_INDEX + 100; // Add one property with a valid property index - PropertyRegistration property1( customType1, "propName", propertyIndex, Property::BOOLEAN, &SetProperty, &GetProperty ); + PropertyRegistration property1(customType1, "propName", propertyIndex, Property::BOOLEAN, &SetProperty, &GetProperty); // Attempt to add another property with the same index try { - PropertyRegistration property2( customType1, "propName2", propertyIndex, Property::BOOLEAN, &SetProperty, &GetProperty ); + PropertyRegistration property2(customType1, "propName2", propertyIndex, Property::BOOLEAN, &SetProperty, &GetProperty); } - catch ( DaliException& e ) + catch(DaliException& e) { - DALI_TEST_ASSERT( e, "! \"Property index already added", TEST_LOCATION ); + DALI_TEST_ASSERT(e, "!\"Property index already added", TEST_LOCATION); } int animatablePropertyIndex = ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX + 100; // Add one property with a valid property index - AnimatablePropertyRegistration property3( customType1, "animPropName", animatablePropertyIndex, Property::BOOLEAN ); + AnimatablePropertyRegistration property3(customType1, "animPropName", animatablePropertyIndex, Property::BOOLEAN); // Attempt to add another property with the same index try { - AnimatablePropertyRegistration property4( customType1, "animPropName2", animatablePropertyIndex, Property::BOOLEAN ); + AnimatablePropertyRegistration property4(customType1, "animPropName2", animatablePropertyIndex, Property::BOOLEAN); } - catch ( DaliException& e ) + catch(DaliException& e) { - DALI_TEST_ASSERT( e, "! \"Property index already added", TEST_LOCATION ); + DALI_TEST_ASSERT(e, "!\"Property index already added", TEST_LOCATION); } END_TEST; } @@ -2016,40 +1995,39 @@ int UtcDaliPropertyRegistrationAddSameIndex(void) int UtcDaliPropertyRegistrationPropertyWritableP(void) { TestApplication application; - int propertyIndex1 = PROPERTY_REGISTRATION_START_INDEX + 200; - int propertyIndex2 = PROPERTY_REGISTRATION_START_INDEX + 201; + int propertyIndex1 = PROPERTY_REGISTRATION_START_INDEX + 200; + int propertyIndex2 = PROPERTY_REGISTRATION_START_INDEX + 201; // Add two properties, one with SetProperty, one without - PropertyRegistration property1( customType1, "propNameReadwrite", propertyIndex1, Property::BOOLEAN, &SetProperty, &GetProperty ); - PropertyRegistration property2( customType1, "propNameReadonly", propertyIndex2, Property::BOOLEAN, NULL, &GetProperty ); + PropertyRegistration property1(customType1, "propNameReadwrite", propertyIndex1, Property::BOOLEAN, &SetProperty, &GetProperty); + PropertyRegistration property2(customType1, "propNameReadonly", propertyIndex2, Property::BOOLEAN, NULL, &GetProperty); // Create custom-actor - TypeInfo typeInfo = TypeRegistry::Get().GetTypeInfo( typeid(MyTestCustomActor) ); - DALI_TEST_CHECK( typeInfo ); + TypeInfo typeInfo = TypeRegistry::Get().GetTypeInfo(typeid(MyTestCustomActor)); + DALI_TEST_CHECK(typeInfo); BaseHandle handle = typeInfo.CreateInstance(); - DALI_TEST_CHECK( handle ); - Actor customActor = Actor::DownCast( handle ); - DALI_TEST_CHECK( customActor ); + DALI_TEST_CHECK(handle); + Actor customActor = Actor::DownCast(handle); + DALI_TEST_CHECK(customActor); // Check whether properties are writable - DALI_TEST_CHECK( customActor.IsPropertyWritable( propertyIndex1 ) ); - DALI_TEST_CHECK( ! customActor.IsPropertyWritable( propertyIndex2 ) ); - + DALI_TEST_CHECK(customActor.IsPropertyWritable(propertyIndex1)); + DALI_TEST_CHECK(!customActor.IsPropertyWritable(propertyIndex2)); // Check the property is writable in the type registry - Internal::TypeInfo& typeInfoImpl = GetImplementation( typeInfo ); + Internal::TypeInfo& typeInfoImpl = GetImplementation(typeInfo); - DALI_TEST_EQUALS( typeInfoImpl.IsPropertyWritable( propertyIndex1 ), true, TEST_LOCATION ); + DALI_TEST_EQUALS(typeInfoImpl.IsPropertyWritable(propertyIndex1), true, TEST_LOCATION); END_TEST; } int UtcDaliPropertyRegistrationPropertyWritableN(void) { - TypeInfo typeInfo = TypeRegistry::Get().GetTypeInfo( typeid(MyTestCustomActor) ); - Internal::TypeInfo& typeInfoImpl = GetImplementation( typeInfo ); + TypeInfo typeInfo = TypeRegistry::Get().GetTypeInfo(typeid(MyTestCustomActor)); + Internal::TypeInfo& typeInfoImpl = GetImplementation(typeInfo); - DALI_TEST_EQUALS( typeInfoImpl.IsPropertyWritable( Actor::Property::COLOR), true, TEST_LOCATION ); + DALI_TEST_EQUALS(typeInfoImpl.IsPropertyWritable(Actor::Property::COLOR), true, TEST_LOCATION); END_TEST; } @@ -2057,98 +2035,97 @@ int UtcDaliPropertyRegistrationPropertyWritableN(void) int UtcDaliPropertyRegistrationPropertyAnimatable(void) { TestApplication application; - int propertyIndex = PROPERTY_REGISTRATION_START_INDEX + 400; - int animatablePropertyIndex = ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX + 400; + int propertyIndex = PROPERTY_REGISTRATION_START_INDEX + 400; + int animatablePropertyIndex = ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX + 400; // These properties are not animatable - PropertyRegistration property1( customType1, "propName", propertyIndex, Property::BOOLEAN, &SetProperty, &GetProperty ); + PropertyRegistration property1(customType1, "propName", propertyIndex, Property::BOOLEAN, &SetProperty, &GetProperty); // These properties are animatable - AnimatablePropertyRegistration property2( customType1, "animPropName", animatablePropertyIndex, Property::BOOLEAN ); + AnimatablePropertyRegistration property2(customType1, "animPropName", animatablePropertyIndex, Property::BOOLEAN); // Create custom-actor - TypeInfo typeInfo = TypeRegistry::Get().GetTypeInfo( typeid(MyTestCustomActor) ); - DALI_TEST_CHECK( typeInfo ); + TypeInfo typeInfo = TypeRegistry::Get().GetTypeInfo(typeid(MyTestCustomActor)); + DALI_TEST_CHECK(typeInfo); BaseHandle handle = typeInfo.CreateInstance(); - DALI_TEST_CHECK( handle ); - Actor customActor = Actor::DownCast( handle ); - DALI_TEST_CHECK( customActor ); + DALI_TEST_CHECK(handle); + Actor customActor = Actor::DownCast(handle); + DALI_TEST_CHECK(customActor); // Check if animatable - DALI_TEST_CHECK( ! customActor.IsPropertyAnimatable( propertyIndex ) ); - DALI_TEST_CHECK( customActor.IsPropertyAnimatable( animatablePropertyIndex ) ); + DALI_TEST_CHECK(!customActor.IsPropertyAnimatable(propertyIndex)); + DALI_TEST_CHECK(customActor.IsPropertyAnimatable(animatablePropertyIndex)); // Create another instance of custom-actor BaseHandle handle2 = typeInfo.CreateInstance(); - DALI_TEST_CHECK( handle2 ); - Actor customActor2 = Actor::DownCast( handle2 ); - DALI_TEST_CHECK( customActor2 ); + DALI_TEST_CHECK(handle2); + Actor customActor2 = Actor::DownCast(handle2); + DALI_TEST_CHECK(customActor2); // Check if animatable - DALI_TEST_CHECK( ! customActor2.IsPropertyAnimatable( propertyIndex ) ); - DALI_TEST_CHECK( customActor2.IsPropertyAnimatable( animatablePropertyIndex ) ); + DALI_TEST_CHECK(!customActor2.IsPropertyAnimatable(propertyIndex)); + DALI_TEST_CHECK(customActor2.IsPropertyAnimatable(animatablePropertyIndex)); END_TEST; } int UtcDaliPropertyRegistrationUnregisteredGetAndSet(void) { TestApplication application; - int propertyIndex = PROPERTY_REGISTRATION_START_INDEX + 2000; - int animatablePropertyIndex = ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX + 2000; + int propertyIndex = PROPERTY_REGISTRATION_START_INDEX + 2000; + int animatablePropertyIndex = ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX + 2000; // Create custom-actor - TypeInfo typeInfo = TypeRegistry::Get().GetTypeInfo( typeid(MyTestCustomActor) ); - DALI_TEST_CHECK( typeInfo ); + TypeInfo typeInfo = TypeRegistry::Get().GetTypeInfo(typeid(MyTestCustomActor)); + DALI_TEST_CHECK(typeInfo); BaseHandle handle = typeInfo.CreateInstance(); - DALI_TEST_CHECK( handle ); - Actor customActor = Actor::DownCast( handle ); - DALI_TEST_CHECK( customActor ); + DALI_TEST_CHECK(handle); + Actor customActor = Actor::DownCast(handle); + DALI_TEST_CHECK(customActor); // Try to set an index that hasn't been registered, this is a no-op for now, to be fixed in future - customActor.SetProperty( propertyIndex, true ); -// DALI_TEST_EQUALS( true, customActor.GetProperty( propertyIndex ).Get(), TEST_LOCATION); + customActor.SetProperty(propertyIndex, true); + // DALI_TEST_EQUALS( true, customActor.GetProperty( propertyIndex ).Get(), TEST_LOCATION); // Try to set an index that hasn't been registered - customActor.SetProperty( animatablePropertyIndex, true ); - DALI_TEST_EQUALS( true, customActor.GetProperty( animatablePropertyIndex ).Get(), TEST_LOCATION); + customActor.SetProperty(animatablePropertyIndex, true); + DALI_TEST_EQUALS(true, customActor.GetProperty(animatablePropertyIndex).Get(), TEST_LOCATION); END_TEST; } - int UtcDaliLongPressGestureDetectorTypeRegistry(void) { TestApplication application; Actor actor = Actor::New(); - actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) ); - actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT); + actor.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f)); + actor.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT); application.GetScene().Add(actor); // Register Type TypeInfo type; - type = TypeRegistry::Get().GetTypeInfo( "LongPressGestureDetector" ); - DALI_TEST_CHECK( type ); + type = TypeRegistry::Get().GetTypeInfo("LongPressGestureDetector"); + DALI_TEST_CHECK(type); BaseHandle handle = type.CreateInstance(); - DALI_TEST_CHECK( handle ); - LongPressGestureDetector detector = LongPressGestureDetector::DownCast( handle ); - DALI_TEST_CHECK( detector ); + DALI_TEST_CHECK(handle); + LongPressGestureDetector detector = LongPressGestureDetector::DownCast(handle); + DALI_TEST_CHECK(detector); // Attach actor to detector - SignalData data; - GestureReceivedFunctor functor( data ); + SignalData data; + GestureReceivedFunctor functor(data); detector.Attach(actor); // Connect to signal through type - handle.ConnectSignal( &application, "longPressDetected", functor ); + handle.ConnectSignal(&application, "longPressDetected", functor); // Render and notify application.SendNotification(); application.Render(); // Emit gesture - TestGenerateLongPress( application, 50.0f, 10.0f ); - TestEndLongPress( application, 50.0f, 10.0f ); + TestGenerateLongPress(application, 50.0f, 10.0f); + TestEndLongPress(application, 50.0f, 10.0f); DALI_TEST_EQUALS(true, data.voidFunctorCalled, TEST_LOCATION); END_TEST; @@ -2159,33 +2136,33 @@ int UtcDaliPanGestureDetectorTypeRegistry(void) TestApplication application; Actor actor = Actor::New(); - actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) ); - actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT); + actor.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f)); + actor.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT); application.GetScene().Add(actor); // Register Type TypeInfo type; - type = TypeRegistry::Get().GetTypeInfo( "PanGestureDetector" ); - DALI_TEST_CHECK( type ); + type = TypeRegistry::Get().GetTypeInfo("PanGestureDetector"); + DALI_TEST_CHECK(type); BaseHandle handle = type.CreateInstance(); - DALI_TEST_CHECK( handle ); - PanGestureDetector detector = PanGestureDetector::DownCast( handle ); - DALI_TEST_CHECK( detector ); + DALI_TEST_CHECK(handle); + PanGestureDetector detector = PanGestureDetector::DownCast(handle); + DALI_TEST_CHECK(detector); // Attach actor to detector - SignalData data; - GestureReceivedFunctor functor( data ); + SignalData data; + GestureReceivedFunctor functor(data); detector.Attach(actor); // Connect to signal through type - handle.ConnectSignal( &application, "panDetected", functor ); + handle.ConnectSignal(&application, "panDetected", functor); // Render and notify application.SendNotification(); application.Render(); // Emit gesture - TestGenerateMiniPan( application ); + TestGenerateMiniPan(application); DALI_TEST_EQUALS(true, data.voidFunctorCalled, TEST_LOCATION); END_TEST; } @@ -2195,33 +2172,33 @@ int UtcDaliPinchGestureDetectorTypeRegistry(void) TestApplication application; Actor actor = Actor::New(); - actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) ); - actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT); + actor.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f)); + actor.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT); application.GetScene().Add(actor); // Register Type TypeInfo type; - type = TypeRegistry::Get().GetTypeInfo( "PinchGestureDetector" ); - DALI_TEST_CHECK( type ); + type = TypeRegistry::Get().GetTypeInfo("PinchGestureDetector"); + DALI_TEST_CHECK(type); BaseHandle handle = type.CreateInstance(); - DALI_TEST_CHECK( handle ); - PinchGestureDetector detector = PinchGestureDetector::DownCast( handle ); - DALI_TEST_CHECK( detector ); + DALI_TEST_CHECK(handle); + PinchGestureDetector detector = PinchGestureDetector::DownCast(handle); + DALI_TEST_CHECK(detector); // Attach actor to detector - SignalData data; - GestureReceivedFunctor functor( data ); + SignalData data; + GestureReceivedFunctor functor(data); detector.Attach(actor); // Connect to signal through type - handle.ConnectSignal( &application, "pinchDetected", functor ); + handle.ConnectSignal(&application, "pinchDetected", functor); // Render and notify application.SendNotification(); application.Render(); // Emit gesture - TestGeneratePinch( application ); + TestGeneratePinch(application); DALI_TEST_EQUALS(true, data.voidFunctorCalled, TEST_LOCATION); END_TEST; @@ -2232,33 +2209,33 @@ int UtcDaliRotationGestureDetectorTypeRegistry(void) TestApplication application; Actor actor = Actor::New(); - actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) ); - actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT); + actor.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f)); + actor.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT); application.GetScene().Add(actor); // Register Type TypeInfo type; - type = TypeRegistry::Get().GetTypeInfo( "RotationGestureDetector" ); - DALI_TEST_CHECK( type ); + type = TypeRegistry::Get().GetTypeInfo("RotationGestureDetector"); + DALI_TEST_CHECK(type); BaseHandle handle = type.CreateInstance(); - DALI_TEST_CHECK( handle ); - RotationGestureDetector detector = RotationGestureDetector::DownCast( handle ); - DALI_TEST_CHECK( detector ); + DALI_TEST_CHECK(handle); + RotationGestureDetector detector = RotationGestureDetector::DownCast(handle); + DALI_TEST_CHECK(detector); // Attach actor to detector - SignalData data; - GestureReceivedFunctor functor( data ); + SignalData data; + GestureReceivedFunctor functor(data); detector.Attach(actor); // Connect to signal through type - handle.ConnectSignal( &application, "rotationDetected", functor ); + handle.ConnectSignal(&application, "rotationDetected", functor); // Render and notify application.SendNotification(); application.Render(); // Emit gesture - TestGenerateRotation( application ); + TestGenerateRotation(application); DALI_TEST_EQUALS(true, data.voidFunctorCalled, TEST_LOCATION); END_TEST; @@ -2269,33 +2246,33 @@ int UtcDaliTapGestureDetectorTypeRegistry(void) TestApplication application; Actor actor = Actor::New(); - actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) ); - actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT); + actor.SetProperty(Actor::Property::SIZE, Vector2(100.0f, 100.0f)); + actor.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT); application.GetScene().Add(actor); // Register Type TypeInfo type; - type = TypeRegistry::Get().GetTypeInfo( "TapGestureDetector" ); - DALI_TEST_CHECK( type ); + type = TypeRegistry::Get().GetTypeInfo("TapGestureDetector"); + DALI_TEST_CHECK(type); BaseHandle handle = type.CreateInstance(); - DALI_TEST_CHECK( handle ); - TapGestureDetector detector = TapGestureDetector::DownCast( handle ); - DALI_TEST_CHECK( detector ); + DALI_TEST_CHECK(handle); + TapGestureDetector detector = TapGestureDetector::DownCast(handle); + DALI_TEST_CHECK(detector); // Attach actor to detector - SignalData data; - GestureReceivedFunctor functor( data ); + SignalData data; + GestureReceivedFunctor functor(data); detector.Attach(actor); // Connect to signal through type - handle.ConnectSignal( &application, "tapDetected", functor ); + handle.ConnectSignal(&application, "tapDetected", functor); // Render and notify application.SendNotification(); application.Render(); // Emit gesture - TestGenerateTap( application, 50.0, 10.0, 100 ); + TestGenerateTap(application, 50.0, 10.0, 100); DALI_TEST_EQUALS(true, data.voidFunctorCalled, TEST_LOCATION); END_TEST; @@ -2304,58 +2281,54 @@ int UtcDaliTapGestureDetectorTypeRegistry(void) int UtcDaliTypeRegistryNamedType(void) { TestApplication application; - TypeRegistry typeRegistry = TypeRegistry::Get(); + TypeRegistry typeRegistry = TypeRegistry::Get(); // Create a normal actor - BaseHandle actorHandle = typeRegistry.GetTypeInfo( "Actor" ).CreateInstance(); - DALI_TEST_CHECK( actorHandle ); - Actor actor( Actor::DownCast( actorHandle ) ); - DALI_TEST_CHECK( actor ); - unsigned int actorPropertyCount( actor.GetPropertyCount() ); + BaseHandle actorHandle = typeRegistry.GetTypeInfo("Actor").CreateInstance(); + DALI_TEST_CHECK(actorHandle); + Actor actor(Actor::DownCast(actorHandle)); + DALI_TEST_CHECK(actor); + unsigned int actorPropertyCount(actor.GetPropertyCount()); // Create Named Actor Type - BaseHandle namedHandle = typeRegistry.GetTypeInfo( "MyNamedActor" ).CreateInstance(); - DALI_TEST_CHECK( namedHandle ); - Actor namedActor( Actor::DownCast( namedHandle ) ); - DALI_TEST_CHECK( namedActor ); - unsigned int namedActorPropertyCount( namedActor.GetPropertyCount() ); + BaseHandle namedHandle = typeRegistry.GetTypeInfo("MyNamedActor").CreateInstance(); + DALI_TEST_CHECK(namedHandle); + Actor namedActor(Actor::DownCast(namedHandle)); + DALI_TEST_CHECK(namedActor); + unsigned int namedActorPropertyCount(namedActor.GetPropertyCount()); - DALI_TEST_CHECK( namedActorPropertyCount > actorPropertyCount ); + DALI_TEST_CHECK(namedActorPropertyCount > actorPropertyCount); END_TEST; } int UtcDaliTypeInfoGetActionNameP(void) { TestApplication application; - TypeRegistry typeRegistry = TypeRegistry::Get(); + TypeRegistry typeRegistry = TypeRegistry::Get(); - TypeInfo typeInfo = typeRegistry.GetTypeInfo( "Actor" ); - DALI_TEST_CHECK( typeInfo ); + TypeInfo typeInfo = typeRegistry.GetTypeInfo("Actor"); + DALI_TEST_CHECK(typeInfo); - DALI_TEST_CHECK( 0 != typeInfo.GetActionCount() ); + DALI_TEST_CHECK(0 != typeInfo.GetActionCount()); std::string name = typeInfo.GetActionName(0); - DALI_TEST_EQUALS( name, "show", TEST_LOCATION ); + DALI_TEST_EQUALS(name, "show", TEST_LOCATION); - - TypeInfo typeInfo2 = typeRegistry.GetTypeInfo( "MyTestCustomActor" ); + TypeInfo typeInfo2 = typeRegistry.GetTypeInfo("MyTestCustomActor"); // search for show action in base class, given a derived class bool foundChildAction = false; - for( std::size_t i = 0; i < typeInfo2.GetActionCount(); i++ ) + for(std::size_t i = 0; i < typeInfo2.GetActionCount(); i++) { - - std::string name = typeInfo2.GetActionName( i ); - if( name == "show") - { - foundChildAction = true; - } - + std::string name = typeInfo2.GetActionName(i); + if(name == "show") + { + foundChildAction = true; + } } - DALI_TEST_EQUALS( foundChildAction, true, TEST_LOCATION ); - + DALI_TEST_EQUALS(foundChildAction, true, TEST_LOCATION); END_TEST; } @@ -2363,16 +2336,16 @@ int UtcDaliTypeInfoGetActionNameP(void) int UtcDaliTypeInfoGetActionNameN(void) { TestApplication application; - TypeRegistry typeRegistry = TypeRegistry::Get(); + TypeRegistry typeRegistry = TypeRegistry::Get(); - TypeInfo typeInfo = typeRegistry.GetTypeInfo( "Actor" ); - DALI_TEST_CHECK( typeInfo ); + TypeInfo typeInfo = typeRegistry.GetTypeInfo("Actor"); + DALI_TEST_CHECK(typeInfo); - DALI_TEST_CHECK( 0 != typeInfo.GetActionCount() ); + DALI_TEST_CHECK(0 != typeInfo.GetActionCount()); std::string name = typeInfo.GetActionName(std::numeric_limits::max()); - DALI_TEST_EQUALS( 0u, name.size(), TEST_LOCATION ); + DALI_TEST_EQUALS(0u, name.size(), TEST_LOCATION); END_TEST; } @@ -2380,31 +2353,31 @@ int UtcDaliTypeInfoGetActionNameN(void) int UtcDaliTypeInfoGetSignalNameP(void) { TestApplication application; - TypeRegistry typeRegistry = TypeRegistry::Get(); + TypeRegistry typeRegistry = TypeRegistry::Get(); - TypeInfo typeInfo = typeRegistry.GetTypeInfo( "Actor" ); - DALI_TEST_CHECK( typeInfo ); + TypeInfo typeInfo = typeRegistry.GetTypeInfo("Actor"); + DALI_TEST_CHECK(typeInfo); - DALI_TEST_CHECK( 0 != typeInfo.GetSignalCount() ); + DALI_TEST_CHECK(0 != typeInfo.GetSignalCount()); std::string name = typeInfo.GetSignalName(0); - DALI_TEST_EQUALS( name, "hovered", TEST_LOCATION ); + DALI_TEST_EQUALS(name, "hovered", TEST_LOCATION); - TypeInfo typeInfo2 = typeRegistry.GetTypeInfo( "MyTestCustomActor" ); + TypeInfo typeInfo2 = typeRegistry.GetTypeInfo("MyTestCustomActor"); // search for signal in base class, given a derived class bool foundSignal = false; - for( std::size_t i = 0; i < typeInfo2.GetSignalCount(); i++ ) + for(std::size_t i = 0; i < typeInfo2.GetSignalCount(); i++) { - std::string name = typeInfo2.GetSignalName( i ); - if( name == "hovered") + std::string name = typeInfo2.GetSignalName(i); + if(name == "hovered") { foundSignal = true; } } - DALI_TEST_EQUALS( foundSignal, true, TEST_LOCATION ); + DALI_TEST_EQUALS(foundSignal, true, TEST_LOCATION); END_TEST; } @@ -2412,36 +2385,35 @@ int UtcDaliTypeInfoGetSignalNameP(void) int UtcDaliTypeInfoGetSignalNameN(void) { TestApplication application; - TypeRegistry typeRegistry = TypeRegistry::Get(); + TypeRegistry typeRegistry = TypeRegistry::Get(); - TypeInfo typeInfo = typeRegistry.GetTypeInfo( "Actor" ); - DALI_TEST_CHECK( typeInfo ); + TypeInfo typeInfo = typeRegistry.GetTypeInfo("Actor"); + DALI_TEST_CHECK(typeInfo); - DALI_TEST_CHECK( 0 != typeInfo.GetSignalCount() ); + DALI_TEST_CHECK(0 != typeInfo.GetSignalCount()); std::string name = typeInfo.GetSignalName(std::numeric_limits::max()); - DALI_TEST_EQUALS( 0u, name.size(), TEST_LOCATION ); + DALI_TEST_EQUALS(0u, name.size(), TEST_LOCATION); END_TEST; } - int UtcDaliTypeInfoGetCreatorP(void) { TestApplication application; - TypeRegistry typeRegistry = TypeRegistry::Get(); + TypeRegistry typeRegistry = TypeRegistry::Get(); - TypeInfo typeInfo = typeRegistry.GetTypeInfo( "Actor" ); - DALI_TEST_CHECK( typeInfo ); + TypeInfo typeInfo = typeRegistry.GetTypeInfo("Actor"); + DALI_TEST_CHECK(typeInfo); TypeInfo::CreateFunction createFn = typeInfo.GetCreator(); - DALI_TEST_EQUALS( createFn != NULL, true, TEST_LOCATION ); - if( createFn ) + DALI_TEST_EQUALS(createFn != NULL, true, TEST_LOCATION); + if(createFn) { // try calling it: BaseHandle handle = createFn(); - DALI_TEST_EQUALS( (bool)handle, true, TEST_LOCATION ); + DALI_TEST_EQUALS((bool)handle, true, TEST_LOCATION); } END_TEST; @@ -2450,13 +2422,13 @@ int UtcDaliTypeInfoGetCreatorP(void) int UtcDaliTypeInfoGetCreatorN(void) { TestApplication application; - TypeRegistry typeRegistry = TypeRegistry::Get(); + TypeRegistry typeRegistry = TypeRegistry::Get(); - TypeInfo typeInfo = typeRegistry.GetTypeInfo( "MyTestCustomActor3" ); - DALI_TEST_CHECK( typeInfo ); + TypeInfo typeInfo = typeRegistry.GetTypeInfo("MyTestCustomActor3"); + DALI_TEST_CHECK(typeInfo); TypeInfo::CreateFunction createFn = typeInfo.GetCreator(); - DALI_TEST_EQUALS( createFn == NULL, true, TEST_LOCATION ); + DALI_TEST_EQUALS(createFn == NULL, true, TEST_LOCATION); END_TEST; } @@ -2464,29 +2436,29 @@ int UtcDaliTypeInfoGetCreatorN(void) int UtcDaliTypeInfoGetPropertyCountP1(void) { TestApplication application; - TypeRegistry typeRegistry = TypeRegistry::Get(); + TypeRegistry typeRegistry = TypeRegistry::Get(); - TypeInfo typeInfo = typeRegistry.GetTypeInfo( "Actor" ); - DALI_TEST_CHECK( typeInfo ); + TypeInfo typeInfo = typeRegistry.GetTypeInfo("Actor"); + DALI_TEST_CHECK(typeInfo); size_t actorPropertyCount = typeInfo.GetPropertyCount(); - DALI_TEST_EQUALS( actorPropertyCount, Actor::New().GetPropertyCount(), TEST_LOCATION ); // No event only props + DALI_TEST_EQUALS(actorPropertyCount, Actor::New().GetPropertyCount(), TEST_LOCATION); // No event only props END_TEST; } int UtcDaliTypeInfoGetPropertyCountP2(void) { TestApplication application; - TypeRegistry typeRegistry = TypeRegistry::Get(); + TypeRegistry typeRegistry = TypeRegistry::Get(); - TypeInfo typeInfo = typeRegistry.GetTypeInfo( "MyTestCustomActor2" ); - DALI_TEST_CHECK( typeInfo ); - size_t propertyCount = typeInfo.GetPropertyCount(); + TypeInfo typeInfo = typeRegistry.GetTypeInfo("MyTestCustomActor2"); + DALI_TEST_CHECK(typeInfo); + size_t propertyCount = typeInfo.GetPropertyCount(); Property::IndexContainer indices; - typeInfo.GetPropertyIndices( indices ); + typeInfo.GetPropertyIndices(indices); - DALI_TEST_EQUALS( propertyCount > 0 && propertyCount <= indices.Size(), true, TEST_LOCATION ); - DALI_TEST_EQUALS( propertyCount, Actor::New().GetPropertyCount() + 2, TEST_LOCATION ); + DALI_TEST_EQUALS(propertyCount > 0 && propertyCount <= indices.Size(), true, TEST_LOCATION); + DALI_TEST_EQUALS(propertyCount, Actor::New().GetPropertyCount() + 2, TEST_LOCATION); END_TEST; } @@ -2494,39 +2466,39 @@ int UtcDaliTypeInfoGetPropertyCountP2(void) int UtcDaliPropertyRegistrationPropertyAnimatableSynchronousSetGet01(void) { TestApplication application; - TypeRegistry typeRegistry = TypeRegistry::Get(); + TypeRegistry typeRegistry = TypeRegistry::Get(); - tet_infoline( "Register a type registered animatable property and ensure set/get behaviour works synchronously" ); + 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 ); + 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 ); + 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 ); + DALI_TEST_CHECK(handle); + Actor customActor = Actor::DownCast(handle); + DALI_TEST_CHECK(customActor); application.GetScene().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("Set the value and ensure it changes straight away"); + DALI_TEST_EQUALS(customActor.GetProperty(animatablePropertyIndex), 0.0f, TEST_LOCATION); + customActor.SetProperty(animatablePropertyIndex, 25.0f); + DALI_TEST_EQUALS(customActor.GetProperty(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 ); + tet_infoline("Check latest scene-graph value is unchanged"); + DALI_TEST_EQUALS(customActor.GetCurrentProperty(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" ); + 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 ); + DALI_TEST_EQUALS(customActor.GetProperty(animatablePropertyIndex), 25.0f, TEST_LOCATION); + DALI_TEST_EQUALS(customActor.GetCurrentProperty(animatablePropertyIndex), 25.0f, TEST_LOCATION); END_TEST; } @@ -2534,64 +2506,64 @@ int UtcDaliPropertyRegistrationPropertyAnimatableSynchronousSetGet01(void) int UtcDaliPropertyRegistrationPropertyAnimatableSynchronousSetGetWithComponentsVector2(void) { TestApplication application; - TypeRegistry typeRegistry = TypeRegistry::Get(); + 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" ); + 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 ); + 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 ); + 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 ); + DALI_TEST_CHECK(handle); + Actor customActor = Actor::DownCast(handle); + DALI_TEST_CHECK(customActor); application.GetScene().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("Get the component values, they should be the default value of the base-property"); + DALI_TEST_EQUALS(customActor.GetProperty(componentZeroPropertyIndex), 13.0f, TEST_LOCATION); + DALI_TEST_EQUALS(customActor.GetProperty(componentOnePropertyIndex), 24.0f, TEST_LOCATION); + DALI_TEST_EQUALS(customActor.GetProperty(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 ); + 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(componentZeroPropertyIndex), 125.0f, TEST_LOCATION); + DALI_TEST_EQUALS(customActor.GetProperty(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 ); + customActor.SetProperty(componentOnePropertyIndex, 225.0f); + DALI_TEST_EQUALS(customActor.GetProperty(componentOnePropertyIndex), 225.0f, TEST_LOCATION); + DALI_TEST_EQUALS(customActor.GetProperty(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 ); + tet_infoline("Check latest scene-graph value is unchanged"); + DALI_TEST_EQUALS(customActor.GetCurrentProperty(basePropertyIndex), Vector2(13.0f, 24.0f), TEST_LOCATION); + DALI_TEST_EQUALS(customActor.GetCurrentProperty(componentZeroPropertyIndex), 13.0f, TEST_LOCATION); + DALI_TEST_EQUALS(customActor.GetCurrentProperty(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 ); + tet_infoline("Check values after rendering and both retrieval methods should return the latest"); + DALI_TEST_EQUALS(customActor.GetProperty(basePropertyIndex), Vector2(125.0f, 225.0f), TEST_LOCATION); + DALI_TEST_EQUALS(customActor.GetProperty(componentZeroPropertyIndex), 125.0f, TEST_LOCATION); + DALI_TEST_EQUALS(customActor.GetProperty(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 ); + DALI_TEST_EQUALS(customActor.GetCurrentProperty(basePropertyIndex), Vector2(125.0f, 225.0f), TEST_LOCATION); + DALI_TEST_EQUALS(customActor.GetCurrentProperty(componentZeroPropertyIndex), 125.0f, TEST_LOCATION); + DALI_TEST_EQUALS(customActor.GetCurrentProperty(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 ); + 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(componentZeroPropertyIndex), 1.0f, TEST_LOCATION); + DALI_TEST_EQUALS(customActor.GetProperty(componentOnePropertyIndex), 2.0f, TEST_LOCATION); + DALI_TEST_EQUALS(customActor.GetProperty(basePropertyIndex), Vector2(1.0f, 2.0f), TEST_LOCATION); END_TEST; } @@ -2599,75 +2571,75 @@ int UtcDaliPropertyRegistrationPropertyAnimatableSynchronousSetGetWithComponents int UtcDaliPropertyRegistrationPropertyAnimatableSynchronousSetGetWithComponentsVector3(void) { TestApplication application; - TypeRegistry typeRegistry = TypeRegistry::Get(); + 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" ); + 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 ); + 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 ); + 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 ); + DALI_TEST_CHECK(handle); + Actor customActor = Actor::DownCast(handle); + DALI_TEST_CHECK(customActor); application.GetScene().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("Get the component values, they should be the default value of the base-property"); + DALI_TEST_EQUALS(customActor.GetProperty(componentZeroPropertyIndex), 13.0f, TEST_LOCATION); + DALI_TEST_EQUALS(customActor.GetProperty(componentOnePropertyIndex), 24.0f, TEST_LOCATION); + DALI_TEST_EQUALS(customActor.GetProperty(componentTwoPropertyIndex), 35.0f, TEST_LOCATION); + DALI_TEST_EQUALS(customActor.GetProperty(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 ); + 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(componentZeroPropertyIndex), 125.0f, TEST_LOCATION); + DALI_TEST_EQUALS(customActor.GetProperty(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(componentOnePropertyIndex, 225.0f); + DALI_TEST_EQUALS(customActor.GetProperty(componentOnePropertyIndex), 225.0f, TEST_LOCATION); + DALI_TEST_EQUALS(customActor.GetProperty(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 ); + customActor.SetProperty(componentTwoPropertyIndex, 325.0f); + DALI_TEST_EQUALS(customActor.GetProperty(componentTwoPropertyIndex), 325.0f, TEST_LOCATION); + DALI_TEST_EQUALS(customActor.GetProperty(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 ); + tet_infoline("Check latest scene-graph value is unchanged"); + DALI_TEST_EQUALS(customActor.GetCurrentProperty(basePropertyIndex), Vector3(13.0f, 24.0f, 35.0f), TEST_LOCATION); + DALI_TEST_EQUALS(customActor.GetCurrentProperty(componentZeroPropertyIndex), 13.0f, TEST_LOCATION); + DALI_TEST_EQUALS(customActor.GetCurrentProperty(componentOnePropertyIndex), 24.0f, TEST_LOCATION); + DALI_TEST_EQUALS(customActor.GetCurrentProperty(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 ); + tet_infoline("Check values after rendering and both retrieval methods should return the latest"); + DALI_TEST_EQUALS(customActor.GetProperty(basePropertyIndex), Vector3(125.0f, 225.0f, 325.0f), TEST_LOCATION); + DALI_TEST_EQUALS(customActor.GetProperty(componentZeroPropertyIndex), 125.0f, TEST_LOCATION); + DALI_TEST_EQUALS(customActor.GetProperty(componentOnePropertyIndex), 225.0f, TEST_LOCATION); + DALI_TEST_EQUALS(customActor.GetProperty(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 ); + DALI_TEST_EQUALS(customActor.GetCurrentProperty(basePropertyIndex), Vector3(125.0f, 225.0f, 325.0f), TEST_LOCATION); + DALI_TEST_EQUALS(customActor.GetCurrentProperty(componentZeroPropertyIndex), 125.0f, TEST_LOCATION); + DALI_TEST_EQUALS(customActor.GetCurrentProperty(componentOnePropertyIndex), 225.0f, TEST_LOCATION); + DALI_TEST_EQUALS(customActor.GetCurrentProperty(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 ); + 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(componentZeroPropertyIndex), 1.0f, TEST_LOCATION); + DALI_TEST_EQUALS(customActor.GetProperty(componentOnePropertyIndex), 2.0f, TEST_LOCATION); + DALI_TEST_EQUALS(customActor.GetProperty(componentTwoPropertyIndex), 3.0f, TEST_LOCATION); + DALI_TEST_EQUALS(customActor.GetProperty(basePropertyIndex), Vector3(1.0f, 2.0f, 3.0f), TEST_LOCATION); END_TEST; } @@ -2675,222 +2647,215 @@ int UtcDaliPropertyRegistrationPropertyAnimatableSynchronousSetGetWithComponents int UtcDaliPropertyRegistrationPropertyAnimatableSynchronousSetGetWithComponentsVector4(void) { TestApplication application; - TypeRegistry typeRegistry = TypeRegistry::Get(); + 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" ); + 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 ); + 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 ); + 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 ); + DALI_TEST_CHECK(handle); + Actor customActor = Actor::DownCast(handle); + DALI_TEST_CHECK(customActor); application.GetScene().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 ); + tet_infoline("Get the component values, they should be the default value of the base-property"); + DALI_TEST_EQUALS(customActor.GetProperty(componentZeroPropertyIndex), 13.0f, TEST_LOCATION); + DALI_TEST_EQUALS(customActor.GetProperty(componentOnePropertyIndex), 24.0f, TEST_LOCATION); + DALI_TEST_EQUALS(customActor.GetProperty(componentTwoPropertyIndex), 35.0f, TEST_LOCATION); + DALI_TEST_EQUALS(customActor.GetProperty(componentThreePropertyIndex), 47.0f, TEST_LOCATION); + DALI_TEST_EQUALS(customActor.GetProperty(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(componentZeroPropertyIndex), 125.0f, TEST_LOCATION); + DALI_TEST_EQUALS(customActor.GetProperty(basePropertyIndex), Vector4(125.0f, 24.0f, 35.0f, 47.0f), TEST_LOCATION); + + customActor.SetProperty(componentOnePropertyIndex, 225.0f); + DALI_TEST_EQUALS(customActor.GetProperty(componentOnePropertyIndex), 225.0f, TEST_LOCATION); + DALI_TEST_EQUALS(customActor.GetProperty(basePropertyIndex), Vector4(125.0f, 225.0f, 35.0f, 47.0f), TEST_LOCATION); + + customActor.SetProperty(componentTwoPropertyIndex, 325.0f); + DALI_TEST_EQUALS(customActor.GetProperty(componentTwoPropertyIndex), 325.0f, TEST_LOCATION); + DALI_TEST_EQUALS(customActor.GetProperty(basePropertyIndex), Vector4(125.0f, 225.0f, 325.0f, 47.0f), TEST_LOCATION); + + customActor.SetProperty(componentThreePropertyIndex, 435.0f); + DALI_TEST_EQUALS(customActor.GetProperty(componentThreePropertyIndex), 435.0f, TEST_LOCATION); + DALI_TEST_EQUALS(customActor.GetProperty(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(basePropertyIndex), Vector4(13.0f, 24.0f, 35.0f, 47.0f), TEST_LOCATION); + DALI_TEST_EQUALS(customActor.GetCurrentProperty(componentZeroPropertyIndex), 13.0f, TEST_LOCATION); + DALI_TEST_EQUALS(customActor.GetCurrentProperty(componentOnePropertyIndex), 24.0f, TEST_LOCATION); + DALI_TEST_EQUALS(customActor.GetCurrentProperty(componentTwoPropertyIndex), 35.0f, TEST_LOCATION); + DALI_TEST_EQUALS(customActor.GetCurrentProperty(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 ); + tet_infoline("Check values after rendering and both retrieval methods should return the latest"); + DALI_TEST_EQUALS(customActor.GetProperty(basePropertyIndex), Vector4(125.0f, 225.0f, 325.0f, 435.0f), TEST_LOCATION); + DALI_TEST_EQUALS(customActor.GetProperty(componentZeroPropertyIndex), 125.0f, TEST_LOCATION); + DALI_TEST_EQUALS(customActor.GetProperty(componentOnePropertyIndex), 225.0f, TEST_LOCATION); + DALI_TEST_EQUALS(customActor.GetProperty(componentTwoPropertyIndex), 325.0f, TEST_LOCATION); + DALI_TEST_EQUALS(customActor.GetProperty(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 ); + DALI_TEST_EQUALS(customActor.GetCurrentProperty(basePropertyIndex), Vector4(125.0f, 225.0f, 325.0f, 435.0f), TEST_LOCATION); + DALI_TEST_EQUALS(customActor.GetCurrentProperty(componentZeroPropertyIndex), 125.0f, TEST_LOCATION); + DALI_TEST_EQUALS(customActor.GetCurrentProperty(componentOnePropertyIndex), 225.0f, TEST_LOCATION); + DALI_TEST_EQUALS(customActor.GetCurrentProperty(componentTwoPropertyIndex), 325.0f, TEST_LOCATION); + DALI_TEST_EQUALS(customActor.GetCurrentProperty(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 ); + 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(componentZeroPropertyIndex), 1.0f, TEST_LOCATION); + DALI_TEST_EQUALS(customActor.GetProperty(componentOnePropertyIndex), 2.0f, TEST_LOCATION); + DALI_TEST_EQUALS(customActor.GetProperty(componentTwoPropertyIndex), 3.0f, TEST_LOCATION); + DALI_TEST_EQUALS(customActor.GetProperty(componentThreePropertyIndex), 4.0f, TEST_LOCATION); + DALI_TEST_EQUALS(customActor.GetProperty(basePropertyIndex), Vector4(1.0f, 2.0f, 3.0f, 4.0f), TEST_LOCATION); END_TEST; } - int UtcDaliTypeInfoRegisterChildProperties01(void) { TestApplication application; - TypeRegistry typeRegistry = TypeRegistry::Get(); + TypeRegistry typeRegistry = TypeRegistry::Get(); - tet_infoline( "Register child properties on a type via name" ); + 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 ); + 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); + 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 ); + 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(); - application.GetScene().Add( customActor ); + application.GetScene().Add(customActor); auto child = Actor::New(); - customActor.Add( child ); + customActor.Add(child); - child.SetProperty( WIDTH_SPECIFICATION, 33 ); + child.SetProperty(WIDTH_SPECIFICATION, 33); - auto value = child.GetProperty( WIDTH_SPECIFICATION ); - DALI_TEST_EQUALS( value, Property::Value(33), TEST_LOCATION ); + 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(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 ); + 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(); + TypeRegistry typeRegistry = TypeRegistry::Get(); - tet_infoline( "Register child properties on a type via name" ); + 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 ); + 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); + 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 ); + 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); - 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( "heightSpecification" ); - DALI_TEST_EQUALS( index, HEIGHT_SPECIFICATION, TEST_LOCATION ); + index = customActorTypeInfo.GetChildPropertyIndex("marginSpecification"); + DALI_TEST_EQUALS(index, Property::INVALID_INDEX, 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); - 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); - auto name = customActorTypeInfo.GetChildPropertyName( WIDTH_SPECIFICATION ); - DALI_TEST_EQUALS( name, "widthSpecification", TEST_LOCATION ); + name = myCustomTypeInfo.GetChildPropertyName(MARGIN_SPECIFICATION); + DALI_TEST_EQUALS(name, "marginSpecification", TEST_LOCATION); - name = customActorTypeInfo.GetChildPropertyName( HEIGHT_SPECIFICATION ); - DALI_TEST_EQUALS( name, "heightSpecification", TEST_LOCATION ); + auto type = customActorTypeInfo.GetChildPropertyType(WIDTH_SPECIFICATION); + DALI_TEST_EQUALS(type, Property::INTEGER, 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 ); + 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(); + TypeRegistry typeRegistry = TypeRegistry::Get(); - tet_infoline( "Check registered child properties can be retrieved" ); + 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 ); + 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); + 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 ); + 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 ); + myCustomTypeInfo.GetChildPropertyIndices(indices); - auto result = std::find( indices.Begin(), indices.End(), WIDTH_SPECIFICATION ); - DALI_TEST_EQUALS( result != indices.End(), true, TEST_LOCATION ); + 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(), 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 ); + result = std::find(indices.Begin(), indices.End(), MARGIN_SPECIFICATION); + DALI_TEST_EQUALS(result != indices.End(), true, TEST_LOCATION); END_TEST; } @@ -2898,7 +2863,7 @@ int UtcDaliTypeInfoRegisterChildProperties03(void) int UtcDaliTypeInfoGetActionNameNegative(void) { TestApplication application; - Dali::TypeInfo instance; + Dali::TypeInfo instance; try { unsigned long arg1(0u); @@ -2915,7 +2880,7 @@ int UtcDaliTypeInfoGetActionNameNegative(void) int UtcDaliTypeInfoGetSignalNameNegative(void) { TestApplication application; - Dali::TypeInfo instance; + Dali::TypeInfo instance; try { unsigned long arg1(0u); @@ -2932,7 +2897,7 @@ int UtcDaliTypeInfoGetSignalNameNegative(void) int UtcDaliTypeInfoGetCreatorNegative(void) { TestApplication application; - Dali::TypeInfo instance; + Dali::TypeInfo instance; try { instance.GetCreator(); @@ -2948,7 +2913,7 @@ int UtcDaliTypeInfoGetCreatorNegative(void) int UtcDaliTypeInfoGetBaseNameNegative(void) { TestApplication application; - Dali::TypeInfo instance; + Dali::TypeInfo instance; try { instance.GetBaseName(); @@ -2964,7 +2929,7 @@ int UtcDaliTypeInfoGetBaseNameNegative(void) int UtcDaliTypeInfoCreateInstanceNegative(void) { TestApplication application; - Dali::TypeInfo instance; + Dali::TypeInfo instance; try { instance.CreateInstance(); @@ -2980,7 +2945,7 @@ int UtcDaliTypeInfoCreateInstanceNegative(void) int UtcDaliTypeInfoGetActionCountNegative(void) { TestApplication application; - Dali::TypeInfo instance; + Dali::TypeInfo instance; try { instance.GetActionCount(); @@ -2996,7 +2961,7 @@ int UtcDaliTypeInfoGetActionCountNegative(void) int UtcDaliTypeInfoGetSignalCountNegative(void) { TestApplication application; - Dali::TypeInfo instance; + Dali::TypeInfo instance; try { instance.GetSignalCount(); @@ -3012,7 +2977,7 @@ int UtcDaliTypeInfoGetSignalCountNegative(void) int UtcDaliTypeInfoGetPropertyNameNegative(void) { TestApplication application; - Dali::TypeInfo instance; + Dali::TypeInfo instance; try { int arg1(0); @@ -3029,7 +2994,7 @@ int UtcDaliTypeInfoGetPropertyNameNegative(void) int UtcDaliTypeInfoGetPropertyCountNegative(void) { TestApplication application; - Dali::TypeInfo instance; + Dali::TypeInfo instance; try { instance.GetPropertyCount(); @@ -3045,7 +3010,7 @@ int UtcDaliTypeInfoGetPropertyCountNegative(void) int UtcDaliTypeInfoGetPropertyIndicesNegative(void) { TestApplication application; - Dali::TypeInfo instance; + Dali::TypeInfo instance; try { Dali::Vector arg1; @@ -3062,7 +3027,7 @@ int UtcDaliTypeInfoGetPropertyIndicesNegative(void) int UtcDaliTypeInfoGetChildPropertyNameNegative(void) { TestApplication application; - Dali::TypeInfo instance; + Dali::TypeInfo instance; try { int arg1(0); @@ -3079,7 +3044,7 @@ int UtcDaliTypeInfoGetChildPropertyNameNegative(void) int UtcDaliTypeInfoGetChildPropertyTypeNegative(void) { TestApplication application; - Dali::TypeInfo instance; + Dali::TypeInfo instance; try { int arg1(0); @@ -3096,7 +3061,7 @@ int UtcDaliTypeInfoGetChildPropertyTypeNegative(void) int UtcDaliTypeInfoGetChildPropertyIndexNegative(void) { TestApplication application; - Dali::TypeInfo instance; + Dali::TypeInfo instance; try { std::string arg1; @@ -3113,7 +3078,7 @@ int UtcDaliTypeInfoGetChildPropertyIndexNegative(void) int UtcDaliTypeInfoGetChildPropertyIndicesNegative(void) { TestApplication application; - Dali::TypeInfo instance; + Dali::TypeInfo instance; try { Dali::Vector arg1; @@ -3130,7 +3095,7 @@ int UtcDaliTypeInfoGetChildPropertyIndicesNegative(void) int UtcDaliTypeInfoGetNameNegative(void) { TestApplication application; - Dali::TypeInfo instance; + Dali::TypeInfo instance; try { instance.GetName(); @@ -3145,7 +3110,7 @@ int UtcDaliTypeInfoGetNameNegative(void) int UtcDaliTypeRegistryGetTypeInfoNegative01(void) { - TestApplication application; + TestApplication application; Dali::TypeRegistry instance; try { @@ -3162,7 +3127,7 @@ int UtcDaliTypeRegistryGetTypeInfoNegative01(void) int UtcDaliTypeRegistryGetTypeInfoNegative02(void) { - TestApplication application; + TestApplication application; Dali::TypeRegistry instance; try { @@ -3178,7 +3143,7 @@ int UtcDaliTypeRegistryGetTypeInfoNegative02(void) int UtcDaliTypeRegistryGetTypeNameNegative(void) { - TestApplication application; + TestApplication application; Dali::TypeRegistry instance; try { @@ -3195,7 +3160,7 @@ int UtcDaliTypeRegistryGetTypeNameNegative(void) int UtcDaliTypeRegistryGetTypeNameCountNegative(void) { - TestApplication application; + TestApplication application; Dali::TypeRegistry instance; try {