author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Fri, 17 Sep 2010 08:37:32 +0300 | |
changeset 60 | 9a7e3d5f461a |
parent 36 | b47902b73a93 |
permissions | -rw-r--r-- |
36 | 1 |
// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). |
2 |
// All rights reserved. |
|
3 |
// This component and the accompanying materials are made available |
|
4 |
// under the terms of "Eclipse Public License v1.0" |
|
5 |
// which accompanies this distribution, and is available |
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 |
// |
|
8 |
// Initial Contributors: |
|
9 |
// Nokia Corporation - initial contribution. |
|
10 |
// |
|
11 |
// Contributors: |
|
12 |
// |
|
13 |
// Description: |
|
14 |
// @file ctlbsx3psteptransmit.cpp |
|
15 |
// This is the class implementation for the Module Information Tests |
|
16 |
// EPOC includes. |
|
17 |
// |
|
18 |
// |
|
19 |
||
20 |
// LBS includes. |
|
21 |
#include <lbs.h> |
|
22 |
#include <lbs/lbsx3p.h> |
|
23 |
#include <lbs/test/lbsnetsimtest.h> |
|
24 |
||
25 |
#include <lbs/lbsadmin.h> |
|
26 |
#include <lbs/lbslocerrors.h> |
|
27 |
||
28 |
#include <lbs/lbsassistancedatabuilderset.h> |
|
29 |
||
30 |
// LBS test includes. |
|
31 |
#include "ctlbsx3psteptransmit.h" |
|
32 |
||
33 |
// Required for LBS-X3P-Transmit-0007 |
|
34 |
#include "ctlbsstepsetautonomousmode.h" |
|
35 |
||
36 |
||
37 |
const TInt KTestAssistanceDataProviderPluginUidValue = 0x10281D77; |
|
38 |
const TInt KRealAssistanceDataProviderPluginUidValue = 0x10285AC2; |
|
39 |
||
40 |
const TUint KLbsGpsLocManagerUidValue = 0x10281D44; |
|
41 |
const TUid KLbsGpsLocManagerUid = {KLbsGpsLocManagerUidValue}; |
|
42 |
||
43 |
#define REFPOS_LAT 52.2 |
|
44 |
#define REFPOS_LONG 0.2 |
|
45 |
#define REFPOS_ALT 10 |
|
46 |
#define REFPOS_HORZ_ACCURACY 100 |
|
47 |
#define REFPOS_VERT_ACCURACY 100 |
|
48 |
||
49 |
#define NETWORK_MAX_FIX_TIME 5000000 |
|
50 |
#define NETWORK_HORZ_ACCURACY 10 |
|
51 |
#define NETWORK_VERT_ACCURACY 10 |
|
52 |
||
53 |
||
54 |
//profile_id in ini file |
|
55 |
_LIT(KLbsProfileId, "profile_id"); |
|
56 |
||
57 |
//max_time in ini file |
|
58 |
_LIT(KLbsMaxTime, "max_time"); |
|
59 |
||
60 |
/** |
|
61 |
* Destructor |
|
62 |
*/ |
|
63 |
CT_LbsX3PStep_Transmit::~CT_LbsX3PStep_Transmit() |
|
64 |
{ |
|
65 |
iServer.Close(); |
|
66 |
iPositionTransmitter.Close(); |
|
67 |
} |
|
68 |
||
69 |
||
70 |
/** |
|
71 |
* Constructor |
|
72 |
*/ |
|
73 |
CT_LbsX3PStep_Transmit::CT_LbsX3PStep_Transmit(CT_LbsX3PServer& aParent) : CT_LbsX3PStep(aParent) |
|
74 |
{ |
|
75 |
SetTestStepName(KLbsX3PStep_Transmit); |
|
76 |
} |
|
77 |
||
78 |
||
79 |
/** |
|
80 |
Static Constructor |
|
81 |
*/ |
|
82 |
CT_LbsX3PStep_Transmit* CT_LbsX3PStep_Transmit::New(CT_LbsX3PServer& aParent) |
|
83 |
{ |
|
84 |
CT_LbsX3PStep_Transmit* testStep = new CT_LbsX3PStep_Transmit(aParent); |
|
85 |
// Note the lack of ELeave. |
|
86 |
// This means that having insufficient memory will return NULL; |
|
87 |
||
88 |
if (testStep) |
|
89 |
{ |
|
90 |
TInt err = KErrNone; |
|
91 |
||
92 |
TRAP(err, testStep->ConstructL()); |
|
93 |
if (err) |
|
94 |
{ |
|
95 |
delete testStep; |
|
96 |
testStep = NULL; |
|
97 |
} |
|
98 |
} |
|
99 |
||
100 |
return testStep; |
|
101 |
} |
|
102 |
||
103 |
void CT_LbsX3PStep_Transmit::ConstructL() |
|
104 |
{ |
|
105 |
CT_LbsX3PStep::ConstructL(); |
|
106 |
||
107 |
//We need to wait while the log events are added |
|
108 |
SetExtendedTimerInterval(1000000); |
|
109 |
||
110 |
// Carry out common test actions (such as connecting to a server). |
|
111 |
||
112 |
// Connect to the Transmit Position server. |
|
113 |
User::LeaveIfError(iServer.Connect()); |
|
114 |
||
115 |
// Open the positioner. |
|
116 |
User::LeaveIfError(iPositionTransmitter.Open(iServer)); |
|
117 |
||
118 |
} |
|
119 |
||
120 |
/** |
|
121 |
* @return - TVerdict code |
|
122 |
* Override of base class pure virtual |
|
123 |
* Our implementation only gets called if the base class doTestStepPreambleL() did |
|
124 |
* not leave. That being the case, the current test result value will be EPass. |
|
125 |
*/ |
|
126 |
TVerdict CT_LbsX3PStep_Transmit::doTestStepL() |
|
127 |
{ |
|
128 |
// Generic test step used to test the LBS Client Notify position update API. |
|
129 |
INFO_PRINTF1(_L(">>CT_LbsX3PStep_Transmit::doTestStepL()")); |
|
130 |
||
131 |
if (TestStepResult() == EPass) |
|
132 |
{ |
|
133 |
//Code common to all switch statements |
|
134 |
||
135 |
// Create the active object to carry out the transmit location. |
|
136 |
iDoTransmitPos = CT_LbsX3PDoTransmitPos::NewL(this, iPositionTransmitter); |
|
137 |
CleanupStack::PushL(iDoTransmitPos); |
|
138 |
||
139 |
// Location to use. |
|
140 |
//RPointerArray<TAny>& srcPosInfoArr = iParent.iSharedData->iVerifyPosInfoArr; |
|
141 |
//TPositionInfo* srcPosInfo = reinterpret_cast<TPositionInfo*>(srcPosInfoArr[0]); |
|
142 |
//TPosition srcPos; |
|
143 |
//srcPosInfo->GetPosition(srcPos); |
|
144 |
||
145 |
||
146 |
||
147 |
iRefPosFlag = GetIntFromConfig(ConfigSection(), KLbsRefPos, iRefPosFlag); |
|
148 |
||
149 |
iFlagsToHaltOn = KLbsCallback_MoLr | |
|
150 |
KLbsCallback_Got_NotifyDoTransmitPos | |
|
151 |
(iRefPosFlag? KLbsCallback_Got_NotifyDoTransmitReferencePos:0) | |
|
152 |
KLbsCallback_NetSim_Got_Connect; // Test case callback events. |
|
153 |
||
154 |
TModuleDataIn modDataIn; // Used to send test information to the test module. |
|
155 |
//Reset test module timeout |
|
156 |
//if(iParent.iSharedData->iTestModuleInUse) |
|
157 |
// { |
|
158 |
// modDataIn.iRequestType = TModuleDataIn::EModuleRequestTimeOut; |
|
159 |
// modDataIn.iTimeOut = 0; |
|
160 |
// |
|
161 |
// iUtils.NotifyModuleOfConfigChangeL(modDataIn); |
|
162 |
// } |
|
163 |
||
164 |
CLbsAdmin* adminApi = CLbsAdmin::NewL(); |
|
165 |
CleanupStack::PushL(adminApi); |
|
166 |
||
167 |
// Kick off the keep alive timer. |
|
168 |
TTimeIntervalMicroSeconds32 interval(KLbsKeepAlivePeriod); |
|
169 |
iKeepAliveTimer->SetTimer(interval); |
|
170 |
||
171 |
// Carry out unique test actions. |
|
172 |
if (GetIntFromConfig(ConfigSection(), KTestCaseId, iTestCaseId)) |
|
173 |
{ |
|
174 |
switch (iTestCaseId) |
|
175 |
{ |
|
176 |
// Test case LBS-X3P-Options-0001 |
|
177 |
case 01: |
|
178 |
// Test case LBS-X3P-Options-0001 Request Transmit to third party with timeout |
|
179 |
// |
|
180 |
// External step: Inform module of required single position to be transmitted. |
|
181 |
// Local step: Do X3P. |
|
182 |
// Local callbacks: Verify callback parameters are as expected. |
|
183 |
// NotifyMeasurementReportLocation callback, aPosition should match iVerifyPosInfoArr. |
|
184 |
// TransmitPosition callback, aStatus should be KErrTimedOut |
|
185 |
||
186 |
{ |
|
187 |
||
188 |
// We now expect extra callback of NotifyMeasurementReportControlFailure instead of |
|
189 |
// KLbsCallback_NetSim_Got_NotifyMeasurementReportLocation due to timeout. |
|
190 |
iFlagsToHaltOn = KLbsCallback_MoLr | |
|
191 |
KLbsCallback_NetSim_Got_Connect | |
|
192 |
KLbsCallback_Got_NotifyDoTransmitPos | |
|
193 |
(iRefPosFlag? KLbsCallback_Got_NotifyDoTransmitReferencePos:0) | |
|
194 |
KLbsCallback_NetSim_Got_NotifyMeasurementReportControlFailure; |
|
195 |
// We expet failure callback due to tmieout! |
|
196 |
||
197 |
iFlagsToHaltOn &=~ KLbsCallback_NetSim_Got_NotifyMeasurementReportLocation; |
|
198 |
iFlagsToHaltOn &=~ KLbsCallback_NetSim_Got_NotifyFacilityLcsMoLrResult; |
|
199 |
||
200 |
//1. |
|
201 |
||
202 |
//2 |
|
203 |
//Transmit Location |
|
204 |
TLbsTransmitPositionOptions transmitOptions; |
|
205 |
transmitOptions.SetTimeOut(5*1000000); //Set X3P Timeout to 5 sec |
|
206 |
iPositionTransmitter.SetTransmitOptions(transmitOptions); |
|
207 |
||
208 |
User::After(1000); |
|
209 |
||
210 |
TLbsTransmitPositionOptions retrievedTransmitOptions; |
|
211 |
iPositionTransmitter.GetTransmitOptions(retrievedTransmitOptions); |
|
212 |
||
213 |
if(retrievedTransmitOptions.TimeOut() != transmitOptions.TimeOut()) |
|
214 |
{ |
|
215 |
INFO_PRINTF1(_L("<FONT><B>Set and Get results didnt match</B></FONT>")); |
|
216 |
SetTestStepResult(EFail); |
|
217 |
} |
|
218 |
||
219 |
// The module request type - time out value. |
|
220 |
modDataIn.iRequestType = TModuleDataIn::EModuleRequestTimeOut; |
|
221 |
modDataIn.iTimeOut = 10*1000000; |
|
222 |
||
223 |
// Send timeout value to test module - will block. |
|
224 |
iUtils.NotifyModuleOfConfigChangeL(modDataIn); |
|
225 |
||
226 |
} |
|
227 |
break; |
|
228 |
||
229 |
case 03: |
|
230 |
{ |
|
231 |
//Timeout for Transmit Location |
|
232 |
TLbsTransmitPositionOptions transmitOptions; |
|
233 |
||
234 |
TTimeIntervalMicroSeconds timeout = transmitOptions.TimeOut(); |
|
235 |
if(timeout.Int64() != 0) |
|
236 |
{ |
|
237 |
INFO_PRINTF1(_L("<FONT><B>Default timeout should be zero</B></FONT>")); |
|
238 |
SetTestStepResult(EFail); |
|
239 |
} |
|
240 |
||
241 |
//iFlagsToHaltOn = KLbsCallback_NetSim_Got_Connect ; |
|
242 |
||
243 |
CleanupStack::PopAndDestroy(adminApi); |
|
244 |
iDoTransmitPos->Cancel(); |
|
245 |
CleanupStack::PopAndDestroy(iDoTransmitPos); |
|
246 |
return TestStepResult(); |
|
247 |
} |
|
248 |
||
249 |
case 04: |
|
250 |
{ |
|
251 |
//We might have to put this test in LBS-X3P-TransmitOptions |
|
252 |
//Timeout for Transmit Location |
|
253 |
TLbsTransmitPositionOptions transmitOptions(-10); |
|
254 |
||
255 |
//The code should panic before and not come to this point |
|
256 |
INFO_PRINTF1(_L("<FONT><B>Negative timout should not be allowed</B></FONT>")); |
|
257 |
SetTestStepResult(EFail); |
|
258 |
||
259 |
//return TestStepResult(); |
|
260 |
} |
|
261 |
||
262 |
case 05: |
|
263 |
{ |
|
264 |
if(iParent.iSharedData->iTestModuleInUse) |
|
265 |
{ |
|
266 |
//Configure gps-test-module to respond after the specified timeout. |
|
267 |
modDataIn.iRequestType = TModuleDataIn::EModuleRequestTimeOut; |
|
268 |
modDataIn.iTimeOut = 140*1000000; |
|
269 |
||
270 |
// Send timeout value to test module - will block. |
|
271 |
iUtils.NotifyModuleOfConfigChangeL(modDataIn); |
|
272 |
} |
|
273 |
||
274 |
iFlagsToHaltOn = KLbsCallback_NetSim_Got_Connect | |
|
275 |
KLbsCallback_NetSim_Got_NotifyRegisterLcsMoLr | |
|
276 |
KLbsCallback_NetSim_Got_NotifyMeasurementControlLocation | |
|
277 |
KLbsCallback_NetSim_Got_NotifyMeasurementReportControlFailure | |
|
278 |
KLbsCallback_NetSim_Got_NotifyReleaseLcsMoLr| |
|
279 |
(iRefPosFlag? KLbsCallback_Got_NotifyDoTransmitReferencePos:0) | |
|
280 |
KLbsCallback_Got_NotifyDoTransmitPos; |
|
281 |
||
282 |
} |
|
283 |
break; |
|
284 |
||
285 |
// Test case LBS-X3P-Transmit-0001 |
|
286 |
// This test uses the default functionality in each of the callbacks. |
|
287 |
case 11: |
|
288 |
{ |
|
289 |
// Kick off basic test. |
|
290 |
// Test case LBS-X3P-Transmit-0001 Transmit current position with default options (no SetTransmitOptions() call |
|
291 |
// and quality profile left as default) to a valid destination. |
|
292 |
// |
|
293 |
// External step: Inform module of required single position to be transmitted. |
|
294 |
// Local step: Do X3P. |
|
295 |
// Local callbacks: Verify callback parameters are as expected. |
|
296 |
// NotifyMeasurementReportLocation callback, aPosition should match iVerifyPosInfoArr. |
|
297 |
// TransmitPosition callback, aStatus should be KErrNone |
|
298 |
||
299 |
} |
|
300 |
break; |
|
301 |
||
302 |
// Test case LBS-X3P-Transmit-0003 |
|
303 |
// This test switches to specific functionality in each of the callbacks. |
|
304 |
case 13: |
|
305 |
{ |
|
306 |
// Test case LBS-X3P-Transmit-0003 Request transmit current position from multiple sessions. |
|
307 |
// |
|
308 |
// External step: Inform module of required single position to be transmitted. |
|
309 |
// Local step: Do multiple X3P. |
|
310 |
// Local callbacks: Verify callback parameters are as expected. |
|
311 |
// NotifyMeasurementReportLocation callback, each aPosition should match iVerifyPosInfoArr. |
|
312 |
// TransmitPosition callback, aStatus should be KErrNone |
|
313 |
||
314 |
// 1. Create single client (RlbsTransnitPositionServer object) |
|
315 |
// 2. Open multiple sub-sessions (RlbsTransnitPosition objects) |
|
316 |
||
317 |
CT_LbsX3PDoTransmitPos* pDoTransPos; |
|
318 |
//RLbsTransmitPosition transPos1; |
|
319 |
//RLbsTransmitPosition transPos2; |
|
320 |
//RLbsTransmitPosition transPos3; |
|
321 |
iTransmitPos1.Open(iServer); |
|
322 |
iTransmitPos2.Open(iServer); |
|
323 |
iTransmitPos3.Open(iServer); |
|
324 |
||
325 |
// 3. Request X3P on each sub-session (can have same priorities) |
|
326 |
// Create the active object array to carry out the transmit location. |
|
327 |
||
328 |
pDoTransPos = CT_LbsX3PDoTransmitPos::NewL(this, iTransmitPos1); |
|
329 |
iDoTransmitPosArr.AppendL(pDoTransPos); |
|
330 |
||
331 |
pDoTransPos = CT_LbsX3PDoTransmitPos::NewL(this, iTransmitPos2); |
|
332 |
iDoTransmitPosArr.AppendL(pDoTransPos); |
|
333 |
||
334 |
pDoTransPos = CT_LbsX3PDoTransmitPos::NewL(this, iTransmitPos3); |
|
335 |
iDoTransmitPosArr.AppendL(pDoTransPos); |
|
336 |
||
337 |
} |
|
338 |
break; |
|
339 |
||
340 |
// Test case LBS-X3P-Transmit-0004 |
|
341 |
case 14: |
|
342 |
||
343 |
// Test case LBS-X3P-Transmit-0004 Transmit current position with specified quality profile Id to a valid destination. |
|
344 |
// |
|
345 |
// External step: Inform module of required single position to be transmitted. |
|
346 |
// Local step: Set admin KLbsSettingQualityProfileTransmitLocate and profile Id 4((which is exist in lbsprofile.ini) |
|
347 |
// Local step: Do X3P. |
|
348 |
// Local callbacks: Verify callback parameters are as expected. |
|
349 |
// NotifyMeasurementReportLocation callback, aPosition should match iVerifyPosInfoArr. |
|
350 |
// TransmitPosition callback, aStatus should be KErrNone |
|
351 |
||
352 |
// Test case LBS-X3P-Transmit-Profile-0033 |
|
353 |
case 133: |
|
354 |
// Test case LBS-X3P-Transmit-Profile-0033 Request Transmit to third party with timeout |
|
355 |
// |
|
356 |
// External step: Inform module of required single position to be transmitted. |
|
357 |
// Local step: Set admin KLbsSettingQualityProfileTransmitLocate and profile Id 0((which is exist in lbsprofile.ini) |
|
358 |
// Local step: Do X3P. |
|
359 |
// Local callbacks: Verify callback parameters are as expected. |
|
360 |
// NotifyMeasurementReportLocation callback, aPosition should match iVerifyPosInfoArr. |
|
361 |
// TransmitPosition callback, aStatus should be KErrTimedOut |
|
362 |
||
363 |
{ |
|
364 |
||
365 |
if(iTestCaseId==133) |
|
366 |
{ |
|
367 |
// We now expect extra callback of NotifyMeasurementReportControlFailure instead of |
|
368 |
// KLbsCallback_NetSim_Got_NotifyMeasurementReportLocation due to timeout. |
|
369 |
iFlagsToHaltOn = KLbsCallback_MoLr | |
|
370 |
KLbsCallback_NetSim_Got_Connect | |
|
371 |
KLbsCallback_Got_NotifyDoTransmitPos | |
|
372 |
(iRefPosFlag? KLbsCallback_Got_NotifyDoTransmitReferencePos:0) | |
|
373 |
KLbsCallback_NetSim_Got_NotifyMeasurementReportControlFailure; |
|
374 |
// We expet failure callback due to tmieout! |
|
375 |
||
376 |
iFlagsToHaltOn &=~ KLbsCallback_NetSim_Got_NotifyMeasurementReportLocation; |
|
377 |
iFlagsToHaltOn &=~ KLbsCallback_NetSim_Got_NotifyFacilityLcsMoLrResult; |
|
378 |
||
379 |
||
380 |
// The module request type - time out value. |
|
381 |
modDataIn.iRequestType = TModuleDataIn::EModuleRequestTimeOut; |
|
382 |
modDataIn.iTimeOut = 10*1000000; |
|
383 |
||
384 |
// Send timeout value to test module - will block. |
|
385 |
iUtils.NotifyModuleOfConfigChangeL(modDataIn); |
|
386 |
} |
|
387 |
||
388 |
TInt profileid_ini; |
|
389 |
TBool profileid_exists; |
|
390 |
profileid_exists = GetIntFromConfig(ConfigSection(), KLbsProfileId, profileid_ini); |
|
391 |
if(!profileid_exists) |
|
392 |
{ |
|
393 |
INFO_PRINTF1(_L("Could not get profileid from section")); |
|
394 |
SetTestStepResult(EFail); |
|
395 |
} |
|
396 |
||
397 |
TLbsQualityProfileId profileId; |
|
398 |
// Set Profile id |
|
399 |
User::LeaveIfError(adminApi->Set(KLbsSettingQualityProfileTransmitLocate, TLbsQualityProfileId(profileid_ini))); |
|
400 |
//wait some time to propagate the setting |
|
401 |
User::After(5*1000000); |
|
402 |
||
403 |
// Verify that the setting is what we expect |
|
404 |
User::LeaveIfError(adminApi->Get(KLbsSettingQualityProfileTransmitLocate, profileId)); |
|
405 |
if(profileId != TLbsQualityProfileId(profileid_ini)) |
|
406 |
{ |
|
407 |
INFO_PRINTF1(_L("<FONT><B>Set Profile id failed</B></FONT>")); |
|
408 |
SetTestStepResult(EFail); |
|
409 |
} |
|
410 |
} |
|
411 |
break; |
|
412 |
||
413 |
// Test case LBS-X3P-Transmit-0006 |
|
414 |
case 16: |
|
415 |
{ |
|
416 |
||
417 |
// Test case LBS-X3P-Transmit-0006 Request X3P when gps unavailable |
|
418 |
// |
|
419 |
// External step: Inform module of required single position to be transmitted. |
|
420 |
// Local step: Do X3P. |
|
421 |
// Local callbacks: Verify callback parameters are as expected. |
|
422 |
// NotifyMeasurementReportLocation callback, aPosition should match iVerifyPosInfoArr. |
|
423 |
// TransmitPosition callback, aStatus should not be KErrNone |
|
424 |
||
425 |
iFlagsToHaltOn = KLbsCallback_NetSim_Got_Connect | |
|
426 |
KLbsCallback_NetSim_Got_NotifyRegisterLcsMoLr | |
|
427 |
KLbsCallback_NetSim_Got_NotifyMeasurementControlLocation | |
|
428 |
KLbsCallback_NetSim_Got_NotifyMeasurementReportControlFailure | |
|
429 |
KLbsCallback_Got_NotifyDoTransmitPos | |
|
430 |
(iRefPosFlag? KLbsCallback_Got_NotifyDoTransmitReferencePos:0) | |
|
431 |
KLbsCallback_NetSim_Got_NotifyReleaseLcsMoLr; |
|
432 |
||
433 |
// 1. Configure test a-gps module to respond with error (gps unavailable) |
|
434 |
// The module request type - error value. |
|
435 |
modDataIn.iRequestType = TModuleDataIn::EModuleRequestError; |
|
436 |
modDataIn.iError = KErrNotFound; |
|
437 |
||
438 |
// Send error value to test module - will block. |
|
439 |
iUtils.NotifyModuleOfConfigChangeL(modDataIn); |
|
440 |
||
441 |
} |
|
442 |
break; |
|
443 |
||
444 |
// Test case LBS-X3P-Transmit-0007 |
|
445 |
case 17: |
|
446 |
{ |
|
447 |
||
448 |
// Test case LBS-X3P-Transmit-0007 Transmit to 3rd party with 'autonomous-only' mode set |
|
449 |
// |
|
450 |
// External step: Inform module of required single position to be transmitted. |
|
451 |
// Local step: Do X3P. |
|
452 |
// Local callbacks: Verify callback parameters are as expected. |
|
453 |
// NotifyMeasurementReportLocation callback, aPosition should match iVerifyPosInfoArr. |
|
454 |
// TransmitPosition callback, aStatus should be KErrNone |
|
455 |
||
456 |
} |
|
457 |
break; |
|
458 |
||
459 |
// Test case LBS-X3P-Transmit-0008 |
|
460 |
case 18: |
|
461 |
{ |
|
462 |
||
463 |
// Test case LBS-X3P-Transmit-0008 Request X3P when X3P turned off in admin settings. |
|
464 |
// |
|
465 |
// External step: Inform module of required single position to be transmitted. |
|
466 |
// Local step: Do X3P. |
|
467 |
// Local callbacks: Verify callback parameters are as expected. |
|
468 |
// Callback should not be invoked |
|
469 |
// TransmitPosition callback, aStatus should be KErrAccessDenied |
|
470 |
||
471 |
// 1. ETransmitLocateOff for KSettingHomeTransmitLocate |
|
472 |
||
473 |
// X3P is turned off so no netsim callbacks should be recieved. |
|
474 |
iFlagsToHaltOn = KLbsCallback_NetSim_Got_Connect | |
|
475 |
(iRefPosFlag? KLbsCallback_Got_NotifyDoTransmitReferencePos:0) | |
|
476 |
KLbsCallback_Got_NotifyDoTransmitPos; |
|
477 |
||
478 |
adminApi->Set(KLbsSettingHomeTransmitLocate, CLbsAdmin::ETransmitLocateOff); |
|
479 |
User::After(10*1000000); |
|
480 |
} |
|
481 |
break; |
|
482 |
||
483 |
// Test case LBS-X3P-Transmit-0009 |
|
484 |
case 19: |
|
485 |
{ |
|
486 |
||
487 |
// Test case LBS-X3P-Transmit-0009 Request X3P when self-locate turned off in admin settings. |
|
488 |
// |
|
489 |
// External step: Inform module of required single position to be transmitted. |
|
490 |
// Local step: Do X3P. |
|
491 |
// Local callbacks: Verify callback parameters are as expected. |
|
492 |
// NotifyMeasurementReportLocation callback, aPosition should match iVerifyPosInfoArr. |
|
493 |
// TransmitPosition callback, aStatus should be KErrNone |
|
494 |
||
495 |
// 1. ESelfLocateOff for KSettingHomeTransmitLocate |
|
496 |
adminApi->Set(KLbsSettingHomeTransmitLocate, CLbsAdmin::ESelfLocateOff); |
|
497 |
User::After(5*1000000); |
|
498 |
} |
|
499 |
break; |
|
500 |
||
501 |
// Test case LBS-X3P-Transmit-0010 |
|
502 |
case 110: |
|
503 |
{ |
|
504 |
||
505 |
// Test case LBS-X3P-Transmit-0010 Request X3P when ExternalLocateOff set for KSettingHomeTransmitLocate in admin settings. |
|
506 |
// |
|
507 |
// External step: Inform module of required single position to be transmitted. |
|
508 |
// Local step: Do X3P. |
|
509 |
// Local callbacks: Verify callback parameters are as expected. |
|
510 |
// NotifyMeasurementReportLocation callback, aPosition should match iVerifyPosInfoArr. |
|
511 |
// TransmitPosition callback, aStatus should be KErrNone |
|
512 |
||
513 |
// 1. EExternalLocateOff for KSettingHomeTransmitLocate |
|
514 |
adminApi->Set(KLbsSettingHomeTransmitLocate, CLbsAdmin::EExternalLocateOff); |
|
515 |
User::After(5*1000000); |
|
516 |
} |
|
517 |
break; |
|
518 |
||
519 |
// Test case LBS-X3P-Transmit-0011 |
|
520 |
case 111: |
|
521 |
{ |
|
522 |
||
523 |
// Test case LBS-X3P-Transmit-0011 Request X3P when X3P turned off in admin settings. Roaming. |
|
524 |
// |
|
525 |
// External step: Inform module of required single position to be transmitted. |
|
526 |
// Local step: Do X3P. |
|
527 |
// Local callbacks: Verify callback parameters are as expected. |
|
528 |
// NotifyMeasurementReportLocation callback, aPosition should match iVerifyPosInfoArr. |
|
529 |
// TransmitPosition callback, aStatus should be KErrNone |
|
530 |
||
531 |
iFlagsToHaltOn = KLbsCallback_NetSim_Got_Connect | |
|
532 |
(iRefPosFlag? KLbsCallback_Got_NotifyDoTransmitReferencePos:0) | |
|
533 |
KLbsCallback_Got_NotifyDoTransmitPos; |
|
534 |
||
535 |
#pragma message("TO DO: LBS-X3P-Transmit-0011 CANNOT TEST THIS IN ROAMING MODE YET. INCOMPLETE") |
|
536 |
||
537 |
// 1. EExternalLocateOff for KSettingRoamingTransmitLocate |
|
538 |
adminApi->Set(KLbsSettingRoamingTransmitLocate, CLbsAdmin::ETransmitLocateOff); |
|
539 |
User::After(5*1000000); |
|
540 |
} |
|
541 |
break; |
|
542 |
||
543 |
// Test case LBS-X3P-Transmit-0012 |
|
544 |
case 112: |
|
545 |
{ |
|
546 |
||
547 |
// Test case LBS-X3P-Transmit-0012 Request X3P when ESelfLocateOff set for KLbsSettingRoamingTransmitLocate in admin settings. |
|
548 |
// |
|
549 |
// External step: Inform module of required single position to be transmitted. |
|
550 |
// Local step: Do X3P. |
|
551 |
// Local callbacks: Verify callback parameters are as expected. |
|
552 |
// NotifyMeasurementReportLocation callback, aPosition should match iVerifyPosInfoArr. |
|
553 |
// TransmitPosition callback, aStatus should be KErrNone |
|
554 |
||
555 |
// 1. ESelfLocateOff for KLbsSettingRoamingTransmitLocate |
|
556 |
adminApi->Set(KLbsSettingRoamingTransmitLocate, CLbsAdmin::ESelfLocateOff); |
|
557 |
User::After(5*1000000); |
|
558 |
} |
|
559 |
break; |
|
560 |
||
561 |
// Test case LBS-X3P-Transmit-0013 |
|
562 |
case 113: |
|
563 |
{ |
|
564 |
||
565 |
// Test case LBS-X3P-Transmit-0013 Request X3P when EExternalLocateOff set for KLbsSettingRoamingTransmitLocate in admin settings. |
|
566 |
// |
|
567 |
// External step: Inform module of required single position to be transmitted. |
|
568 |
// Local step: Do X3P. |
|
569 |
// Local callbacks: Verify callback parameters are as expected. |
|
570 |
// NotifyMeasurementReportLocation callback, aPosition should match iVerifyPosInfoArr. |
|
571 |
// TransmitPosition callback, aStatus should be KErrNone |
|
572 |
||
573 |
// 1. EExternalLocateOff for KLbsSettingRoamingTransmitLocate |
|
574 |
adminApi->Set(KLbsSettingRoamingTransmitLocate, CLbsAdmin::EExternalLocateOff); |
|
575 |
User::After(5*1000000); |
|
576 |
} |
|
577 |
break; |
|
578 |
||
579 |
// Test case LBS-X3P-Transmit-0014 |
|
580 |
case 114: |
|
581 |
{ |
|
582 |
if(iParent.iSharedData->iTestModuleInUse) |
|
583 |
{ |
|
584 |
//Configure gps-test-module to respond after the specified timeout. |
|
585 |
modDataIn.iRequestType = TModuleDataIn::EModuleRequestTimeOut; |
|
586 |
modDataIn.iTimeOut = 10*1000000; |
|
587 |
||
588 |
// Send timeout value to test module - will block. |
|
589 |
iUtils.NotifyModuleOfConfigChangeL(modDataIn); |
|
590 |
} |
|
591 |
||
592 |
//Set timeout to 0 - This should disable Timeout |
|
593 |
TLbsTransmitPositionOptions transmitOptions; |
|
594 |
transmitOptions.SetTimeOut(0); |
|
595 |
iPositionTransmitter.SetTransmitOptions(transmitOptions); |
|
596 |
||
597 |
} |
|
598 |
break; |
|
599 |
||
600 |
// Test case LBS-X3P-Transmit-0015 |
|
601 |
case 115: |
|
602 |
{ |
|
603 |
iFlagsToHaltOn = KLbsCallback_NetSim_Got_Connect | |
|
604 |
KLbsCallback_NetSim_Got_NotifyRegisterLcsMoLr | |
|
605 |
(iRefPosFlag? KLbsCallback_Got_NotifyDoTransmitReferencePos:0) | |
|
606 |
KLbsCallback_Got_NotifyDoTransmitPos; |
|
607 |
||
608 |
} |
|
609 |
break; |
|
610 |
||
611 |
// Test case LBS-X3P-Transmit-0016 |
|
612 |
case 116: |
|
613 |
{ |
|
614 |
iFlagsToHaltOn = KLbsCallback_NetSim_Got_Connect | |
|
615 |
KLbsCallback_NetSim_Got_NotifyRegisterLcsMoLr | |
|
616 |
KLbsCallback_NetSim_Got_NotifyMeasurementControlLocation | |
|
617 |
(iRefPosFlag? KLbsCallback_Got_NotifyDoTransmitReferencePos:0) | |
|
618 |
KLbsCallback_Got_NotifyDoTransmitPos; |
|
619 |
||
620 |
} |
|
621 |
break; |
|
622 |
||
623 |
// Test case LBS-X3P-Transmit-0017 |
|
624 |
case 117: |
|
625 |
{ |
|
626 |
if(iParent.iSharedData->iTestModuleInUse) |
|
627 |
{ |
|
628 |
//Configure gps-test-module to request for more assitance data. |
|
629 |
T_LbsUtils utils; |
|
630 |
TModuleDataIn modDataIn; // Used to send test information to the test module. |
|
631 |
modDataIn.iRequestType = TModuleDataIn::EModuleRequestTestMode; |
|
632 |
modDataIn.iAssDataEventType = TModuleDataIn::EAssDataEventExpectSingle; |
|
633 |
modDataIn.iAssDataTestMode = TModuleDataIn::EModuleTestModeAssDataOn_SomeDataNotAvailable; |
|
634 |
||
635 |
utils.NotifyModuleOfConfigChangeL(modDataIn); |
|
636 |
} |
|
637 |
||
638 |
iFlagsToHaltOn |= KLbsCallback_NetSim_Got_NotifyMeasurementReportRequestMoreAssistanceData; |
|
639 |
||
640 |
} |
|
641 |
break; |
|
642 |
||
643 |
case 118: |
|
644 |
break; |
|
645 |
||
646 |
||
647 |
// Test case LBS-X3P-Transmit-0030 |
|
648 |
case 130: |
|
649 |
{ |
|
650 |
// Test case LBS-X3P-Transmit-0030 Kick off X3P test with bad phone number/email. |
|
651 |
// |
|
652 |
// External step: Inform module of required single position to be transmitted. |
|
653 |
// Local step: Do X3P but pass in an invalid number/email. |
|
654 |
// Local callbacks: Verify callback parameters are as expected. |
|
655 |
// TransmitPosition callback, aStatus should be KErrNotFound |
|
656 |
iFlagsToHaltOn = KLbsCallback_NetSim_Got_Connect | |
|
657 |
(iRefPosFlag? KLbsCallback_Got_NotifyDoTransmitReferencePos:0) | |
|
658 |
KLbsCallback_Got_NotifyDoTransmitPos | |
|
659 |
KLbsCallback_NetSim_Got_NotifyReleaseLcsMoLr; |
|
660 |
||
661 |
} |
|
662 |
break; |
|
663 |
||
664 |
// Test case LBS-X3P-Timeout-0001 |
|
665 |
case 134: |
|
666 |
{ |
|
667 |
// Kick off basic test. |
|
668 |
// Test case LBS-X3P-Timeout-0001 Transmit current position with default options (no SetTransmitOptions() call |
|
669 |
// and quality profile left as default) to a valid destination. |
|
670 |
// |
|
671 |
// External step: Inform module of required single position to be transmitted. |
|
672 |
// Local step: Do X3P. |
|
673 |
// Local callbacks: Verify callback parameters are as expected. |
|
674 |
// NotifyMeasurementReportLocation callback, aStatus should be KPositionQualityLoss |
|
675 |
// as the location provided didn't meet the quality requirements |
|
676 |
iFlagsToHaltOn = KLbsCallback_NetSim_Got_Connect | |
|
677 |
KLbsCallback_NetSim_Got_NotifyRegisterLcsMoLr | |
|
678 |
KLbsCallback_NetSim_Got_NotifyMeasurementControlLocation | |
|
679 |
KLbsCallback_NetSim_Got_NotifyReleaseLcsMoLr | |
|
680 |
KLbsCallback_Got_NotifyDoTransmitPos | |
|
681 |
KLbsCallback_NetSim_Got_NotifyMeasurementReportLocation | |
|
682 |
KLbsCallback_NetSim_Got_NotifyFacilityLcsMoLrResult; |
|
683 |
} |
|
684 |
break; |
|
685 |
||
686 |
||
687 |
default: |
|
688 |
{ |
|
689 |
User::Panic(KLbsX3PStep_Transmit, KErrUnknown); |
|
690 |
} |
|
691 |
} |
|
692 |
} |
|
693 |
||
694 |
//Connect to NetSim |
|
695 |
iNetSim.ConnectL(this); |
|
696 |
||
697 |
// Set the reference position, which also be used for any required verification. |
|
698 |
iRefPos.SetCoordinate(REFPOS_LAT, REFPOS_LONG, REFPOS_ALT); |
|
699 |
iRefPos.SetAccuracy(REFPOS_HORZ_ACCURACY, REFPOS_VERT_ACCURACY); |
|
700 |
iRefPos.SetCurrentTime(); |
|
701 |
||
702 |
if (!iNetSim.SetReferenceLocation(iRefPos)) |
|
703 |
{ |
|
704 |
INFO_PRINTF1(_L("Failed test, can't set NetSim's reference location.")); |
|
705 |
SetTestStepResult(EFail); |
|
706 |
iNetSim.Close(); |
|
707 |
return TestStepResult(); |
|
708 |
} |
|
709 |
||
710 |
// Test case LBS-X3P-Transmit-0004 or Test case LBS-X3P-Transmit-0005 |
|
711 |
if(iTestCaseId==14 || iTestCaseId==15) |
|
712 |
{ |
|
713 |
// Set all parameters invalid (0 for max fix time; NaN for |
|
714 |
// accuracy) then network should use quality profile with the |
|
715 |
// ID set |
|
716 |
TTimeIntervalMicroSeconds maxFixTime(0); |
|
717 |
iNetPosQuality.SetMaxFixTime(maxFixTime); |
|
718 |
TRealX nan; |
|
719 |
nan.SetNaN(); |
|
720 |
iNetPosQuality.SetMinHorizontalAccuracy(nan); |
|
721 |
iNetPosQuality.SetMinVerticalAccuracy(nan); |
|
722 |
} |
|
723 |
// Test case LBS-X3P-Timeout-0001 |
|
724 |
else if (iTestCaseId==134) |
|
725 |
{ |
|
726 |
TTimeIntervalMicroSeconds maxFixTime(5000000); |
|
727 |
iNetPosQuality.SetMaxFixTime(maxFixTime); |
|
728 |
iNetPosQuality.SetMinHorizontalAccuracy(1); |
|
729 |
iNetPosQuality.SetMinVerticalAccuracy(1); |
|
730 |
} |
|
731 |
else |
|
732 |
{ |
|
733 |
//Set the position quality required by the network. |
|
734 |
TTimeIntervalMicroSeconds maxFixTime(120 * 1000000);//default was 60 |
|
735 |
//max acceptable age of a position |
|
736 |
iNetPosQuality.SetMaxFixTime(maxFixTime); |
|
737 |
iNetPosQuality.SetMinHorizontalAccuracy(NETWORK_HORZ_ACCURACY); |
|
738 |
iNetPosQuality.SetMinVerticalAccuracy(NETWORK_VERT_ACCURACY); |
|
739 |
} |
|
740 |
||
741 |
if (!iNetSim.SetQuality(iNetPosQuality)) |
|
742 |
{ |
|
743 |
INFO_PRINTF1(_L("Failed test, can't set NetSim's quality.")); |
|
744 |
SetTestStepResult(EFail); |
|
745 |
iNetSim.Close(); |
|
746 |
return TestStepResult(); |
|
747 |
} |
|
748 |
||
749 |
TUid pluginUid; |
|
750 |
if(iParent.iSharedData->iTestModuleInUse) |
|
751 |
{ |
|
752 |
// Set plugin to use. |
|
753 |
pluginUid = TUid::Uid(KTestAssistanceDataProviderPluginUidValue); |
|
754 |
} |
|
755 |
else |
|
756 |
{ |
|
757 |
// Real AGPS Uid |
|
758 |
pluginUid = TUid::Uid(KRealAssistanceDataProviderPluginUidValue); |
|
759 |
} |
|
760 |
||
761 |
||
762 |
if (!iNetSim.SetAssistanceDataProvider(pluginUid)) |
|
763 |
{ |
|
764 |
INFO_PRINTF1(_L("Failed test, can't set NetSim's assistance data plugin uid.")); |
|
765 |
SetTestStepResult(EFail); |
|
766 |
iNetSim.Close(); |
|
767 |
return TestStepResult(); |
|
768 |
} |
|
769 |
||
770 |
if(iTestCaseId !=133) |
|
771 |
{ |
|
772 |
//Set X3P Timeout |
|
773 |
TLbsTransmitPositionOptions transmitOptions; //This is how long we wait for an X3P |
|
774 |
TTimeIntervalMicroSeconds KLbsTransmitPositionTimeOut; |
|
775 |
if(iTestCaseId == 01) |
|
776 |
KLbsTransmitPositionTimeOut = 5*1000000; //5 sec |
|
777 |
else if(iTestCaseId==05) |
|
778 |
KLbsTransmitPositionTimeOut = 180*1000000; //180 sec - Let maxFixtime expire first |
|
779 |
else if (iTestCaseId==134) |
|
780 |
KLbsTransmitPositionTimeOut = 10*1000000; //10 sec - Let maxFixtime expire first |
|
781 |
else |
|
782 |
KLbsTransmitPositionTimeOut = 20*1000000; //20 sec |
|
783 |
||
784 |
transmitOptions.SetTimeOut(KLbsTransmitPositionTimeOut); |
|
785 |
iPositionTransmitter.SetTransmitOptions(transmitOptions); |
|
786 |
} |
|
787 |
||
788 |
||
789 |
//Kickoff test |
|
790 |
CActiveScheduler::Start(); |
|
791 |
||
792 |
switch(iTestCaseId) |
|
793 |
{ |
|
794 |
case 01: |
|
795 |
case 05: |
|
796 |
case 133: |
|
797 |
{ |
|
798 |
// The module request type - time out value. |
|
799 |
modDataIn.iRequestType = TModuleDataIn::EModuleRequestTimeOut; |
|
800 |
modDataIn.iTimeOut = 0; |
|
801 |
||
802 |
// Reset test module timeout |
|
803 |
iUtils.NotifyModuleOfConfigChangeL(modDataIn); |
|
804 |
||
805 |
} |
|
806 |
break; |
|
807 |
||
808 |
case 13: |
|
809 |
{ |
|
810 |
iDoTransmitPosArr.ResetAndDestroy(); |
|
811 |
||
812 |
//Close temporary transmitPosition objects |
|
813 |
iTransmitPos1.Close(); |
|
814 |
iTransmitPos2.Close(); |
|
815 |
iTransmitPos3.Close(); |
|
816 |
} |
|
817 |
break; |
|
818 |
||
819 |
||
820 |
case 16: |
|
821 |
{ |
|
822 |
//reset the error code back |
|
823 |
// The module request type - error value. |
|
824 |
modDataIn.iRequestType = TModuleDataIn::EModuleRequestError; |
|
825 |
modDataIn.iError = KErrNone; |
|
826 |
||
827 |
// Send error value to test module - will block. |
|
828 |
iUtils.NotifyModuleOfConfigChangeL(modDataIn); |
|
829 |
} |
|
830 |
break; |
|
831 |
||
832 |
default: |
|
833 |
break; |
|
834 |
} |
|
835 |
||
836 |
iNetSim.ClearAssistanceDataFilters(); |
|
837 |
iNetSim.Close(); |
|
838 |
||
839 |
CleanupStack::PopAndDestroy(adminApi); |
|
840 |
iDoTransmitPos->Cancel(); |
|
841 |
CleanupStack::PopAndDestroy(iDoTransmitPos); |
|
842 |
||
843 |
} |
|
844 |
||
845 |
||
846 |
INFO_PRINTF1(_L("<<CT_LbsX3PStep_Transmit::doTestStepL()")); |
|
847 |
||
848 |
return TestStepResult(); |
|
849 |
} |
|
850 |
||
851 |
||
852 |
||
853 |
/** NetSim callbacks given for a X3P, which we invoke as a result of the notify position update. |
|
854 |
*/ |
|
855 |
void CT_LbsX3PStep_Transmit::Connected() |
|
856 |
{ |
|
857 |
||
858 |
CT_LbsNetSimStep::Connected(); |
|
859 |
||
860 |
// Create a posinfo and store in our shared array for later verification. |
|
861 |
RPointerArray<TAny>& posInfoArr = iParent.iSharedData->iCurrentPosInfoArr; |
|
862 |
TPositionInfo* posInfo = NULL; |
|
863 |
||
864 |
||
865 |
iUtils.ResetAndDestroy_PosInfoArr(posInfoArr); // Clear previous entries before new entry is appended. |
|
866 |
||
867 |
//If X3PRefLocation flag is on, we have to test reference location functionality |
|
868 |
//TBool bRefPos; |
|
869 |
//bRefPos = GetIntFromConfig(ConfigSection(), KLbsRefPos, bRefPos); |
|
870 |
||
871 |
switch(iTestCaseId) |
|
872 |
{ |
|
873 |
case 3: |
|
874 |
case 4: |
|
875 |
break; |
|
876 |
||
877 |
case 13: |
|
878 |
{ |
|
879 |
for(TInt counter = 0 ; counter < KMaxCount ; counter++) |
|
880 |
{ |
|
881 |
posInfo = new TPositionInfo(); |
|
882 |
if (posInfo != NULL) |
|
883 |
{ |
|
884 |
posInfoArr.Append(posInfo); |
|
885 |
CT_LbsX3PDoTransmitPos* localDoTransmitPos; |
|
886 |
localDoTransmitPos = (reinterpret_cast<CT_LbsX3PDoTransmitPos*>(iDoTransmitPosArr[counter])); |
|
887 |
if(iRefPosFlag) |
|
888 |
localDoTransmitPos->TransmitPositionReportingRefLoc(KDefaultDestination, KTransmitPriority, *posInfo); |
|
889 |
else |
|
890 |
localDoTransmitPos->TransmitPosition(KDefaultDestination, KTransmitPriority, *posInfo); |
|
891 |
||
892 |
} |
|
893 |
} |
|
894 |
} |
|
895 |
break; |
|
896 |
||
897 |
case 130: |
|
898 |
{ |
|
899 |
// Kick off transmit position. |
|
900 |
posInfo = new(ELeave) TPositionInfo(); |
|
901 |
CleanupStack::PushL(posInfo); |
|
902 |
posInfoArr.AppendL(posInfo); |
|
903 |
CleanupStack::Pop(posInfo); |
|
904 |
if(iRefPosFlag) |
|
905 |
iDoTransmitPos->TransmitPositionReportingRefLoc(KInvalidDestination, KTransmitPriority, *posInfo); |
|
906 |
else |
|
907 |
iDoTransmitPos->TransmitPosition(KInvalidDestination, KTransmitPriority, *posInfo); |
|
908 |
||
909 |
iState = EWaiting; |
|
910 |
} |
|
911 |
break; |
|
912 |
default: |
|
913 |
{ |
|
914 |
posInfo = new TPositionInfo(); |
|
915 |
CleanupStack::PushL(posInfo); |
|
916 |
posInfoArr.AppendL(posInfo); |
|
917 |
CleanupStack::Pop(posInfo); |
|
918 |
||
919 |
if(iTestCaseId ==133) |
|
920 |
{ |
|
921 |
// Position requested at |
|
922 |
iTimeRequested.UniversalTime(); |
|
923 |
} |
|
924 |
||
925 |
if(iRefPosFlag) |
|
926 |
{ |
|
927 |
iDoTransmitPos->TransmitPositionReportingRefLoc(KDefaultDestination, KTransmitPriority, *posInfo); |
|
928 |
} |
|
929 |
else |
|
930 |
{ |
|
931 |
iDoTransmitPos->TransmitPosition(KDefaultDestination, KTransmitPriority, *posInfo); |
|
932 |
} |
|
933 |
||
934 |
||
935 |
iState = EWaiting; |
|
936 |
} |
|
937 |
break; |
|
938 |
||
939 |
} |
|
940 |
} |
|
941 |
||
942 |
void CT_LbsX3PStep_Transmit::NotifyRegisterLcsMoLr(const TDesC& aData) |
|
943 |
{ |
|
944 |
//First NetSim callback (FROM: Gateway) |
|
945 |
||
946 |
CT_LbsNetSimStep::NotifyRegisterLcsMoLr(aData); |
|
947 |
||
948 |
// find out what aData is, it may be an idea to verify it's correct |
|
949 |
// Verify correct destination telephone number: |
|
950 |
// if its an X3P aData will contain "something", |
|
951 |
// if its an MOLR aData should contain "nothing". |
|
952 |
||
953 |
switch(iTestCaseId) |
|
954 |
{ |
|
955 |
// X3P should be turned off for these test cases |
|
956 |
case 111: |
|
957 |
case 18: |
|
958 |
{ |
|
959 |
INFO_PRINTF1(_L("<FONT><B>NotifyRegisterLcsMoLr should not be invoked. Test Failed. </B></FONT>")); |
|
960 |
SetTestStepResult(EFail); |
|
961 |
} |
|
962 |
break; |
|
963 |
||
964 |
case 130: |
|
965 |
{ |
|
966 |
if(aData.Compare(KInvalidDestination) != 0) |
|
967 |
{ |
|
968 |
INFO_PRINTF1(_L("<FOND><B>For case 130 the phone number should have been invalid.</B></FONT>")); |
|
969 |
SetTestStepResult(EFail); |
|
970 |
} |
|
971 |
} |
|
972 |
break; |
|
973 |
||
974 |
case 115: |
|
975 |
{ |
|
976 |
if(!iNetSim.SetResponseError(RLbsNetSimTest::KNetSimNetworkNotAvailable, ETrue)) |
|
977 |
{ |
|
978 |
INFO_PRINTF1(_L("CT_LbsClientStep_CellBasedNotifyPosUpdate::doTestStepL() Failed: Can't set NetSim's response error.")); |
|
979 |
SetTestStepResult(EFail); |
|
980 |
} |
|
981 |
} |
|
982 |
break; |
|
983 |
||
984 |
default: |
|
985 |
{ |
|
986 |
if(aData.Compare(KDefaultDestination) != 0) |
|
987 |
{ |
|
988 |
INFO_PRINTF1(_L("<FOND><B>For an X3P, aData should contain something.</B></FONT>")); |
|
989 |
SetTestStepResult(EFail); |
|
990 |
} |
|
991 |
} |
|
992 |
} |
|
993 |
} |
|
994 |
||
995 |
||
996 |
||
997 |
void CT_LbsX3PStep_Transmit::NotifyMeasurementControlLocation( const TPositionInfo& aPosition, |
|
998 |
const RLbsAssistanceDataBuilderSet& aData, |
|
999 |
const TLbsNetPosRequestQuality& aQuality) |
|
1000 |
{ |
|
1001 |
//Second callback |
|
1002 |
||
1003 |
// Call base functionality |
|
1004 |
CT_LbsNetSimStep::NotifyMeasurementControlLocation(aPosition, aData, aQuality); |
|
1005 |
/* |
|
1006 |
aPosition is the reference position set at the top in netsim.setrefposition(). |
|
1007 |
compare aposition and this to verify its correct. |
|
1008 |
*/ |
|
1009 |
||
1010 |
||
1011 |
//RPointerArray<TAny>& srcPosInfoArr = iParent.iSharedData->iVerifyPosInfoArr; |
|
1012 |
//TPositionInfo* srcPosInfo = reinterpret_cast<TPositionInfo*>(srcPosInfoArr[0]); |
|
1013 |
||
1014 |
//T_LbsUtils::TComparisonAccuracyType whatAccuracyToUse; |
|
1015 |
||
1016 |
//if(iParent.iSharedData->iTestModuleInUse) |
|
1017 |
// { |
|
1018 |
// whatAccuracyToUse = T_LbsUtils::EExactAccuracy; |
|
1019 |
// } |
|
1020 |
//else |
|
1021 |
// { |
|
1022 |
// whatAccuracyToUse = T_LbsUtils::ERoughAccuracy; |
|
1023 |
// } |
|
1024 |
//TPositionInfo refPosInfo; |
|
1025 |
//refPosInfo.SetPosition(iRefPos); |
|
1026 |
//if(!iUtils.Compare_PosInfo(refPosInfo, aPosition, whatAccuracyToUse)) |
|
1027 |
||
1028 |
TPositionInfo refPosInfo; |
|
1029 |
T_LbsUtils::TComparisonAccuracyType accType; |
|
1030 |
||
1031 |
refPosInfo.SetPosition(iRefPos); |
|
1032 |
||
1033 |
if(iParent.iSharedData->iTestModuleInUse) |
|
1034 |
accType = T_LbsUtils::EExactAccuracy; |
|
1035 |
else |
|
1036 |
accType = T_LbsUtils::ERoughAccuracy; |
|
1037 |
||
1038 |
if(!iUtils.Compare_PosInfo(refPosInfo, aPosition, accType)) |
|
1039 |
{ |
|
1040 |
INFO_PRINTF1(_L("<FONT><B>Failed test, NotifyMeasurementControlLocation: srcPosInfo differs from aPositionInfo</B></FONT>")); |
|
1041 |
SetTestStepResult(EFail); |
|
1042 |
} |
|
1043 |
||
1044 |
if(iParent.iSharedData->iTestModuleInUse) |
|
1045 |
{ |
|
1046 |
||
1047 |
// Verify the assistance data for test mode. |
|
1048 |
RLbsAssistanceDataBuilderSet& data = const_cast<RLbsAssistanceDataBuilderSet&>(aData); |
|
1049 |
RUEPositioningGpsReferenceTimeBuilder* refTimeBuilder = NULL; |
|
1050 |
||
1051 |
data.GetDataBuilder(refTimeBuilder); |
|
1052 |
||
1053 |
// Create a reader from the builder's data to allow us to verify the actual |
|
1054 |
// assistance data. |
|
1055 |
TInt err; |
|
1056 |
||
1057 |
RUEPositioningGpsReferenceTimeReader refTimeReader; |
|
1058 |
||
1059 |
TRAP(err, refTimeReader.OpenL()); |
|
1060 |
if (err == KErrNone) |
|
1061 |
{ |
|
1062 |
refTimeReader.DataBuffer() = refTimeBuilder->DataBuffer(); |
|
1063 |
||
1064 |
if (!iUtils.VerifySimpleAssistanceData(refTimeReader)) |
|
1065 |
{ |
|
1066 |
INFO_PRINTF1(_L("Failed test, assistance data incorrect.")); |
|
1067 |
SetTestStepResult(EFail); |
|
1068 |
} |
|
1069 |
refTimeReader.Close(); |
|
1070 |
} |
|
1071 |
||
1072 |
else |
|
1073 |
{ |
|
1074 |
INFO_PRINTF2(_L("Failed test, assistance data reader err %d."), err); |
|
1075 |
SetTestStepResult(EFail); |
|
1076 |
} |
|
1077 |
} |
|
1078 |
else |
|
1079 |
{ |
|
1080 |
//Real data, dont know what to expect so cant check it for cnonsistency. |
|
1081 |
} |
|
1082 |
||
1083 |
||
1084 |
// Need to check quality. Should be same for real and test. |
|
1085 |
// Can't check for NaN by a direct check |
|
1086 |
TBool maxFixTimeOK = aQuality.MaxFixTime() == iNetPosQuality.MaxFixTime(); |
|
1087 |
TBool minHAccuracyOK = (aQuality.MinHorizontalAccuracy() == iNetPosQuality.MinHorizontalAccuracy()) || |
|
1088 |
(Math::IsNaN(aQuality.MinHorizontalAccuracy()) && Math::IsNaN(iNetPosQuality.MinHorizontalAccuracy())); |
|
1089 |
TBool minVAccuracyOK = (aQuality.MinVerticalAccuracy() == iNetPosQuality.MinVerticalAccuracy()) || |
|
1090 |
(Math::IsNaN(aQuality.MinVerticalAccuracy()) && Math::IsNaN(iNetPosQuality.MinVerticalAccuracy())); |
|
1091 |
||
1092 |
if( !maxFixTimeOK || !minHAccuracyOK || !minVAccuracyOK) |
|
1093 |
{ |
|
1094 |
INFO_PRINTF1(_L("NotifyMeasurementControlLocation: Quality should have matched.")); |
|
1095 |
SetTestStepResult(EFail); |
|
1096 |
} |
|
1097 |
||
1098 |
if(iTestCaseId == 116) |
|
1099 |
{ |
|
1100 |
if(!iNetSim.SetResponseError(RLbsNetSimTest::KNetSimNetworkNotAvailable, ETrue)) |
|
1101 |
{ |
|
1102 |
INFO_PRINTF1(_L("CT_LbsClientStep_CellBasedNotifyPosUpdate::doTestStepL() Failed: Can't set NetSim's response error.")); |
|
1103 |
SetTestStepResult(EFail); |
|
1104 |
} |
|
1105 |
} |
|
1106 |
} |
|
1107 |
||
1108 |
||
1109 |
// NotifyMeasurementReportLocation callback, aPosition should match iVerifyPosInfoArr |
|
1110 |
void CT_LbsX3PStep_Transmit::NotifyMeasurementReportLocation(const TPositionInfo& aPosition) |
|
1111 |
{ |
|
1112 |
||
1113 |
//Third NetSim callback (FROM: Gateway) |
|
1114 |
CT_LbsNetSimStep::NotifyMeasurementReportLocation(aPosition); |
|
1115 |
||
1116 |
T_LbsUtils::TComparisonAccuracyType whatAccuracyToUse; |
|
1117 |
||
1118 |
if(iParent.iSharedData->iTestModuleInUse) |
|
1119 |
{ |
|
1120 |
whatAccuracyToUse = T_LbsUtils::EExactAccuracy; |
|
1121 |
} |
|
1122 |
else |
|
1123 |
{ |
|
1124 |
whatAccuracyToUse = T_LbsUtils::ERoughAccuracy; |
|
1125 |
} |
|
1126 |
||
1127 |
// get the ref position from the iVerifyPosInfoArr (the last time) then verify with aPosition |
|
1128 |
// the array would have been added to at the call to TransmitPosition above in net connect callback |
|
1129 |
||
1130 |
// Common stuff |
|
1131 |
// Create a posinfo and store in our shared array for later verification. |
|
1132 |
||
1133 |
RPointerArray<TAny>& posInfoArr = iParent.iSharedData->iVerifyPosInfoArr; |
|
1134 |
||
1135 |
||
1136 |
switch (iTestCaseId) |
|
1137 |
{ |
|
1138 |
case 13: |
|
1139 |
{ |
|
1140 |
for(TInt counter = 0 ; counter < KMaxCount ; counter++) |
|
1141 |
{ |
|
1142 |
if(!iUtils.Compare_PosInfo(*(reinterpret_cast<TPositionInfo*>(posInfoArr[counter])), aPosition, whatAccuracyToUse)) |
|
1143 |
{ |
|
1144 |
INFO_PRINTF1(_L("<FONT><B>aPosition didn't match any of the contents of posInfoArr.</B></FONT>")); |
|
1145 |
SetTestStepResult(EFail); |
|
1146 |
} |
|
1147 |
} |
|
1148 |
} |
|
1149 |
break; |
|
1150 |
||
1151 |
// X3P should be turned off for these test cases |
|
1152 |
case 111: |
|
1153 |
case 18: |
|
1154 |
{ |
|
1155 |
INFO_PRINTF1(_L("<FONT><B>NotifyMeasurementReportLocation should not be invoked. Test Failed. </B></FONT>")); |
|
1156 |
SetTestStepResult(EFail); |
|
1157 |
} |
|
1158 |
break; |
|
1159 |
||
1160 |
default: |
|
1161 |
{ |
|
1162 |
if(!iUtils.Compare_PosInfo(*(reinterpret_cast<TPositionInfo*>(posInfoArr[0])), aPosition, whatAccuracyToUse)) |
|
1163 |
{ |
|
1164 |
INFO_PRINTF1(_L("<FONT><B>aPosition didn't match contents of posInfoArr.</B></FONT>")); |
|
1165 |
SetTestStepResult(EFail); |
|
1166 |
} |
|
1167 |
} |
|
1168 |
break; |
|
1169 |
} |
|
1170 |
||
1171 |
} |
|
1172 |
||
1173 |
void CT_LbsX3PStep_Transmit::NotifyReleaseLcsMoLr(TInt aReason) |
|
1174 |
{ |
|
1175 |
||
1176 |
// Fifth NetSim callback (FROM: Gateway) |
|
1177 |
iReleaseCallBackCount++; |
|
1178 |
||
1179 |
if(iTestCaseId != 13) |
|
1180 |
{ |
|
1181 |
//INFO_PRINTF1(_L("Got - Notify Release Lcs MoLr Callback Event")); |
|
1182 |
CT_LbsNetSimStep::NotifyReleaseLcsMoLr(aReason); |
|
1183 |
} |
|
1184 |
||
1185 |
switch (iTestCaseId) |
|
1186 |
{ |
|
1187 |
case 01: |
|
1188 |
case 05: |
|
1189 |
case 133: |
|
1190 |
{ |
|
1191 |
if( aReason != KErrTimedOut) |
|
1192 |
{ |
|
1193 |
INFO_PRINTF3(_L("<FONT><B>Case %d iDoTransmitPos should have timed out. Error recieved: %d. Test Failed. </B></FONT>"),iTestCaseId, aReason); |
|
1194 |
SetTestStepResult(EFail); |
|
1195 |
} |
|
1196 |
} |
|
1197 |
break; |
|
1198 |
||
1199 |
case 16: |
|
1200 |
{ |
|
1201 |
if(aReason != KErrNone) |
|
1202 |
{ |
|
1203 |
INFO_PRINTF2(_L("<FONT><B>NotifyReleaseLcsMoLr had an unexpected aReason of: %d</B></FONT>"), aReason); |
|
1204 |
SetTestStepResult(EFail); |
|
1205 |
} |
|
1206 |
} |
|
1207 |
break; |
|
1208 |
||
1209 |
||
1210 |
||
1211 |
case 13: |
|
1212 |
{ |
|
1213 |
INFO_PRINTF2(_L("Got - Notify Release Lcs MoLr Callback Event %d times"),iReleaseCallBackCount); |
|
1214 |
if( iReleaseCallBackCount == (iDoTransmitPosArr.Count() * 2)) |
|
1215 |
{ |
|
1216 |
INFO_PRINTF1(_L(" Setting Notify Release Lcs MoLr Callback Event bit")); |
|
1217 |
CT_LbsNetSimStep::NotifyReleaseLcsMoLr(aReason); |
|
1218 |
} |
|
1219 |
||
1220 |
if(KErrNone != aReason) |
|
1221 |
{ |
|
1222 |
INFO_PRINTF2(_L("<FONT><B>NotifyReleaseLcsMoLr had an unexpected aReason of: %d</B></FONT>"), aReason); |
|
1223 |
SetTestStepResult(EFail); |
|
1224 |
} |
|
1225 |
||
1226 |
} |
|
1227 |
default: |
|
1228 |
if(KErrNone != aReason) |
|
1229 |
{ |
|
1230 |
INFO_PRINTF2(_L("<FONT><B>NotifyReleaseLcsMoLr had an unexpected aReason of: %d</B></FONT>"), aReason); |
|
1231 |
SetTestStepResult(EFail); |
|
1232 |
} |
|
1233 |
||
1234 |
} |
|
1235 |
} |
|
1236 |
||
1237 |
void CT_LbsX3PStep_Transmit::MT_LbsX3PDoRefPosCallback(const TRequestStatus& aStatus,const TPositionInfo& aRefPosInfo) |
|
1238 |
{ |
|
1239 |
//(void)aStatus; |
|
1240 |
//(void)aRefPosInfo; |
|
1241 |
||
1242 |
INFO_PRINTF1(_L("Got - Transmit Position Reference Postion - Callback Event")); |
|
1243 |
SetCallbackFlag(KLbsCallback_Got_NotifyDoTransmitReferencePos); |
|
1244 |
||
1245 |
switch(iTestCaseId) |
|
1246 |
{ |
|
1247 |
case 18: |
|
1248 |
case 130: |
|
1249 |
case 15: |
|
1250 |
case 115: |
|
1251 |
break; |
|
1252 |
||
1253 |
case 13: |
|
1254 |
{ |
|
1255 |
if(aStatus != KErrNone) |
|
1256 |
{ |
|
1257 |
INFO_PRINTF1(_L("<FONT><B>TransmitPosition Reference Position doesnt complete with KErrNone </B></FONT>")); |
|
1258 |
SetTestStepResult(EFail); |
|
1259 |
} |
|
1260 |
} |
|
1261 |
break; |
|
1262 |
||
1263 |
case 116: |
|
1264 |
{ |
|
1265 |
if(aStatus != KErrDisconnected && aStatus != KErrNone) |
|
1266 |
{ |
|
1267 |
// NOTE: Due to a race condition in test framework that can occur on H4, it is a possibility |
|
1268 |
// that we will not see the KErrDisconnected, but instead KErrNone. Therefore we cant fail the test for this. |
|
1269 |
INFO_PRINTF2(_L("<FONT><B> should have returned KErrDisconnected or KErrNone, recevied %d instead</B></FONT>"),aStatus.Int()); |
|
1270 |
||
1271 |
SetTestStepResult(EFail); |
|
1272 |
} |
|
1273 |
||
1274 |
} |
|
1275 |
break; |
|
1276 |
||
1277 |
default: |
|
1278 |
{ |
|
1279 |
TPositionInfo refPosInfo; |
|
1280 |
T_LbsUtils::TComparisonAccuracyType accType; |
|
1281 |
||
1282 |
refPosInfo.SetPosition(iRefPos); |
|
1283 |
||
1284 |
if(iParent.iSharedData->iTestModuleInUse) |
|
1285 |
accType = T_LbsUtils::EExactAccuracy; |
|
1286 |
else |
|
1287 |
accType = T_LbsUtils::ERoughAccuracy; |
|
1288 |
||
1289 |
if(!iUtils.Compare_PosInfo(refPosInfo, aRefPosInfo, accType)) |
|
1290 |
{ |
|
1291 |
INFO_PRINTF1(_L("<FONT><B>Failed test, X3PRefPos callback: Reference Position differs from aPositionInfo</B></FONT>")); |
|
1292 |
SetTestStepResult(EFail); |
|
1293 |
} |
|
1294 |
||
1295 |
if(aStatus != KErrNone || (iCallbackFlags&KLbsCallback_Got_NotifyDoTransmitPos) !=0) |
|
1296 |
{ |
|
1297 |
INFO_PRINTF1(_L("<FONT><B>TransmitPosition completed before Reference Position </B></FONT>")); |
|
1298 |
SetTestStepResult(EFail); |
|
1299 |
} |
|
1300 |
||
1301 |
//Verify TPositionClassTypeBase parameters |
|
1302 |
if(aRefPosInfo.ModuleId() != KLbsGpsLocManagerUid || |
|
1303 |
aRefPosInfo.PositionMode() != TPositionModuleInfo::ETechnologyNetwork || |
|
1304 |
aRefPosInfo.PositionModeReason() != EPositionModeReasonNone || |
|
1305 |
aRefPosInfo.UpdateType() != EPositionUpdateGeneral ) |
|
1306 |
{ |
|
1307 |
INFO_PRINTF1(_L("<FONT><B>Reference Position values mismatch </B></FONT>")); |
|
1308 |
SetTestStepResult(EFail); |
|
1309 |
} |
|
1310 |
||
1311 |
} |
|
1312 |
break; |
|
1313 |
} |
|
1314 |
} |
|
1315 |
||
1316 |
||
1317 |
/** Transmit position callback. |
|
1318 |
||
1319 |
The notify position update as completed. We can mark as done in the callback flags. |
|
1320 |
||
1321 |
---Implementing inherited method |
|
1322 |
*/ |
|
1323 |
||
1324 |
void CT_LbsX3PStep_Transmit::MT_LbsX3PDoTransmitPosCallback(TRequestStatus& aStatus, CT_LbsX3PDoTransmitPos* aDoTransmitPosAO) |
|
1325 |
{ |
|
1326 |
(void)aDoTransmitPosAO; |
|
1327 |
||
1328 |
INFO_PRINTF1(_L("Got - Transmit Position - Callback Event.")); |
|
1329 |
SetCallbackFlag(KLbsCallback_Got_NotifyDoTransmitPos); |
|
1330 |
||
1331 |
if(iTestCaseId==133) |
|
1332 |
{ |
|
1333 |
// Position received at |
|
1334 |
iTimeReceived.UniversalTime(); |
|
1335 |
} |
|
1336 |
TInt counter = 0; |
|
1337 |
switch (iTestCaseId) |
|
1338 |
{ |
|
1339 |
case 01: |
|
1340 |
case 05: |
|
1341 |
case 133: |
|
1342 |
{ |
|
1343 |
if( iDoTransmitPos ->iStatus != KErrTimedOut) |
|
1344 |
{ |
|
1345 |
INFO_PRINTF2(_L("<FONT><B>Case %d iDoTransmitPos should have timed out. Test Failed. </B></FONT>"),iTestCaseId); |
|
1346 |
SetTestStepResult(EFail); |
|
1347 |
} |
|
1348 |
||
1349 |
if(aStatus != KErrTimedOut) |
|
1350 |
{ |
|
1351 |
INFO_PRINTF3(_L("<FONT><B>iTestCaseId: %d, TransmitPositionCallBack aStatus: %d</B></FONT>"),iTestCaseId, aStatus.Int()); |
|
1352 |
} |
|
1353 |
||
1354 |
if(iTestCaseId==133) |
|
1355 |
{ |
|
1356 |
TInt maxtime_ini; |
|
1357 |
TBool maxtime_exists; |
|
1358 |
||
1359 |
||
1360 |
maxtime_exists = GetIntFromConfig(ConfigSection(), KLbsMaxTime, maxtime_ini); |
|
1361 |
if(!maxtime_exists) |
|
1362 |
{ |
|
1363 |
INFO_PRINTF1(_L("Could not get maxtime from ini file")); |
|
1364 |
SetTestStepResult(EFail); |
|
1365 |
} |
|
1366 |
// we are stampping the received time after callback ,so we are adding 1s for actual maxtime. |
|
60
9a7e3d5f461a
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
1367 |
TInt64 realtimediff= maxtime_ini + 2000000; |
36 | 1368 |
//Timedifference between position actually received and position actually requested |
1369 |
TInt64 actualtimediff; |
|
1370 |
actualtimediff = iTimeReceived.Int64() - iTimeRequested.Int64(); |
|
60
9a7e3d5f461a
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
1371 |
INFO_PRINTF2(_L("timediff = %ld"), actualtimediff); |
36 | 1372 |
//compare actualtimediff with realtimediff |
1373 |
if(actualtimediff > realtimediff) |
|
1374 |
{ |
|
60
9a7e3d5f461a
Revision: 201037
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
36
diff
changeset
|
1375 |
INFO_PRINTF2(_L("timediff greater than maxfixtime %ld in profile"), realtimediff); |
36 | 1376 |
SetTestStepResult(EFail); |
1377 |
} |
|
1378 |
} |
|
1379 |
} |
|
1380 |
break; |
|
1381 |
||
1382 |
case 13: |
|
1383 |
{ |
|
1384 |
// Each completed status needs to equal KErrNone. |
|
1385 |
// Not KErrPending |
|
1386 |
||
1387 |
iReleaseCallBackCount++; |
|
1388 |
if( iReleaseCallBackCount == (iDoTransmitPosArr.Count() * 2)) |
|
1389 |
{ |
|
1390 |
INFO_PRINTF1(_L(" Setting Notify Release Lcs MoLr Callback Event bit")); |
|
1391 |
CT_LbsNetSimStep::NotifyReleaseLcsMoLr(KErrNone); |
|
1392 |
} |
|
1393 |
||
1394 |
for(counter = 0 ; counter < iDoTransmitPosArr.Count() ; counter++) |
|
1395 |
{ |
|
1396 |
CT_LbsX3PDoTransmitPos* transmitter = reinterpret_cast<CT_LbsX3PDoTransmitPos*>(iDoTransmitPosArr[counter]); |
|
1397 |
TInt err = transmitter->iStatus.Int(); |
|
1398 |
switch (err) |
|
1399 |
{ |
|
1400 |
case KRequestPending: |
|
1401 |
INFO_PRINTF2(_L("iDoTransmitPos in position %d of the array is pending."),counter); |
|
1402 |
break; |
|
1403 |
||
1404 |
case KErrNone: |
|
1405 |
INFO_PRINTF2(_L("iDoTransmitPos in position %d of the array completed successfully."),counter); |
|
1406 |
break; |
|
1407 |
||
1408 |
case KErrTimedOut: |
|
1409 |
INFO_PRINTF2(_L("iDoTransmitPos in position %d of the array Timed Out."),counter); |
|
1410 |
break; |
|
1411 |
||
1412 |
default: |
|
1413 |
INFO_PRINTF3(_L("iDoTransmitPos in position %d of the array does not appear to have completed successfully, error: %d ."),counter,err); |
|
1414 |
break; |
|
1415 |
} |
|
1416 |
||
1417 |
||
1418 |
||
1419 |
// After TransmitPosition gets called for the last time... |
|
1420 |
if( counter == iDoTransmitPosArr.Count() ) |
|
1421 |
{ |
|
1422 |
// Check that all requests completed successfully... |
|
1423 |
for(counter = 0 ; counter < iDoTransmitPosArr.Count() ; counter++) |
|
1424 |
{ |
|
1425 |
CT_LbsX3PDoTransmitPos* transmitter = reinterpret_cast<CT_LbsX3PDoTransmitPos*>(iDoTransmitPosArr[counter]); |
|
1426 |
TInt err = transmitter->iStatus.Int(); |
|
1427 |
if(err != KErrNone) |
|
1428 |
{ |
|
1429 |
INFO_PRINTF3(_L("<FONT><B>iDoTransmitPos in position %d of the array never completed successfully, error: %d .</B></FONT>"),counter,err); |
|
1430 |
SetTestStepResult(EFail); |
|
1431 |
} |
|
1432 |
} |
|
1433 |
||
1434 |
} |
|
1435 |
} |
|
1436 |
||
1437 |
if(aStatus != KErrNone) |
|
1438 |
{ |
|
1439 |
INFO_PRINTF3(_L("iTestCaseId: %d, This instance of TransmitPositionCallBack has aStatus: %d"),iTestCaseId, aStatus.Int()); |
|
1440 |
} |
|
1441 |
} |
|
1442 |
break; |
|
1443 |
||
1444 |
// Test case LBS-X3P-Transmit-0005 |
|
1445 |
case 15: |
|
1446 |
{ |
|
1447 |
if(aStatus != KErrAccessDenied) |
|
1448 |
{ |
|
1449 |
INFO_PRINTF3(_L("<FONT><B>iTestCaseId: %d, TransmitPositionCallBack aStatus: %d, not KErrAccessDenied</B></FONT>"),iTestCaseId, aStatus.Int()); |
|
1450 |
SetTestStepResult(EFail); |
|
1451 |
} |
|
1452 |
} |
|
1453 |
break; |
|
1454 |
||
1455 |
case 16: |
|
1456 |
{ |
|
1457 |
if( iDoTransmitPos ->iStatus == KErrNone) |
|
1458 |
{ |
|
1459 |
INFO_PRINTF1(_L("<FONT><B>iDoTransmitPos completed successfully. Test AGPS should be unavailable. Test Failed. </B></FONT>")); |
|
1460 |
SetTestStepResult(EFail); |
|
1461 |
} |
|
1462 |
||
1463 |
if(aStatus != KErrNotFound) |
|
1464 |
{ |
|
1465 |
INFO_PRINTF3(_L("<FONT><B>iTestCaseId: %d, aStatus was not KErrNotfound, TransmitPositionCallBack aStatus was: %d</B></FONT>"),iTestCaseId, aStatus.Int()); |
|
1466 |
} |
|
1467 |
} |
|
1468 |
break; |
|
1469 |
||
1470 |
// X3P should be turned off for these test cases |
|
1471 |
case 111: |
|
1472 |
case 18: |
|
1473 |
{ |
|
1474 |
if( iDoTransmitPos->iStatus != KErrAccessDenied || |
|
1475 |
iDoTransmitPos->iStatus == KErrNone) |
|
1476 |
{ |
|
1477 |
INFO_PRINTF1(_L("<FONT><B>Transmit X3P should have failed. Test Failed.</B></FONT>")); |
|
1478 |
SetTestStepResult(EFail); |
|
1479 |
} |
|
1480 |
||
1481 |
||
1482 |
if( aStatus != KErrAccessDenied || |
|
1483 |
aStatus == KErrNone) |
|
1484 |
{ |
|
1485 |
INFO_PRINTF3(_L("<FONT><B>iTestCaseId: %d, TransmitPositionCallBack aStatus: %d</B></FONT>"),iTestCaseId, aStatus.Int()); |
|
1486 |
} |
|
1487 |
||
1488 |
} |
|
1489 |
break; |
|
1490 |
||
1491 |
case 130: |
|
1492 |
{ |
|
1493 |
if( iDoTransmitPos ->iStatus != KErrArgument) |
|
1494 |
{ |
|
1495 |
INFO_PRINTF1(_L("<FONT><B>iDoTransmitPos did not complete with KErrArgument. Test Failed. </B></FONT>")); |
|
1496 |
SetTestStepResult(EFail); |
|
1497 |
} |
|
1498 |
||
1499 |
||
1500 |
if(aStatus != KErrArgument) |
|
1501 |
{ |
|
1502 |
INFO_PRINTF3(_L("<FONT><B>iTestCaseId: %d, TransmitPositionCallBack aStatus: %d, not KErrArgument.</B></FONT>"),iTestCaseId, aStatus.Int()); |
|
1503 |
SetTestStepResult(EFail); |
|
1504 |
} |
|
1505 |
} |
|
1506 |
break; |
|
1507 |
||
1508 |
case 115: |
|
1509 |
case 116: |
|
1510 |
{ |
|
1511 |
if(aStatus == KErrNone) //We should set proper errocode - TBD |
|
1512 |
{ |
|
1513 |
INFO_PRINTF1(_L("<FONT><B> should have returned KErrTimedOut</B></FONT>")); |
|
1514 |
SetTestStepResult(EFail); |
|
1515 |
} |
|
1516 |
} |
|
1517 |
break; |
|
1518 |
||
1519 |
case 118: |
|
1520 |
{ |
|
1521 |
if(!(iCallbackFlags & KLbsCallback_NetSim_Got_NotifyMeasurementReportLocation)) |
|
1522 |
{ |
|
1523 |
INFO_PRINTF1(_L("<FONT><B> TransmitPostion completed before </B></FONT>")); |
|
1524 |
SetTestStepResult(EFail); |
|
1525 |
} |
|
1526 |
} |
|
1527 |
break; |
|
1528 |
||
1529 |
case 134: //LBS-X3P-Timeout-0001 |
|
1530 |
{ |
|
1531 |
if (aStatus != KPositionQualityLoss) |
|
1532 |
SetTestStepResult(EFail); |
|
1533 |
} |
|
1534 |
break; |
|
1535 |
||
1536 |
default: |
|
1537 |
{ |
|
1538 |
||
1539 |
if(aStatus != KErrNone) |
|
1540 |
{ |
|
1541 |
INFO_PRINTF3(_L("<FONT><B>iTestCaseId: %d, TransmitPositionCallBack aStatus: %d, not KErrNone.</B></FONT>"),iTestCaseId, aStatus.Int()); |
|
1542 |
SetTestStepResult(EFail); |
|
1543 |
} |
|
1544 |
||
1545 |
} |
|
1546 |
break; |
|
1547 |
} |
|
1548 |
} |
|
1549 |
||
1550 |
||
1551 |
void CT_LbsX3PStep_Transmit::NotifyMeasurementReportControlFailure(TInt aReason) |
|
1552 |
{ |
|
1553 |
||
1554 |
// To stop test timing out on unexpected reciept of this callback we wont set the bit |
|
1555 |
//switch (iTestCaseId) |
|
1556 |
// { |
|
1557 |
// case 01: |
|
1558 |
// case 05: |
|
1559 |
// case 15: |
|
1560 |
// case 16: |
|
1561 |
// CT_LbsNetSimStep::NotifyMeasurementReportControlFailure(aReason); |
|
1562 |
// break; |
|
1563 |
// |
|
1564 |
// default: |
|
1565 |
// { |
|
1566 |
// INFO_PRINTF2(_L("Got - Net Sim Notify Measurement Report Control Failure - Callback Event. Reason = %d"), aReason); |
|
1567 |
// INFO_PRINTF1(_L(" Net Sim Notify Measurement Report Control Failure - Unexpected so Bit not set")); |
|
1568 |
// } |
|
1569 |
// break; |
|
1570 |
// } |
|
1571 |
||
1572 |
switch (iTestCaseId) |
|
1573 |
{ |
|
1574 |
case 01: |
|
1575 |
case 133: |
|
1576 |
{ |
|
1577 |
if( aReason != KErrCancel) |
|
1578 |
{ |
|
1579 |
INFO_PRINTF2(_L("<FONT><B>NotifyMeasurementReportControlFailure should have failed with KErrCancel. </B></FONT>"),iTestCaseId); |
|
1580 |
SetTestStepResult(EFail); |
|
1581 |
} |
|
1582 |
CT_LbsNetSimStep::NotifyMeasurementReportControlFailure(aReason); |
|
1583 |
} |
|
1584 |
break; |
|
1585 |
||
1586 |
case 05: |
|
1587 |
{ |
|
1588 |
if( aReason != KErrTimedOut) |
|
1589 |
{ |
|
1590 |
INFO_PRINTF2(_L("<FONT><B>NotifyMeasurementReportControlFailure should have failed with KErrTimedOut. </B></FONT>"),iTestCaseId); |
|
1591 |
SetTestStepResult(EFail); |
|
1592 |
} |
|
1593 |
CT_LbsNetSimStep::NotifyMeasurementReportControlFailure(aReason); |
|
1594 |
} |
|
1595 |
break; |
|
1596 |
||
1597 |
// Test case LBS-X3P-Transmit-0005 |
|
1598 |
case 15: |
|
1599 |
{ |
|
1600 |
if(aReason != KErrAccessDenied) |
|
1601 |
{ |
|
1602 |
INFO_PRINTF2(_L("<FONT><B>NotifyMeasurementReportControlFailure should have failed with KErrAccessDenied, Error recieved is %d</B></FONT>"),aReason); |
|
1603 |
SetTestStepResult(EFail); |
|
1604 |
} |
|
1605 |
CT_LbsNetSimStep::NotifyMeasurementReportControlFailure(aReason); |
|
1606 |
} |
|
1607 |
break; |
|
1608 |
case 16: |
|
1609 |
{ |
|
1610 |
if(aReason != KErrNotFound) |
|
1611 |
{ |
|
1612 |
INFO_PRINTF2(_L("<FONT><B>NotifyMeasurementReportControlFailure should have failed with KErrNotFound, Error recieved is %d</B></FONT>"),aReason); |
|
1613 |
SetTestStepResult(EFail); |
|
1614 |
} |
|
1615 |
CT_LbsNetSimStep::NotifyMeasurementReportControlFailure(aReason); |
|
1616 |
} |
|
1617 |
break; |
|
1618 |
||
1619 |
default: |
|
1620 |
if(iParent.iSharedData->iTestModuleInUse) |
|
1621 |
{ |
|
1622 |
INFO_PRINTF2(_L("Failed test, got un-expected NotifyMeasurementReportControlFailure with Reason: %d."), aReason); |
|
1623 |
SetTestStepResult(EFail); |
|
1624 |
} |
|
1625 |
||
1626 |
//if( KErrNone != aReason ) |
|
1627 |
// { |
|
1628 |
// INFO_PRINTF2(_L("<FONT><B>NotifyMeasurementReportControlFailure had an unexpected aReason of: %d</B></FONT>"), aReason); |
|
1629 |
// SetTestStepResult(EFail); |
|
1630 |
// } |
|
1631 |
} |
|
1632 |
} |
|
1633 |
||
1634 |
||
1635 |
void CT_LbsX3PStep_Transmit::ProcessMeasurementControlLocationError(TInt aError) |
|
1636 |
{ |
|
1637 |
CT_LbsNetSimStep::ProcessMeasurementControlLocationError(aError); |
|
1638 |
||
1639 |
switch (iTestCaseId) |
|
1640 |
{ |
|
1641 |
case 130: |
|
1642 |
{ |
|
1643 |
if(iDoTransmitPos->iStatus != KErrArgument) |
|
1644 |
{ |
|
1645 |
//!@SYMTestExpectedResults Request fails with KErrNotFound? |
|
1646 |
INFO_PRINTF1(_L("<FONT><B>iDoTransmitPos completed successfully. Should have recieved KErrNotFound. Test Failed. </B></FONT>")); |
|
1647 |
SetTestStepResult(EFail); |
|
1648 |
} |
|
1649 |
||
1650 |
||
1651 |
if(aError != KErrArgument) |
|
1652 |
{ |
|
1653 |
INFO_PRINTF3(_L("<FONT><B>iTestCaseId: %d, ProcessMeasurementControlLocationError aError: %d</B></FONT>"),iTestCaseId, aError); |
|
1654 |
} |
|
1655 |
} |
|
1656 |
break; |
|
1657 |
||
1658 |
||
1659 |
default: |
|
1660 |
{ |
|
1661 |
INFO_PRINTF2(_L("<FONT><B>ProcessMeasurementControlLocationError shouldnt have been called in this test. Error code: %d</B></FONT>"),aError); |
|
1662 |
SetTestStepResult(EFail); |
|
1663 |
} |
|
1664 |
break; |
|
1665 |
} |
|
1666 |
||
1667 |
} |
|
1668 |
||
1669 |
||
1670 |
||
1671 |
void CT_LbsX3PStep_Transmit::NotifyMeasurementReportRequestMoreAssistanceData(const TLbsAssistanceDataGroup& aFilter) |
|
1672 |
{ |
|
1673 |
// CT_LbsNetSimStep::NotifyMeasurementReportRequestMoreAssistanceData(const TLbsAssistanceDataGroup& aFilter) |
|
1674 |
(void)aFilter; |
|
1675 |
||
1676 |
switch (iTestCaseId) |
|
1677 |
{ |
|
1678 |
case 117: |
|
1679 |
// Call base implementation. |
|
1680 |
CT_LbsNetSimStep::NotifyMeasurementReportRequestMoreAssistanceData(aFilter); |
|
1681 |
break; |
|
1682 |
||
1683 |
default: |
|
1684 |
//Note: In the case of real GPS, this message could come at anytime. |
|
1685 |
if(iParent.iSharedData->iTestModuleInUse) |
|
1686 |
{ |
|
1687 |
INFO_PRINTF2(_L("Failed test, got un-expected request for more assistance data with filter value = %d."), aFilter); |
|
1688 |
SetTestStepResult(EFail); |
|
1689 |
} |
|
1690 |
break; |
|
1691 |
} |
|
1692 |
//INFO_PRINTF1(_L("Got - Net Sim Notify Measurement Report Request More Assistance Data - Callback Event.")); |
|
1693 |
//INFO_PRINTF1(_L(" Not setting Net Sim Notify Measurement Report Request More Assistance Data callback flag")); |
|
1694 |
//SetCallbackFlag(KLbsCallback_NetSim_Got_NotifyMeasurementReportRequestMoreAssistanceData); |
|
1695 |
} |