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( UtcDaliGestureConstructor, POSITIVE_TC_IDX );
48 TEST_FUNCTION( UtcDaliGestureAssignment, POSITIVE_TC_IDX );
50 // Called only once before first test is run.
55 // Called only once after last test is run
60 // TestGesture Struct (Gesture constructor is protected)
61 struct TestGesture : public Gesture
64 TestGesture(Gesture::Type type, Gesture::State state)
65 : Gesture(type, state) {}
67 virtual ~TestGesture() {}
70 static void UtcDaliGestureConstructor()
72 TestApplication application; // Reset all test adapter return codes
74 TestGesture pan(Gesture::Pan, Gesture::Started);
75 DALI_TEST_EQUALS(Gesture::Pan, pan.type, TEST_LOCATION);
76 DALI_TEST_EQUALS(Gesture::Started, pan.state, TEST_LOCATION);
78 TestGesture pinch(Gesture::Pinch, Gesture::Clear);
79 DALI_TEST_EQUALS(Gesture::Pinch, pinch.type, TEST_LOCATION);
80 DALI_TEST_EQUALS(Gesture::Clear, pinch.state, TEST_LOCATION);
82 // Test copy constructor
83 TestGesture pan2(pan);
84 DALI_TEST_EQUALS(Gesture::Pan, pan2.type, TEST_LOCATION);
85 DALI_TEST_EQUALS(Gesture::Started, pan2.state, TEST_LOCATION);
88 static void UtcDaliGestureAssignment()
90 // Test Assignment operator
91 TestGesture pan(Gesture::Pan, Gesture::Finished);
92 DALI_TEST_EQUALS(Gesture::Pan, pan.type, TEST_LOCATION);
93 DALI_TEST_EQUALS(Gesture::Finished, pan.state, TEST_LOCATION);
95 TestGesture test(Gesture::Pinch, Gesture::Started);
96 DALI_TEST_EQUALS(Gesture::Pinch, test.type, TEST_LOCATION);
97 DALI_TEST_EQUALS(Gesture::Started, test.state, TEST_LOCATION);
100 DALI_TEST_EQUALS(Gesture::Pan, test.type, TEST_LOCATION);
101 DALI_TEST_EQUALS(Gesture::Finished, test.state, TEST_LOCATION);