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.
22 #include <dali/public-api/dali-core.h>
24 #include <dali-test-suite-utils.h>
28 static void Startup();
29 static void Cleanup();
32 void (*tet_startup)() = Startup;
33 void (*tet_cleanup)() = Cleanup;
37 POSITIVE_TC_IDX = 0x01,
41 #define MAX_NUMBER_OF_TESTS 10000
43 struct tet_testlist tet_testlist[MAX_NUMBER_OF_TESTS];
46 // Add test functionality for all APIs in the class (Positive and Negative)
47 TEST_FUNCTION( UtcDaliLongPressGestureConstructor, POSITIVE_TC_IDX );
48 TEST_FUNCTION( UtcDaliLongPressGestureAssignment, POSITIVE_TC_IDX );
50 // Called only once before first test is run.
55 // Called only once after last test is run
61 // Positive test case for a method
62 static void UtcDaliLongPressGestureConstructor()
64 TestApplication application; // Reset all test adapter return codes
66 LongPressGesture gesture( Gesture::Started );
67 DALI_TEST_EQUALS(1u, gesture.numberOfTouches, TEST_LOCATION);
68 DALI_TEST_EQUALS(Gesture::LongPress, gesture.type, TEST_LOCATION);
70 // Test Copy constructor
71 gesture.numberOfTouches = 5u;
73 LongPressGesture gesture2(gesture);
74 DALI_TEST_EQUALS(5u, gesture2.numberOfTouches, TEST_LOCATION);
75 DALI_TEST_EQUALS(Gesture::LongPress, gesture2.type, TEST_LOCATION);
76 DALI_TEST_EQUALS(Gesture::Started, gesture2.state, TEST_LOCATION);
79 static void UtcDaliLongPressGestureAssignment()
81 // Test Assignment operator
82 LongPressGesture gesture( Gesture::Started );
83 DALI_TEST_EQUALS(1u, gesture.numberOfTouches, TEST_LOCATION);
84 DALI_TEST_EQUALS(Gesture::LongPress, gesture.type, TEST_LOCATION);
86 gesture.numberOfTouches = 5u;
88 LongPressGesture gesture2( Gesture::Finished );
89 DALI_TEST_EQUALS(Gesture::Finished, gesture2.state, TEST_LOCATION);
91 DALI_TEST_EQUALS(5u, gesture2.numberOfTouches, TEST_LOCATION);
92 DALI_TEST_EQUALS(Gesture::LongPress, gesture2.type, TEST_LOCATION);
93 DALI_TEST_EQUALS(Gesture::Started, gesture2.state, TEST_LOCATION);