License conversion from Flora to Apache 2.0
[platform/core/uifw/dali-core.git] / automated-tests / src / dali-unmanaged / utc-Dali-DynamicsWorldConfig.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 #include <stdlib.h>
20 #include <dali/dali.h>
21 #include <dali/public-api/dali-core.h>
22 #include <dali-test-suite-utils.h>
23
24
25 using namespace Dali;
26
27
28 int UtcDaliDynamicsWorldConfigConstructor(void)
29 {
30   tet_infoline("UtcDaliDynamicsWorldConfigConstructor - DynamicsWorldConfig::DynamicsWorldConfig");
31
32   TestApplication application;
33
34   // start up
35   application.SendNotification();
36   application.Render();
37   application.Render();
38
39   // Default constructor - create an uninitialized handle
40   DynamicsWorldConfig worldConfig;
41   DALI_TEST_CHECK( !worldConfig );
42
43   // initialize handle
44   worldConfig = DynamicsWorldConfig::New();
45
46   DALI_TEST_CHECK( worldConfig );
47   END_TEST;
48 }
49
50 int UtcDaliDynamicsWorldConfigNew(void)
51 {
52   tet_infoline("UtcDaliDynamicsWorldConfigNew - DynamicsWorldConfig::New");
53
54   TestApplication application;
55
56   // start up
57   application.SendNotification();
58   application.Render();
59   application.Render();
60
61   // Default constructor - create an uninitialized handle
62   DynamicsWorldConfig worldConfig( DynamicsWorldConfig::New() );
63
64   DALI_TEST_CHECK( worldConfig );
65   END_TEST;
66 }
67
68 int UtcDaliDynamicsWorldConfigType(void)
69 {
70   TestApplication application;
71
72   // start up
73   application.SendNotification();
74   application.Render();
75   application.Render();
76
77   // Default constructor - create an uninitialized handle
78   DynamicsWorldConfig worldConfig( DynamicsWorldConfig::New() );
79
80   tet_infoline("UtcDaliDynamicsWorldConfigNew - DynamicsWorldConfig::GetType");
81   DALI_TEST_CHECK(DynamicsWorldConfig::RIGID == worldConfig.GetType());
82
83   tet_infoline("UtcDaliDynamicsWorldConfigNew - DynamicsWorldConfig::SetType");
84   worldConfig.SetType(DynamicsWorldConfig::SOFT);
85   DALI_TEST_CHECK(DynamicsWorldConfig::SOFT == worldConfig.GetType());
86   END_TEST;
87 }