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.
20 #include <dali/dali.h>
21 #include <dali-test-suite-utils.h>
25 void utc_dali_pinch_gesture_startup(void)
27 test_return_value = TET_UNDEF;
30 void utc_dali_pinch_gesture_cleanup(void)
32 test_return_value = TET_PASS;
35 // Positive test case for a method
36 int UtcDaliPinchGestureConstructor(void)
38 TestApplication application; // Reset all test adapter return codes
40 PinchGesture gesture(Gesture::Started);
41 DALI_TEST_EQUALS(Gesture::Started, gesture.state, TEST_LOCATION);
42 DALI_TEST_EQUALS(0.0f, gesture.scale, TEST_LOCATION);
43 DALI_TEST_EQUALS(0.0f, gesture.speed, TEST_LOCATION);
44 DALI_TEST_EQUALS(Gesture::Pinch, gesture.type, TEST_LOCATION);
46 PinchGesture gesture2(Gesture::Continuing);
47 DALI_TEST_EQUALS(Gesture::Continuing, gesture2.state, TEST_LOCATION);
48 DALI_TEST_EQUALS(0.0f, gesture2.scale, TEST_LOCATION);
49 DALI_TEST_EQUALS(0.0f, gesture2.speed, TEST_LOCATION);
50 DALI_TEST_EQUALS(Gesture::Pinch, gesture2.type, TEST_LOCATION);
52 PinchGesture gesture3(Gesture::Finished);
53 DALI_TEST_EQUALS(Gesture::Finished, gesture3.state, TEST_LOCATION);
54 DALI_TEST_EQUALS(0.0f, gesture3.scale, TEST_LOCATION);
55 DALI_TEST_EQUALS(0.0f, gesture3.speed, TEST_LOCATION);
56 DALI_TEST_EQUALS(Gesture::Pinch, gesture3.type, TEST_LOCATION);
58 // Test copy constructor
59 gesture3.scale = 3.0f;
60 gesture3.speed = 5.0f;
62 PinchGesture pinch(gesture3);
63 DALI_TEST_EQUALS(Gesture::Finished, pinch.state, TEST_LOCATION);
64 DALI_TEST_EQUALS(3.0f, pinch.scale, TEST_LOCATION);
65 DALI_TEST_EQUALS(5.0f, pinch.speed, TEST_LOCATION);
66 DALI_TEST_EQUALS(Gesture::Pinch, pinch.type, TEST_LOCATION);
70 int UtcDaliPinchGestureAssignment(void)
72 // Test Assignment operator
73 PinchGesture gesture(Gesture::Started);
74 DALI_TEST_EQUALS(Gesture::Started, gesture.state, TEST_LOCATION);
75 DALI_TEST_EQUALS(0.0f, gesture.scale, TEST_LOCATION);
76 DALI_TEST_EQUALS(0.0f, gesture.speed, TEST_LOCATION);
77 DALI_TEST_EQUALS(Gesture::Pinch, gesture.type, TEST_LOCATION);
79 PinchGesture gesture2(Gesture::Continuing);
80 DALI_TEST_EQUALS(Gesture::Continuing, gesture2.state, TEST_LOCATION);
81 DALI_TEST_EQUALS(0.0f, gesture2.scale, TEST_LOCATION);
82 DALI_TEST_EQUALS(0.0f, gesture2.speed, TEST_LOCATION);
83 DALI_TEST_EQUALS(Gesture::Pinch, gesture2.type, TEST_LOCATION);
85 gesture2.scale = 3.0f;
86 gesture2.speed = 5.0f;
89 DALI_TEST_EQUALS(Gesture::Continuing, gesture.state, TEST_LOCATION);
90 DALI_TEST_EQUALS(3.0f, gesture.scale, TEST_LOCATION);
91 DALI_TEST_EQUALS(5.0f, gesture.speed, TEST_LOCATION);
92 DALI_TEST_EQUALS(Gesture::Pinch, gesture.type, TEST_LOCATION);