sl@0
|
1 |
// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
2 |
// All rights reserved.
|
sl@0
|
3 |
// This component and the accompanying materials are made available
|
sl@0
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
sl@0
|
5 |
// which accompanies this distribution, and is available
|
sl@0
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
7 |
//
|
sl@0
|
8 |
// Initial Contributors:
|
sl@0
|
9 |
// Nokia Corporation - initial contribution.
|
sl@0
|
10 |
//
|
sl@0
|
11 |
// Contributors:
|
sl@0
|
12 |
//
|
sl@0
|
13 |
// Description:
|
sl@0
|
14 |
// Advanced pointer event unit tests
|
sl@0
|
15 |
//
|
sl@0
|
16 |
//
|
sl@0
|
17 |
|
sl@0
|
18 |
/**
|
sl@0
|
19 |
@file
|
sl@0
|
20 |
@test
|
sl@0
|
21 |
@internalComponent - Internal Symbian test code
|
sl@0
|
22 |
*/
|
sl@0
|
23 |
|
sl@0
|
24 |
#include "tadvancedpointerevent.h"
|
sl@0
|
25 |
|
sl@0
|
26 |
CTAdvancedPointerEvent::CTAdvancedPointerEvent(CTestStep* aStep)
|
sl@0
|
27 |
: CTWsGraphicsBase(aStep)
|
sl@0
|
28 |
{}
|
sl@0
|
29 |
|
sl@0
|
30 |
CTAdvancedPointerEvent::~CTAdvancedPointerEvent()
|
sl@0
|
31 |
{}
|
sl@0
|
32 |
|
sl@0
|
33 |
void CTAdvancedPointerEvent::TestPointerEventInit()
|
sl@0
|
34 |
{
|
sl@0
|
35 |
// Test size of class with hard coded values to prevent regression failure
|
sl@0
|
36 |
TEST(sizeof(TPointerEvent) == 24);
|
sl@0
|
37 |
|
sl@0
|
38 |
TPointerEvent ptrEvent1 = TPointerEvent();
|
sl@0
|
39 |
ptrEvent1.iType = TPointerEvent::EButton1Down;
|
sl@0
|
40 |
TPoint initCoords(10,10);
|
sl@0
|
41 |
ptrEvent1.iPosition = initCoords;
|
sl@0
|
42 |
ptrEvent1.iParentPosition = initCoords;
|
sl@0
|
43 |
ptrEvent1.iModifiers = 0;
|
sl@0
|
44 |
|
sl@0
|
45 |
// Construct two TPointerEvent objects. The first using default constructor, the second using the copy constructor. T
|
sl@0
|
46 |
{
|
sl@0
|
47 |
TPointerEvent ptrEvent2 = TPointerEvent(ptrEvent1);
|
sl@0
|
48 |
TEST(0==Mem::Compare(reinterpret_cast<TUint8*>(&ptrEvent1),sizeof(TPointerEvent),reinterpret_cast<TUint8*>(&ptrEvent2),sizeof(TPointerEvent)));
|
sl@0
|
49 |
}
|
sl@0
|
50 |
|
sl@0
|
51 |
{
|
sl@0
|
52 |
TPointerEvent ptrEvent2(TPointerEvent::EButton1Down, 0, initCoords, initCoords);
|
sl@0
|
53 |
TEST(0==Mem::Compare(reinterpret_cast<TUint8*>(&ptrEvent1),sizeof(TPointerEvent),reinterpret_cast<TUint8*>(&ptrEvent2),sizeof(TPointerEvent)));
|
sl@0
|
54 |
}
|
sl@0
|
55 |
}
|
sl@0
|
56 |
|
sl@0
|
57 |
void AdvancedPointerInit(TWsEvent& aEvent1, TWsEvent& aEvent2, const TPointerEvent::TType aType, const TPoint3D& aPoint3D, const TUint8 aPointerNumber)
|
sl@0
|
58 |
{
|
sl@0
|
59 |
// init first event
|
sl@0
|
60 |
TAdvancedPointerEvent& ptrEvent = *aEvent1.Pointer();
|
sl@0
|
61 |
ptrEvent.iType = aType;
|
sl@0
|
62 |
ptrEvent.iModifiers = EModifierAdvancedPointerEvent; // done implicitly by TAdvancedPointerEvent::Init method
|
sl@0
|
63 |
ptrEvent.iPosition.iX = aPoint3D.iX;
|
sl@0
|
64 |
ptrEvent.iPosition.iY = aPoint3D.iY;
|
sl@0
|
65 |
aEvent1.SetPointerNumber(aPointerNumber);
|
sl@0
|
66 |
aEvent1.SetPointerZ(aPoint3D.iZ);
|
sl@0
|
67 |
|
sl@0
|
68 |
// init 2nd event
|
sl@0
|
69 |
aEvent2.InitAdvancedPointerEvent(aType,0,aPoint3D,aPointerNumber);
|
sl@0
|
70 |
}
|
sl@0
|
71 |
|
sl@0
|
72 |
void CTAdvancedPointerEvent::TestAdvancedPointerInit()
|
sl@0
|
73 |
{
|
sl@0
|
74 |
// Test size of class with hard coded values to prevent regression failure
|
sl@0
|
75 |
TEST(sizeof(TAdvancedPointerEvent) == 32);
|
sl@0
|
76 |
|
sl@0
|
77 |
TWsEvent event1;
|
sl@0
|
78 |
TWsEvent event2;
|
sl@0
|
79 |
|
sl@0
|
80 |
// low value coords, lowest value event type
|
sl@0
|
81 |
{
|
sl@0
|
82 |
TPoint3D point3D(1,2,3);
|
sl@0
|
83 |
AdvancedPointerInit(event1, event2, TPointerEvent::EButton1Down, point3D, 1);
|
sl@0
|
84 |
}
|
sl@0
|
85 |
TEST(0==Mem::Compare(reinterpret_cast<TUint8*>(&event1),sizeof(TWsEvent),reinterpret_cast<TUint8*>(&event2),sizeof(TWsEvent)));
|
sl@0
|
86 |
|
sl@0
|
87 |
// high value coords, highest value event type and pointer number
|
sl@0
|
88 |
{
|
sl@0
|
89 |
TPoint3D point3D(KMaxTInt, KMaxTInt-1, KMaxTInt-3);
|
sl@0
|
90 |
AdvancedPointerInit(event1, event2, TPointerEvent::EOutOfRange, point3D, KMaxTUint8);
|
sl@0
|
91 |
}
|
sl@0
|
92 |
TEST(0==Mem::Compare(reinterpret_cast<TUint8*>(&event1),sizeof(TWsEvent),reinterpret_cast<TUint8*>(&event2),sizeof(TWsEvent)));
|
sl@0
|
93 |
|
sl@0
|
94 |
// high negative value coords, highest value event type and pointer number
|
sl@0
|
95 |
{
|
sl@0
|
96 |
TPoint3D point3D(KMinTInt, KMinTInt+1, KMinTInt+3);
|
sl@0
|
97 |
AdvancedPointerInit(event1, event2, TPointerEvent::EOutOfRange, point3D, KMaxTUint8);
|
sl@0
|
98 |
}
|
sl@0
|
99 |
TEST(0==Mem::Compare(reinterpret_cast<TUint8*>(&event1),sizeof(TWsEvent),reinterpret_cast<TUint8*>(&event2),sizeof(TWsEvent)));
|
sl@0
|
100 |
}
|
sl@0
|
101 |
|
sl@0
|
102 |
void CTAdvancedPointerEvent::TestAdvancedPointerGetPointerId()
|
sl@0
|
103 |
{
|
sl@0
|
104 |
TWsEvent event;
|
sl@0
|
105 |
TAdvancedPointerEvent& ptrEvent = *event.Pointer();
|
sl@0
|
106 |
const TPoint3D point3D(1,2,3);
|
sl@0
|
107 |
const TUint8 MaxLikelyCommonPointerNumber = 10;
|
sl@0
|
108 |
|
sl@0
|
109 |
// Likely Common Values
|
sl@0
|
110 |
TUint8 pointerNumber = 0;
|
sl@0
|
111 |
for(;pointerNumber<=MaxLikelyCommonPointerNumber;pointerNumber++)
|
sl@0
|
112 |
{
|
sl@0
|
113 |
event.InitAdvancedPointerEvent(TPointerEvent::EMove,0,point3D,pointerNumber);
|
sl@0
|
114 |
TEST(ptrEvent.PointerNumber()==pointerNumber);
|
sl@0
|
115 |
}
|
sl@0
|
116 |
|
sl@0
|
117 |
// mid-range value
|
sl@0
|
118 |
pointerNumber = 127;
|
sl@0
|
119 |
event.InitAdvancedPointerEvent(TPointerEvent::EMove,0,point3D,pointerNumber);
|
sl@0
|
120 |
TEST(ptrEvent.PointerNumber()==pointerNumber);
|
sl@0
|
121 |
|
sl@0
|
122 |
// highest value
|
sl@0
|
123 |
pointerNumber = 255; // KMaxTUint8 is there was one defined.
|
sl@0
|
124 |
event.InitAdvancedPointerEvent(TPointerEvent::EMove,0,point3D,pointerNumber);
|
sl@0
|
125 |
TEST(ptrEvent.PointerNumber()==pointerNumber);
|
sl@0
|
126 |
}
|
sl@0
|
127 |
|
sl@0
|
128 |
/** helper method for TestAdvancedPointerGetPressureAndProximity() */
|
sl@0
|
129 |
void CTAdvancedPointerEvent::TestAdvancedPointerGetPressureAndProximity(const TPoint3D aPoint3D)
|
sl@0
|
130 |
{
|
sl@0
|
131 |
TWsEvent event;
|
sl@0
|
132 |
event.InitAdvancedPointerEvent(TPointerEvent::EMove, 0, aPoint3D, 0);
|
sl@0
|
133 |
TAdvancedPointerEvent ptrEvent = *event.Pointer();
|
sl@0
|
134 |
const TPoint3D positionAndPressure3D = ptrEvent.PositionAndPressure3D();
|
sl@0
|
135 |
TEST(0==Mem::Compare(reinterpret_cast<TUint8 const*>(&aPoint3D),sizeof(TPoint3D),reinterpret_cast<TUint8 const*>(&positionAndPressure3D),sizeof(TPoint3D)));
|
sl@0
|
136 |
TInt proximityAndPressure = ptrEvent.ProximityAndPressure();
|
sl@0
|
137 |
TEST(aPoint3D.iZ==proximityAndPressure);
|
sl@0
|
138 |
}
|
sl@0
|
139 |
|
sl@0
|
140 |
void CTAdvancedPointerEvent::TestAdvancedPointerGetPressureAndProximity()
|
sl@0
|
141 |
{
|
sl@0
|
142 |
{
|
sl@0
|
143 |
// middle value
|
sl@0
|
144 |
TPoint3D point3D(0,0,0);
|
sl@0
|
145 |
TestAdvancedPointerGetPressureAndProximity(point3D);
|
sl@0
|
146 |
}
|
sl@0
|
147 |
{
|
sl@0
|
148 |
// Typical value
|
sl@0
|
149 |
TPoint3D point3D(10,9,8);
|
sl@0
|
150 |
TestAdvancedPointerGetPressureAndProximity(point3D);
|
sl@0
|
151 |
}
|
sl@0
|
152 |
{
|
sl@0
|
153 |
// Typical value
|
sl@0
|
154 |
TPoint3D point3D(10,9,-8);
|
sl@0
|
155 |
TestAdvancedPointerGetPressureAndProximity(point3D);
|
sl@0
|
156 |
}
|
sl@0
|
157 |
{
|
sl@0
|
158 |
// max values
|
sl@0
|
159 |
TPoint3D point3D(KMaxTInt-2,KMaxTInt-1,KMaxTInt);
|
sl@0
|
160 |
TestAdvancedPointerGetPressureAndProximity(point3D);
|
sl@0
|
161 |
}
|
sl@0
|
162 |
{
|
sl@0
|
163 |
// min values
|
sl@0
|
164 |
TPoint3D point3D(KMinTInt+2,KMinTInt+1,KMinTInt);
|
sl@0
|
165 |
TestAdvancedPointerGetPressureAndProximity(point3D);
|
sl@0
|
166 |
}
|
sl@0
|
167 |
}
|
sl@0
|
168 |
|
sl@0
|
169 |
void CTAdvancedPointerEvent::TestAdvancedPointerGetPressure()
|
sl@0
|
170 |
{
|
sl@0
|
171 |
{
|
sl@0
|
172 |
// middle value
|
sl@0
|
173 |
const TPoint3D point3D(0,0,0);
|
sl@0
|
174 |
TWsEvent event;
|
sl@0
|
175 |
event.InitAdvancedPointerEvent(TPointerEvent::EMove, 0, point3D, 0);
|
sl@0
|
176 |
TAdvancedPointerEvent ptrEvent = *event.Pointer();
|
sl@0
|
177 |
const TPoint3D pressure3D = ptrEvent.Pressure3D();
|
sl@0
|
178 |
TEST(0==Mem::Compare(reinterpret_cast<TUint8 const*>(&point3D),sizeof(TPoint3D),reinterpret_cast<TUint8 const*>(&pressure3D),sizeof(TPoint3D)));
|
sl@0
|
179 |
TInt pressure = ptrEvent.Pressure();
|
sl@0
|
180 |
TEST(point3D.iZ==pressure);
|
sl@0
|
181 |
}
|
sl@0
|
182 |
{
|
sl@0
|
183 |
// Typical value
|
sl@0
|
184 |
const TPoint3D point3D(10,9,8);
|
sl@0
|
185 |
TWsEvent event;
|
sl@0
|
186 |
event.InitAdvancedPointerEvent(TPointerEvent::EMove, 0, point3D, 0);
|
sl@0
|
187 |
TAdvancedPointerEvent ptrEvent = *event.Pointer();
|
sl@0
|
188 |
const TPoint3D pressure3D = ptrEvent.Pressure3D();
|
sl@0
|
189 |
TEST(0==Mem::Compare(reinterpret_cast<TUint8 const*>(&point3D),sizeof(TPoint3D),reinterpret_cast<TUint8 const*>(&pressure3D),sizeof(TPoint3D)));
|
sl@0
|
190 |
TInt pressure = ptrEvent.Pressure();
|
sl@0
|
191 |
TEST(point3D.iZ==pressure);
|
sl@0
|
192 |
}
|
sl@0
|
193 |
{
|
sl@0
|
194 |
// max value
|
sl@0
|
195 |
const TPoint3D point3D(KMaxTInt-2,KMaxTInt-1,KMaxTInt);
|
sl@0
|
196 |
TWsEvent event;
|
sl@0
|
197 |
event.InitAdvancedPointerEvent(TPointerEvent::EMove, 0, point3D, 0);
|
sl@0
|
198 |
TAdvancedPointerEvent ptrEvent = *event.Pointer();
|
sl@0
|
199 |
const TPoint3D pressure3D = ptrEvent.Pressure3D();
|
sl@0
|
200 |
TEST(0==Mem::Compare(reinterpret_cast<TUint8 const*>(&point3D),sizeof(TPoint3D),reinterpret_cast<TUint8 const*>(&pressure3D),sizeof(TPoint3D)));
|
sl@0
|
201 |
TInt pressure = ptrEvent.Pressure();
|
sl@0
|
202 |
TEST(point3D.iZ==pressure);
|
sl@0
|
203 |
}
|
sl@0
|
204 |
{
|
sl@0
|
205 |
// min value
|
sl@0
|
206 |
TPoint3D point3D(KMinTInt+2,KMinTInt+1,KMinTInt);
|
sl@0
|
207 |
TWsEvent event;
|
sl@0
|
208 |
event.InitAdvancedPointerEvent(TPointerEvent::EMove, 0, point3D, 0);
|
sl@0
|
209 |
TAdvancedPointerEvent ptrEvent = *event.Pointer();
|
sl@0
|
210 |
const TPoint3D pressure3D = ptrEvent.Pressure3D();
|
sl@0
|
211 |
point3D.iZ=0; // pressure can't be negative
|
sl@0
|
212 |
TEST(0==Mem::Compare(reinterpret_cast<TUint8*>(&point3D),sizeof(TPoint3D),reinterpret_cast<TUint8 const*>(&pressure3D),sizeof(TPoint3D)));
|
sl@0
|
213 |
TInt pressure = ptrEvent.Pressure();
|
sl@0
|
214 |
TEST(0==pressure);
|
sl@0
|
215 |
}
|
sl@0
|
216 |
}
|
sl@0
|
217 |
|
sl@0
|
218 |
void CTAdvancedPointerEvent::TestAdvancedPointerGetPosition()
|
sl@0
|
219 |
{
|
sl@0
|
220 |
{
|
sl@0
|
221 |
// middle value
|
sl@0
|
222 |
const TPoint3D point3D(0,0,0);
|
sl@0
|
223 |
TWsEvent event;
|
sl@0
|
224 |
event.InitAdvancedPointerEvent(TPointerEvent::EMove, 0, point3D, 0);
|
sl@0
|
225 |
TAdvancedPointerEvent ptrEvent = *event.Pointer();
|
sl@0
|
226 |
const TPoint3D position3D = ptrEvent.Position3D();
|
sl@0
|
227 |
TEST(0==Mem::Compare(reinterpret_cast<TUint8 const*>(&point3D),sizeof(TPoint3D),reinterpret_cast<TUint8 const*>(&position3D),sizeof(TPoint3D)));
|
sl@0
|
228 |
TInt proximity = ptrEvent.Proximity();
|
sl@0
|
229 |
TEST(point3D.iZ==proximity);
|
sl@0
|
230 |
}
|
sl@0
|
231 |
{
|
sl@0
|
232 |
// typical value
|
sl@0
|
233 |
const TPoint3D point3D(10,9,-8);
|
sl@0
|
234 |
TWsEvent event;
|
sl@0
|
235 |
event.InitAdvancedPointerEvent(TPointerEvent::EMove, 0, point3D, 0);
|
sl@0
|
236 |
TAdvancedPointerEvent ptrEvent = *event.Pointer();
|
sl@0
|
237 |
const TPoint3D position3D = ptrEvent.Position3D();
|
sl@0
|
238 |
TEST(0==Mem::Compare(reinterpret_cast<TUint8 const*>(&point3D),sizeof(TPoint3D),reinterpret_cast<TUint8 const*>(&position3D),sizeof(TPoint3D)));
|
sl@0
|
239 |
TInt proximity = ptrEvent.Proximity();
|
sl@0
|
240 |
TEST(point3D.iZ==proximity);
|
sl@0
|
241 |
}
|
sl@0
|
242 |
{
|
sl@0
|
243 |
// highest value
|
sl@0
|
244 |
TPoint3D point3D(KMaxTInt-2,KMaxTInt-1,KMaxTInt);
|
sl@0
|
245 |
TWsEvent event;
|
sl@0
|
246 |
event.InitAdvancedPointerEvent(TPointerEvent::EMove, 0, point3D, 0);
|
sl@0
|
247 |
TAdvancedPointerEvent ptrEvent = *event.Pointer();
|
sl@0
|
248 |
const TPoint3D position3D = ptrEvent.Position3D();
|
sl@0
|
249 |
point3D.iZ=0; // proximity can't be positive
|
sl@0
|
250 |
TEST(0==Mem::Compare(reinterpret_cast<TUint8*>(&point3D),sizeof(TPoint3D),reinterpret_cast<TUint8 const*>(&position3D),sizeof(TPoint3D)));
|
sl@0
|
251 |
TInt proximity = ptrEvent.Proximity();
|
sl@0
|
252 |
TEST(0==proximity);
|
sl@0
|
253 |
}
|
sl@0
|
254 |
{
|
sl@0
|
255 |
// lowest value
|
sl@0
|
256 |
const TPoint3D point3D(KMinTInt+2,KMinTInt+1,KMinTInt);
|
sl@0
|
257 |
TWsEvent event;
|
sl@0
|
258 |
event.InitAdvancedPointerEvent(TPointerEvent::EMove, 0, point3D, 0);
|
sl@0
|
259 |
TAdvancedPointerEvent ptrEvent = *event.Pointer();
|
sl@0
|
260 |
const TPoint3D position3D = ptrEvent.Position3D();
|
sl@0
|
261 |
TEST(0==Mem::Compare(reinterpret_cast<TUint8 const*>(&point3D),sizeof(TPoint3D),reinterpret_cast<TUint8 const*>(&position3D),sizeof(TPoint3D)));
|
sl@0
|
262 |
TInt proximity = ptrEvent.Proximity();
|
sl@0
|
263 |
TEST(point3D.iZ==proximity);
|
sl@0
|
264 |
}
|
sl@0
|
265 |
}
|
sl@0
|
266 |
|
sl@0
|
267 |
void CTAdvancedPointerEvent::TestPointerEventCopying()
|
sl@0
|
268 |
{
|
sl@0
|
269 |
TWsEvent event;
|
sl@0
|
270 |
event.InitAdvancedPointerEvent(TPointerEvent::EMove, 0, TPoint3D(2,3,4),1);
|
sl@0
|
271 |
TPointerEvent testPointerEvent;
|
sl@0
|
272 |
testPointerEvent.iModifiers =0;
|
sl@0
|
273 |
testPointerEvent.iParentPosition=TPoint(0,0);
|
sl@0
|
274 |
testPointerEvent.iPosition = TPoint(2,3);
|
sl@0
|
275 |
testPointerEvent.iType=TPointerEvent::EMove;
|
sl@0
|
276 |
|
sl@0
|
277 |
// TPointerEvent to TPointerEvent
|
sl@0
|
278 |
// Copy Constructor
|
sl@0
|
279 |
{
|
sl@0
|
280 |
TPointerEvent* pointerEventPtr = event.Pointer();
|
sl@0
|
281 |
TPointerEvent pointerEvent = *pointerEventPtr;
|
sl@0
|
282 |
TEST(0==Mem::Compare(reinterpret_cast<TUint8 const*>(&pointerEvent),sizeof(TPointerEvent),reinterpret_cast<TUint8 const*>(&testPointerEvent),sizeof(TPointerEvent)));
|
sl@0
|
283 |
}
|
sl@0
|
284 |
// Assignment operator
|
sl@0
|
285 |
{
|
sl@0
|
286 |
TPointerEvent* pointerEventPtr = event.Pointer();
|
sl@0
|
287 |
TPointerEvent pointerEvent;
|
sl@0
|
288 |
pointerEvent = *pointerEventPtr;
|
sl@0
|
289 |
TEST(0==Mem::Compare(reinterpret_cast<TUint8 const*>(&pointerEvent),sizeof(TPointerEvent),reinterpret_cast<TUint8 const*>(&testPointerEvent),sizeof(TPointerEvent)));
|
sl@0
|
290 |
}
|
sl@0
|
291 |
// TAdvancedPointerEvent to TPointerEvent
|
sl@0
|
292 |
// Copy Constructor
|
sl@0
|
293 |
{
|
sl@0
|
294 |
TAdvancedPointerEvent* advancedPointerEventPtr = event.Pointer();
|
sl@0
|
295 |
TPointerEvent pointerEvent = *advancedPointerEventPtr;
|
sl@0
|
296 |
TEST(0==Mem::Compare(reinterpret_cast<TUint8 const*>(&pointerEvent),sizeof(TPointerEvent),reinterpret_cast<TUint8 const*>(&testPointerEvent),sizeof(TPointerEvent)));
|
sl@0
|
297 |
}
|
sl@0
|
298 |
// Assignment operator
|
sl@0
|
299 |
{
|
sl@0
|
300 |
TAdvancedPointerEvent* advancedPointerEventPtr = event.Pointer();
|
sl@0
|
301 |
TPointerEvent pointerEvent;
|
sl@0
|
302 |
pointerEvent = *advancedPointerEventPtr;
|
sl@0
|
303 |
TEST(0==Mem::Compare(reinterpret_cast<TUint8 const*>(&pointerEvent),sizeof(TPointerEvent),reinterpret_cast<TUint8 const*>(&testPointerEvent),sizeof(TPointerEvent)));
|
sl@0
|
304 |
}
|
sl@0
|
305 |
|
sl@0
|
306 |
// TPointerEvent to TPointerEvent
|
sl@0
|
307 |
// Copy Method
|
sl@0
|
308 |
{
|
sl@0
|
309 |
TPointerEvent* pointerEventPtr = event.Pointer();
|
sl@0
|
310 |
TPointerEvent pointerEvent;
|
sl@0
|
311 |
pointerEvent.Copy(*pointerEventPtr);
|
sl@0
|
312 |
TEST(0==Mem::Compare(reinterpret_cast<TUint8 const*>(&pointerEvent),sizeof(TPointerEvent),reinterpret_cast<TUint8 const*>(&testPointerEvent),sizeof(TPointerEvent)));
|
sl@0
|
313 |
}
|
sl@0
|
314 |
|
sl@0
|
315 |
// TAdvancedPointerEvent to TPointerEvent
|
sl@0
|
316 |
// Copy Constructor
|
sl@0
|
317 |
{
|
sl@0
|
318 |
TAdvancedPointerEvent* advancedPointerEventPtr = event.Pointer();
|
sl@0
|
319 |
TPointerEvent pointerEvent;
|
sl@0
|
320 |
pointerEvent.Copy(*advancedPointerEventPtr);
|
sl@0
|
321 |
TEST(0==Mem::Compare(reinterpret_cast<TUint8 const*>(&pointerEvent),sizeof(TPointerEvent),reinterpret_cast<TUint8 const*>(&testPointerEvent),sizeof(TPointerEvent)));
|
sl@0
|
322 |
}
|
sl@0
|
323 |
|
sl@0
|
324 |
// Assignment operator
|
sl@0
|
325 |
{
|
sl@0
|
326 |
TAdvancedPointerEvent* advancedPointerEventPtr = event.Pointer();
|
sl@0
|
327 |
TAdvancedPointerEvent advancedPointerEventPtr2;
|
sl@0
|
328 |
advancedPointerEventPtr2 = *advancedPointerEventPtr;
|
sl@0
|
329 |
TEST(0==Mem::Compare(reinterpret_cast<TUint8 const*>(&advancedPointerEventPtr2),sizeof(TAdvancedPointerEvent),reinterpret_cast<TUint8 const*>(event.Pointer()),sizeof(TAdvancedPointerEvent)));
|
sl@0
|
330 |
}
|
sl@0
|
331 |
}
|
sl@0
|
332 |
|
sl@0
|
333 |
void CTAdvancedPointerEvent::RunTestCaseL(TInt /*aCurTestCase*/)
|
sl@0
|
334 |
{
|
sl@0
|
335 |
_LIT(KTest1,"PointerEventInit");
|
sl@0
|
336 |
_LIT(KTest2,"AdvancedPointerEventInit");
|
sl@0
|
337 |
_LIT(KTest3,"PointerEventCopying");
|
sl@0
|
338 |
_LIT(KTest4,"AdvancedPointerEventGetPointerId");
|
sl@0
|
339 |
_LIT(KTest5,"AdvancedPointerEventGetPressureAndProximity");
|
sl@0
|
340 |
_LIT(KTest6,"AdvancedPointerEventGetPressure");
|
sl@0
|
341 |
_LIT(KTest7,"AdvancedPointerEventGetPosition");
|
sl@0
|
342 |
|
sl@0
|
343 |
((CTAdvancedPointerEventStep*)iStep)->SetTestStepID(KUnknownSYMTestCaseIDName);
|
sl@0
|
344 |
switch(++iTest->iState)
|
sl@0
|
345 |
{
|
sl@0
|
346 |
case 1:
|
sl@0
|
347 |
/**
|
sl@0
|
348 |
@SYMTestCaseID GRAPHICS-WSERV-0542
|
sl@0
|
349 |
*/
|
sl@0
|
350 |
((CTAdvancedPointerEventStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0542"));
|
sl@0
|
351 |
iTest->LogSubTest(KTest1);
|
sl@0
|
352 |
TestPointerEventInit();
|
sl@0
|
353 |
break;
|
sl@0
|
354 |
case 2:
|
sl@0
|
355 |
/**
|
sl@0
|
356 |
@SYMTestCaseID GRAPHICS-WSERV-0543
|
sl@0
|
357 |
*/
|
sl@0
|
358 |
((CTAdvancedPointerEventStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0543"));
|
sl@0
|
359 |
iTest->LogSubTest(KTest2);
|
sl@0
|
360 |
TestAdvancedPointerInit();
|
sl@0
|
361 |
break;
|
sl@0
|
362 |
case 3:
|
sl@0
|
363 |
/**
|
sl@0
|
364 |
@SYMTestCaseID GRAPHICS-WSERV-0544
|
sl@0
|
365 |
*/
|
sl@0
|
366 |
((CTAdvancedPointerEventStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0544"));
|
sl@0
|
367 |
iTest->LogSubTest(KTest3);
|
sl@0
|
368 |
TestPointerEventCopying();
|
sl@0
|
369 |
break;
|
sl@0
|
370 |
case 4:
|
sl@0
|
371 |
/**
|
sl@0
|
372 |
@SYMTestCaseID GRAPHICS-WSERV-0545
|
sl@0
|
373 |
*/
|
sl@0
|
374 |
((CTAdvancedPointerEventStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0545"));
|
sl@0
|
375 |
iTest->LogSubTest(KTest4);
|
sl@0
|
376 |
TestAdvancedPointerGetPointerId();
|
sl@0
|
377 |
break;
|
sl@0
|
378 |
case 5:
|
sl@0
|
379 |
/**
|
sl@0
|
380 |
@SYMTestCaseID GRAPHICS-WSERV-0546
|
sl@0
|
381 |
*/
|
sl@0
|
382 |
((CTAdvancedPointerEventStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0546"));
|
sl@0
|
383 |
iTest->LogSubTest(KTest5);
|
sl@0
|
384 |
TestAdvancedPointerGetPressureAndProximity();
|
sl@0
|
385 |
break;
|
sl@0
|
386 |
case 6:
|
sl@0
|
387 |
/**
|
sl@0
|
388 |
@SYMTestCaseID GRAPHICS-WSERV-0547
|
sl@0
|
389 |
*/
|
sl@0
|
390 |
((CTAdvancedPointerEventStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0547"));
|
sl@0
|
391 |
iTest->LogSubTest(KTest6);
|
sl@0
|
392 |
TestAdvancedPointerGetPressure();
|
sl@0
|
393 |
break;
|
sl@0
|
394 |
case 7:
|
sl@0
|
395 |
/**
|
sl@0
|
396 |
@SYMTestCaseID GRAPHICS-WSERV-0548
|
sl@0
|
397 |
*/
|
sl@0
|
398 |
((CTAdvancedPointerEventStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0548"));
|
sl@0
|
399 |
iTest->LogSubTest(KTest7);
|
sl@0
|
400 |
TestAdvancedPointerGetPosition();
|
sl@0
|
401 |
break;
|
sl@0
|
402 |
default:
|
sl@0
|
403 |
((CTAdvancedPointerEventStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
|
sl@0
|
404 |
((CTAdvancedPointerEventStep*)iStep)->CloseTMSGraphicsStep();
|
sl@0
|
405 |
TestComplete();
|
sl@0
|
406 |
break;
|
sl@0
|
407 |
}
|
sl@0
|
408 |
((CTAdvancedPointerEventStep*)iStep)->RecordTestResultL();
|
sl@0
|
409 |
}
|
sl@0
|
410 |
|
sl@0
|
411 |
__WS_CONSTRUCT_STEP__(AdvancedPointerEvent)
|