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 the License "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 |
// e32test\digitiser\t_ldddigitisertest.cpp
|
sl@0
|
15 |
//
|
sl@0
|
16 |
//
|
sl@0
|
17 |
|
sl@0
|
18 |
#include <e32test.h>
|
sl@0
|
19 |
#include <e32hal.h>
|
sl@0
|
20 |
#include "d_lddDigitisertest.h"
|
sl@0
|
21 |
#include <hal.h>
|
sl@0
|
22 |
|
sl@0
|
23 |
_LIT(KLddFileName, "D_LDDDIGITISERTEST.LDD");
|
sl@0
|
24 |
|
sl@0
|
25 |
RLddDigitiserTest gLDD;
|
sl@0
|
26 |
GLDEF_D RTest test(_L("Digitiser LDD tests"));
|
sl@0
|
27 |
|
sl@0
|
28 |
void DoTestOnUnregisteredDevice()
|
sl@0
|
29 |
{
|
sl@0
|
30 |
__UHEAP_MARK;
|
sl@0
|
31 |
test.Printf(_L("DoTestOnUnregisteredDevice(): should return KErrNotSupported coz NO DEVICE IS REGISTERED !!!"));
|
sl@0
|
32 |
TInt r;
|
sl@0
|
33 |
TInt halApiVal;
|
sl@0
|
34 |
TInt unregisteredDeviceNumber=99; // Its highly unlikely that this device number is registered
|
sl@0
|
35 |
|
sl@0
|
36 |
r=HAL::Get(unregisteredDeviceNumber,HALData::EPointer3D,halApiVal);
|
sl@0
|
37 |
test(r==KErrNotSupported);
|
sl@0
|
38 |
|
sl@0
|
39 |
r=HAL::Get(unregisteredDeviceNumber,HALData::EPointer3DMaxProximity,halApiVal);
|
sl@0
|
40 |
test(r==KErrNotSupported);
|
sl@0
|
41 |
|
sl@0
|
42 |
r=HAL::Get(unregisteredDeviceNumber,HALData::EPointer3DThetaSupported,halApiVal);
|
sl@0
|
43 |
test(r==KErrNotSupported);
|
sl@0
|
44 |
|
sl@0
|
45 |
r=HAL::Get(unregisteredDeviceNumber,HALData::EPointer3DPhiSupported,halApiVal);
|
sl@0
|
46 |
test(r==KErrNotSupported);
|
sl@0
|
47 |
|
sl@0
|
48 |
r=HAL::Get(unregisteredDeviceNumber,HALData::EPointer3DRotationSupported,halApiVal);
|
sl@0
|
49 |
test(r==KErrNotSupported);
|
sl@0
|
50 |
|
sl@0
|
51 |
r=HAL::Get(unregisteredDeviceNumber,HALData::EPointer3DPressureSupported,halApiVal);
|
sl@0
|
52 |
test(r==KErrNotSupported);
|
sl@0
|
53 |
|
sl@0
|
54 |
r=HAL::Get(unregisteredDeviceNumber,HALData::EPointer3DProximityStep,halApiVal);
|
sl@0
|
55 |
test(r==KErrNotSupported);
|
sl@0
|
56 |
|
sl@0
|
57 |
r=HAL::Get(unregisteredDeviceNumber,HALData::EPointerMaxPointers,halApiVal);
|
sl@0
|
58 |
test(r==KErrNotSupported);
|
sl@0
|
59 |
|
sl@0
|
60 |
r=HAL::Get(unregisteredDeviceNumber,HALData::EPointerNumberOfPointers,halApiVal);
|
sl@0
|
61 |
test(r==KErrNotSupported);
|
sl@0
|
62 |
|
sl@0
|
63 |
r=HAL::Get(unregisteredDeviceNumber,HALData::EPointer3DMaxPressure,halApiVal);
|
sl@0
|
64 |
test(r==KErrNotSupported);
|
sl@0
|
65 |
|
sl@0
|
66 |
r=HAL::Get(unregisteredDeviceNumber,HALData::EPointer3DPressureStep,halApiVal);
|
sl@0
|
67 |
test(r==KErrNotSupported);
|
sl@0
|
68 |
|
sl@0
|
69 |
test.Printf(_L("Successully Finished Testing the DoTestOnUnregisteredDevice\n"));
|
sl@0
|
70 |
__UHEAP_MARKEND;
|
sl@0
|
71 |
}
|
sl@0
|
72 |
|
sl@0
|
73 |
void DoTestDerivedeAtributes()
|
sl@0
|
74 |
{
|
sl@0
|
75 |
__UHEAP_MARK;
|
sl@0
|
76 |
TInt r;
|
sl@0
|
77 |
TInt halApiVal;
|
sl@0
|
78 |
TInt testDriverVal;
|
sl@0
|
79 |
TInt testDeviceNumber;
|
sl@0
|
80 |
|
sl@0
|
81 |
//new Values for HAL::Set
|
sl@0
|
82 |
TInt halPointer3DMaxProximity=45;
|
sl@0
|
83 |
TInt halPointerNumberOfPointers=5;
|
sl@0
|
84 |
|
sl@0
|
85 |
// New attribute values for Driver APIs
|
sl@0
|
86 |
TInt newPointer3D=0;
|
sl@0
|
87 |
TInt newPointer3DMaxProximity=50;
|
sl@0
|
88 |
TInt newPointer3DThetaSupported=0;
|
sl@0
|
89 |
TInt newPointer3DPhiSupported=0;
|
sl@0
|
90 |
TInt newPointer3DRotationSupported=0;
|
sl@0
|
91 |
TInt newPointer3DPressureSupported=0;
|
sl@0
|
92 |
TInt newPointer3DProximityStep=6;
|
sl@0
|
93 |
TInt newPointerMaxPointers=7;
|
sl@0
|
94 |
TInt newPointerNumberOfPointers=2;
|
sl@0
|
95 |
TInt newPointer3DMaxPressure=501;
|
sl@0
|
96 |
TInt newPointer3DPressureStep=50;
|
sl@0
|
97 |
|
sl@0
|
98 |
/*
|
sl@0
|
99 |
The following sequence should be followed
|
sl@0
|
100 |
|
sl@0
|
101 |
a) Load the test Driver
|
sl@0
|
102 |
|
sl@0
|
103 |
b) Open the channel
|
sl@0
|
104 |
|
sl@0
|
105 |
c) Register Kernel Hal Handler
|
sl@0
|
106 |
|
sl@0
|
107 |
d) Get the Registered Device Number
|
sl@0
|
108 |
|
sl@0
|
109 |
e) Initialise HAL data
|
sl@0
|
110 |
|
sl@0
|
111 |
f) Get/Set HAL Data using HAL APIS (HAL::GET, HAL::SET)
|
sl@0
|
112 |
|
sl@0
|
113 |
g) Get/Set the HAL data throught the test driver APIS
|
sl@0
|
114 |
|
sl@0
|
115 |
h) Compare the results and make sure that data recived are same and data set
|
sl@0
|
116 |
using HAL library apis received with test driver APIS and vice versa.
|
sl@0
|
117 |
|
sl@0
|
118 |
i) Do it for all the new Digitiser Attributes (11 at the moment)
|
sl@0
|
119 |
|
sl@0
|
120 |
j) .....
|
sl@0
|
121 |
|
sl@0
|
122 |
k) De-register the Kernel HAL handler
|
sl@0
|
123 |
|
sl@0
|
124 |
l) Unload the Driver
|
sl@0
|
125 |
|
sl@0
|
126 |
m) END...
|
sl@0
|
127 |
|
sl@0
|
128 |
*/
|
sl@0
|
129 |
test.Printf(_L("Testing Derived Attributes using a test Driver for Digitiser\n"));
|
sl@0
|
130 |
r=User::LoadLogicalDevice(KLddFileName);
|
sl@0
|
131 |
test(r==KErrNone);
|
sl@0
|
132 |
|
sl@0
|
133 |
r=gLDD.Open();
|
sl@0
|
134 |
test(r==KErrNone);
|
sl@0
|
135 |
|
sl@0
|
136 |
r=gLDD.registerHalHandler();
|
sl@0
|
137 |
test(r==KErrNone || r==KErrNotSupported);
|
sl@0
|
138 |
|
sl@0
|
139 |
testDeviceNumber=gLDD.getRegisteredDeviceNumber();
|
sl@0
|
140 |
test(testDeviceNumber != KErrNotFound);
|
sl@0
|
141 |
gLDD.initialiseHalData();
|
sl@0
|
142 |
|
sl@0
|
143 |
r=HAL::Get(testDeviceNumber,HALData::EPointer3D,halApiVal);
|
sl@0
|
144 |
test(r==KErrNone);
|
sl@0
|
145 |
testDriverVal=gLDD.getPointer3D();
|
sl@0
|
146 |
test(halApiVal == testDriverVal);
|
sl@0
|
147 |
|
sl@0
|
148 |
r=HAL::Get(testDeviceNumber,HALData::EPointer3DMaxProximity,halApiVal);
|
sl@0
|
149 |
test(r==KErrNone);
|
sl@0
|
150 |
testDriverVal=gLDD.getPointer3DMaxProximity();
|
sl@0
|
151 |
test(halApiVal == testDriverVal);
|
sl@0
|
152 |
|
sl@0
|
153 |
r=HAL::Get(testDeviceNumber,HALData::EPointer3DThetaSupported,halApiVal);
|
sl@0
|
154 |
test(r==KErrNone);
|
sl@0
|
155 |
testDriverVal=gLDD.getPointer3DThetaSupported();
|
sl@0
|
156 |
test(halApiVal == testDriverVal);
|
sl@0
|
157 |
|
sl@0
|
158 |
r=HAL::Get(testDeviceNumber,HALData::EPointer3DPhiSupported,halApiVal);
|
sl@0
|
159 |
test(r==KErrNone);
|
sl@0
|
160 |
testDriverVal=gLDD.getPointer3DPhiSupported();
|
sl@0
|
161 |
test(halApiVal == testDriverVal);
|
sl@0
|
162 |
|
sl@0
|
163 |
r=HAL::Get(testDeviceNumber,HALData::EPointer3DRotationSupported,halApiVal);
|
sl@0
|
164 |
test(r==KErrNone);
|
sl@0
|
165 |
testDriverVal=gLDD.getPointer3DRotationSupported();
|
sl@0
|
166 |
test(halApiVal == testDriverVal);
|
sl@0
|
167 |
|
sl@0
|
168 |
r=HAL::Get(testDeviceNumber,HALData::EPointer3DPressureSupported,halApiVal);
|
sl@0
|
169 |
test(r==KErrNone);
|
sl@0
|
170 |
testDriverVal=gLDD.getPointer3DPressureSupported();
|
sl@0
|
171 |
test(halApiVal == testDriverVal);
|
sl@0
|
172 |
|
sl@0
|
173 |
r=HAL::Get(testDeviceNumber,HALData::EPointer3DProximityStep,halApiVal);
|
sl@0
|
174 |
test(r==KErrNone);
|
sl@0
|
175 |
testDriverVal=gLDD.getPointer3DProximityStep();
|
sl@0
|
176 |
test(halApiVal == testDriverVal);
|
sl@0
|
177 |
|
sl@0
|
178 |
r=HAL::Get(testDeviceNumber,HALData::EPointerMaxPointers,halApiVal);
|
sl@0
|
179 |
test(r==KErrNone);
|
sl@0
|
180 |
testDriverVal=gLDD.getPointerMaxPointers();
|
sl@0
|
181 |
test(halApiVal == testDriverVal);
|
sl@0
|
182 |
|
sl@0
|
183 |
r=HAL::Get(testDeviceNumber,HALData::EPointerNumberOfPointers,halApiVal);
|
sl@0
|
184 |
test(r==KErrNone);
|
sl@0
|
185 |
testDriverVal=gLDD.getPointerNumberOfPointers();
|
sl@0
|
186 |
test(halApiVal == testDriverVal);
|
sl@0
|
187 |
|
sl@0
|
188 |
r=HAL::Get(testDeviceNumber,HALData::EPointer3DMaxPressure,halApiVal);
|
sl@0
|
189 |
test(r==KErrNone);
|
sl@0
|
190 |
testDriverVal=gLDD.getPointer3DMaxPressure();
|
sl@0
|
191 |
test(halApiVal == testDriverVal);
|
sl@0
|
192 |
|
sl@0
|
193 |
r=HAL::Get(testDeviceNumber,HALData::EPointer3DPressureStep,halApiVal);
|
sl@0
|
194 |
test(r==KErrNone);
|
sl@0
|
195 |
testDriverVal=gLDD.getPointer3DPressureStep();
|
sl@0
|
196 |
test(halApiVal == testDriverVal);
|
sl@0
|
197 |
|
sl@0
|
198 |
// There are just 2 settable HAL Values. Set them using HAL APIs and get the same using
|
sl@0
|
199 |
// Test Driver APIs.
|
sl@0
|
200 |
r=HAL::Set(testDeviceNumber,HALData::EPointer3DMaxProximity,halPointer3DMaxProximity);
|
sl@0
|
201 |
test(r==KErrNone);
|
sl@0
|
202 |
testDriverVal=gLDD.getPointer3DMaxProximity();
|
sl@0
|
203 |
test(halPointer3DMaxProximity == testDriverVal);
|
sl@0
|
204 |
r=HAL::Get(testDeviceNumber,HALData::EPointer3DMaxProximity,halApiVal);
|
sl@0
|
205 |
test(r==KErrNone);
|
sl@0
|
206 |
test(halApiVal == halPointer3DMaxProximity);
|
sl@0
|
207 |
|
sl@0
|
208 |
r=HAL::Set(testDeviceNumber,HALData::EPointerNumberOfPointers,halPointerNumberOfPointers);
|
sl@0
|
209 |
test(r==KErrNone);
|
sl@0
|
210 |
testDriverVal=gLDD.getPointerNumberOfPointers();
|
sl@0
|
211 |
test(halPointerNumberOfPointers == testDriverVal);
|
sl@0
|
212 |
r=HAL::Get(testDeviceNumber,HALData::EPointerNumberOfPointers,halApiVal);
|
sl@0
|
213 |
test(r==KErrNone);
|
sl@0
|
214 |
test(halApiVal == halPointerNumberOfPointers);
|
sl@0
|
215 |
|
sl@0
|
216 |
// Set the Attributes values using the Driver APis and make sure that the same is
|
sl@0
|
217 |
// received with HAL::Get APis
|
sl@0
|
218 |
gLDD.setPointer3D(newPointer3D);
|
sl@0
|
219 |
r=HAL::Get(testDeviceNumber,HALData::EPointer3D,halApiVal);
|
sl@0
|
220 |
test(r==KErrNone);
|
sl@0
|
221 |
test(halApiVal == newPointer3D);
|
sl@0
|
222 |
|
sl@0
|
223 |
gLDD.setPointer3DMaxProximity(newPointer3DMaxProximity);
|
sl@0
|
224 |
r=HAL::Get(testDeviceNumber,HALData::EPointer3DMaxProximity,halApiVal);
|
sl@0
|
225 |
test(r==KErrNone);
|
sl@0
|
226 |
test(halApiVal == newPointer3DMaxProximity);
|
sl@0
|
227 |
|
sl@0
|
228 |
gLDD.setPointer3DThetaSupported(newPointer3DThetaSupported);
|
sl@0
|
229 |
r=HAL::Get(testDeviceNumber,HALData::EPointer3DThetaSupported,halApiVal);
|
sl@0
|
230 |
test(r==KErrNone);
|
sl@0
|
231 |
test(halApiVal == newPointer3DThetaSupported);
|
sl@0
|
232 |
|
sl@0
|
233 |
gLDD.setPointer3DPhiSupported(newPointer3DPhiSupported);
|
sl@0
|
234 |
r=HAL::Get(testDeviceNumber,HALData::EPointer3DPhiSupported,halApiVal);
|
sl@0
|
235 |
test(r==KErrNone);
|
sl@0
|
236 |
test(halApiVal == newPointer3DPhiSupported);
|
sl@0
|
237 |
|
sl@0
|
238 |
gLDD.setPointer3DRotationSupported(newPointer3DRotationSupported);
|
sl@0
|
239 |
r=HAL::Get(testDeviceNumber,HALData::EPointer3DRotationSupported,halApiVal);
|
sl@0
|
240 |
test(r==KErrNone);
|
sl@0
|
241 |
test(halApiVal == newPointer3DRotationSupported);
|
sl@0
|
242 |
|
sl@0
|
243 |
gLDD.setPointer3DPressureSupported(newPointer3DPressureSupported);
|
sl@0
|
244 |
r=HAL::Get(testDeviceNumber,HALData::EPointer3DPressureSupported,halApiVal);
|
sl@0
|
245 |
test(r==KErrNone);
|
sl@0
|
246 |
test(halApiVal == newPointer3DPressureSupported);
|
sl@0
|
247 |
|
sl@0
|
248 |
gLDD.setPointer3DProximityStep(newPointer3DProximityStep);
|
sl@0
|
249 |
r=HAL::Get(testDeviceNumber,HALData::EPointer3DProximityStep,halApiVal);
|
sl@0
|
250 |
test(r==KErrNone);
|
sl@0
|
251 |
test(halApiVal == newPointer3DProximityStep);
|
sl@0
|
252 |
|
sl@0
|
253 |
gLDD.setPointerMaxPointers(newPointerMaxPointers);
|
sl@0
|
254 |
r=HAL::Get(testDeviceNumber,HALData::EPointerMaxPointers,halApiVal);
|
sl@0
|
255 |
test(r==KErrNone);
|
sl@0
|
256 |
test(halApiVal == newPointerMaxPointers);
|
sl@0
|
257 |
|
sl@0
|
258 |
gLDD.setPointerNumberOfPointers(newPointerNumberOfPointers);
|
sl@0
|
259 |
r=HAL::Get(testDeviceNumber,HALData::EPointerNumberOfPointers,halApiVal);
|
sl@0
|
260 |
test(r==KErrNone);
|
sl@0
|
261 |
test(halApiVal == newPointerNumberOfPointers);
|
sl@0
|
262 |
|
sl@0
|
263 |
gLDD.setPointer3DMaxPressure(newPointer3DMaxPressure);
|
sl@0
|
264 |
r=HAL::Get(testDeviceNumber,HALData::EPointer3DMaxPressure,halApiVal);
|
sl@0
|
265 |
test(r==KErrNone);
|
sl@0
|
266 |
test(halApiVal == newPointer3DMaxPressure);
|
sl@0
|
267 |
|
sl@0
|
268 |
gLDD.setPointer3DPressureStep(newPointer3DPressureStep);
|
sl@0
|
269 |
|
sl@0
|
270 |
r=HAL::Get(testDeviceNumber,HALData::EPointer3DPressureStep,halApiVal);
|
sl@0
|
271 |
test(r==KErrNone);
|
sl@0
|
272 |
test(halApiVal == newPointer3DPressureStep);
|
sl@0
|
273 |
|
sl@0
|
274 |
r=gLDD.removeHalHandler();
|
sl@0
|
275 |
test(r == KErrNone);
|
sl@0
|
276 |
|
sl@0
|
277 |
gLDD.Close();
|
sl@0
|
278 |
|
sl@0
|
279 |
r = User::FreeLogicalDevice(KLddFileName);;
|
sl@0
|
280 |
test(r==KErrNone);
|
sl@0
|
281 |
User::After(100000);
|
sl@0
|
282 |
|
sl@0
|
283 |
// Finished Testing Derived attributes
|
sl@0
|
284 |
test.Printf(_L("Successully Finished Testing the Derived attributes\n"));
|
sl@0
|
285 |
__UHEAP_MARKEND;
|
sl@0
|
286 |
}
|
sl@0
|
287 |
|
sl@0
|
288 |
void DoTestNonDerivedAtributes()
|
sl@0
|
289 |
{
|
sl@0
|
290 |
__UHEAP_MARK;
|
sl@0
|
291 |
// The following 4 HAL attributes would be tested using HAL::GET,HAL:SET APIs
|
sl@0
|
292 |
// 1. EPointer3DEnterHighPressureThreshold
|
sl@0
|
293 |
// 2. EPointer3DExitHighPressureThreshold
|
sl@0
|
294 |
// 3. EPointer3DEnterCloseProximityThreshold
|
sl@0
|
295 |
// 4. EPointer3DExitCloseProximityThreshold
|
sl@0
|
296 |
//////////********TEST STEPS********////////////////////
|
sl@0
|
297 |
// Step1: Get the existing/default values using HAL:GET() and save them (for restoring it at Step4)
|
sl@0
|
298 |
// Step2: Set new valuee using HAL:SET()
|
sl@0
|
299 |
// Step3: Make sure that the new values are set by camparing the new valuee with the values got by HAL:GET()
|
sl@0
|
300 |
// Step4: Restore the orginal values( saved at Step1)
|
sl@0
|
301 |
|
sl@0
|
302 |
TInt r;
|
sl@0
|
303 |
TInt halGetVal;
|
sl@0
|
304 |
// Save the Original Values
|
sl@0
|
305 |
TInt origPointer3DEnterHighPressureThreshold;
|
sl@0
|
306 |
TInt origPointer3DExitHighPressureThreshold;
|
sl@0
|
307 |
TInt origPointer3DEnterCloseProximityThreshold;
|
sl@0
|
308 |
TInt origPointer3DExitCloseProximityThreshold;
|
sl@0
|
309 |
|
sl@0
|
310 |
// New values to be set
|
sl@0
|
311 |
TInt newPointer3DEnterHighPressureThreshold = 500;
|
sl@0
|
312 |
TInt newPointer3DExitHighPressureThreshold = 300;
|
sl@0
|
313 |
TInt newPointer3DEnterCloseProximityThreshold = 20;
|
sl@0
|
314 |
TInt newPointer3DExitCloseProximityThreshold = 35;
|
sl@0
|
315 |
|
sl@0
|
316 |
test.Printf(_L("Testing Non-Derived attributes\n"));
|
sl@0
|
317 |
|
sl@0
|
318 |
// Test EPointer3DEnterHighPressureThreshold
|
sl@0
|
319 |
r=HAL::Get(HALData::EPointer3DEnterHighPressureThreshold,origPointer3DEnterHighPressureThreshold);
|
sl@0
|
320 |
test(r==KErrNone);
|
sl@0
|
321 |
r=HAL::Set(HALData::EPointer3DEnterHighPressureThreshold,newPointer3DEnterHighPressureThreshold);
|
sl@0
|
322 |
test(r==KErrNone);
|
sl@0
|
323 |
r=HAL::Get(HALData::EPointer3DEnterHighPressureThreshold,halGetVal);
|
sl@0
|
324 |
test(r==KErrNone);
|
sl@0
|
325 |
test(halGetVal == newPointer3DEnterHighPressureThreshold);
|
sl@0
|
326 |
r=HAL::Set(HALData::EPointer3DEnterHighPressureThreshold,origPointer3DEnterHighPressureThreshold);
|
sl@0
|
327 |
test(r==KErrNone);
|
sl@0
|
328 |
r=HAL::Get(HALData::EPointer3DEnterHighPressureThreshold,halGetVal);
|
sl@0
|
329 |
test(r==KErrNone);
|
sl@0
|
330 |
test(halGetVal == origPointer3DEnterHighPressureThreshold);
|
sl@0
|
331 |
|
sl@0
|
332 |
// Test EPointer3DExitHighPressureThreshold
|
sl@0
|
333 |
r=HAL::Get(HALData::EPointer3DExitHighPressureThreshold,origPointer3DExitHighPressureThreshold);
|
sl@0
|
334 |
test(r==KErrNone);
|
sl@0
|
335 |
r=HAL::Set(HALData::EPointer3DExitHighPressureThreshold,newPointer3DExitHighPressureThreshold);
|
sl@0
|
336 |
test(r==KErrNone);
|
sl@0
|
337 |
r=HAL::Get(HALData::EPointer3DExitHighPressureThreshold,halGetVal);
|
sl@0
|
338 |
test(r==KErrNone);
|
sl@0
|
339 |
test(halGetVal == newPointer3DExitHighPressureThreshold);
|
sl@0
|
340 |
r=HAL::Set(HALData::EPointer3DExitHighPressureThreshold,origPointer3DExitHighPressureThreshold);
|
sl@0
|
341 |
test(r==KErrNone);
|
sl@0
|
342 |
r=HAL::Get(HALData::EPointer3DExitHighPressureThreshold,halGetVal);
|
sl@0
|
343 |
test(r==KErrNone);
|
sl@0
|
344 |
test(halGetVal == origPointer3DExitHighPressureThreshold);
|
sl@0
|
345 |
|
sl@0
|
346 |
// Test EPointer3DEnterCloseProximityThreshold
|
sl@0
|
347 |
r=HAL::Get(HALData::EPointer3DEnterCloseProximityThreshold,origPointer3DEnterCloseProximityThreshold);
|
sl@0
|
348 |
test(r==KErrNone);
|
sl@0
|
349 |
r=HAL::Set(HALData::EPointer3DEnterCloseProximityThreshold,newPointer3DEnterCloseProximityThreshold);
|
sl@0
|
350 |
test(r==KErrNone);
|
sl@0
|
351 |
r=HAL::Get(HALData::EPointer3DEnterCloseProximityThreshold,halGetVal);
|
sl@0
|
352 |
test(r==KErrNone);
|
sl@0
|
353 |
test(halGetVal == newPointer3DEnterCloseProximityThreshold);
|
sl@0
|
354 |
r=HAL::Set(HALData::EPointer3DEnterCloseProximityThreshold,origPointer3DEnterCloseProximityThreshold);
|
sl@0
|
355 |
test(r==KErrNone);
|
sl@0
|
356 |
r=HAL::Get(HALData::EPointer3DEnterCloseProximityThreshold,halGetVal);
|
sl@0
|
357 |
test(r==KErrNone);
|
sl@0
|
358 |
test(halGetVal == origPointer3DEnterCloseProximityThreshold);
|
sl@0
|
359 |
|
sl@0
|
360 |
// Test EPointer3DExitCloseProximityThreshold
|
sl@0
|
361 |
r=HAL::Get(HALData::EPointer3DExitCloseProximityThreshold,origPointer3DExitCloseProximityThreshold);
|
sl@0
|
362 |
test(r==KErrNone);
|
sl@0
|
363 |
r=HAL::Set(HALData::EPointer3DExitCloseProximityThreshold,newPointer3DExitCloseProximityThreshold);
|
sl@0
|
364 |
test(r==KErrNone);
|
sl@0
|
365 |
r=HAL::Get(HALData::EPointer3DExitCloseProximityThreshold,halGetVal);
|
sl@0
|
366 |
test(r==KErrNone);
|
sl@0
|
367 |
test(halGetVal == newPointer3DExitCloseProximityThreshold);
|
sl@0
|
368 |
r=HAL::Set(HALData::EPointer3DExitCloseProximityThreshold,origPointer3DExitCloseProximityThreshold);
|
sl@0
|
369 |
test(r==KErrNone);
|
sl@0
|
370 |
r=HAL::Get(HALData::EPointer3DExitCloseProximityThreshold,halGetVal);
|
sl@0
|
371 |
test(r==KErrNone);
|
sl@0
|
372 |
test(halGetVal == origPointer3DExitCloseProximityThreshold);
|
sl@0
|
373 |
|
sl@0
|
374 |
// Finished Testing non-derived attributes
|
sl@0
|
375 |
test.Printf(_L("Successully Finished Testing the non-derived attributes\n"));
|
sl@0
|
376 |
__UHEAP_MARKEND;
|
sl@0
|
377 |
}
|
sl@0
|
378 |
|
sl@0
|
379 |
GLDEF_C TInt E32Main()
|
sl@0
|
380 |
//
|
sl@0
|
381 |
// Test Digitiser LDD
|
sl@0
|
382 |
//
|
sl@0
|
383 |
{
|
sl@0
|
384 |
TInt machineUid=0;
|
sl@0
|
385 |
// This Testing is performed only on H4,Wins and WinEmulator, so need to get the machinUID
|
sl@0
|
386 |
const TInt r = HAL::Get(HAL::EMachineUid, machineUid);
|
sl@0
|
387 |
if(r==KErrNone)
|
sl@0
|
388 |
{
|
sl@0
|
389 |
test.Start(_L("Test Start : LDDDigitiserTest"));
|
sl@0
|
390 |
// Non-Derived attributes are tested using a Test Driver for Digitiser which is supported only on H4,Wins and WinEmulator
|
sl@0
|
391 |
if((machineUid == HAL::EMachineUid_OmapH4) || (machineUid == HAL::EMachineUid_Win32Emulator))
|
sl@0
|
392 |
{
|
sl@0
|
393 |
DoTestNonDerivedAtributes();
|
sl@0
|
394 |
}
|
sl@0
|
395 |
// Derived attributes are tested using a Test Driver for Digitiser which is supported only on H4
|
sl@0
|
396 |
if(machineUid == HAL::EMachineUid_OmapH4)
|
sl@0
|
397 |
{
|
sl@0
|
398 |
DoTestOnUnregisteredDevice();
|
sl@0
|
399 |
DoTestDerivedeAtributes();
|
sl@0
|
400 |
}
|
sl@0
|
401 |
}
|
sl@0
|
402 |
test.End();
|
sl@0
|
403 |
test.Close();
|
sl@0
|
404 |
return(KErrNone);
|
sl@0
|
405 |
}
|