Revert public API changes. Handle methods.
[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 UtcDaliHandleNonAnimtableProperties(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   try
505   {
506     actor.SetProperty( nonAnimStringIndex, Property::Value("yes") );
507   }
508   catch (Dali::DaliException& e)
509   {
510     DALI_TEST_CHECK(!"exception");
511   }
512
513   DALI_TEST_CHECK( "yes"  == actor.GetProperty( nonAnimStringIndex ).Get<std::string>() );
514
515   //// cannot modify read only?
516   Property::Index readonly = actor.RegisterProperty( "float", 0.f, Property::READ_ONLY);
517
518   DALI_TEST_CHECK(!actor.IsPropertyAnimatable(readonly));
519   DALI_TEST_CHECK(!actor.IsPropertyWritable(readonly));
520
521   bool exception = false;
522   try
523   {
524     actor.SetProperty( readonly, Property::Value(1.f) );
525   }
526   catch (Dali::DaliException& e)
527   {
528     exception = true;
529   }
530
531   DALI_TEST_CHECK(!exception);// trying to set a read-only property is a no-op
532
533   DALI_TEST_EQUALS( 0.f, actor.GetProperty( readonly ).Get<float>(), TEST_LOCATION );
534
535   /// animatable can be set
536   Property::Index write_anim = actor.RegisterProperty( "write_float", 0.f, Property::ANIMATABLE);
537
538   DALI_TEST_CHECK(actor.IsPropertyAnimatable(write_anim));
539   DALI_TEST_CHECK(actor.IsPropertyWritable(write_anim));
540
541   exception = false;
542   try
543   {
544     actor.SetProperty( write_anim, Property::Value(1.f) );
545   }
546   catch (Dali::DaliException& e)
547   {
548     exception = true;
549   }
550
551   DALI_TEST_CHECK(!exception);
552
553   //// animate a non animatable property is a noop?
554   float durationSeconds(2.0f);
555   Animation animation = Animation::New(durationSeconds);
556   bool relativeValue(true);
557
558   exception = false;
559
560   try
561   {
562     animation.AnimateBy(Property(actor, nonAnimStringIndex), relativeValue, AlphaFunction::EASE_IN);
563     animation.Play();
564     application.SendNotification();
565     application.Render(static_cast<unsigned int>(durationSeconds*0100.0f)/* some progress */);
566   }
567   catch (Dali::DaliException& e)
568   {
569     exception = true;
570   }
571
572   DALI_TEST_CHECK(!exception);
573   DALI_TEST_EQUALS( "yes", actor.GetProperty( nonAnimStringIndex ).Get<std::string>(), TEST_LOCATION );
574
575   END_TEST;
576 }
577
578 int UtcDaliHandleNonAnimtableCompositeProperties(void)
579 {
580   tet_infoline("Test Non Animatable Composite Properties");
581   TestApplication application;
582
583   Actor actor = Actor::New();
584
585   Property::Value value(Property::ARRAY);
586   Property::Array* array = value.GetArray();
587   DALI_TEST_CHECK( array );
588
589   array->PushBack( Property::Value( 0.1f ) );
590   array->PushBack( "a string" );
591   array->PushBack( Property::Value( Vector3(1,2,3) ) );
592
593   DALI_TEST_EQUALS( 3u, array->Count(), TEST_LOCATION );
594
595   Property::Index propertyIndex = actor.RegisterProperty( "composite", value, Property::READ_WRITE );
596
597   Property::Value out = actor.GetProperty( propertyIndex );
598   Property::Array* outArray = out.GetArray();
599   DALI_TEST_CHECK( outArray != NULL );
600
601   DALI_TEST_CHECK( Property::FLOAT     == outArray->GetElementAt(0).GetType());
602   DALI_TEST_CHECK( Property::STRING    == outArray->GetElementAt(1).GetType());
603   DALI_TEST_CHECK( Property::VECTOR3   == outArray->GetElementAt(2).GetType());
604
605   DALI_TEST_EQUALS( 0.1f,            outArray->GetElementAt(0).Get<float>(),       TEST_LOCATION);
606   DALI_TEST_EQUALS( "a string",     outArray->GetElementAt(1).Get<std::string>(),  TEST_LOCATION);
607   DALI_TEST_EQUALS( Vector3(1,2,3), outArray->GetElementAt(2).Get<Vector3>(),      TEST_LOCATION);
608
609   // composite types not animatable
610   bool exception = false;
611   try
612   {
613     actor.RegisterProperty( "compositemap", value, Property::ANIMATABLE);
614   }
615   catch (Dali::DaliException& e)
616   {
617     exception = true;
618     DALI_TEST_PRINT_ASSERT( e );
619   }
620
621   DALI_TEST_EQUALS(exception, true, TEST_LOCATION);
622
623   // Map of maps
624   Property::Value mapOfMaps(Property::MAP);
625   Property::Map* map = mapOfMaps.GetMap();
626
627   map->Insert( "key", Property::Value(Property::MAP) );
628   map->Insert( "2key", "a string" );
629
630   DALI_TEST_EQUALS( "a string",  (*map)["2key"].Get<std::string>(),  TEST_LOCATION);
631
632   Property::Map* innerMap = map->Find("key")->GetMap();
633   innerMap->Insert( "subkey", 5.f );
634
635   DALI_TEST_CHECK( NULL != map->Find("key")->GetMap()->Find("subkey") );
636   DALI_TEST_EQUALS( 5.f, map->Find("key")->GetMap()->Find("subkey")->Get<float>(), TEST_LOCATION);
637   END_TEST;
638 }
639
640 int UtcDaliHandleSetProperty01(void)
641 {
642   tet_infoline("Positive Test Dali::Handle::SetProperty()");
643   TestApplication application;
644
645   Actor actor = Actor::New();
646   DALI_TEST_CHECK( ParentOrigin::TOP_LEFT == actor.GetProperty( Actor::Property::PARENT_ORIGIN ).Get<Vector3>() );
647
648   actor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
649   // flush the queue and render once
650   application.SendNotification();
651   application.Render();
652   DALI_TEST_CHECK( ParentOrigin::CENTER == actor.GetProperty( Actor::Property::PARENT_ORIGIN ).Get<Vector3>() );
653   END_TEST;
654 }
655
656 int UtcDaliHandleSetProperty02(void)
657 {
658   tet_infoline("Positive Test Dali::Handle::SetProperty()");
659   TestApplication application;
660
661   Actor actor = Actor::New();
662
663   DALI_TEST_CHECK( !actor.IsPropertyWritable( Actor::Property::WORLD_POSITION ) );
664
665   // World position is not writable so this is a no-op and should not crash
666   actor.SetProperty( Actor::Property::WORLD_POSITION, Vector3(1,2,3) );
667
668   END_TEST;
669 }
670
671 int UtcDaliHandleRegisterProperty01(void)
672 {
673   tet_infoline("Positive Test Dali::Handle::RegisterProperty()");
674   TestApplication application;
675
676   Stage stage = Stage::GetCurrent();
677
678   Actor actor = Actor::New();
679   stage.Add( actor );
680
681   const unsigned int defaultPropertyCount = actor.GetPropertyCount();
682
683   application.SendNotification();
684   application.Render();
685
686   Property::Index index1 = actor.RegisterProperty( "MyProperty", Vector3::ONE );
687
688   application.SendNotification();
689   application.Render();
690
691   DALI_TEST_EQUALS( actor.GetPropertyCount(), defaultPropertyCount + 1, TEST_LOCATION );
692   DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( index1 ), Vector3::ONE, TEST_LOCATION );
693
694   // No new property should be registered when we call the below function
695   Property::Index index2 = actor.RegisterProperty( "MyProperty", Vector3::ZAXIS );
696
697   application.SendNotification();
698   application.Render();
699
700
701   DALI_TEST_EQUALS( index1, index2, TEST_LOCATION ); // We should have the same index as per the first registration
702   DALI_TEST_EQUALS( actor.GetPropertyCount(), defaultPropertyCount + 1, TEST_LOCATION ); // Property count should be the same
703   DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( index2 ), Vector3::ZAXIS, TEST_LOCATION ); // Value should be what we sent on second RegisterProperty call
704
705   END_TEST;
706 }
707
708 int UtcDaliHandleRegisterProperty02(void)
709 {
710   tet_infoline("Positive Test Dali::Handle::RegisterProperty() int key");
711   TestApplication application;
712
713   Stage stage = Stage::GetCurrent();
714
715   Actor actor = Actor::New();
716   stage.Add( actor );
717
718   const unsigned int defaultPropertyCount = actor.GetPropertyCount();
719
720   application.SendNotification();
721   application.Render();
722
723   Property::Index key1 = CORE_PROPERTY_MAX_INDEX+1;
724   Property::Index key2 = CORE_PROPERTY_MAX_INDEX+2;
725
726   const Vector4 testColor(0.5f, 0.2f, 0.9f, 1.0f);
727   const float withFlake(99.f);
728
729   Property::Index index1 = actor.RegisterProperty( "MyPropertyOne", Vector3::ONE );
730   Property::Index index2 = DevelHandle::RegisterProperty( actor, key1, "sideColor", testColor);
731   Property::Index index3 = DevelHandle::RegisterProperty( actor, key2, "iceCream", withFlake );
732
733   application.SendNotification();
734   application.Render();
735
736   DALI_TEST_EQUALS( actor.GetPropertyCount(), defaultPropertyCount + 3, TEST_LOCATION );
737   DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( index1 ), Vector3::ONE, TEST_LOCATION );
738   DALI_TEST_EQUALS( actor.GetProperty< Vector4 >( index2 ), testColor, TEST_LOCATION );
739   DALI_TEST_EQUALS( actor.GetProperty< float >( index3 ), withFlake, TEST_LOCATION );
740
741   // No new property should be registered when we call the below functions
742   Property::Index testIndex2 = actor.RegisterProperty( "iceCream", 2200.f );
743   Property::Index testIndex1 = actor.RegisterProperty( "sideColor", Color::BLACK );
744   application.SendNotification();
745   application.Render();
746
747   DALI_TEST_EQUALS( index2, testIndex1, TEST_LOCATION ); // We should have the same index as per the first registration
748   DALI_TEST_EQUALS( index3, testIndex2, TEST_LOCATION ); // We should have the same index as per the first registration
749   DALI_TEST_EQUALS( actor.GetPropertyCount(), defaultPropertyCount + 3, TEST_LOCATION ); // Property count should be the same
750   DALI_TEST_EQUALS( actor.GetProperty< Vector4 >( index2 ), Color::BLACK, TEST_LOCATION ); // Value should be what we sent on second RegisterProperty call
751   DALI_TEST_EQUALS( actor.GetProperty< float >( index3 ), 2200.f, TEST_LOCATION );
752
753   END_TEST;
754 }
755
756
757
758 int UtcDaliHandleGetProperty(void)
759 {
760   tet_infoline("Positive Test Dali::Handle::GetProperty()");
761   TestApplication application;
762
763   Actor actor = Actor::New();
764
765   DALI_TEST_CHECK( ParentOrigin::TOP_LEFT == actor.GetProperty( Actor::Property::PARENT_ORIGIN   ).Get<Vector3>() );
766   DALI_TEST_CHECK( AnchorPoint::CENTER    == actor.GetProperty( Actor::Property::ANCHOR_POINT    ).Get<Vector3>() );
767   DALI_TEST_CHECK( Vector3::ZERO          == actor.GetProperty( Actor::Property::SIZE            ).Get<Vector3>() );
768   DALI_TEST_CHECK( Vector3::ZERO          == actor.GetProperty( Actor::Property::POSITION        ).Get<Vector3>() );
769   DALI_TEST_CHECK( Vector3::ONE           == actor.GetProperty( Actor::Property::SCALE           ).Get<Vector3>() );
770   DALI_TEST_CHECK( true                   == actor.GetProperty( Actor::Property::VISIBLE         ).Get<bool>() );
771   DALI_TEST_CHECK( Color::WHITE           == actor.GetProperty( Actor::Property::COLOR           ).Get<Vector4>() );
772   END_TEST;
773 }
774
775 int UtcDaliHandleDownCast(void)
776 {
777   TestApplication application;
778   tet_infoline("Testing Dali::Handle::DownCast()");
779
780   Actor actor = Actor::New();
781
782   BaseHandle baseHandle = actor;
783
784   Handle handle = Handle::DownCast(baseHandle);
785
786   DALI_TEST_CHECK( handle );
787
788   baseHandle = BaseHandle();
789
790   handle = Handle::DownCast(baseHandle);
791
792   DALI_TEST_CHECK( !handle );
793
794   END_TEST;
795 }
796
797 int UtcDaliHandleDownCastNegative(void)
798 {
799   TestApplication application;
800
801   // BaseObject is NOT an Object, so this DownCast should fail
802   BaseHandle handle( new BaseObjectType );
803   Handle customHandle1 = Handle::DownCast( handle );
804   DALI_TEST_CHECK( ! customHandle1 );
805
806   // A DownCast on an empty handle will also fail
807   Handle empty;
808   Handle customHandle2 = Handle::DownCast( empty );
809   DALI_TEST_CHECK( ! customHandle2 );
810   END_TEST;
811 }
812
813 int UtcDaliHandleGetPropertyIndices(void)
814 {
815   TestApplication application;
816   Property::IndexContainer indices;
817
818   // Actor
819   Actor actor = Actor::New();
820   actor.GetPropertyIndices( indices );
821   int numDefaultProperties = indices.Size();
822   DALI_TEST_CHECK( numDefaultProperties > 0 );
823   DALI_TEST_EQUALS( numDefaultProperties, actor.GetPropertyCount(), TEST_LOCATION );
824
825   const Vector4 testColor(0.5f, 0.2f, 0.9f, 1.0f);
826   const float withFlake(99.f);
827
828   Property::Index key1 = CORE_PROPERTY_MAX_INDEX+1;
829   Property::Index key2 = CORE_PROPERTY_MAX_INDEX+2;
830
831   actor.RegisterProperty( "MyPropertyOne", Vector3::ONE );
832   DevelHandle::RegisterProperty( actor, key1, "sideColor", testColor);
833   actor.RegisterProperty( "MyPropertyTwo", 1234 );
834   Property::Index index4 = DevelHandle::RegisterProperty( actor, key2, "iceCream", withFlake );
835   actor.RegisterProperty( "MyPropertyThree", Vector2(.2f,.7f) );
836
837   actor.GetPropertyIndices( indices );
838
839   DALI_TEST_EQUALS( indices.Size(), numDefaultProperties + 5, TEST_LOCATION );
840   DALI_TEST_EQUALS( indices[indices.Size()-2], index4, TEST_LOCATION );
841
842   END_TEST;
843 }
844
845 int UtcDaliHandleRegisterPropertyTypes(void)
846 {
847   TestApplication application;
848
849   struct PropertyTypeAnimatable
850   {
851     const char * name;
852     Property::Value value;
853     bool animatable;
854   };
855
856   Property::Array array;
857   Property::Map map;
858
859   PropertyTypeAnimatable properties[] =
860   {
861     { "Property::BOOLEAN",          true,              true  },
862     { "Property::FLOAT",            1.0f,              true  },
863     { "Property::INTEGER",          1,                 true  },
864     { "Property::VECTOR2",          Vector2::ONE,      true  },
865     { "Property::VECTOR3",          Vector3::ONE,      true  },
866     { "Property::VECTOR4",          Vector4::ONE,      true  },
867     { "Property::MATRIX3",          Matrix3::IDENTITY, true  },
868     { "Property::MATRIX",           Matrix::IDENTITY,  true  },
869     { "Property::RECTANGLE",        Rect<int>(),       false },
870     { "Property::ROTATION",         AngleAxis(),       true  },
871     { "Property::STRING",           std::string("Me"), false },
872     { "Property::ARRAY",            array,             false },
873     { "Property::MAP",              map,               false },
874   };
875
876   unsigned int numOfProperties( sizeof( properties ) / sizeof( properties[0] ) );
877
878   for ( unsigned int i = 0; i < numOfProperties; ++i )
879   {
880     tet_printf( "Testing: %s\n", properties[i].name );
881
882     bool exception = false;
883     try
884     {
885       Actor actor = Actor::New();
886       actor.RegisterProperty( "manFromDelmonte",   properties[i].value );
887     }
888     catch (Dali::DaliException& e)
889     {
890       exception = true;
891     }
892
893     DALI_TEST_CHECK( properties[i].animatable != exception );
894   }
895   END_TEST;
896 }
897
898 int UtcDaliHandleCustomProperty(void)
899 {
900   TestApplication application;
901
902   Handle handle = Handle::New();
903
904   float startValue(1.0f);
905   Property::Index index = handle.RegisterProperty( "testProperty",  startValue );
906   DALI_TEST_CHECK( handle.GetProperty<float>(index) == startValue );
907
908   application.SendNotification();
909   application.Render(0);
910   DALI_TEST_CHECK( handle.GetProperty<float>(index) == startValue );
911   application.Render(0);
912   DALI_TEST_CHECK( handle.GetProperty<float>(index) == startValue );
913
914   handle.SetProperty( index, 5.0f );
915
916   application.SendNotification();
917   application.Render(0);
918   DALI_TEST_CHECK( handle.GetProperty<float>(index) == 5.0f );
919   application.Render(0);
920   DALI_TEST_CHECK( handle.GetProperty<float>(index) == 5.0f );
921   END_TEST;
922 }
923
924 int UtcDaliHandleWeightNew(void)
925 {
926   TestApplication application;
927
928   Handle handle = WeightObject::New();;
929   DALI_TEST_CHECK( handle.GetProperty<float>(WeightObject::WEIGHT) == 0.0f );
930
931   END_TEST;
932 }