Dali 3D User Interface Engine
utc-Dali-PinchGesture.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2014 Samsung Electronics Co., Ltd.
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
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 
18 #include <iostream>
19 
20 #include <stdlib.h>
22 #include <dali-test-suite-utils.h>
23 
24 using namespace Dali;
25 
27 {
29 }
30 
32 {
34 }
35 
36 // Positive test case for a method
38 {
39  TestApplication application; // Reset all test adapter return codes
40 
43  DALI_TEST_EQUALS(0.0f, gesture.scale, TEST_LOCATION);
44  DALI_TEST_EQUALS(0.0f, gesture.speed, TEST_LOCATION);
46 
49  DALI_TEST_EQUALS(0.0f, gesture2.scale, TEST_LOCATION);
50  DALI_TEST_EQUALS(0.0f, gesture2.speed, TEST_LOCATION);
52 
55  DALI_TEST_EQUALS(0.0f, gesture3.scale, TEST_LOCATION);
56  DALI_TEST_EQUALS(0.0f, gesture3.speed, TEST_LOCATION);
58 
59  // Test copy constructor
60  gesture3.scale = 3.0f;
61  gesture3.speed = 5.0f;
62 
63  PinchGesture pinch(gesture3);
65  DALI_TEST_EQUALS(3.0f, pinch.scale, TEST_LOCATION);
66  DALI_TEST_EQUALS(5.0f, pinch.speed, TEST_LOCATION);
68  END_TEST;
69 }
70 
72 {
73  // Test Assignment operator
76  DALI_TEST_EQUALS(0.0f, gesture.scale, TEST_LOCATION);
77  DALI_TEST_EQUALS(0.0f, gesture.speed, TEST_LOCATION);
79 
82  DALI_TEST_EQUALS(0.0f, gesture2.scale, TEST_LOCATION);
83  DALI_TEST_EQUALS(0.0f, gesture2.speed, TEST_LOCATION);
85 
86  gesture2.scale = 3.0f;
87  gesture2.speed = 5.0f;
88 
89  gesture = gesture2;
91  DALI_TEST_EQUALS(3.0f, gesture.scale, TEST_LOCATION);
92  DALI_TEST_EQUALS(5.0f, gesture.speed, TEST_LOCATION);
94  END_TEST;
95 }
96 
98 {
99  PinchGesture* gesture = new PinchGesture( Gesture::Started );
101  DALI_TEST_EQUALS(0.0f, gesture->scale, TEST_LOCATION);
102  DALI_TEST_EQUALS(0.0f, gesture->speed, TEST_LOCATION);
104  delete gesture;
105 
106  END_TEST;
107 }
Dali Docs Home
Read more about Dali