2 * Copyright (c) 2014 Samsung Electronics Co., Ltd.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
20 #include <dali/public-api/dali-core.h>
21 #include <dali-test-suite-utils.h>
23 void utc_dali_angle_axis_startup(void)
25 test_return_value = TET_UNDEF;
28 void utc_dali_angle_axis_cleanup(void)
30 test_return_value = TET_PASS;
35 int UtcDaliAngleAxisNew01(void)
37 TestApplication application;
40 DALI_TEST_EQUALS(float(a.angle), 0.0f, 0.001f, TEST_LOCATION);
41 DALI_TEST_EQUALS(a.axis, Vector3(0.0f, 0.0f, 0.0f), 0.001f, TEST_LOCATION);
47 int UtcDaliAngleAxisNew02(void)
49 TestApplication application;
52 AngleAxis a(d, Vector3::XAXIS);
54 DALI_TEST_EQUALS(a.angle, Radian(d), 0.001f, TEST_LOCATION);
55 DALI_TEST_EQUALS(a.axis, Vector3::XAXIS, 0.001f, TEST_LOCATION);
60 int UtcDaliAngleAxisNew03(void)
62 TestApplication application;
65 AngleAxis a(r, Vector3::ZAXIS);
67 // AngleAxis stores its angle as a degree, so should only do degree comparison.
68 DALI_TEST_EQUALS(a.angle, Radian(Math::PI_2), 0.001f, TEST_LOCATION);
69 DALI_TEST_EQUALS(a.axis, Vector3::ZAXIS, 0.001f, TEST_LOCATION);
73 int UtcDaliAngleAxisAssign(void)
75 TestApplication application;
78 AngleAxis a(r, Vector3::ZAXIS);
82 // AngleAxis stores its angle as a degree, so should only do degree comparison.
83 DALI_TEST_EQUALS(b.angle, Radian(Math::PI_2), 0.001f, TEST_LOCATION);
84 DALI_TEST_EQUALS(b.axis, Vector3::ZAXIS, 0.001f, TEST_LOCATION);
88 int UtcDaliAngleAxisCopy(void)
90 TestApplication application;
93 AngleAxis a(r, Vector3::ZAXIS);
96 // AngleAxis stores its angle as a degree, so should only do degree comparison.
97 DALI_TEST_EQUALS(b.angle, Radian(Math::PI_2), 0.001f, TEST_LOCATION);
98 DALI_TEST_EQUALS(b.axis, Vector3::ZAXIS, 0.001f, TEST_LOCATION);
102 int UtcDaliAngleAxisEqual(void)
104 TestApplication application;
106 Radian r(Math::PI_2);
107 AngleAxis a(r, Vector3::ZAXIS);
110 tet_result((a == b) ? TET_PASS : TET_FAIL);
112 b.axis = Vector3::YAXIS;
113 tet_result(!(a == b) ? TET_PASS : TET_FAIL);