Merge remote-tracking branch 'origin/tizen' into devel/new_mesh
[platform/core/uifw/dali-core.git] / automated-tests / src / dali / utc-Dali-Geometry.cpp
1 /*
2  * Copyright (c) 2015 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 <dali/public-api/dali-core.h>
19 #include <dali-test-suite-utils.h>
20
21 using namespace Dali;
22
23 #include <mesh-builder.h>
24
25 void geometry_test_startup(void)
26 {
27   test_return_value = TET_UNDEF;
28 }
29
30 void geometry_test_cleanup(void)
31 {
32   test_return_value = TET_PASS;
33 }
34
35 namespace
36 {
37 }
38
39
40 int UtcDaliGeometryNew01(void)
41 {
42   TestApplication application;
43
44   Geometry geometry = Geometry::New();
45
46   DALI_TEST_EQUALS( (bool)geometry, true, TEST_LOCATION );
47   END_TEST;
48 }
49
50 int UtcDaliGeometryNew02(void)
51 {
52   TestApplication application;
53   Geometry geometry;
54   DALI_TEST_EQUALS( (bool)geometry, false, TEST_LOCATION );
55   END_TEST;
56 }
57
58 int UtcDaliGeometryDownCast01(void)
59 {
60   TestApplication application;
61
62   Geometry geometry = Geometry::New();
63
64   BaseHandle handle(geometry);
65   Geometry geometry2 = Geometry::DownCast(handle);
66   DALI_TEST_EQUALS( (bool)geometry2, true, TEST_LOCATION );
67   END_TEST;
68 }
69
70 int UtcDaliGeometryDownCast02(void)
71 {
72   TestApplication application;
73
74   Handle handle = Handle::New(); // Create a custom object
75   Geometry geometry = Geometry::DownCast(handle);
76   DALI_TEST_EQUALS( (bool)geometry, false, TEST_LOCATION );
77   END_TEST;
78 }