Add devel API to link an object (e.g. C# custom control) with its correct type-info
[platform/core/uifw/dali-core.git] / automated-tests / src / dali / utc-Dali-Handle.cpp
1 /*
2  * Copyright (c) 2014 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17
18 #include <iostream>
19
20 #include <stdlib.h>
21 #include <dali/public-api/dali-core.h>
22 #include <dali/devel-api/object/handle-devel.h>
23 #include "dali-test-suite-utils/dali-test-suite-utils.h"
24 #include <mesh-builder.h>
25
26 using namespace Dali;
27
28 void handle_test_startup(void)
29 {
30   test_return_value = TET_UNDEF;
31 }
32
33 void handle_test_cleanup(void)
34 {
35   test_return_value = TET_PASS;
36 }
37
38 namespace
39 {
40
41 /// Allows the creation of a BaseObject
42 class BaseObjectType : public BaseObject
43 {
44 public:
45   BaseObjectType()
46   {
47   }
48 };
49
50 Handle ImplicitCopyConstructor(Handle passedByValue)
51 {
52   // object + copy + passedByValue, ref count == 3
53   DALI_TEST_CHECK(passedByValue);
54   if (passedByValue)
55   {
56     DALI_TEST_EQUALS(3, passedByValue.GetBaseObject().ReferenceCount(), TEST_LOCATION);
57   }
58
59   return passedByValue;
60 }
61
62 } // anon namespace
63
64
65 int UtcDaliHandleConstructorVoid(void)
66 {
67   TestApplication application;
68   tet_infoline("Testing Dali::Handle::Handle()");
69
70   Handle object;
71
72   DALI_TEST_CHECK(!object);
73
74   END_TEST;
75 }
76
77 int UtcDaliHandleCopyConstructor(void)
78 {
79   TestApplication application;
80   tet_infoline("Testing Dali::Handle::Handle(const Handle&)");
81
82   // Initialize an object, ref count == 1
83   Handle object = Actor::New();
84
85   DALI_TEST_EQUALS(1, object.GetBaseObject().ReferenceCount(), TEST_LOCATION);
86
87   // Copy the object, ref count == 2
88   Handle copy(object);
89   DALI_TEST_CHECK(copy);
90   if (copy)
91   {
92     DALI_TEST_EQUALS(2, copy.GetBaseObject().ReferenceCount(), TEST_LOCATION);
93   }
94
95   {
96     // Pass by value, and return another copy, ref count == 3
97     Handle anotherCopy = ImplicitCopyConstructor(copy);
98
99     DALI_TEST_CHECK(anotherCopy);
100     if (anotherCopy)
101     {
102       DALI_TEST_EQUALS(3, anotherCopy.GetBaseObject().ReferenceCount(), TEST_LOCATION);
103     }
104   }
105
106   // anotherCopy out of scope, ref count == 2
107   DALI_TEST_CHECK(copy);
108   if (copy)
109   {
110     DALI_TEST_EQUALS(2, copy.GetBaseObject().ReferenceCount(), TEST_LOCATION);
111   }
112   END_TEST;
113 }
114
115 int UtcDaliHandleAssignmentOperator(void)
116 {
117   TestApplication application;
118   tet_infoline("Testing Dali::Handle::operator=");
119
120   Handle object = Actor::New();
121
122   DALI_TEST_CHECK(object);
123   DALI_TEST_EQUALS(1, object.GetBaseObject().ReferenceCount(), TEST_LOCATION);
124
125   Handle copy;
126   DALI_TEST_CHECK(!copy);
127
128   copy = object;
129   DALI_TEST_CHECK(copy);
130   DALI_TEST_EQUALS(2, copy.GetBaseObject().ReferenceCount(), TEST_LOCATION);
131   DALI_TEST_CHECK(&(copy.GetBaseObject()) == &(object.GetBaseObject()));
132   END_TEST;
133 }
134
135 int UtcDaliHandleSupports(void)
136 {
137   tet_infoline("Positive Test Dali::Handle::Supports()");
138   TestApplication application;
139
140   Actor actor = Actor::New();
141   DALI_TEST_CHECK( true == actor.Supports( Handle::DYNAMIC_PROPERTIES ) );
142   END_TEST;
143 }
144
145 int UtcDaliHandleGetPropertyCount(void)
146 {
147   tet_infoline("Positive Test Dali::Handle::GetPropertyCount()");
148   TestApplication application;
149
150   Actor actor = Actor::New();
151   int defaultPropertyCount( actor.GetPropertyCount() );
152
153   // Register a dynamic property
154   actor.RegisterProperty( "testProperty",  float(123.0f) );
155   DALI_TEST_CHECK( (defaultPropertyCount + 1u) == actor.GetPropertyCount() );
156   END_TEST;
157 }
158
159 int UtcDaliHandleGetPropertyName(void)
160 {
161   tet_infoline("Positive Test Dali::Handle::GetPropertyName()");
162   TestApplication application;
163
164   Actor actor = Actor::New();
165   DALI_TEST_CHECK( "parentOrigin" == actor.GetPropertyName( Actor::Property::PARENT_ORIGIN ) );
166
167   // Register a dynamic property
168   std::string name("thisNameShouldMatch");
169   Property::Index index = actor.RegisterProperty( name, float(123.0f) );
170   DALI_TEST_CHECK( name == actor.GetPropertyName( index ) );
171
172   END_TEST;
173 }
174
175 int UtcDaliHandleGetPropertyIndex01(void)
176 {
177   tet_infoline("Positive Test Dali::Handle::GetPropertyIndex()");
178   TestApplication application;
179
180   Actor actor = Actor::New();
181   DALI_TEST_CHECK( Actor::Property::PARENT_ORIGIN == actor.GetPropertyIndex("parentOrigin") );
182
183   // Register a dynamic property
184   std::string name("thisNameShouldMatch");
185   Property::Index index = actor.RegisterProperty( name, float(123.0f) );
186   DALI_TEST_CHECK( index == actor.GetPropertyIndex( name ) );
187   END_TEST;
188 }
189
190 int UtcDaliHandleGetPropertyIndex02(void)
191 {
192   tet_infoline("Positive Test Dali::Handle::GetPropertyIndex() int key");
193   TestApplication application;
194
195   Stage stage = Stage::GetCurrent();
196
197   Actor actor = Actor::New();
198   stage.Add( actor );
199
200   const unsigned int defaultPropertyCount = actor.GetPropertyCount();
201
202   application.SendNotification();
203   application.Render();
204
205   Property::Index key1 = CORE_PROPERTY_MAX_INDEX+1;
206   Property::Index key2 = CORE_PROPERTY_MAX_INDEX+2;
207
208   const Vector4 testColor(0.5f, 0.2f, 0.9f, 1.0f);
209   const float withFlake(99.f);
210
211   Property::Index index1 = actor.RegisterProperty( "MyPropertyOne", Vector3::ONE );
212   Property::Index index2 = DevelHandle::RegisterProperty( actor, key1, "sideColor", testColor);
213   Property::Index index3 = actor.RegisterProperty( "MyPropertyTwo", Vector3::ONE );
214   Property::Index index4 = DevelHandle::RegisterProperty( actor, key2, "iceCream", withFlake );
215   Property::Index index5 = actor.RegisterProperty( "MyPropertyThree", Vector3::ONE );
216
217   application.SendNotification();
218   application.Render();
219
220   // Test that we can get the property index from the integer key
221   Property::Index testIndex1 = DevelHandle::GetPropertyIndex( actor, key1 );
222   Property::Index testIndex2 = DevelHandle::GetPropertyIndex( actor, key2 );
223
224   DALI_TEST_EQUALS( index2, testIndex1, TEST_LOCATION );
225   DALI_TEST_EQUALS( index4, testIndex2, TEST_LOCATION );
226
227   // Test that we keep the same indices on the named properties
228   Property::Index testIndex = actor.GetPropertyIndex("MyPropertyOne");
229   DALI_TEST_EQUALS(testIndex, index1, TEST_LOCATION);
230   testIndex = actor.GetPropertyIndex("MyPropertyTwo");
231   DALI_TEST_EQUALS(testIndex, index3, TEST_LOCATION);
232   testIndex = actor.GetPropertyIndex("MyPropertyThree");
233   DALI_TEST_EQUALS(testIndex, index5, TEST_LOCATION);
234   testIndex = actor.GetPropertyIndex("sideColor");
235   DALI_TEST_EQUALS(testIndex, index2, TEST_LOCATION);
236   testIndex = actor.GetPropertyIndex("iceCream");
237   DALI_TEST_EQUALS(testIndex, index4, TEST_LOCATION);
238
239   DALI_TEST_EQUALS(defaultPropertyCount+5, actor.GetPropertyCount(), TEST_LOCATION);
240   END_TEST;
241 }
242
243 int UtcDaliHandleGetPropertyIndex03(void)
244 {
245   TestApplication application;
246
247   Actor actor = Actor::New();
248
249   std::string myName("croydon");
250   Property::Index intKey = CORE_PROPERTY_MAX_INDEX+1;
251   Property::Value value( Color::GREEN );
252   Property::Index myIndex = DevelHandle::RegisterProperty( actor, intKey, myName, value );
253
254   DALI_TEST_EQUALS( myIndex, DevelHandle::GetPropertyIndex( actor, intKey ), TEST_LOCATION );
255
256   Property::Key key1(myName);
257   Property::Key key2(intKey);
258
259   DALI_TEST_EQUALS( myIndex, DevelHandle::GetPropertyIndex( actor, key1 ), TEST_LOCATION );
260   DALI_TEST_EQUALS( myIndex, DevelHandle::GetPropertyIndex( actor, key2 ), TEST_LOCATION );
261   END_TEST;
262 }
263
264
265 int UtcDaliHandleIsPropertyWritable(void)
266 {
267   tet_infoline("Positive Test Dali::Handle::IsPropertyWritable()");
268   TestApplication application;
269
270   Actor actor = Actor::New();
271
272   // Actor properties which are writable:
273   DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::Property::PARENT_ORIGIN ) );
274   DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::Property::PARENT_ORIGIN_X ) );
275   DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::Property::PARENT_ORIGIN_Y ) );
276   DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::Property::PARENT_ORIGIN_Z ) );
277   DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::Property::ANCHOR_POINT ) );
278   DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::Property::ANCHOR_POINT_X ) );
279   DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::Property::ANCHOR_POINT_Y ) );
280   DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::Property::ANCHOR_POINT_Z ) );
281   DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::Property::SIZE ) );
282   DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::Property::SIZE_WIDTH  ) );
283   DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::Property::SIZE_HEIGHT ) );
284   DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::Property::SIZE_DEPTH  ) );
285   DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::Property::POSITION ) );
286   DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::Property::POSITION_X ) );
287   DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::Property::POSITION_Y ) );
288   DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::Property::POSITION_Z ) );
289   DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::Property::ORIENTATION ) );
290   DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::Property::SCALE ) );
291   DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::Property::SCALE_X ) );
292   DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::Property::SCALE_Y ) );
293   DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::Property::SCALE_Z ) );
294   DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::Property::VISIBLE ) );
295   DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::Property::COLOR ) );
296   DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::Property::COLOR_RED ) );
297   DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::Property::COLOR_GREEN ) );
298   DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::Property::COLOR_BLUE ) );
299   DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::Property::COLOR_ALPHA ) );
300
301   // World-properties are not writable:
302   DALI_TEST_CHECK( false == actor.IsPropertyWritable( Actor::Property::WORLD_POSITION ) );
303   DALI_TEST_CHECK( false == actor.IsPropertyWritable( Actor::Property::WORLD_ORIENTATION ) );
304   DALI_TEST_CHECK( false == actor.IsPropertyWritable( Actor::Property::WORLD_SCALE ) );
305   DALI_TEST_CHECK( false == actor.IsPropertyWritable( Actor::Property::WORLD_COLOR ) );
306   DALI_TEST_CHECK( false == actor.IsPropertyWritable( Actor::Property::WORLD_POSITION_X ) );
307   DALI_TEST_CHECK( false == actor.IsPropertyWritable( Actor::Property::WORLD_POSITION_Y ) );
308   DALI_TEST_CHECK( false == actor.IsPropertyWritable( Actor::Property::WORLD_POSITION_Z ) );
309
310   END_TEST;
311 }
312
313 int UtcDaliHandleIsPropertyAnimatable(void)
314 {
315   tet_infoline("Positive Test Dali::Handle::IsPropertyAnimatable()");
316   TestApplication application;
317
318   Actor actor = Actor::New();
319
320   // Actor properties which are animatable:
321   DALI_TEST_CHECK( false == actor.IsPropertyAnimatable( Actor::Property::PARENT_ORIGIN ) );
322   DALI_TEST_CHECK( false == actor.IsPropertyAnimatable( Actor::Property::PARENT_ORIGIN_X ) );
323   DALI_TEST_CHECK( false == actor.IsPropertyAnimatable( Actor::Property::PARENT_ORIGIN_Y ) );
324   DALI_TEST_CHECK( false == actor.IsPropertyAnimatable( Actor::Property::PARENT_ORIGIN_Z ) );
325   DALI_TEST_CHECK( false == actor.IsPropertyAnimatable( Actor::Property::ANCHOR_POINT ) );
326   DALI_TEST_CHECK( false == actor.IsPropertyAnimatable( Actor::Property::ANCHOR_POINT_X ) );
327   DALI_TEST_CHECK( false == actor.IsPropertyAnimatable( Actor::Property::ANCHOR_POINT_Y ) );
328   DALI_TEST_CHECK( false == actor.IsPropertyAnimatable( Actor::Property::ANCHOR_POINT_Z ) );
329   DALI_TEST_CHECK( true == actor.IsPropertyAnimatable( Actor::Property::SIZE ) );
330   DALI_TEST_CHECK( true == actor.IsPropertyAnimatable( Actor::Property::SIZE_WIDTH  ) );
331   DALI_TEST_CHECK( true == actor.IsPropertyAnimatable( Actor::Property::SIZE_HEIGHT ) );
332   DALI_TEST_CHECK( true == actor.IsPropertyAnimatable( Actor::Property::SIZE_DEPTH  ) );
333   DALI_TEST_CHECK( true == actor.IsPropertyAnimatable( Actor::Property::POSITION ) );
334   DALI_TEST_CHECK( true == actor.IsPropertyAnimatable( Actor::Property::POSITION_X ) );
335   DALI_TEST_CHECK( true == actor.IsPropertyAnimatable( Actor::Property::POSITION_Y ) );
336   DALI_TEST_CHECK( true == actor.IsPropertyAnimatable( Actor::Property::POSITION_Z ) );
337   DALI_TEST_CHECK( true == actor.IsPropertyAnimatable( Actor::Property::ORIENTATION ) );
338   DALI_TEST_CHECK( true == actor.IsPropertyAnimatable( Actor::Property::SCALE ) );
339   DALI_TEST_CHECK( true == actor.IsPropertyAnimatable( Actor::Property::SCALE_X ) );
340   DALI_TEST_CHECK( true == actor.IsPropertyAnimatable( Actor::Property::SCALE_Y ) );
341   DALI_TEST_CHECK( true == actor.IsPropertyAnimatable( Actor::Property::SCALE_Z ) );
342   DALI_TEST_CHECK( true == actor.IsPropertyAnimatable( Actor::Property::VISIBLE ) );
343   DALI_TEST_CHECK( true == actor.IsPropertyAnimatable( Actor::Property::COLOR ) );
344   DALI_TEST_CHECK( true == actor.IsPropertyAnimatable( Actor::Property::COLOR_RED ) );
345   DALI_TEST_CHECK( true == actor.IsPropertyAnimatable( Actor::Property::COLOR_GREEN ) );
346   DALI_TEST_CHECK( true == actor.IsPropertyAnimatable( Actor::Property::COLOR_BLUE ) );
347   DALI_TEST_CHECK( true == actor.IsPropertyAnimatable( Actor::Property::COLOR_ALPHA ) );
348
349   // World-properties can not be animated
350   DALI_TEST_CHECK( false == actor.IsPropertyAnimatable( Actor::Property::WORLD_POSITION ) );
351   DALI_TEST_CHECK( false == actor.IsPropertyAnimatable( Actor::Property::WORLD_ORIENTATION ) );
352   DALI_TEST_CHECK( false == actor.IsPropertyAnimatable( Actor::Property::WORLD_SCALE ) );
353   DALI_TEST_CHECK( false == actor.IsPropertyAnimatable( Actor::Property::WORLD_COLOR ) );
354   DALI_TEST_CHECK( false == actor.IsPropertyAnimatable( Actor::Property::WORLD_POSITION_X ) );
355   DALI_TEST_CHECK( false == actor.IsPropertyAnimatable( Actor::Property::WORLD_POSITION_Y ) );
356   DALI_TEST_CHECK( false == actor.IsPropertyAnimatable( Actor::Property::WORLD_POSITION_Z ) );
357
358   END_TEST;
359 }
360
361 int UtcDaliHandleIsPropertyAConstraintInput(void)
362 {
363   TestApplication application;
364
365   Actor actor = Actor::New();
366
367   // Actor properties which can be used as a constraint input:
368   DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::Property::PARENT_ORIGIN ) );
369   DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::Property::PARENT_ORIGIN_X ) );
370   DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::Property::PARENT_ORIGIN_Y ) );
371   DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::Property::PARENT_ORIGIN_Z ) );
372   DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::Property::ANCHOR_POINT ) );
373   DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::Property::ANCHOR_POINT_X ) );
374   DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::Property::ANCHOR_POINT_Y ) );
375   DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::Property::ANCHOR_POINT_Z ) );
376   DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::Property::SIZE ) );
377   DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::Property::SIZE_WIDTH  ) );
378   DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::Property::SIZE_HEIGHT ) );
379   DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::Property::SIZE_DEPTH  ) );
380   DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::Property::POSITION ) );
381   DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::Property::POSITION_X ) );
382   DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::Property::POSITION_Y ) );
383   DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::Property::POSITION_Z ) );
384   DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::Property::ORIENTATION ) );
385   DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::Property::SCALE ) );
386   DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::Property::SCALE_X ) );
387   DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::Property::SCALE_Y ) );
388   DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::Property::SCALE_Z ) );
389   DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::Property::VISIBLE ) );
390   DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::Property::COLOR ) );
391   DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::Property::COLOR_RED ) );
392   DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::Property::COLOR_GREEN ) );
393   DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::Property::COLOR_BLUE ) );
394   DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::Property::COLOR_ALPHA ) );
395   DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::Property::WORLD_POSITION ) );
396   DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::Property::WORLD_ORIENTATION ) );
397   DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::Property::WORLD_SCALE ) );
398   DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::Property::WORLD_COLOR ) );
399   DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::Property::WORLD_POSITION_X ) );
400   DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::Property::WORLD_POSITION_Y ) );
401   DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::Property::WORLD_POSITION_Z ) );
402
403   // Actor properties that cannot be used as a constraint input
404   DALI_TEST_CHECK( false == actor.IsPropertyAConstraintInput( Actor::Property::NAME ) );
405   DALI_TEST_CHECK( false == actor.IsPropertyAConstraintInput( Actor::Property::SENSITIVE ) );
406   DALI_TEST_CHECK( false == actor.IsPropertyAConstraintInput( Actor::Property::LEAVE_REQUIRED ) );
407   DALI_TEST_CHECK( false == actor.IsPropertyAConstraintInput( Actor::Property::INHERIT_ORIENTATION ) );
408   DALI_TEST_CHECK( false == actor.IsPropertyAConstraintInput( Actor::Property::INHERIT_SCALE ) );
409   DALI_TEST_CHECK( false == actor.IsPropertyAConstraintInput( Actor::Property::COLOR_MODE ) );
410   DALI_TEST_CHECK( false == actor.IsPropertyAConstraintInput( Actor::Property::POSITION_INHERITANCE ) );
411   DALI_TEST_CHECK( false == actor.IsPropertyAConstraintInput( Actor::Property::DRAW_MODE ) );
412   DALI_TEST_CHECK( false == actor.IsPropertyAConstraintInput( Actor::Property::SIZE_MODE_FACTOR ) );
413
414   END_TEST;
415 }
416
417
418 int UtcDaliHandleGetPropertyType(void)
419 {
420   tet_infoline("Positive Test Dali::Handle::GetPropertyType()");
421   TestApplication application;
422
423   Actor actor = Actor::New();
424   DALI_TEST_CHECK( Property::VECTOR3  == actor.GetPropertyType( Actor::Property::PARENT_ORIGIN ) );
425   DALI_TEST_CHECK( Property::VECTOR3  == actor.GetPropertyType( Actor::Property::ANCHOR_POINT ) );
426   DALI_TEST_CHECK( Property::VECTOR3  == actor.GetPropertyType( Actor::Property::SIZE ) );
427   DALI_TEST_CHECK( Property::VECTOR3  == actor.GetPropertyType( Actor::Property::POSITION ) );
428   DALI_TEST_CHECK( Property::ROTATION == actor.GetPropertyType( Actor::Property::ORIENTATION ) );
429   DALI_TEST_CHECK( Property::VECTOR3  == actor.GetPropertyType( Actor::Property::SCALE ) );
430   DALI_TEST_CHECK( Property::BOOLEAN  == actor.GetPropertyType( Actor::Property::VISIBLE ) );
431   DALI_TEST_CHECK( Property::VECTOR4  == actor.GetPropertyType( Actor::Property::COLOR ) );
432
433   // Register some dynamic properties
434   Property::Index boolIndex     = actor.RegisterProperty( "boolProperty",      bool(true) );
435   Property::Index floatIndex    = actor.RegisterProperty( "floatProperty",     float(123.0f) );
436   Property::Index intIndex      = actor.RegisterProperty( "intProperty",       123 );
437   Property::Index vector2Index  = actor.RegisterProperty( "vector2Property",   Vector2(1.0f, 2.0f) );
438   Property::Index vector3Index  = actor.RegisterProperty( "vector3Property",   Vector3(1.0f, 2.0f, 3.0f) );
439   Property::Index vector4Index  = actor.RegisterProperty( "vector4Property",   Vector4(1.0f, 2.0f, 3.0f, 4.0f) );
440   Property::Index rotationIndex = actor.RegisterProperty( "rotationProperty",  AngleAxis(Degree(180.0f), Vector3::YAXIS) );
441
442   DALI_TEST_CHECK( Property::BOOLEAN  == actor.GetPropertyType( boolIndex ) );
443   DALI_TEST_CHECK( Property::FLOAT    == actor.GetPropertyType( floatIndex ) );
444   DALI_TEST_CHECK( Property::INTEGER  == actor.GetPropertyType( intIndex ) );
445   DALI_TEST_CHECK( Property::VECTOR2  == actor.GetPropertyType( vector2Index ) );
446   DALI_TEST_CHECK( Property::VECTOR3  == actor.GetPropertyType( vector3Index ) );
447   DALI_TEST_CHECK( Property::VECTOR4  == actor.GetPropertyType( vector4Index ) );
448   DALI_TEST_CHECK( Property::ROTATION == actor.GetPropertyType( rotationIndex ) );
449
450   // Non animatable properties
451   Property::Index nonAnimStringIndex = actor.RegisterProperty( "manFromDelmonte",   std::string("yes"), Property::READ_WRITE);
452   Property::Index nonAnimV2Index = actor.RegisterProperty( "v2", Vector2(1.f, 2.f), Property::READ_WRITE);
453   Property::Index nonAnimV3Index = actor.RegisterProperty( "v3", Vector3(1.f, 2.f, 3.f), Property::READ_WRITE);
454   Property::Index nonAnimV4Index = actor.RegisterProperty( "v4", Vector4(1.f, 2.f, 3.f, 4.f), Property::READ_WRITE);
455   Property::Index nonAnimBooleanIndex = actor.RegisterProperty( "bool", true, Property::READ_WRITE);
456   Property::Index nonAnimFloatIndex = actor.RegisterProperty( "float", 0.f, Property::READ_WRITE);
457   Property::Index nonAnimIntegerIndex = actor.RegisterProperty( "int", 0, Property::READ_WRITE);
458
459   DALI_TEST_CHECK( nonAnimStringIndex  != Property::INVALID_INDEX );
460   DALI_TEST_CHECK( nonAnimV2Index      != Property::INVALID_INDEX );
461   DALI_TEST_CHECK( nonAnimV3Index      != Property::INVALID_INDEX );
462   DALI_TEST_CHECK( nonAnimV4Index      != Property::INVALID_INDEX );
463   DALI_TEST_CHECK( nonAnimBooleanIndex != Property::INVALID_INDEX );
464   DALI_TEST_CHECK( nonAnimFloatIndex   != Property::INVALID_INDEX );
465   DALI_TEST_CHECK( nonAnimIntegerIndex != Property::INVALID_INDEX );
466
467   DALI_TEST_CHECK( Property::STRING   == actor.GetPropertyType( nonAnimStringIndex ) );
468   DALI_TEST_CHECK( Property::VECTOR2  == actor.GetPropertyType( nonAnimV2Index ) );
469   DALI_TEST_CHECK( Property::VECTOR3  == actor.GetPropertyType( nonAnimV3Index ) );
470   DALI_TEST_CHECK( Property::VECTOR4  == actor.GetPropertyType( nonAnimV4Index ) );
471   DALI_TEST_CHECK( Property::BOOLEAN  == actor.GetPropertyType( nonAnimBooleanIndex ) );
472   DALI_TEST_CHECK( Property::FLOAT    == actor.GetPropertyType( nonAnimFloatIndex ) );
473   DALI_TEST_CHECK( Property::INTEGER  == actor.GetPropertyType( nonAnimIntegerIndex ) );
474
475   DALI_TEST_CHECK( !actor.IsPropertyAnimatable( nonAnimStringIndex ) );
476   DALI_TEST_CHECK( !actor.IsPropertyAnimatable( nonAnimV2Index ) );
477   DALI_TEST_CHECK( !actor.IsPropertyAnimatable( nonAnimV3Index ) );
478   DALI_TEST_CHECK( !actor.IsPropertyAnimatable( nonAnimV4Index ) );
479   DALI_TEST_CHECK( !actor.IsPropertyAnimatable( nonAnimBooleanIndex ) );
480   DALI_TEST_CHECK( !actor.IsPropertyAnimatable( nonAnimFloatIndex ) );
481   DALI_TEST_CHECK( !actor.IsPropertyAnimatable( nonAnimIntegerIndex ) );
482
483   DALI_TEST_EQUALS( "yes" , actor.GetProperty( nonAnimStringIndex ).Get<std::string>(), TEST_LOCATION );
484   DALI_TEST_EQUALS( Vector2(1.f, 2.f) , actor.GetProperty( nonAnimV2Index ).Get<Vector2>(), TEST_LOCATION );
485   DALI_TEST_EQUALS( Vector3(1.f, 2.f, 3.f) , actor.GetProperty( nonAnimV3Index ).Get<Vector3>(), TEST_LOCATION );
486   DALI_TEST_EQUALS( Vector4(1.f, 2.f, 3.f, 4.f) , actor.GetProperty( nonAnimV4Index ).Get<Vector4>(), TEST_LOCATION );
487   DALI_TEST_EQUALS( true, actor.GetProperty( nonAnimBooleanIndex ).Get<bool>(), TEST_LOCATION );
488   DALI_TEST_EQUALS( 0.f, actor.GetProperty( nonAnimFloatIndex ).Get<float>(), TEST_LOCATION );
489   DALI_TEST_EQUALS( 0, actor.GetProperty( nonAnimIntegerIndex ).Get<int>(), TEST_LOCATION );
490
491   END_TEST;
492 }
493
494 int UtcDaliHandleNonAnimatableProperties(void)
495 {
496   tet_infoline("Test Non Animatable Properties");
497   TestApplication application;
498
499   Actor actor = Actor::New();
500
501   Property::Index nonAnimStringIndex = actor.RegisterProperty( "manFromDelmonte", std::string("no"), Property::READ_WRITE);
502
503   //// modify writable?
504   actor.SetProperty( nonAnimStringIndex, Property::Value("yes") );
505
506   DALI_TEST_CHECK( "yes"  == actor.GetProperty( nonAnimStringIndex ).Get<std::string>() );
507
508   //// cannot modify read only?
509   Property::Index readonly = actor.RegisterProperty( "float", 0.f, Property::READ_ONLY);
510
511   DALI_TEST_CHECK(!actor.IsPropertyAnimatable(readonly));
512   DALI_TEST_CHECK(!actor.IsPropertyWritable(readonly));
513
514   actor.SetProperty( readonly, Property::Value(1.f) );
515   // trying to set a read-only property is a no-op
516
517   DALI_TEST_EQUALS( 0.f, actor.GetProperty( readonly ).Get<float>(), TEST_LOCATION );
518
519   /// animatable can be set
520   Property::Index write_anim = actor.RegisterProperty( "write_float", 0.f, Property::ANIMATABLE);
521
522   DALI_TEST_CHECK(actor.IsPropertyAnimatable(write_anim));
523   DALI_TEST_CHECK(actor.IsPropertyWritable(write_anim));
524
525   actor.SetProperty( write_anim, Property::Value(1.f) );
526
527   //// animate a non animatable property throws
528   float durationSeconds(2.0f);
529   Animation animation = Animation::New(durationSeconds);
530   bool relativeValue(true);
531   try
532   {
533     animation.AnimateBy(Property(actor, nonAnimStringIndex), relativeValue, AlphaFunction::EASE_IN);
534   }
535   catch ( Dali::DaliException& e )
536   {
537     DALI_TEST_ASSERT( e, "Animated value and Property type don't match", TEST_LOCATION );
538   }
539
540   DALI_TEST_EQUALS( "yes", actor.GetProperty( nonAnimStringIndex ).Get<std::string>(), TEST_LOCATION );
541
542   END_TEST;
543 }
544
545 int UtcDaliHandleNonAnimtableCompositeProperties(void)
546 {
547   tet_infoline("Test Non Animatable Composite Properties");
548   TestApplication application;
549
550   Actor actor = Actor::New();
551
552   Property::Value value(Property::ARRAY);
553   Property::Array* array = value.GetArray();
554   DALI_TEST_CHECK( array );
555
556   array->PushBack( Property::Value( 0.1f ) );
557   array->PushBack( "a string" );
558   array->PushBack( Property::Value( Vector3(1,2,3) ) );
559
560   DALI_TEST_EQUALS( 3u, array->Count(), TEST_LOCATION );
561
562   Property::Index propertyIndex = actor.RegisterProperty( "composite", value, Property::READ_WRITE );
563
564   Property::Value out = actor.GetProperty( propertyIndex );
565   Property::Array* outArray = out.GetArray();
566   DALI_TEST_CHECK( outArray != NULL );
567
568   DALI_TEST_CHECK( Property::FLOAT     == outArray->GetElementAt(0).GetType());
569   DALI_TEST_CHECK( Property::STRING    == outArray->GetElementAt(1).GetType());
570   DALI_TEST_CHECK( Property::VECTOR3   == outArray->GetElementAt(2).GetType());
571
572   DALI_TEST_EQUALS( 0.1f,            outArray->GetElementAt(0).Get<float>(),       TEST_LOCATION);
573   DALI_TEST_EQUALS( "a string",     outArray->GetElementAt(1).Get<std::string>(),  TEST_LOCATION);
574   DALI_TEST_EQUALS( Vector3(1,2,3), outArray->GetElementAt(2).Get<Vector3>(),      TEST_LOCATION);
575
576   // composite types not animatable
577   bool exception = false;
578   try
579   {
580     actor.RegisterProperty( "compositemap", value, Property::ANIMATABLE);
581   }
582   catch (Dali::DaliException& e)
583   {
584     exception = true;
585     DALI_TEST_PRINT_ASSERT( e );
586   }
587
588   DALI_TEST_EQUALS(exception, true, TEST_LOCATION);
589
590   // Map of maps
591   Property::Value mapOfMaps(Property::MAP);
592   Property::Map* map = mapOfMaps.GetMap();
593
594   map->Insert( "key", Property::Value(Property::MAP) );
595   map->Insert( "2key", "a string" );
596
597   DALI_TEST_EQUALS( "a string",  (*map)["2key"].Get<std::string>(),  TEST_LOCATION);
598
599   Property::Map* innerMap = map->Find("key")->GetMap();
600   innerMap->Insert( "subkey", 5.f );
601
602   DALI_TEST_CHECK( NULL != map->Find("key")->GetMap()->Find("subkey") );
603   DALI_TEST_EQUALS( 5.f, map->Find("key")->GetMap()->Find("subkey")->Get<float>(), TEST_LOCATION);
604   END_TEST;
605 }
606
607 int UtcDaliHandleSetProperty01(void)
608 {
609   tet_infoline("Positive Test Dali::Handle::SetProperty()");
610   TestApplication application;
611
612   Actor actor = Actor::New();
613   DALI_TEST_CHECK( ParentOrigin::TOP_LEFT == actor.GetProperty( Actor::Property::PARENT_ORIGIN ).Get<Vector3>() );
614
615   actor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
616   // flush the queue and render once
617   application.SendNotification();
618   application.Render();
619   DALI_TEST_CHECK( ParentOrigin::CENTER == actor.GetProperty( Actor::Property::PARENT_ORIGIN ).Get<Vector3>() );
620   END_TEST;
621 }
622
623 int UtcDaliHandleSetProperty02(void)
624 {
625   tet_infoline("Positive Test Dali::Handle::SetProperty()");
626   TestApplication application;
627
628   Actor actor = Actor::New();
629
630   DALI_TEST_CHECK( !actor.IsPropertyWritable( Actor::Property::WORLD_POSITION ) );
631
632   // World position is not writable so this is a no-op and should not crash
633   actor.SetProperty( Actor::Property::WORLD_POSITION, Vector3(1,2,3) );
634
635   END_TEST;
636 }
637
638 int UtcDaliHandleRegisterProperty01(void)
639 {
640   tet_infoline("Positive Test Dali::Handle::RegisterProperty()");
641   TestApplication application;
642
643   Stage stage = Stage::GetCurrent();
644
645   Actor actor = Actor::New();
646   stage.Add( actor );
647
648   const unsigned int defaultPropertyCount = actor.GetPropertyCount();
649
650   application.SendNotification();
651   application.Render();
652
653   Property::Index index1 = actor.RegisterProperty( "MyProperty", Vector3::ONE );
654
655   application.SendNotification();
656   application.Render();
657
658   DALI_TEST_EQUALS( actor.GetPropertyCount(), defaultPropertyCount + 1, TEST_LOCATION );
659   DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( index1 ), Vector3::ONE, TEST_LOCATION );
660
661   // No new property should be registered when we call the below function
662   Property::Index index2 = actor.RegisterProperty( "MyProperty", Vector3::ZAXIS );
663
664   application.SendNotification();
665   application.Render();
666
667
668   DALI_TEST_EQUALS( index1, index2, TEST_LOCATION ); // We should have the same index as per the first registration
669   DALI_TEST_EQUALS( actor.GetPropertyCount(), defaultPropertyCount + 1, TEST_LOCATION ); // Property count should be the same
670   DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( index2 ), Vector3::ZAXIS, TEST_LOCATION ); // Value should be what we sent on second RegisterProperty call
671
672   END_TEST;
673 }
674
675 int UtcDaliHandleRegisterProperty02(void)
676 {
677   tet_infoline("Positive Test Dali::Handle::RegisterProperty() int key");
678   TestApplication application;
679
680   Stage stage = Stage::GetCurrent();
681
682   Actor actor = Actor::New();
683   stage.Add( actor );
684
685   const unsigned int defaultPropertyCount = actor.GetPropertyCount();
686
687   application.SendNotification();
688   application.Render();
689
690   Property::Index key1 = CORE_PROPERTY_MAX_INDEX+1;
691   Property::Index key2 = CORE_PROPERTY_MAX_INDEX+2;
692
693   const Vector4 testColor(0.5f, 0.2f, 0.9f, 1.0f);
694   const float withFlake(99.f);
695
696   Property::Index index1 = actor.RegisterProperty( "MyPropertyOne", Vector3::ONE );
697   Property::Index index2 = DevelHandle::RegisterProperty( actor, key1, "sideColor", testColor);
698   Property::Index index3 = DevelHandle::RegisterProperty( actor, key2, "iceCream", withFlake );
699
700   application.SendNotification();
701   application.Render();
702
703   DALI_TEST_EQUALS( actor.GetPropertyCount(), defaultPropertyCount + 3, TEST_LOCATION );
704   DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( index1 ), Vector3::ONE, TEST_LOCATION );
705   DALI_TEST_EQUALS( actor.GetProperty< Vector4 >( index2 ), testColor, TEST_LOCATION );
706   DALI_TEST_EQUALS( actor.GetProperty< float >( index3 ), withFlake, TEST_LOCATION );
707
708   // No new property should be registered when we call the below functions
709   Property::Index testIndex2 = actor.RegisterProperty( "iceCream", 2200.f );
710   Property::Index testIndex1 = actor.RegisterProperty( "sideColor", Color::BLACK );
711   application.SendNotification();
712   application.Render();
713
714   DALI_TEST_EQUALS( index2, testIndex1, TEST_LOCATION ); // We should have the same index as per the first registration
715   DALI_TEST_EQUALS( index3, testIndex2, TEST_LOCATION ); // We should have the same index as per the first registration
716   DALI_TEST_EQUALS( actor.GetPropertyCount(), defaultPropertyCount + 3, TEST_LOCATION ); // Property count should be the same
717   DALI_TEST_EQUALS( actor.GetProperty< Vector4 >( index2 ), Color::BLACK, TEST_LOCATION ); // Value should be what we sent on second RegisterProperty call
718   DALI_TEST_EQUALS( actor.GetProperty< float >( index3 ), 2200.f, TEST_LOCATION );
719
720   END_TEST;
721 }
722
723
724
725 int UtcDaliHandleGetProperty(void)
726 {
727   tet_infoline("Positive Test Dali::Handle::GetProperty()");
728   TestApplication application;
729
730   Actor actor = Actor::New();
731
732   DALI_TEST_CHECK( ParentOrigin::TOP_LEFT == actor.GetProperty( Actor::Property::PARENT_ORIGIN   ).Get<Vector3>() );
733   DALI_TEST_CHECK( AnchorPoint::CENTER    == actor.GetProperty( Actor::Property::ANCHOR_POINT    ).Get<Vector3>() );
734   DALI_TEST_CHECK( Vector3::ZERO          == actor.GetProperty( Actor::Property::SIZE            ).Get<Vector3>() );
735   DALI_TEST_CHECK( Vector3::ZERO          == actor.GetProperty( Actor::Property::POSITION        ).Get<Vector3>() );
736   DALI_TEST_CHECK( Vector3::ONE           == actor.GetProperty( Actor::Property::SCALE           ).Get<Vector3>() );
737   DALI_TEST_CHECK( true                   == actor.GetProperty( Actor::Property::VISIBLE         ).Get<bool>() );
738   DALI_TEST_CHECK( Color::WHITE           == actor.GetProperty( Actor::Property::COLOR           ).Get<Vector4>() );
739   END_TEST;
740 }
741
742 int UtcDaliHandleDownCast(void)
743 {
744   TestApplication application;
745   tet_infoline("Testing Dali::Handle::DownCast()");
746
747   Actor actor = Actor::New();
748
749   BaseHandle baseHandle = actor;
750
751   Handle handle = Handle::DownCast(baseHandle);
752
753   DALI_TEST_CHECK( handle );
754
755   baseHandle = BaseHandle();
756
757   handle = Handle::DownCast(baseHandle);
758
759   DALI_TEST_CHECK( !handle );
760
761   END_TEST;
762 }
763
764 int UtcDaliHandleDownCastNegative(void)
765 {
766   TestApplication application;
767
768   // BaseObject is NOT an Object, so this DownCast should fail
769   BaseHandle handle( new BaseObjectType );
770   Handle customHandle1 = Handle::DownCast( handle );
771   DALI_TEST_CHECK( ! customHandle1 );
772
773   // A DownCast on an empty handle will also fail
774   Handle empty;
775   Handle customHandle2 = Handle::DownCast( empty );
776   DALI_TEST_CHECK( ! customHandle2 );
777   END_TEST;
778 }
779
780 int UtcDaliHandleGetPropertyIndices(void)
781 {
782   TestApplication application;
783   Property::IndexContainer indices;
784
785   // Actor
786   Actor actor = Actor::New();
787   actor.GetPropertyIndices( indices );
788   int numDefaultProperties = indices.Size();
789   DALI_TEST_CHECK( numDefaultProperties > 0 );
790   DALI_TEST_EQUALS( numDefaultProperties, actor.GetPropertyCount(), TEST_LOCATION );
791
792   const Vector4 testColor(0.5f, 0.2f, 0.9f, 1.0f);
793   const float withFlake(99.f);
794
795   Property::Index key1 = CORE_PROPERTY_MAX_INDEX+1;
796   Property::Index key2 = CORE_PROPERTY_MAX_INDEX+2;
797
798   actor.RegisterProperty( "MyPropertyOne", Vector3::ONE );
799   DevelHandle::RegisterProperty( actor, key1, "sideColor", testColor);
800   actor.RegisterProperty( "MyPropertyTwo", 1234 );
801   Property::Index index4 = DevelHandle::RegisterProperty( actor, key2, "iceCream", withFlake );
802   actor.RegisterProperty( "MyPropertyThree", Vector2(.2f,.7f) );
803
804   actor.GetPropertyIndices( indices );
805
806   DALI_TEST_EQUALS( indices.Size(), numDefaultProperties + 5, TEST_LOCATION );
807   DALI_TEST_EQUALS( indices[indices.Size()-2], index4, TEST_LOCATION );
808
809   END_TEST;
810 }
811
812 int UtcDaliHandleRegisterPropertyTypes(void)
813 {
814   TestApplication application;
815
816   struct PropertyTypeAnimatable
817   {
818     const char * name;
819     Property::Value value;
820     bool animatable;
821   };
822
823   Property::Array array;
824   Property::Map map;
825
826   PropertyTypeAnimatable properties[] =
827   {
828     { "Property::BOOLEAN",          true,              true  },
829     { "Property::FLOAT",            1.0f,              true  },
830     { "Property::INTEGER",          1,                 true  },
831     { "Property::VECTOR2",          Vector2::ONE,      true  },
832     { "Property::VECTOR3",          Vector3::ONE,      true  },
833     { "Property::VECTOR4",          Vector4::ONE,      true  },
834     { "Property::MATRIX3",          Matrix3::IDENTITY, true  },
835     { "Property::MATRIX",           Matrix::IDENTITY,  true  },
836     { "Property::RECTANGLE",        Rect<int>(),       false },
837     { "Property::ROTATION",         AngleAxis(),       true  },
838     { "Property::STRING",           std::string("Me"), false },
839     { "Property::ARRAY",            array,             false },
840     { "Property::MAP",              map,               false },
841   };
842
843   unsigned int numOfProperties( sizeof( properties ) / sizeof( properties[0] ) );
844
845   for ( unsigned int i = 0; i < numOfProperties; ++i )
846   {
847     tet_printf( "Testing: %s\n", properties[i].name );
848
849     bool exception = false;
850     try
851     {
852       Actor actor = Actor::New();
853       actor.RegisterProperty( "manFromDelmonte",   properties[i].value );
854     }
855     catch (Dali::DaliException& e)
856     {
857       exception = true;
858     }
859
860     DALI_TEST_CHECK( properties[i].animatable != exception );
861   }
862   END_TEST;
863 }
864
865 int UtcDaliHandleCustomProperty(void)
866 {
867   TestApplication application;
868
869   Handle handle = Handle::New();
870
871   float startValue(1.0f);
872   Property::Index index = handle.RegisterProperty( "testProperty",  startValue );
873   DALI_TEST_CHECK( handle.GetProperty<float>(index) == startValue );
874
875   application.SendNotification();
876   application.Render(0);
877   DALI_TEST_CHECK( handle.GetProperty<float>(index) == startValue );
878   application.Render(0);
879   DALI_TEST_CHECK( handle.GetProperty<float>(index) == startValue );
880
881   handle.SetProperty( index, 5.0f );
882
883   application.SendNotification();
884   application.Render(0);
885   DALI_TEST_CHECK( handle.GetProperty<float>(index) == 5.0f );
886   application.Render(0);
887   DALI_TEST_CHECK( handle.GetProperty<float>(index) == 5.0f );
888   END_TEST;
889 }
890
891 int UtcDaliHandleWeightNew(void)
892 {
893   TestApplication application;
894
895   Handle handle = WeightObject::New();;
896   DALI_TEST_CHECK( handle.GetProperty<float>(WeightObject::WEIGHT) == 0.0f );
897
898   END_TEST;
899 }
900
901 int UtcDaliHandleSetTypeInfo(void)
902 {
903   TestApplication application;
904   TypeRegistry typeRegistry = TypeRegistry::Get();
905
906   TypeInfo typeInfo = typeRegistry.GetTypeInfo( "Actor" );
907   DALI_TEST_CHECK( typeInfo );
908
909   Actor actor = Actor::DownCast(typeInfo.CreateInstance());
910   DALI_TEST_CHECK( actor );
911
912   DevelHandle::SetTypeInfo(actor, typeInfo);
913
914   TypeInfo newTypeInfo;
915   bool success = actor.GetTypeInfo( newTypeInfo );
916   DALI_TEST_CHECK( success );
917
918   DALI_TEST_CHECK(typeInfo.GetName() == newTypeInfo.GetName());
919   DALI_TEST_CHECK(typeInfo.GetBaseName() == newTypeInfo.GetBaseName());
920
921   END_TEST;
922 }
923