2 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
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
8 // http://floralicense.org/license/
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.
19 #include <dali/dali.h>
20 #include <dali-test-suite-utils.h>
22 void utc_dali_angle_axis_startup(void)
24 test_return_value = TET_UNDEF;
27 void utc_dali_angle_axis_cleanup(void)
29 test_return_value = TET_PASS;
34 int UtcDaliAngleAxisNew01(void)
36 TestApplication application;
39 DALI_TEST_EQUALS(float(a.angle), 0.0f, 0.001f, TEST_LOCATION);
40 DALI_TEST_EQUALS(a.axis, Vector3(0.0f, 0.0f, 0.0f), 0.001f, TEST_LOCATION);
46 int UtcDaliAngleAxisNew02(void)
48 TestApplication application;
51 AngleAxis a(d, Vector3::XAXIS);
53 DALI_TEST_EQUALS(a.angle, d, 0.001f, TEST_LOCATION);
54 DALI_TEST_EQUALS(a.axis, Vector3::XAXIS, 0.001f, TEST_LOCATION);
59 int UtcDaliAngleAxisNew03(void)
61 TestApplication application;
64 AngleAxis a(r, Vector3::ZAXIS);
66 // AngleAxis stores its angle as a degree, so should only do degree comparison.
67 DALI_TEST_EQUALS(a.angle, Degree(Radian(Math::PI_2)), 0.001f, TEST_LOCATION);
68 DALI_TEST_EQUALS(a.axis, Vector3::ZAXIS, 0.001f, TEST_LOCATION);
72 int UtcDaliAngleAxisAssign(void)
74 TestApplication application;
77 AngleAxis a(r, Vector3::ZAXIS);
81 // AngleAxis stores its angle as a degree, so should only do degree comparison.
82 DALI_TEST_EQUALS(b.angle, Degree(Radian(Math::PI_2)), 0.001f, TEST_LOCATION);
83 DALI_TEST_EQUALS(b.axis, Vector3::ZAXIS, 0.001f, TEST_LOCATION);
87 int UtcDaliAngleAxisCopy(void)
89 TestApplication application;
92 AngleAxis a(r, Vector3::ZAXIS);
95 // AngleAxis stores its angle as a degree, so should only do degree comparison.
96 DALI_TEST_EQUALS(b.angle, Degree(Radian(Math::PI_2)), 0.001f, TEST_LOCATION);
97 DALI_TEST_EQUALS(b.axis, Vector3::ZAXIS, 0.001f, TEST_LOCATION);