Resynced test cases and removed TET framework
[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 Flora License, Version 1.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://floralicense.org/license/
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 #include <iostream>
18
19 #include <stdlib.h>
20 #include <dali/dali.h>
21 #include "dali-test-suite-utils/dali-test-suite-utils.h"
22
23 using namespace Dali;
24
25 void handle_test_startup(void)
26 {
27   test_return_value = TET_UNDEF;
28 }
29
30 void handle_test_cleanup(void)
31 {
32   test_return_value = TET_PASS;
33 }
34
35 namespace
36 {
37
38 Handle ImplicitCopyConstructor(Handle passedByValue)
39 {
40   // object + copy + passedByValue, ref count == 3
41   DALI_TEST_CHECK(passedByValue);
42   if (passedByValue)
43   {
44     DALI_TEST_EQUALS(3, passedByValue.GetBaseObject().ReferenceCount(), TEST_LOCATION);
45   }
46
47   return passedByValue;
48 }
49
50 void CheckTypeName(const Property::Type& type)
51 {
52   switch(type)
53   {
54     case Property::NONE:
55     {
56       DALI_TEST_CHECK( "NONE" == std::string(PropertyTypes::GetName( type ) ) );
57       break;
58     }
59     case Property::BOOLEAN:
60     {
61       DALI_TEST_CHECK( "BOOLEAN" == std::string(PropertyTypes::GetName( type ) ) );
62       break;
63     }
64     case Property::FLOAT:
65     {
66       DALI_TEST_CHECK( "FLOAT" == std::string(PropertyTypes::GetName( type ) ) );
67       break;
68     }
69     case Property::INTEGER:
70     {
71       DALI_TEST_CHECK( "INTEGER" == std::string(PropertyTypes::GetName( type ) ) );
72       break;
73     }
74     case Property::UNSIGNED_INTEGER:
75     {
76       DALI_TEST_CHECK( "UNSIGNED_INTEGER" == std::string(PropertyTypes::GetName( type ) ) );
77       break;
78     }
79     case Property::VECTOR2:
80     {
81       DALI_TEST_CHECK( "VECTOR2" == std::string(PropertyTypes::GetName( type ) ) );
82       break;
83     }
84     case Property::VECTOR3:
85     {
86       DALI_TEST_CHECK( "VECTOR3" == std::string(PropertyTypes::GetName( type ) ) );
87       break;
88     }
89     case Property::VECTOR4:
90     {
91       DALI_TEST_CHECK( "VECTOR4" == std::string(PropertyTypes::GetName( type ) ) );
92       break;
93     }
94     case Property::MATRIX3:
95     {
96       DALI_TEST_CHECK( "MATRIX3" == std::string(PropertyTypes::GetName( type  ) ) );
97       break;
98     }
99     case Property::MATRIX:
100     {
101       DALI_TEST_CHECK( "MATRIX" == std::string(PropertyTypes::GetName( type ) ) );
102       break;
103     }
104     case Property::RECTANGLE:
105     {
106       DALI_TEST_CHECK( "RECTANGLE" == std::string(PropertyTypes::GetName( type ) ) );
107       break;
108     }
109     case Property::ROTATION:
110     {
111       DALI_TEST_CHECK( "ROTATION" == std::string(PropertyTypes::GetName( type ) ) );
112       break;
113     }
114     case Property::STRING:
115     {
116       DALI_TEST_CHECK( "STRING" == std::string(PropertyTypes::GetName( type ) ) );
117       break;
118     }
119     case Property::ARRAY:
120     {
121       DALI_TEST_CHECK( "ARRAY" == std::string(PropertyTypes::GetName( type ) ) );
122       break;
123     }
124     case Property::MAP:
125     {
126       DALI_TEST_CHECK( "MAP" == std::string(PropertyTypes::GetName( type ) ) );
127       break;
128     }
129     case Property::TYPE_COUNT:
130     {
131       DALI_TEST_CHECK( "NONE" == std::string(PropertyTypes::GetName( type ) ) );
132       break;
133     }
134   } // switch(type)
135
136 } // CheckTypeName
137
138 } // anon namespace
139
140
141 int UtcDaliHandleConstructorVoid(void)
142 {
143   TestApplication application;
144   tet_infoline("Testing Dali::Handle::Handle()");
145
146   Handle object;
147
148   DALI_TEST_CHECK(!object);
149   END_TEST;
150 }
151
152 int UtcDaliHandleCopyConstructor(void)
153 {
154   TestApplication application;
155   tet_infoline("Testing Dali::Handle::Handle(const Handle&)");
156
157   // Initialize an object, ref count == 1
158   Handle object = Actor::New();
159
160   DALI_TEST_EQUALS(1, object.GetBaseObject().ReferenceCount(), TEST_LOCATION);
161
162   // Copy the object, ref count == 2
163   Handle copy(object);
164   DALI_TEST_CHECK(copy);
165   if (copy)
166   {
167     DALI_TEST_EQUALS(2, copy.GetBaseObject().ReferenceCount(), TEST_LOCATION);
168   }
169
170   {
171     // Pass by value, and return another copy, ref count == 3
172     Handle anotherCopy = ImplicitCopyConstructor(copy);
173
174     DALI_TEST_CHECK(anotherCopy);
175     if (anotherCopy)
176     {
177       DALI_TEST_EQUALS(3, anotherCopy.GetBaseObject().ReferenceCount(), TEST_LOCATION);
178     }
179   }
180
181   // anotherCopy out of scope, ref count == 2
182   DALI_TEST_CHECK(copy);
183   if (copy)
184   {
185     DALI_TEST_EQUALS(2, copy.GetBaseObject().ReferenceCount(), TEST_LOCATION);
186   }
187   END_TEST;
188 }
189
190 int UtcDaliHandleAssignmentOperator(void)
191 {
192   TestApplication application;
193   tet_infoline("Testing Dali::Handle::operator=");
194
195   Handle object = Actor::New();
196
197   DALI_TEST_CHECK(object);
198   DALI_TEST_EQUALS(1, object.GetBaseObject().ReferenceCount(), TEST_LOCATION);
199
200   Handle copy;
201   DALI_TEST_CHECK(!copy);
202
203   copy = object;
204   DALI_TEST_CHECK(copy);
205   DALI_TEST_EQUALS(2, copy.GetBaseObject().ReferenceCount(), TEST_LOCATION);
206   DALI_TEST_CHECK(&(copy.GetBaseObject()) == &(object.GetBaseObject()));
207   END_TEST;
208 }
209
210 int UtcDaliHandleSupports(void)
211 {
212   tet_infoline("Positive Test Dali::Handle::Supports()");
213   TestApplication application;
214
215   Actor actor = Actor::New();
216   DALI_TEST_CHECK( true == actor.Supports( Handle::DYNAMIC_PROPERTIES ) );
217   END_TEST;
218 }
219
220 int UtcDaliHandleGetPropertyCount(void)
221 {
222   tet_infoline("Positive Test Dali::Handle::GetPropertyCount()");
223   TestApplication application;
224
225   Actor actor = Actor::New();
226   int defaultPropertyCount( actor.GetPropertyCount() );
227
228   // Register a dynamic property
229   actor.RegisterProperty( "test-property", float(123.0f) );
230   DALI_TEST_CHECK( (defaultPropertyCount + 1u) == actor.GetPropertyCount() );
231   END_TEST;
232 }
233
234 int UtcDaliHandleGetPropertyName(void)
235 {
236   tet_infoline("Positive Test Dali::Handle::GetPropertyName()");
237   TestApplication application;
238
239   Actor actor = Actor::New();
240   DALI_TEST_CHECK( "parent-origin" == actor.GetPropertyName( Actor::PARENT_ORIGIN ) );
241
242   // Register a dynamic property
243   std::string name("this-name-should-match");
244   Property::Index index = actor.RegisterProperty( name, float(123.0f) );
245   DALI_TEST_CHECK( name == actor.GetPropertyName( index ) );
246
247   END_TEST;
248 }
249
250 int UtcDaliHandleGetPropertyIndex(void)
251 {
252   tet_infoline("Positive Test Dali::Handle::GetPropertyIndex()");
253   TestApplication application;
254
255   Actor actor = Actor::New();
256   DALI_TEST_CHECK( Actor::PARENT_ORIGIN == actor.GetPropertyIndex("parent-origin") );
257
258   // Register a dynamic property
259   std::string name("this-name-should-match");
260   Property::Index index = actor.RegisterProperty( name, float(123.0f) );
261   DALI_TEST_CHECK( index == actor.GetPropertyIndex( name ) );
262   END_TEST;
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::PARENT_ORIGIN ) );
274   DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::PARENT_ORIGIN_X ) );
275   DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::PARENT_ORIGIN_Y ) );
276   DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::PARENT_ORIGIN_Z ) );
277   DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::ANCHOR_POINT ) );
278   DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::ANCHOR_POINT_X ) );
279   DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::ANCHOR_POINT_Y ) );
280   DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::ANCHOR_POINT_Z ) );
281   DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::SIZE ) );
282   DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::SIZE_WIDTH  ) );
283   DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::SIZE_HEIGHT ) );
284   DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::SIZE_DEPTH  ) );
285   DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::POSITION ) );
286   DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::POSITION_X ) );
287   DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::POSITION_Y ) );
288   DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::POSITION_Z ) );
289   DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::ROTATION ) );
290   DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::SCALE ) );
291   DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::SCALE_X ) );
292   DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::SCALE_Y ) );
293   DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::SCALE_Z ) );
294   DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::VISIBLE ) );
295   DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::COLOR ) );
296   DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::COLOR_RED ) );
297   DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::COLOR_GREEN ) );
298   DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::COLOR_BLUE ) );
299   DALI_TEST_CHECK( true == actor.IsPropertyWritable( Actor::COLOR_ALPHA ) );
300
301   // World-properties are not writable:
302   DALI_TEST_CHECK( false == actor.IsPropertyWritable( Actor::WORLD_POSITION ) );
303   DALI_TEST_CHECK( false == actor.IsPropertyWritable( Actor::WORLD_ROTATION ) );
304   DALI_TEST_CHECK( false == actor.IsPropertyWritable( Actor::WORLD_SCALE ) );
305   DALI_TEST_CHECK( false == actor.IsPropertyWritable( Actor::WORLD_COLOR ) );
306   DALI_TEST_CHECK( false == actor.IsPropertyWritable( Actor::WORLD_POSITION_X ) );
307   DALI_TEST_CHECK( false == actor.IsPropertyWritable( Actor::WORLD_POSITION_Y ) );
308   DALI_TEST_CHECK( false == actor.IsPropertyWritable( Actor::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::PARENT_ORIGIN ) );
322   DALI_TEST_CHECK( false == actor.IsPropertyAnimatable( Actor::PARENT_ORIGIN_X ) );
323   DALI_TEST_CHECK( false == actor.IsPropertyAnimatable( Actor::PARENT_ORIGIN_Y ) );
324   DALI_TEST_CHECK( false == actor.IsPropertyAnimatable( Actor::PARENT_ORIGIN_Z ) );
325   DALI_TEST_CHECK( false == actor.IsPropertyAnimatable( Actor::ANCHOR_POINT ) );
326   DALI_TEST_CHECK( false == actor.IsPropertyAnimatable( Actor::ANCHOR_POINT_X ) );
327   DALI_TEST_CHECK( false == actor.IsPropertyAnimatable( Actor::ANCHOR_POINT_Y ) );
328   DALI_TEST_CHECK( false == actor.IsPropertyAnimatable( Actor::ANCHOR_POINT_Z ) );
329   DALI_TEST_CHECK( true == actor.IsPropertyAnimatable( Actor::SIZE ) );
330   DALI_TEST_CHECK( true == actor.IsPropertyAnimatable( Actor::SIZE_WIDTH  ) );
331   DALI_TEST_CHECK( true == actor.IsPropertyAnimatable( Actor::SIZE_HEIGHT ) );
332   DALI_TEST_CHECK( true == actor.IsPropertyAnimatable( Actor::SIZE_DEPTH  ) );
333   DALI_TEST_CHECK( true == actor.IsPropertyAnimatable( Actor::POSITION ) );
334   DALI_TEST_CHECK( true == actor.IsPropertyAnimatable( Actor::POSITION_X ) );
335   DALI_TEST_CHECK( true == actor.IsPropertyAnimatable( Actor::POSITION_Y ) );
336   DALI_TEST_CHECK( true == actor.IsPropertyAnimatable( Actor::POSITION_Z ) );
337   DALI_TEST_CHECK( true == actor.IsPropertyAnimatable( Actor::ROTATION ) );
338   DALI_TEST_CHECK( true == actor.IsPropertyAnimatable( Actor::SCALE ) );
339   DALI_TEST_CHECK( true == actor.IsPropertyAnimatable( Actor::SCALE_X ) );
340   DALI_TEST_CHECK( true == actor.IsPropertyAnimatable( Actor::SCALE_Y ) );
341   DALI_TEST_CHECK( true == actor.IsPropertyAnimatable( Actor::SCALE_Z ) );
342   DALI_TEST_CHECK( true == actor.IsPropertyAnimatable( Actor::VISIBLE ) );
343   DALI_TEST_CHECK( true == actor.IsPropertyAnimatable( Actor::COLOR ) );
344   DALI_TEST_CHECK( true == actor.IsPropertyAnimatable( Actor::COLOR_RED ) );
345   DALI_TEST_CHECK( true == actor.IsPropertyAnimatable( Actor::COLOR_GREEN ) );
346   DALI_TEST_CHECK( true == actor.IsPropertyAnimatable( Actor::COLOR_BLUE ) );
347   DALI_TEST_CHECK( true == actor.IsPropertyAnimatable( Actor::COLOR_ALPHA ) );
348
349   // World-properties can not be animated
350   DALI_TEST_CHECK( false == actor.IsPropertyAnimatable( Actor::WORLD_POSITION ) );
351   DALI_TEST_CHECK( false == actor.IsPropertyAnimatable( Actor::WORLD_ROTATION ) );
352   DALI_TEST_CHECK( false == actor.IsPropertyAnimatable( Actor::WORLD_SCALE ) );
353   DALI_TEST_CHECK( false == actor.IsPropertyAnimatable( Actor::WORLD_COLOR ) );
354   DALI_TEST_CHECK( false == actor.IsPropertyAnimatable( Actor::WORLD_POSITION_X ) );
355   DALI_TEST_CHECK( false == actor.IsPropertyAnimatable( Actor::WORLD_POSITION_Y ) );
356   DALI_TEST_CHECK( false == actor.IsPropertyAnimatable( Actor::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::PARENT_ORIGIN ) );
369   DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::PARENT_ORIGIN_X ) );
370   DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::PARENT_ORIGIN_Y ) );
371   DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::PARENT_ORIGIN_Z ) );
372   DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::ANCHOR_POINT ) );
373   DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::ANCHOR_POINT_X ) );
374   DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::ANCHOR_POINT_Y ) );
375   DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::ANCHOR_POINT_Z ) );
376   DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::SIZE ) );
377   DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::SIZE_WIDTH  ) );
378   DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::SIZE_HEIGHT ) );
379   DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::SIZE_DEPTH  ) );
380   DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::POSITION ) );
381   DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::POSITION_X ) );
382   DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::POSITION_Y ) );
383   DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::POSITION_Z ) );
384   DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::ROTATION ) );
385   DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::SCALE ) );
386   DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::SCALE_X ) );
387   DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::SCALE_Y ) );
388   DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::SCALE_Z ) );
389   DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::VISIBLE ) );
390   DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::COLOR ) );
391   DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::COLOR_RED ) );
392   DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::COLOR_GREEN ) );
393   DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::COLOR_BLUE ) );
394   DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::COLOR_ALPHA ) );
395   DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::WORLD_POSITION ) );
396   DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::WORLD_ROTATION ) );
397   DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::WORLD_SCALE ) );
398   DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::WORLD_COLOR ) );
399   DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::WORLD_POSITION_X ) );
400   DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::WORLD_POSITION_Y ) );
401   DALI_TEST_CHECK( true == actor.IsPropertyAConstraintInput( Actor::WORLD_POSITION_Z ) );
402
403   // Actor properties that cannot be used as a constraint input
404   DALI_TEST_CHECK( false == actor.IsPropertyAConstraintInput( Actor::NAME ) );
405   DALI_TEST_CHECK( false == actor.IsPropertyAConstraintInput( Actor::SENSITIVE ) );
406   DALI_TEST_CHECK( false == actor.IsPropertyAConstraintInput( Actor::LEAVE_REQUIRED ) );
407   DALI_TEST_CHECK( false == actor.IsPropertyAConstraintInput( Actor::INHERIT_SHADER_EFFECT ) );
408   DALI_TEST_CHECK( false == actor.IsPropertyAConstraintInput( Actor::INHERIT_ROTATION ) );
409   DALI_TEST_CHECK( false == actor.IsPropertyAConstraintInput( Actor::INHERIT_SCALE ) );
410   DALI_TEST_CHECK( false == actor.IsPropertyAConstraintInput( Actor::COLOR_MODE ) );
411   DALI_TEST_CHECK( false == actor.IsPropertyAConstraintInput( Actor::POSITION_INHERITANCE ) );
412   DALI_TEST_CHECK( false == actor.IsPropertyAConstraintInput( Actor::DRAW_MODE ) );
413
414   END_TEST;
415 }
416
417
418 int UtcDaliHandleGetPropertyType(void)
419 {
420   tet_infoline("Positive Test Dali::Handle::GetPropertyType()");
421   TestApplication application;
422   unsigned int unsingedIntTest = 33;
423
424   Actor actor = Actor::New();
425   DALI_TEST_CHECK( Property::VECTOR3  == actor.GetPropertyType( Actor::PARENT_ORIGIN ) );
426   DALI_TEST_CHECK( Property::VECTOR3  == actor.GetPropertyType( Actor::ANCHOR_POINT ) );
427   DALI_TEST_CHECK( Property::VECTOR3  == actor.GetPropertyType( Actor::SIZE ) );
428   DALI_TEST_CHECK( Property::VECTOR3  == actor.GetPropertyType( Actor::POSITION ) );
429   DALI_TEST_CHECK( Property::ROTATION == actor.GetPropertyType( Actor::ROTATION ) );
430   DALI_TEST_CHECK( Property::VECTOR3  == actor.GetPropertyType( Actor::SCALE ) );
431   DALI_TEST_CHECK( Property::BOOLEAN  == actor.GetPropertyType( Actor::VISIBLE ) );
432   DALI_TEST_CHECK( Property::VECTOR4  == actor.GetPropertyType( Actor::COLOR ) );
433
434   // Register some dynamic properties
435   Property::Index boolIndex     = actor.RegisterProperty( "bool-property",     bool(true) );
436   Property::Index floatIndex    = actor.RegisterProperty( "float-property",    float(123.0f) );
437   Property::Index vector2Index  = actor.RegisterProperty( "vector2-property",  Vector2(1.0f, 2.0f) );
438   Property::Index vector3Index  = actor.RegisterProperty( "vector3-property",  Vector3(1.0f, 2.0f, 3.0f) );
439   Property::Index vector4Index  = actor.RegisterProperty( "vector4-property",  Vector4(1.0f, 2.0f, 3.0f, 4.0f) );
440   Property::Index rotationIndex = actor.RegisterProperty( "rotation-property", 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::VECTOR2  == actor.GetPropertyType( vector2Index ) );
445   DALI_TEST_CHECK( Property::VECTOR3  == actor.GetPropertyType( vector3Index ) );
446   DALI_TEST_CHECK( Property::VECTOR4  == actor.GetPropertyType( vector4Index ) );
447   DALI_TEST_CHECK( Property::ROTATION == actor.GetPropertyType( rotationIndex ) );
448
449   // Non animatable properties
450   Property::Index nonAnimStringIndex = actor.RegisterProperty( "man-from-delmonte", std::string("yes"), Property::READ_WRITE);
451   Property::Index nonAnimV2Index = actor.RegisterProperty( "v2", Vector2(1.f, 2.f), Property::READ_WRITE);
452   Property::Index nonAnimV3Index = actor.RegisterProperty( "v3", Vector3(1.f, 2.f, 3.f), Property::READ_WRITE);
453   Property::Index nonAnimV4Index = actor.RegisterProperty( "v4", Vector4(1.f, 2.f, 3.f, 4.f), Property::READ_WRITE);
454   Property::Index nonAnimBooleanIndex = actor.RegisterProperty( "bool", true, Property::READ_WRITE);
455   Property::Index nonAnimFloatIndex = actor.RegisterProperty( "float", 0.f, Property::READ_WRITE);
456   Property::Index nonAnimUnsignedIntIndex = actor.RegisterProperty( "unsinged-int", unsingedIntTest, Property::READ_WRITE);
457
458   DALI_TEST_CHECK( nonAnimStringIndex  != Property::INVALID_INDEX );
459   DALI_TEST_CHECK( nonAnimV2Index      != Property::INVALID_INDEX );
460   DALI_TEST_CHECK( nonAnimV3Index      != Property::INVALID_INDEX );
461   DALI_TEST_CHECK( nonAnimV4Index      != Property::INVALID_INDEX );
462   DALI_TEST_CHECK( nonAnimBooleanIndex != Property::INVALID_INDEX );
463   DALI_TEST_CHECK( nonAnimFloatIndex   != Property::INVALID_INDEX );
464   DALI_TEST_CHECK( nonAnimUnsignedIntIndex != Property::INVALID_INDEX );
465
466   DALI_TEST_CHECK( Property::STRING   == actor.GetPropertyType( nonAnimStringIndex ) );
467   DALI_TEST_CHECK( Property::VECTOR2  == actor.GetPropertyType( nonAnimV2Index ) );
468   DALI_TEST_CHECK( Property::VECTOR3  == actor.GetPropertyType( nonAnimV3Index ) );
469   DALI_TEST_CHECK( Property::VECTOR4  == actor.GetPropertyType( nonAnimV4Index ) );
470   DALI_TEST_CHECK( Property::BOOLEAN  == actor.GetPropertyType( nonAnimBooleanIndex ) );
471   DALI_TEST_CHECK( Property::FLOAT    == actor.GetPropertyType( nonAnimFloatIndex ) );
472   DALI_TEST_CHECK( Property::UNSIGNED_INTEGER == actor.GetPropertyType( nonAnimUnsignedIntIndex ) );
473
474   DALI_TEST_CHECK( !actor.IsPropertyAnimatable( nonAnimStringIndex ) );
475   DALI_TEST_CHECK( !actor.IsPropertyAnimatable( nonAnimV2Index ) );
476   DALI_TEST_CHECK( !actor.IsPropertyAnimatable( nonAnimV3Index ) );
477   DALI_TEST_CHECK( !actor.IsPropertyAnimatable( nonAnimV4Index ) );
478   DALI_TEST_CHECK( !actor.IsPropertyAnimatable( nonAnimBooleanIndex ) );
479   DALI_TEST_CHECK( !actor.IsPropertyAnimatable( nonAnimFloatIndex ) );
480   DALI_TEST_CHECK( !actor.IsPropertyAnimatable( nonAnimUnsignedIntIndex ) );
481
482   DALI_TEST_EQUALS( "yes" , actor.GetProperty( nonAnimStringIndex ).Get<std::string>(), TEST_LOCATION );
483   DALI_TEST_EQUALS( Vector2(1.f, 2.f) , actor.GetProperty( nonAnimV2Index ).Get<Vector2>(), TEST_LOCATION );
484   DALI_TEST_EQUALS( Vector3(1.f, 2.f, 3.f) , actor.GetProperty( nonAnimV3Index ).Get<Vector3>(), TEST_LOCATION );
485   DALI_TEST_EQUALS( Vector4(1.f, 2.f, 3.f, 4.f) , actor.GetProperty( nonAnimV4Index ).Get<Vector4>(), TEST_LOCATION );
486   DALI_TEST_EQUALS( true, actor.GetProperty( nonAnimBooleanIndex ).Get<bool>(), TEST_LOCATION );
487   DALI_TEST_EQUALS( 0.f, actor.GetProperty( nonAnimFloatIndex ).Get<float>(), TEST_LOCATION );
488   DALI_TEST_EQUALS( unsingedIntTest, actor.GetProperty( nonAnimUnsignedIntIndex ).Get<unsigned int>(), TEST_LOCATION );
489
490   END_TEST;
491 }
492
493 int UtcDaliHandleNonAnimtableProperties(void)
494 {
495   tet_infoline("Test Non Animatable Properties");
496   TestApplication application;
497
498   Actor actor = Actor::New();
499
500   Property::Index nonAnimStringIndex = actor.RegisterProperty( "man-from-delmonte", std::string("no"), Property::READ_WRITE);
501
502   //// modify writable?
503   try
504   {
505     actor.SetProperty( nonAnimStringIndex, Property::Value("yes") );
506   }
507   catch (Dali::DaliException& e)
508   {
509     DALI_TEST_CHECK(!"exception");
510   }
511
512   DALI_TEST_CHECK( "yes"  == actor.GetProperty( nonAnimStringIndex ).Get<std::string>() );
513
514   //// cannot modify read only?
515   Property::Index readonly = actor.RegisterProperty( "float", 0.f, Property::READ_ONLY);
516
517   DALI_TEST_CHECK(!actor.IsPropertyAnimatable(readonly));
518   DALI_TEST_CHECK(!actor.IsPropertyWritable(readonly));
519
520   bool exception = false;
521   try
522   {
523     actor.SetProperty( readonly, Property::Value(1.f) );
524   }
525   catch (Dali::DaliException& e)
526   {
527     exception = true;
528   }
529
530   DALI_TEST_CHECK(exception);
531
532   DALI_TEST_EQUALS( 0.f, actor.GetProperty( readonly ).Get<float>(), TEST_LOCATION );
533
534   /// animatable can be set
535   Property::Index write_anim = actor.RegisterProperty( "write_float", 0.f, Property::ANIMATABLE);
536
537   DALI_TEST_CHECK(actor.IsPropertyAnimatable(write_anim));
538   DALI_TEST_CHECK(actor.IsPropertyWritable(write_anim));
539
540   exception = false;
541   try
542   {
543     actor.SetProperty( write_anim, Property::Value(1.f) );
544   }
545   catch (Dali::DaliException& e)
546   {
547     exception = true;
548   }
549
550   DALI_TEST_CHECK(!exception);
551
552   //// animate a non animatable property is a noop?
553   float durationSeconds(2.0f);
554   Animation animation = Animation::New(durationSeconds);
555   bool relativeValue(true);
556
557   exception = false;
558
559   try
560   {
561     animation.AnimateBy(Property(actor, nonAnimStringIndex), relativeValue, AlphaFunctions::EaseIn);
562     animation.Play();
563     application.SendNotification();
564     application.Render(static_cast<unsigned int>(durationSeconds*0100.0f)/* some progress */);
565   }
566   catch (Dali::DaliException& e)
567   {
568     exception = true;
569   }
570
571   DALI_TEST_CHECK(!exception);
572   DALI_TEST_EQUALS( "yes", actor.GetProperty( nonAnimStringIndex ).Get<std::string>(), TEST_LOCATION );
573
574   END_TEST;
575 }
576
577 int UtcDaliHandleNonAnimtableCompositeProperties(void)
578 {
579   tet_infoline("Test Non Animatable Composite Properties");
580   TestApplication application;
581
582   Actor actor = Actor::New();
583
584   Property::Value value(Property::ARRAY);
585   Property::Array anArray;
586   DALI_TEST_CHECK( Property::Value(anArray).GetType() == Property::ARRAY ); // 2nd constructor
587
588   value.AppendItem( Property::Value( 0.f ) );
589   value.AppendItem( "a string" );
590   value.SetItem(0, Property::Value( 5.f )); // exercise SetItem
591
592   int index = value.AppendItem( Vector3(1,2,3) );
593
594   DALI_TEST_EQUALS( 2, index, TEST_LOCATION);
595   DALI_TEST_EQUALS( 3, value.GetSize(), TEST_LOCATION);
596
597   Property::Index propertyIndex = actor.RegisterProperty( "composite", value, Property::READ_WRITE);
598
599   Property::Value out = actor.GetProperty( propertyIndex );
600
601   DALI_TEST_CHECK( Property::FLOAT     == out.GetItem(0).GetType());
602   DALI_TEST_CHECK( Property::STRING    == out.GetItem(1).GetType());
603   DALI_TEST_CHECK( Property::VECTOR3   == out.GetItem(2).GetType());
604
605   DALI_TEST_EQUALS( 5.f,            out.GetItem(0).Get<float>(),        TEST_LOCATION);
606   DALI_TEST_EQUALS( "a string",     out.GetItem(1).Get<std::string>(),  TEST_LOCATION);
607   DALI_TEST_EQUALS( Vector3(1,2,3), out.GetItem(2).Get<Vector3>(),      TEST_LOCATION);
608
609   // Property Maps
610   Property::Value valueMap(Property::MAP);
611   Property::Map aKindofMap;
612   DALI_TEST_CHECK( Property::Value(aKindofMap).GetType() == Property::MAP ); // 2nd constructor
613
614   valueMap.SetValue("key", 5.f);
615   valueMap.SetValue("2key", "a string");
616
617   DALI_TEST_EQUALS( true, valueMap.HasKey("key"),         TEST_LOCATION);
618   DALI_TEST_EQUALS( "key", valueMap.GetKey(0),           TEST_LOCATION);
619
620   DALI_TEST_EQUALS( true, valueMap.HasKey("2key"),       TEST_LOCATION);
621   DALI_TEST_EQUALS( "2key", valueMap.GetKey(1),          TEST_LOCATION);
622
623   DALI_TEST_EQUALS( 5.f,         valueMap.GetValue("key").Get<float>(),         TEST_LOCATION);
624   DALI_TEST_EQUALS( "a string",  valueMap.GetValue("2key").Get<std::string>(),  TEST_LOCATION);
625
626   valueMap.SetItem(0, Property::Value("a string"));
627   valueMap.SetItem(1, Property::Value(5.f));
628
629   DALI_TEST_EQUALS( 5.f,         valueMap.GetValue("2key").Get<float>(),         TEST_LOCATION);
630   DALI_TEST_EQUALS( "a string",  valueMap.GetValue("key").Get<std::string>(),  TEST_LOCATION);
631
632   // ordered map
633   valueMap = Property::Value(Property::MAP);
634
635   valueMap.SetValue("key", 5.f);
636   valueMap.SetValue("2key", "a string");
637
638   DALI_TEST_EQUALS( 5.f,         valueMap.GetItem(0).Get<float>(),         TEST_LOCATION);
639   DALI_TEST_EQUALS( "a string",  valueMap.GetItem(1).Get<std::string>(),   TEST_LOCATION);
640
641   DALI_TEST_EQUALS( 2, valueMap.GetSize(), TEST_LOCATION);
642
643   // composite types not animatable
644   bool exception = false;
645   try
646   {
647     /* Property::Index mapPropertyIndex = */ actor.RegisterProperty( "compositemap", value, Property::ANIMATABLE);
648   }
649   catch (Dali::DaliException& e)
650   {
651     exception = true;
652     tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
653   }
654
655   DALI_TEST_EQUALS(exception, true, TEST_LOCATION);
656
657   // Map of maps
658   Property::Value mapOfMaps(Property::MAP);
659
660   mapOfMaps.SetValue( "key", Property::Value(Property::MAP) );
661   mapOfMaps.SetValue( "2key", "a string" );
662
663   DALI_TEST_EQUALS( "a string",  mapOfMaps.GetValue("2key").Get<std::string>(),  TEST_LOCATION);
664
665   mapOfMaps.GetValue("key").SetValue("subkey", 5.f);
666
667   DALI_TEST_EQUALS( true, mapOfMaps.GetValue("key").HasKey("subkey"), TEST_LOCATION);
668   DALI_TEST_EQUALS( 5.f, mapOfMaps.GetValue("key").GetValue("subkey").Get<float>(), TEST_LOCATION);
669
670   // list of maps
671   Property::Value listOfMaps(Property::ARRAY);
672
673   listOfMaps.AppendItem( Property::Value(Property::MAP) );
674   listOfMaps.AppendItem( Property::Value(Property::MAP) );
675
676   listOfMaps.GetItem(0).SetValue("key", 5.f);
677   listOfMaps.GetItem(1).SetValue("key",10.f);
678
679   DALI_TEST_EQUALS( 5.f, listOfMaps.GetItem(0).GetValue("key").Get<float>(), TEST_LOCATION );
680   DALI_TEST_EQUALS( 10.f, listOfMaps.GetItem(1).GetValue("key").Get<float>(), TEST_LOCATION );
681
682   END_TEST;
683 }
684
685 int UtcDaliHandleSetProperty01(void)
686 {
687   tet_infoline("Positive Test Dali::Handle::SetProperty()");
688   TestApplication application;
689
690   Actor actor = Actor::New();
691   DALI_TEST_CHECK( ParentOrigin::TOP_LEFT == actor.GetProperty( Actor::PARENT_ORIGIN ).Get<Vector3>() );
692
693   actor.SetProperty( Actor::PARENT_ORIGIN, ParentOrigin::CENTER );
694   // flush the queue and render once
695   application.SendNotification();
696   application.Render();
697   DALI_TEST_CHECK( ParentOrigin::CENTER == actor.GetProperty( Actor::PARENT_ORIGIN ).Get<Vector3>() );
698   END_TEST;
699 }
700
701 int UtcDaliHandleSetProperty02(void)
702 {
703   tet_infoline("Positive Test Dali::Handle::SetProperty()");
704   TestApplication application;
705
706   Actor actor = Actor::New();
707
708   DALI_TEST_CHECK( !actor.IsPropertyWritable( Actor::WORLD_POSITION ) );
709
710   try
711   {
712     // World position is not writable
713     actor.SetProperty( Actor::WORLD_POSITION, Vector3(1,2,3) );
714   }
715   catch (Dali::DaliException& e)
716   {
717     tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
718     DALI_TEST_ASSERT(e, "IsDefaultPropertyWritable(index) && \"Property is read-only\"", TEST_LOCATION);
719   }
720
721   END_TEST;
722 }
723
724 int UtcDaliHandleRegisterProperty(void)
725 {
726   tet_infoline("Positive Test Dali::Handle::RegisterProperty()");
727   TestApplication application;
728
729   Actor actor = Actor::New();
730   DALI_TEST_CHECK( ParentOrigin::TOP_LEFT == actor.GetProperty( Actor::PARENT_ORIGIN ).Get<Vector3>() );
731
732   END_TEST;
733 }
734
735 int UtcDaliHandleGetProperty(void)
736 {
737   tet_infoline("Positive Test Dali::Handle::GetProperty()");
738   TestApplication application;
739
740   Actor actor = Actor::New();
741
742   DALI_TEST_CHECK( ParentOrigin::TOP_LEFT == actor.GetProperty( Actor::PARENT_ORIGIN   ).Get<Vector3>() );
743   DALI_TEST_CHECK( AnchorPoint::CENTER    == actor.GetProperty( Actor::ANCHOR_POINT    ).Get<Vector3>() );
744   DALI_TEST_CHECK( Vector3::ZERO          == actor.GetProperty( Actor::SIZE            ).Get<Vector3>() );
745   DALI_TEST_CHECK( Vector3::ZERO          == actor.GetProperty( Actor::POSITION        ).Get<Vector3>() );
746   DALI_TEST_CHECK( Vector3::ONE           == actor.GetProperty( Actor::SCALE           ).Get<Vector3>() );
747   DALI_TEST_CHECK( true                   == actor.GetProperty( Actor::VISIBLE         ).Get<bool>() );
748   DALI_TEST_CHECK( Color::WHITE           == actor.GetProperty( Actor::COLOR           ).Get<Vector4>() );
749   END_TEST;
750 }
751
752 int UtcDaliHandleDownCast(void)
753 {
754   TestApplication application;
755   tet_infoline("Testing Dali::Handle::DownCast()");
756
757   Actor actor = Actor::New();
758
759   BaseHandle baseHandle = actor;
760
761   Handle handle = Handle::DownCast(baseHandle);
762
763   DALI_TEST_CHECK( handle );
764
765   baseHandle = BaseHandle();
766
767   handle = Handle::DownCast(baseHandle);
768
769   DALI_TEST_CHECK( !handle );
770
771   END_TEST;
772 }
773
774 int UtcDaliHandleCreateProperty(void)
775 {
776   TestApplication application;
777   tet_infoline("Testing PropertyTypes::GetName()");
778
779   Property::Type type = Property::NONE;
780   CheckTypeName(type);
781   // Value(Value&) ctor and Value(Type&) ctor
782   DALI_TEST_CHECK( Property::Value(Property::Value(type)).GetType() == type );
783   DALI_TEST_CHECK( Property::NONE == type );
784
785   // PropertyTypes
786   type = Property::BOOLEAN;
787   CheckTypeName(type);
788   DALI_TEST_CHECK( Property::Value(Property::Value(type)).GetType() == type );
789   DALI_TEST_CHECK( PropertyTypes::Get<bool>()            == type );
790
791   type = Property::FLOAT;
792   CheckTypeName(type);
793   DALI_TEST_CHECK( Property::Value(Property::Value(type)).GetType() == type );
794   DALI_TEST_CHECK( PropertyTypes::Get<float>()           == type );
795
796   type = Property::INTEGER;
797   CheckTypeName(type);
798   DALI_TEST_CHECK( Property::Value(Property::Value(type)).GetType() == type );
799   DALI_TEST_CHECK( PropertyTypes::Get<int>()             == type );
800
801   type = Property::UNSIGNED_INTEGER;
802   CheckTypeName(type);
803   DALI_TEST_CHECK( Property::Value(Property::Value(type)).GetType() == type );
804   DALI_TEST_CHECK( PropertyTypes::Get<unsigned int>()    == type );
805
806   type = Property::VECTOR2;
807   CheckTypeName(type);
808   DALI_TEST_CHECK( Property::Value(Property::Value(type)).GetType() == type );
809   DALI_TEST_CHECK( PropertyTypes::Get<Vector2>()         == type );
810
811   type = Property::VECTOR3;
812   CheckTypeName(type);
813   DALI_TEST_CHECK( Property::Value(Property::Value(type)).GetType() == type );
814   DALI_TEST_CHECK( PropertyTypes::Get<Vector3>()         == type );
815
816   type = Property::VECTOR4;
817   CheckTypeName(type);
818   DALI_TEST_CHECK( Property::Value(Property::Value(type)).GetType() == type );
819   DALI_TEST_CHECK( PropertyTypes::Get<Vector4>()         == type );
820
821   type = Property::MATRIX3;
822   CheckTypeName(type);
823   DALI_TEST_CHECK( Property::Value(Property::Value(type)).GetType() == type );
824   DALI_TEST_CHECK( PropertyTypes::Get<Matrix3>()         == type );
825
826   type = Property::MATRIX;
827   CheckTypeName(type);
828   DALI_TEST_CHECK( Property::Value(Property::Value(type)).GetType() == type );
829   DALI_TEST_CHECK( PropertyTypes::Get<Matrix>()          == type );
830
831   typedef Dali::Rect<int> Rectangle;
832   type = Property::RECTANGLE;
833   CheckTypeName(type);
834   DALI_TEST_CHECK( Property::Value(Property::Value(type)).GetType() == type );
835   DALI_TEST_CHECK( PropertyTypes::Get<Rectangle>()       == type );
836
837   type = Property::ROTATION;
838   CheckTypeName(type);
839   DALI_TEST_CHECK( Property::Value(Property::Value(type)).GetType() == type );
840   DALI_TEST_CHECK( PropertyTypes::Get<Quaternion>()      == type );
841
842   type = Property::ROTATION;
843   CheckTypeName(type);
844   DALI_TEST_CHECK( Property::Value(Property::Value(type)).GetType() == type );
845   DALI_TEST_CHECK( PropertyTypes::Get<AngleAxis>()       == type );
846
847   type = Property::STRING;
848   CheckTypeName(type);
849   DALI_TEST_CHECK( Property::Value(Property::Value(type)).GetType() == type );
850   DALI_TEST_CHECK( PropertyTypes::Get<std::string>()     == type );
851
852   type = Property::ARRAY;
853   CheckTypeName(type);
854   DALI_TEST_CHECK( Property::Value(Property::Value(type)).GetType() == type );
855   DALI_TEST_CHECK( PropertyTypes::Get<Property::Array>() == type );
856
857   type = Property::MAP;
858   CheckTypeName(type);
859   DALI_TEST_CHECK( Property::Value(Property::Value(type)).GetType() == type );
860   DALI_TEST_CHECK( PropertyTypes::Get<Property::Map>()   == type );
861   END_TEST;
862 }
863
864 int UtcDaliHandleGetPropertyGet(void)
865 {
866   TestApplication application;
867   tet_infoline("Testing PropertyTypes::GetName()");
868
869   Property::Value value;
870
871   bool b = false;
872   value = Property::Value(true);
873   value.Get(b);
874   DALI_TEST_CHECK( true == b );
875
876   float f = 5.f;
877   value = Property::Value(10.f);
878   value.Get(f);
879   DALI_TEST_CHECK( Dali::Equals(10.f, f) );
880
881   int i = 5;
882   value = Property::Value(10);
883   value.Get(i);
884   DALI_TEST_CHECK( 10 == i );
885
886   unsigned int ui = 5;
887   value = Property::Value(10U);
888   value.Get(ui);
889   DALI_TEST_CHECK( 10 == ui );
890
891   Vector2 v2 = Vector2(0,0);
892   value = Property::Value( Vector2(1,1) );
893   value.Get(v2);
894   DALI_TEST_CHECK( Vector2(1,1) == v2 );
895
896   Vector3 v3 = Vector3(0.f,0.f,0.f);
897   value = Property::Value( Vector3(1.f,1.f,1.f) );
898   value.Get(v3);
899   DALI_TEST_CHECK( Vector3(1.f,1.f,1.f) == v3 );
900
901   Vector4 v4 = Vector4(0,0,0,0);
902   value = Property::Value( Vector4(1,1,1,1) );
903   value.Get(v4);
904   DALI_TEST_CHECK( Vector4(1,1,1,1) == v4 );
905
906   Matrix3 m3 = Matrix3(0.f,0.f,0.f,0.f,0.f,0.f,0.f,0.f,0.f);
907   value = Property::Value( Matrix3::IDENTITY );
908   value.Get(m3);
909   DALI_TEST_CHECK( Matrix3::IDENTITY == m3 );
910
911   Matrix m = Matrix(true);
912   value = Property::Value( Matrix::IDENTITY );
913   value.Get(m);
914   DALI_TEST_CHECK( Matrix::IDENTITY == m );
915
916   typedef Dali::Rect<int> Rectangle;
917   Rectangle r = Rectangle(0,0,0,0);
918   value = Property::Value( Rectangle(1,1,1,1) );
919   value.Get(r);
920   DALI_TEST_CHECK( Rectangle(1,1,1,1) == r );
921
922   Quaternion q = Quaternion(0,0,0,0);
923   value = Property::Value( Quaternion(1,1,1,1) );
924   value.Get(q);
925   DALI_TEST_CHECK( Quaternion(1,1,1,1) == q );
926
927   AngleAxis aa = AngleAxis( Degree(0), Vector3(0.f,0.f,0.f) );
928   value = Property::Value( AngleAxis( Radian(Math::PI_2), Vector3::XAXIS  ));
929   value.Get(aa);
930   Quaternion r8(Radian(Degree(aa.angle)), aa.axis);
931   DALI_TEST_EQUALS(r8, Quaternion(Math::PI_2, Vector3::XAXIS), 0.001, TEST_LOCATION);
932
933   std::string s = "no";
934   value = Property::Value("yes");
935   value.Get(s);
936   DALI_TEST_CHECK( "yes" == s );
937
938   Property::Array array;
939   value = Property::Value(Property::ARRAY);
940   value.AppendItem(10);
941   value.Get(array);
942   int getItem = 0;
943   array[0].Get(getItem);
944   DALI_TEST_CHECK( getItem == 10 );
945
946   Property::Map map;
947   value = Property::Value(Property::MAP);
948   value.SetValue("key", "value");
949   value.Get(map);
950   DALI_TEST_CHECK( map[0].first == "key" );
951
952   END_TEST;
953 }
954
955 int UtcDaliHandleGetPropertyIndices(void)
956 {
957   TestApplication application;
958   Property::IndexContainer indices;
959
960   // Actor
961   Actor actor = Actor::New();
962   actor.GetPropertyIndices( indices );
963   DALI_TEST_CHECK( ! indices.empty() );
964   DALI_TEST_EQUALS( indices.size(), actor.GetPropertyCount(), TEST_LOCATION );
965   END_TEST;
966 }