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.
21 #include <dali/public-api/dali-core.h>
22 #include <dali-test-suite-utils.h>
27 int UtcDaliUint16PairConstructor01P(void)
29 Dali::TestApplication testApp;
33 DALI_TEST_EQUALS(v.GetX(), 0u, TEST_LOCATION);
34 DALI_TEST_EQUALS(v.GetY(), 0u, TEST_LOCATION);
39 int UtcDaliUint16PairConstructor02P(void)
41 Dali::TestApplication testApp;
45 DALI_TEST_EQUALS(v.GetX(), 10u, TEST_LOCATION);
46 DALI_TEST_EQUALS(v.GetY(), 10u, TEST_LOCATION);
51 int UtcDaliUint16PairCopyConstructor01P(void)
53 Dali::TestApplication testApp;
57 DALI_TEST_EQUALS(v.GetX(), 5u, TEST_LOCATION);
58 DALI_TEST_EQUALS(v.GetY(), 5u, TEST_LOCATION);
63 int UtcDaliUint16PairGetWidthP(void)
65 Dali::TestApplication testApp;
68 DALI_TEST_EQUALS(v.GetWidth(), 5u, TEST_LOCATION);
73 int UtcDaliUint16PairGetHeightP(void)
75 Dali::TestApplication testApp;
78 DALI_TEST_EQUALS(v.GetHeight(), 5u, TEST_LOCATION);
83 int UtcDaliUint16PairGetXP(void)
85 Dali::TestApplication testApp;
88 DALI_TEST_EQUALS(v.GetX(), 5u, TEST_LOCATION);
93 int UtcDaliUint16PairGetYP(void)
95 Dali::TestApplication testApp;
98 DALI_TEST_EQUALS(v.GetY(), 5u, TEST_LOCATION);
103 int UtcDaliUint16PairEqualsP(void)
105 Dali::TestApplication testApp;
109 DALI_TEST_EQUALS(v == u, true, TEST_LOCATION);
113 DALI_TEST_EQUALS(v == u, false, TEST_LOCATION);
118 int UtcDaliUint16PairNotEqualsP(void)
120 Dali::TestApplication testApp;
124 DALI_TEST_EQUALS(v != u, false, TEST_LOCATION);
128 DALI_TEST_EQUALS(v != u, true, TEST_LOCATION);
133 int UtcDaliUint16PairLessThanP(void)
135 Dali::TestApplication testApp;
139 DALI_TEST_EQUALS(u < v, true, TEST_LOCATION);
143 DALI_TEST_EQUALS(v < u, true, TEST_LOCATION);
147 DALI_TEST_EQUALS(v < u, false, TEST_LOCATION);
152 int UtcDaliUint16PairGreaterThanP(void)
154 Dali::TestApplication testApp;
161 DALI_TEST_EQUALS(u > v, true, TEST_LOCATION);
165 DALI_TEST_EQUALS(v > u, true, TEST_LOCATION);
170 int UtcDaliUint16PairFromFloatVecP(void)
172 Dali::TestApplication testApp;
174 Dali::Vector2 v2(5.f, 5.f);
176 Uint16Pair u = Uint16Pair::FromFloatVec2(v2);
177 DALI_TEST_EQUALS(u.GetX(), 5u, TEST_LOCATION);
178 DALI_TEST_EQUALS(u.GetY(), 5u, TEST_LOCATION);
180 Dali::Vector3 v3(5.f, 5.f, 5.f);
182 u = Uint16Pair::FromFloatVec2(v3);
183 DALI_TEST_EQUALS(u.GetX(), 5u, TEST_LOCATION);
184 DALI_TEST_EQUALS(u.GetY(), 5u, TEST_LOCATION);
189 int UtcDaliUint16PairFromFloatArrayP(void)
191 Dali::TestApplication testApp;
193 float array[] = {5.f, 5.f};
195 Uint16Pair u = Uint16Pair::FromFloatArray(array);
196 DALI_TEST_EQUALS(u.GetX(), 5u, TEST_LOCATION);
197 DALI_TEST_EQUALS(u.GetY(), 5u, TEST_LOCATION);