Revert "License conversion from Flora to Apache 2.0"
[platform/core/uifw/dali-core.git] / automated-tests / src / dali / utc-Dali-LongPressGesture.cpp
1 //
2 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
3 //
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
7 //
8 //     http://floralicense.org/license/
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 #include <iostream>
18
19 #include <stdlib.h>
20 #include <dali/dali.h>
21 #include <dali-test-suite-utils.h>
22
23 using namespace Dali;
24
25 void utc_dali_long_press_gesture_startup(void)
26 {
27   test_return_value = TET_UNDEF;
28 }
29
30 void utc_dali_long_press_gesture_cleanup(void)
31 {
32   test_return_value = TET_PASS;
33 }
34
35
36 // Positive test case for a method
37 int UtcDaliLongPressGestureConstructor(void)
38 {
39   TestApplication application; // Reset all test adapter return codes
40
41   LongPressGesture gesture( Gesture::Started );
42   DALI_TEST_EQUALS(1u, gesture.numberOfTouches, TEST_LOCATION);
43   DALI_TEST_EQUALS(Gesture::LongPress, gesture.type, TEST_LOCATION);
44
45   // Test Copy constructor
46   gesture.numberOfTouches = 5u;
47
48   LongPressGesture gesture2(gesture);
49   DALI_TEST_EQUALS(5u, gesture2.numberOfTouches, TEST_LOCATION);
50   DALI_TEST_EQUALS(Gesture::LongPress, gesture2.type, TEST_LOCATION);
51   DALI_TEST_EQUALS(Gesture::Started, gesture2.state, TEST_LOCATION);
52   END_TEST;
53 }
54
55 int UtcDaliLongPressGestureAssignment(void)
56 {
57   // Test Assignment operator
58   LongPressGesture gesture( Gesture::Started );
59   DALI_TEST_EQUALS(1u, gesture.numberOfTouches, TEST_LOCATION);
60   DALI_TEST_EQUALS(Gesture::LongPress, gesture.type, TEST_LOCATION);
61
62   gesture.numberOfTouches = 5u;
63
64   LongPressGesture gesture2( Gesture::Finished );
65   DALI_TEST_EQUALS(Gesture::Finished, gesture2.state, TEST_LOCATION);
66   gesture2 = gesture;
67   DALI_TEST_EQUALS(5u, gesture2.numberOfTouches, TEST_LOCATION);
68   DALI_TEST_EQUALS(Gesture::LongPress, gesture2.type, TEST_LOCATION);
69   DALI_TEST_EQUALS(Gesture::Started, gesture2.state, TEST_LOCATION);
70   END_TEST;
71 }