30ae43402b39319b56e8382468a481931a9c8231
[platform/core/uifw/dali-core.git] / automated-tests / src / dali-internal / utc-Dali-DynamicsBodyConfig.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-test-suite-utils.h>
23 #include <dali/devel-api/dynamics/dynamics.h>
24
25 using namespace Dali;
26
27
28 int UtcDaliDynamicsBodyConfigNew(void)
29 {
30 #if !defined(DYNAMICS_SUPPORT)
31   tet_infoline("No dynamics support compiled\n");
32   return 0;
33 #endif
34
35   tet_infoline("UtcDaliDynamicsBodyConfigNew - DynamicsBodyConfig::New()");
36
37   TestApplication application;
38
39   // start up
40   application.SendNotification();
41   application.Render();
42   application.Render();
43
44   DynamicsWorldConfig worldConfig(DynamicsWorldConfig::New());
45   DynamicsWorld world( Stage::GetCurrent().InitializeDynamics(worldConfig) );
46
47   if( !world )
48   {
49     // cannot create dynamics world, log failure and exit
50     DALI_TEST_CHECK( false );
51     END_TEST;
52   }
53
54   DynamicsBodyConfig config(DynamicsBodyConfig::New());
55
56   DALI_TEST_CHECK( config );
57   END_TEST;
58 }
59
60 int UtcDaliDynamicsBodyConfigConstructor(void)
61 {
62 #if !defined(DYNAMICS_SUPPORT)
63   tet_infoline("No dynamics support compiled\n");
64   return 0;
65 #endif
66   tet_infoline("UtcDaliDynamicsBodyConfigConstructor - DynamicsBodyConfig::DynamicsBodyConfig()");
67
68   TestApplication application;
69
70   // start up
71   application.SendNotification();
72   application.Render();
73   application.Render();
74
75   // Default constructor - create an uninitialized handle
76   DynamicsBodyConfig config;
77
78   DALI_TEST_CHECK( !config );
79
80   DynamicsWorldConfig worldConfig(DynamicsWorldConfig::New());
81   DynamicsWorld world( Stage::GetCurrent().InitializeDynamics(worldConfig) );
82
83   if( !world )
84   {
85     // cannot create dynamics world, log failure and exit
86     DALI_TEST_CHECK( false );
87     END_TEST;
88   }
89
90   // initialize handle
91   config = DynamicsBodyConfig::New();
92
93   DALI_TEST_CHECK( config );
94   END_TEST;
95 }
96
97 int UtcDaliDynamicsBodyConfigType(void)
98 {
99 #if !defined(DYNAMICS_SUPPORT)
100   tet_infoline("No dynamics support compiled\n");
101   return 0;
102 #endif
103   TestApplication application;
104
105   // start up
106   application.SendNotification();
107   application.Render();
108   application.Render();
109
110   DynamicsWorldConfig worldConfig(DynamicsWorldConfig::New());
111   DynamicsWorld world( Stage::GetCurrent().InitializeDynamics(worldConfig) );
112
113   if( !world )
114   {
115     // cannot create dynamics world, log failure and exit
116     DALI_TEST_CHECK( false );
117     END_TEST;
118   }
119
120   DynamicsBodyConfig config(DynamicsBodyConfig::New());
121
122   tet_infoline("UtcDaliDynamicsBodyConfigType - DynamicsBodyConfig::GetType");
123   DALI_TEST_CHECK( DynamicsBodyConfig::RIGID == config.GetType() );
124
125   tet_infoline("UtcDaliDynamicsBodyConfigType - DynamicsBodyConfig::SetType(const BodyType)");
126   config.SetType( DynamicsBodyConfig::SOFT );
127   DALI_TEST_CHECK( DynamicsBodyConfig::SOFT == config.GetType() );
128   END_TEST;
129 }
130
131 int UtcDaliDynamicsBodyConfigSetShape01(void)
132 {
133 #if !defined(DYNAMICS_SUPPORT)
134   tet_infoline("No dynamics support compiled\n");
135   return 0;
136 #endif
137   tet_infoline("UtcDaliDynamicsBodyConfigSetShape01 - DynamicsBodyConfig::SetShape(const DynamicsShape::ShapeType,const Vector3&)");
138
139   TestApplication application;
140
141   // start up
142   application.SendNotification();
143   application.Render();
144   application.Render();
145
146   DynamicsWorldConfig worldConfig(DynamicsWorldConfig::New());
147   DynamicsWorld world( Stage::GetCurrent().InitializeDynamics(worldConfig) );
148
149   if( !world )
150   {
151     // cannot create dynamics world, log failure and exit
152     DALI_TEST_CHECK( false );
153     END_TEST;
154   }
155
156   DynamicsBodyConfig config(DynamicsBodyConfig::New());
157
158   DALI_TEST_CHECK( DynamicsShape::CUBE == config.GetShape().GetType() );
159
160   const float radius(1.5f);
161   config.SetShape(DynamicsShape::SPHERE, Vector3(radius, 0.0f, 0.0f));
162
163   DALI_TEST_CHECK( DynamicsShape::SPHERE == config.GetShape().GetType() );
164   END_TEST;
165 }
166
167 int UtcDaliDynamicsBodyConfigSetShape02(void)
168 {
169 #if !defined(DYNAMICS_SUPPORT)
170   tet_infoline("No dynamics support compiled\n");
171   return 0;
172 #endif
173   tet_infoline("UtcDaliDynamicsBodyConfigSetShape02 - DynamicsBodyConfig::SetShape(DynamicsShape)");
174
175   TestApplication application;
176
177   // start up
178   application.SendNotification();
179   application.Render();
180   application.Render();
181
182   DynamicsWorldConfig worldConfig(DynamicsWorldConfig::New());
183   DynamicsWorld world( Stage::GetCurrent().InitializeDynamics(worldConfig) );
184
185   if( !world )
186   {
187     // cannot create dynamics world, log failure and exit
188     DALI_TEST_CHECK( false );
189     END_TEST;
190   }
191
192   DynamicsBodyConfig config(DynamicsBodyConfig::New());
193
194   DALI_TEST_CHECK( DynamicsShape::CUBE == config.GetShape().GetType() );
195
196   const float radius(1.5f);
197   DynamicsShape shape(DynamicsShape::NewSphere(radius));
198   config.SetShape(shape);
199
200   DALI_TEST_CHECK( DynamicsShape::SPHERE == config.GetShape().GetType() );
201   END_TEST;
202 }
203
204 int UtcDaliDynamicsBodyConfigGetShape(void)
205 {
206 #if !defined(DYNAMICS_SUPPORT)
207   tet_infoline("No dynamics support compiled\n");
208   return 0;
209 #endif
210   tet_infoline("UtcDaliDynamicsBodyConfigGetShape - DynamicsBodyConfig::GetShape");
211
212   TestApplication application;
213
214   // start up
215   application.SendNotification();
216   application.Render();
217   application.Render();
218
219   DynamicsWorldConfig worldConfig(DynamicsWorldConfig::New());
220   DynamicsWorld world( Stage::GetCurrent().InitializeDynamics(worldConfig) );
221
222   if( !world )
223   {
224     // cannot create dynamics world, log failure and exit
225     DALI_TEST_CHECK( false );
226     END_TEST;
227   }
228
229   DynamicsBodyConfig config(DynamicsBodyConfig::New());
230
231   DALI_TEST_CHECK( DynamicsShape::CUBE == config.GetShape().GetType() );
232   END_TEST;
233 }
234
235 int UtcDaliDynamicsBodyConfigMass(void)
236 {
237 #if !defined(DYNAMICS_SUPPORT)
238   tet_infoline("No dynamics support compiled\n");
239   return 0;
240 #endif
241   TestApplication application;
242
243   // start up
244   application.SendNotification();
245   application.Render();
246   application.Render();
247
248   const float testMass = 1.23f;
249
250   DynamicsWorldConfig worldConfig(DynamicsWorldConfig::New());
251   DynamicsWorld world( Stage::GetCurrent().InitializeDynamics(worldConfig) );
252
253   if( !world )
254   {
255     // cannot create dynamics world, log failure and exit
256     DALI_TEST_CHECK( false );
257     END_TEST;
258   }
259
260   DynamicsBodyConfig config(DynamicsBodyConfig::New());
261   config.SetMass(testMass);
262
263   tet_infoline("UtcDaliDynamicsBodyConfigMass - DynamicsBodyConfig::GetMass");
264   DALI_TEST_EQUALS( testMass, config.GetMass(), Math::MACHINE_EPSILON_0, TEST_LOCATION );
265
266   tet_infoline("UtcDaliDynamicsBodyConfigMass - DynamicsBodyConfig::SetMass");
267   const float mass = config.GetMass() + 0.1f;
268   config.SetMass(mass);
269   DALI_TEST_EQUALS( mass, config.GetMass(), Math::MACHINE_EPSILON_0, TEST_LOCATION );
270   END_TEST;
271 }
272
273 int UtcDaliDynamicsBodyConfigElasticity(void)
274 {
275 #if !defined(DYNAMICS_SUPPORT)
276   tet_infoline("No dynamics support compiled\n");
277   return 0;
278 #endif
279   TestApplication application;
280
281   // start up
282   application.SendNotification();
283   application.Render();
284   application.Render();
285
286   const float testElasticity = 0.87f;
287
288   DynamicsWorldConfig worldConfig(DynamicsWorldConfig::New());
289   DynamicsWorld world( Stage::GetCurrent().InitializeDynamics(worldConfig) );
290
291   if( !world )
292   {
293     // cannot create dynamics world, log failure and exit
294     DALI_TEST_CHECK( false );
295     END_TEST;
296   }
297
298   DynamicsBodyConfig config(DynamicsBodyConfig::New());
299   config.SetElasticity(testElasticity);
300
301   tet_infoline("UtcDaliDynamicsBodyConfigElasticity- DynamicsBodyConfig::GetElasticity");
302   DALI_TEST_EQUALS( testElasticity, config.GetElasticity(), Math::MACHINE_EPSILON_0, TEST_LOCATION );
303
304   tet_infoline("UtcDaliDynamicsBodyConfigElasticity - DynamicsBodyConfig::SetElasticity");
305   const float elasticity = config.GetElasticity() + 0.1f;
306   config.SetElasticity(elasticity);
307   DALI_TEST_EQUALS( elasticity, config.GetElasticity(), Math::MACHINE_EPSILON_0, TEST_LOCATION );
308   END_TEST;
309 }
310
311 int UtcDaliDynamicsBodyConfigFriction(void)
312 {
313 #if !defined(DYNAMICS_SUPPORT)
314   tet_infoline("No dynamics support compiled\n");
315   return 0;
316 #endif
317   TestApplication application;
318
319   // start up
320   application.SendNotification();
321   application.Render();
322   application.Render();
323
324   const float testFriction= 0.87f;
325
326   DynamicsWorldConfig worldConfig(DynamicsWorldConfig::New());
327   DynamicsWorld world( Stage::GetCurrent().InitializeDynamics(worldConfig) );
328
329   if( !world )
330   {
331     // cannot create dynamics world, log failure and exit
332     DALI_TEST_CHECK( false );
333     END_TEST;
334   }
335
336   DynamicsBodyConfig config(DynamicsBodyConfig::New());
337   config.SetFriction(testFriction);
338
339   tet_infoline("UtcDaliDynamicsBodyConfigFriction - DynamicsBodyConfig::GetFriction");
340   DALI_TEST_EQUALS( testFriction, config.GetFriction(), Math::MACHINE_EPSILON_0, TEST_LOCATION );
341
342   tet_infoline("UtcDaliDynamicsBodyConfigFriction - DynamicsBodyConfig::SetFriction");
343   const float friction = config.GetFriction() + 0.1f;
344   config.SetFriction(friction);
345   DALI_TEST_EQUALS( friction, config.GetFriction(), Math::MACHINE_EPSILON_0, TEST_LOCATION );
346   END_TEST;
347 }
348
349 int UtcDaliDynamicsBodyConfigLinearDamping(void)
350 {
351 #if !defined(DYNAMICS_SUPPORT)
352   tet_infoline("No dynamics support compiled\n");
353   return 0;
354 #endif
355   TestApplication application;
356
357   // start up
358   application.SendNotification();
359   application.Render();
360   application.Render();
361
362   const float testDamping = 0.123f;
363
364   DynamicsWorldConfig worldConfig(DynamicsWorldConfig::New());
365   DynamicsWorld world( Stage::GetCurrent().InitializeDynamics(worldConfig) );
366
367   if( !world )
368   {
369     // cannot create dynamics world, log failure and exit
370     DALI_TEST_CHECK( false );
371     END_TEST;
372   }
373
374   DynamicsBodyConfig config(DynamicsBodyConfig::New());
375   config.SetLinearDamping(testDamping);
376
377   tet_infoline("UtcDaliDynamicsBodyConfigLinearDamping- DynamicsBodyConfig::GetLinearDamping");
378   DALI_TEST_EQUALS( testDamping, config.GetLinearDamping(), Math::MACHINE_EPSILON_0, TEST_LOCATION );
379
380   tet_infoline("UtcDaliDynamicsBodyConfigLinearDamping - DynamicsBodyConfig::SetLinearDamping");
381   const float damping = config.GetLinearDamping() + 0.1f;
382   config.SetLinearDamping(damping);
383   DALI_TEST_EQUALS( damping, config.GetLinearDamping(), Math::MACHINE_EPSILON_0, TEST_LOCATION );
384   END_TEST;
385 }
386
387 int UtcDaliDynamicsBodyConfigAngularDamping(void)
388 {
389 #if !defined(DYNAMICS_SUPPORT)
390   tet_infoline("No dynamics support compiled\n");
391   return 0;
392 #endif
393   TestApplication application;
394
395   // start up
396   application.SendNotification();
397   application.Render();
398   application.Render();
399
400   const float testDamping = 0.123f;
401
402   DynamicsWorldConfig worldConfig(DynamicsWorldConfig::New());
403   DynamicsWorld world( Stage::GetCurrent().InitializeDynamics(worldConfig) );
404
405   if( !world )
406   {
407     // cannot create dynamics world, log failure and exit
408     DALI_TEST_CHECK( false );
409     END_TEST;
410   }
411
412   DynamicsBodyConfig config(DynamicsBodyConfig::New());
413   config.SetAngularDamping(testDamping);
414
415   tet_infoline("UtcDaliDynamicsBodyConfigAngularDamping- DynamicsBodyConfig::GetAngularDamping");
416   DALI_TEST_EQUALS( testDamping, config.GetAngularDamping(), Math::MACHINE_EPSILON_0, TEST_LOCATION );
417
418   tet_infoline("UtcDaliDynamicsBodyConfigAngularDamping - DynamicsBodyConfig::SetAngularDamping");
419   const float damping = config.GetAngularDamping() + 0.1f;
420   config.SetAngularDamping(damping);
421   DALI_TEST_EQUALS( damping, config.GetAngularDamping(), Math::MACHINE_EPSILON_0, TEST_LOCATION );
422   END_TEST;
423 }
424
425 int UtcDaliDynamicsBodyConfigLinearSleepVelocity(void)
426 {
427 #if !defined(DYNAMICS_SUPPORT)
428   tet_infoline("No dynamics support compiled\n");
429   return 0;
430 #endif
431   TestApplication application;
432
433   // start up
434   application.SendNotification();
435   application.Render();
436   application.Render();
437
438   const float testSleepVelocity = 0.123f;
439
440   DynamicsWorldConfig worldConfig(DynamicsWorldConfig::New());
441   DynamicsWorld world( Stage::GetCurrent().InitializeDynamics(worldConfig) );
442
443   if( !world )
444   {
445     // cannot create dynamics world, log failure and exit
446     DALI_TEST_CHECK( false );
447     END_TEST;
448   }
449
450   DynamicsBodyConfig config(DynamicsBodyConfig::New());
451   config.SetLinearSleepVelocity(testSleepVelocity);
452
453   tet_infoline("UtcDaliDynamicsBodyConfigLinearSleepVelocity - DynamicsBodyConfig::GetLinearSleepVelocity");
454   DALI_TEST_EQUALS( testSleepVelocity, config.GetLinearSleepVelocity(), Math::MACHINE_EPSILON_0, TEST_LOCATION );
455
456   tet_infoline("UtcDaliDynamicsBodyConfigLinearSleepVelocity - DynamicsBodyConfig::SetLinearSleepVelocity");
457   const float sleepVelocity = config.GetLinearSleepVelocity() + 0.1f;
458   config.SetLinearSleepVelocity(sleepVelocity);
459   DALI_TEST_EQUALS( sleepVelocity, config.GetLinearSleepVelocity(), Math::MACHINE_EPSILON_0, TEST_LOCATION );
460   END_TEST;
461 }
462
463 int UtcDaliDynamicsBodyConfigAngularSleepVelocity(void)
464 {
465 #if !defined(DYNAMICS_SUPPORT)
466   tet_infoline("No dynamics support compiled\n");
467   return 0;
468 #endif
469   TestApplication application;
470
471   // start up
472   application.SendNotification();
473   application.Render();
474   application.Render();
475
476   const float testSleepVelocity = 0.123f;
477
478   DynamicsWorldConfig worldConfig(DynamicsWorldConfig::New());
479   DynamicsWorld world( Stage::GetCurrent().InitializeDynamics(worldConfig) );
480
481   if( !world )
482   {
483     // cannot create dynamics world, log failure and exit
484     DALI_TEST_CHECK( false );
485     END_TEST;
486   }
487
488   DynamicsBodyConfig config(DynamicsBodyConfig::New());
489   config.SetAngularSleepVelocity(testSleepVelocity);
490
491   tet_infoline("UtcDaliDynamicsBodyConfigAngularSleepVelocity - DynamicsBodyConfig::GetAngularSleepVelocity");
492   DALI_TEST_EQUALS( testSleepVelocity, config.GetAngularSleepVelocity(), Math::MACHINE_EPSILON_0, TEST_LOCATION );
493
494   tet_infoline("UtcDaliDynamicsBodyConfigAngularSleepVelocity - DynamicsBodyConfig::SetAngularSleepVelocity");
495   const float sleepVelocity = config.GetAngularSleepVelocity() + 0.1f;
496   config.SetAngularSleepVelocity(sleepVelocity);
497   DALI_TEST_EQUALS( sleepVelocity, config.GetAngularSleepVelocity(), Math::MACHINE_EPSILON_0, TEST_LOCATION );
498   END_TEST;
499 }
500
501 int UtcDaliDynamicsBodyConfigCollisionGroup(void)
502 {
503 #if !defined(DYNAMICS_SUPPORT)
504   tet_infoline("No dynamics support compiled\n");
505   return 0;
506 #endif
507   TestApplication application;
508
509   // start up
510   application.SendNotification();
511   application.Render();
512   application.Render();
513
514   const short int testGroup = 0x1234;
515
516   DynamicsWorldConfig worldConfig(DynamicsWorldConfig::New());
517   DynamicsWorld world( Stage::GetCurrent().InitializeDynamics(worldConfig) );
518
519   if( !world )
520   {
521     // cannot create dynamics world, log failure and exit
522     DALI_TEST_CHECK( false );
523     END_TEST;
524   }
525
526   DynamicsBodyConfig config(DynamicsBodyConfig::New());
527   config.SetCollisionGroup(testGroup);
528
529   tet_infoline("UtcDaliDynamicsBodyConfigCollisionGroup- DynamicsBodyConfig::GetCollisionGroup");
530   DALI_TEST_EQUALS( testGroup, config.GetCollisionGroup(), TEST_LOCATION );
531
532   tet_infoline("UtcDaliDynamicsBodyConfigCollisionGroup - DynamicsBodyConfig::SetCollisionGroup");
533   const short int group = config.GetCollisionGroup() + 1;
534   config.SetCollisionGroup(group);
535   DALI_TEST_EQUALS( group, config.GetCollisionGroup(), TEST_LOCATION );
536   END_TEST;
537 }
538
539 int UtcDaliDynamicsBodyConfigCollisionMask(void)
540 {
541 #if !defined(DYNAMICS_SUPPORT)
542   tet_infoline("No dynamics support compiled\n");
543   return 0;
544 #endif
545   TestApplication application;
546
547   // start up
548   application.SendNotification();
549   application.Render();
550   application.Render();
551
552   const short int testMask = 0x7ffe;
553
554   DynamicsWorldConfig worldConfig(DynamicsWorldConfig::New());
555   DynamicsWorld world( Stage::GetCurrent().InitializeDynamics(worldConfig) );
556
557   if( !world )
558   {
559     // cannot create dynamics world, log failure and exit
560     DALI_TEST_CHECK( false );
561     END_TEST;
562   }
563
564   DynamicsBodyConfig config(DynamicsBodyConfig::New());
565   config.SetCollisionMask(testMask);
566
567   tet_infoline("UtcDaliDynamicsBodyConfigCollisionMask- DynamicsBodyConfig::GetCollisionMask");
568   DALI_TEST_EQUALS( testMask, config.GetCollisionMask(), TEST_LOCATION );
569
570   tet_infoline("UtcDaliDynamicsBodyConfigCollisionMask - DynamicsBodyConfig::SetCollisionMask");
571   const short int mask = config.GetCollisionMask() + 1;
572   config.SetCollisionMask(mask);
573   DALI_TEST_EQUALS( mask, config.GetCollisionMask(), TEST_LOCATION );
574   END_TEST;
575 }
576
577 int UtcDaliDynamicsBodyConfigAnchorHardness(void)
578 {
579 #if !defined(DYNAMICS_SUPPORT)
580   tet_infoline("No dynamics support compiled\n");
581   return 0;
582 #endif
583   TestApplication application;
584
585   // start up
586   application.SendNotification();
587   application.Render();
588   application.Render();
589
590   const float testHardness = 0.87f;
591
592   DynamicsWorldConfig worldConfig(DynamicsWorldConfig::New());
593   DynamicsWorld world( Stage::GetCurrent().InitializeDynamics(worldConfig) );
594
595   if( !world )
596   {
597     // cannot create dynamics world, log failure and exit
598     DALI_TEST_CHECK( false );
599     END_TEST;
600   }
601
602   DynamicsBodyConfig config(DynamicsBodyConfig::New());
603   config.SetAnchorHardness(testHardness);
604
605   tet_infoline("UtcDaliDynamicsBodyConfigAnchorHardness - DynamicsBodyConfig::GetAnchorHardness");
606   DALI_TEST_EQUALS( testHardness, config.GetAnchorHardness(), Math::MACHINE_EPSILON_0, TEST_LOCATION );
607
608   tet_infoline("UtcDaliDynamicsBodyConfigAnchorHardness - DynamicsBodyConfig::SetAnchorHardness");
609   const float hardness = config.GetAnchorHardness() + 0.1f;
610   config.SetAnchorHardness(hardness);
611   DALI_TEST_EQUALS( hardness, config.GetAnchorHardness(), Math::MACHINE_EPSILON_1, TEST_LOCATION );
612   END_TEST;
613 }
614
615 int UtcDaliDynamicsBodyConfigVolumeConservation(void)
616 {
617 #if !defined(DYNAMICS_SUPPORT)
618   tet_infoline("No dynamics support compiled\n");
619   return 0;
620 #endif
621   tet_infoline("UtcDaliDynamicsBodyConfigVolumeConservation");
622
623   TestApplication application;
624
625   // start up
626   application.SendNotification();
627   application.Render();
628   application.Render();
629
630   DynamicsWorldConfig worldConfig(DynamicsWorldConfig::New());
631   DynamicsWorld world( Stage::GetCurrent().InitializeDynamics(worldConfig) );
632
633   if( !world )
634   {
635     // cannot create dynamics world, log failure and exit
636     DALI_TEST_CHECK( false );
637     END_TEST;
638   }
639
640   DynamicsBodyConfig config(DynamicsBodyConfig::New());
641
642   const float conservation = config.GetVolumeConservation() + 0.1f;
643   config.SetVolumeConservation(conservation);
644   DALI_TEST_EQUALS( conservation, config.GetVolumeConservation(), Math::MACHINE_EPSILON_1, TEST_LOCATION );
645   END_TEST;
646 }
647
648 int UtcDaliDynamicsBodyConfigShapeConservation(void)
649 {
650 #if !defined(DYNAMICS_SUPPORT)
651   tet_infoline("No dynamics support compiled\n");
652   return 0;
653 #endif
654   tet_infoline("UtcDaliDynamicsBodyConfigShapeConservation");
655
656   TestApplication application;
657
658   // start up
659   application.SendNotification();
660   application.Render();
661   application.Render();
662
663   DynamicsWorldConfig worldConfig(DynamicsWorldConfig::New());
664   DynamicsWorld world( Stage::GetCurrent().InitializeDynamics(worldConfig) );
665
666   if( !world )
667   {
668     // cannot create dynamics world, log failure and exit
669     DALI_TEST_CHECK( false );
670     END_TEST;
671   }
672
673   DynamicsBodyConfig config(DynamicsBodyConfig::New());
674
675   const float conservation = config.GetShapeConservation() + 0.1f;
676   config.SetShapeConservation(conservation);
677   DALI_TEST_EQUALS( conservation, config.GetShapeConservation(), Math::MACHINE_EPSILON_1, TEST_LOCATION );
678   END_TEST;
679 }