|
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 ctlbsassdatastepx3ppushselflocate.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/lbsnetcommon.h> |
|
23 #include <lbssatellite.h> |
|
24 #include <lbs/lbsnetprotocolbase.h> |
|
25 #include <lbs/lbsassistancedatabuilderset.h> |
|
26 #include <e32math.h> |
|
27 |
|
28 // LBS test includes. |
|
29 #include "ctlbsconflictstepx3ppushselflocate.h" |
|
30 #include <lbs/test/tlbsutils.h> |
|
31 |
|
32 |
|
33 _LIT(KTransmitDestination, "07712345678"); |
|
34 const TUint KTransmitPriority = 2; // X3P Push. |
|
35 |
|
36 //const TUint KLbsAbortPeriod = 10000000; // The test case should finish before 10 seconds. |
|
37 |
|
38 |
|
39 /** Test case development notes |
|
40 =========================== |
|
41 |
|
42 It was decided to aid readablity each test class shall only support a single test case. |
|
43 This example has been produced to show how a typical conflict test case should be coded. |
|
44 |
|
45 |
|
46 Net Sim and Sequence Events |
|
47 --------------------------- |
|
48 Every test case implementation will use the ctlbsconflictstep class which supports Net Sim |
|
49 interactions and a way to ensure Net Sim events and client completion events have a occured |
|
50 in the correct order. An array is used to hold the expected sequence event values, and a second |
|
51 array contains the actual events produced during the test. Once the test moves into the EWaiting |
|
52 state typically after all the client requests have been made, the event arrays are compared to |
|
53 ensure the correct events were given. |
|
54 |
|
55 To set the expected sequence events populate the array in the SetExpectedSeq() function. |
|
56 |
|
57 |
|
58 Async wappers |
|
59 ------------- |
|
60 Each Lbs client async request is wappared in a active object class, to allow a number of |
|
61 outstanding async requests during the test. Any async calls you wish to make should also |
|
62 be wrapped in the same way, see CT_LbsDoX3P and CT_LbsDoPosUpdate for examples. |
|
63 These classes are constructed in the test class ConstructL, and maybe started or cancelled |
|
64 during the test at any point. |
|
65 |
|
66 |
|
67 Verify Position Information |
|
68 --------------------------- |
|
69 A test should verify each client call which expected a location to be returned. The |
|
70 location data should be validation to ensure it's correct. See VerifyPosInfos. |
|
71 */ |
|
72 |
|
73 |
|
74 /** |
|
75 Static Constructor |
|
76 */ |
|
77 CT_LbsConflictStepx3ppushselflocate* CT_LbsConflictStepx3ppushselflocate::New(CT_LbsConflictServer& aParent) |
|
78 { |
|
79 // Note the lack of ELeave. |
|
80 // This means that having insufficient memory will return NULL; |
|
81 CT_LbsConflictStepx3ppushselflocate* testStep = new CT_LbsConflictStepx3ppushselflocate(aParent); |
|
82 if (testStep) |
|
83 { |
|
84 TInt err = KErrNone; |
|
85 |
|
86 TRAP(err, testStep->ConstructL()); |
|
87 if (err) |
|
88 { |
|
89 delete testStep; |
|
90 testStep = NULL; |
|
91 } |
|
92 } |
|
93 return testStep; |
|
94 } |
|
95 |
|
96 |
|
97 /** |
|
98 * Constructor |
|
99 */ |
|
100 CT_LbsConflictStepx3ppushselflocate::CT_LbsConflictStepx3ppushselflocate(CT_LbsConflictServer& aParent) : CT_LbsConflictStep(aParent) |
|
101 { |
|
102 SetTestStepName(KLbsConflictStepx3ppushselflocate); |
|
103 } |
|
104 |
|
105 |
|
106 void CT_LbsConflictStepx3ppushselflocate::ConstructL() |
|
107 { |
|
108 // Create the base class objects. |
|
109 CT_LbsConflictStep::ConstructL(); |
|
110 |
|
111 // Self locate async wrapper. |
|
112 iDoPosUpdate = CT_LbsDoPosUpdate::NewL(this); |
|
113 |
|
114 // X3P async wrapper. |
|
115 iDoX3P = CT_LbsDoX3P::NewL(this); |
|
116 } |
|
117 |
|
118 |
|
119 /** |
|
120 * Destructor |
|
121 */ |
|
122 CT_LbsConflictStepx3ppushselflocate::~CT_LbsConflictStepx3ppushselflocate() |
|
123 { |
|
124 iDoPosUpdate->Cancel(); |
|
125 delete iDoPosUpdate; |
|
126 |
|
127 iDoX3P->Cancel(); |
|
128 delete iDoX3P; |
|
129 } |
|
130 |
|
131 |
|
132 /** Called at the start of the test... |
|
133 |
|
134 Each test case MUST implement this. |
|
135 |
|
136 The table below describes the expcted order that the callbacks should be called |
|
137 during the test. |
|
138 |
|
139 Note that the tests deliberateley do NOT check the order that the client requests |
|
140 are completed. This is because the delivery order is not guaranteed by LBS. |
|
141 The tests will check that all client requests are completed with the correct error |
|
142 code and position at the end of the test. |
|
143 */ |
|
144 void CT_LbsConflictStepx3ppushselflocate::SetExpectedSeq() |
|
145 { |
|
146 |
|
147 //! Client:TransmitPosition(PUSH) ->LBS |
|
148 //! RegisterLcsMoLr ->NET |
|
149 //! Client:NotifyPositionUpdate ->LBS |
|
150 //! MeasurementControlLocation <-NET |
|
151 //! MeasurementReportLocation ->NET |
|
152 //! FacilityLcsMoLrResult <-NET |
|
153 //! ReleaseLcsMoLr ->NET |
|
154 //! Client:RunL(NotifyPositionUpdate(pos,KErrServerBusy)) ->LBS |
|
155 //! Client:RunL(TransmitPosition(PUSH,pos,KErrNone)) ->LBS |
|
156 |
|
157 |
|
158 // Self locate MOLR (iState = ERegPosUpdate) |
|
159 SetVerifySeqEvent(EX3P_PUSH_MOLR_NetSim_Got_NotifyRegisterLcsMoLr); // --> To Net |
|
160 SetVerifySeqEvent(EX3P_PUSH_MOLR_NetSim_Got_NotifyMeasurementControlLocation); // <-- From Net |
|
161 SetVerifySeqEvent(EX3P_PUSH_MOLR_NetSim_Got_NotifyMeasurementReportLocation); // --> To Net |
|
162 SetVerifySeqEvent(EX3P_PUSH_MOLR_NetSim_Got_NotifyFacilityLcsMoLrResult); // <-- From Net |
|
163 |
|
164 SetVerifySeqEvent(EX3P_PUSH_MOLR_NetSim_Got_NotifyReleaseLcsMoLr); // --> To Net |
|
165 // (after X3P release iState = EWaiting). |
|
166 |
|
167 SetVerifyAdhocEvent(EClient_Got_PosUpdate_Complete); |
|
168 SetVerifyAdhocEvent(EClient_Got_X3P_Complete); |
|
169 } |
|
170 |
|
171 |
|
172 |
|
173 /** Called at the end of the test to verify the correct position data has been returned to the |
|
174 client. |
|
175 |
|
176 Each test case SHOULD implement a version of this. |
|
177 */ |
|
178 void CT_LbsConflictStepx3ppushselflocate::VerifyPosInfos() |
|
179 { |
|
180 T_LbsUtils utils; |
|
181 RPointerArray<TAny>& verifyPosInfoArr = iParent.iSharedData->iVerifyPosInfoArr; |
|
182 RPointerArray<TAny>& currPosInfoArr = iParent.iSharedData->iCurrentPosInfoArr; |
|
183 TPositionInfo* currPosInfo; |
|
184 |
|
185 |
|
186 // Verify entry 0 for the X3P. We expect a real location value, compare using the data |
|
187 // sent to the test APGS module. |
|
188 TPositionInfo* verifyPosInfo = reinterpret_cast<TPositionInfo*>(verifyPosInfoArr[0]); |
|
189 currPosInfo = reinterpret_cast<TPositionInfo*>(currPosInfoArr[0]); |
|
190 if (!utils.Compare_PosInfo(*verifyPosInfo, *currPosInfo)) |
|
191 { |
|
192 INFO_PRINTF1(_L("Failed test, X3P position incorrect.")); |
|
193 SetTestStepResult(EFail); |
|
194 } |
|
195 |
|
196 // entry 1 - the self locate pos should have ll NANs in it! |
|
197 currPosInfo = reinterpret_cast<TPositionInfo*>(currPosInfoArr[1]); |
|
198 TPosition pos; |
|
199 currPosInfo->GetPosition(pos); |
|
200 if (!Math::IsNaN(pos.Latitude())) |
|
201 { |
|
202 INFO_PRINTF1(_L("Failed test, Position does not contain NANs")); |
|
203 |
|
204 SetTestStepResult(EFail); |
|
205 } |
|
206 if (!Math::IsNaN(pos.Longitude())) |
|
207 { |
|
208 INFO_PRINTF1(_L("Failed test, Position does not contain NANs")); |
|
209 |
|
210 SetTestStepResult(EFail); |
|
211 } |
|
212 |
|
213 } |
|
214 |
|
215 |
|
216 /** A standard TEF test case doTestStepL, this SHOULD only support a single test case. |
|
217 |
|
218 Typically the function will look much like this. |
|
219 */ |
|
220 TVerdict CT_LbsConflictStepx3ppushselflocate::doTestStepL() |
|
221 { |
|
222 // Generic test step used to test the LBS Client Notify position update API. |
|
223 INFO_PRINTF1(_L(">>CT_LbsConflictStepx3ppushselflocate::doTestStepL()")); |
|
224 |
|
225 if (TestStepResult() == EPass) |
|
226 { |
|
227 // Setup the expected sequence events for the test. |
|
228 SetExpectedSeq(); |
|
229 |
|
230 // Open and setup net sim. |
|
231 OpenNetSim(this); |
|
232 |
|
233 // Kick off the test abort and keep alive timers. |
|
234 TTimeIntervalMicroSeconds32 abortInterval(KLbsAbortPeriod); |
|
235 TTimeIntervalMicroSeconds32 keepAliveInterval(KLbsKeepAlivePeriod); |
|
236 |
|
237 iAbortTimer->SetTimer(abortInterval); |
|
238 iKeepAliveTimer->SetTimer(keepAliveInterval); |
|
239 |
|
240 // Kick off test. |
|
241 CActiveScheduler::Start(); |
|
242 |
|
243 // Verify location data. |
|
244 VerifyPosInfos(); |
|
245 |
|
246 // Clean up. |
|
247 CloseNetSim(); |
|
248 } |
|
249 |
|
250 INFO_PRINTF1(_L("<<CT_LbsConflictStepx3ppushselflocate::doTestStepL()")); |
|
251 |
|
252 return TestStepResult(); |
|
253 } |
|
254 |
|
255 |
|
256 /** NetSim callbacks given for a MoLr, which we invoke as a result of the notify position update. |
|
257 */ |
|
258 void CT_LbsConflictStepx3ppushselflocate::Connected() |
|
259 { |
|
260 // Call base implementation. |
|
261 CT_LbsConflictStep::Connected(); |
|
262 |
|
263 // Kick off first pos update. |
|
264 |
|
265 // Create a posinfo and store in our shared array for later verification. |
|
266 RPointerArray<TAny>& posInfoArr = iParent.iSharedData->iCurrentPosInfoArr; |
|
267 TPositionInfo* posInfo = new(ELeave) TPositionInfo(); |
|
268 |
|
269 T_LbsUtils utils; |
|
270 utils.ResetAndDestroy_PosInfoArr(posInfoArr); // Clear previous entries before new entry is appended. |
|
271 |
|
272 posInfoArr.Append(posInfo); |
|
273 |
|
274 TLbsTransmitPositionOptions transOpts; |
|
275 |
|
276 iDoX3P->SetOptions(transOpts); // Set timeout value to 0, to disable the timeout. |
|
277 iDoX3P->StartL(KTransmitDestination, KTransmitPriority, *posInfo); |
|
278 |
|
279 } |
|
280 |
|
281 |
|
282 void CT_LbsConflictStepx3ppushselflocate::Disconnected() |
|
283 { |
|
284 // Call base implementation. |
|
285 CT_LbsConflictStep::Disconnected(); |
|
286 } |
|
287 |
|
288 |
|
289 void CT_LbsConflictStepx3ppushselflocate::NotifyRegisterLcsMoLr(const TDesC& aData) |
|
290 { |
|
291 // Determine and record the sequence event. A blank aData indicates a self locate |
|
292 // MOLR, otherwise we have a X3P MOLR. Also the current test state indicates which |
|
293 // type MOLR is being carried out. |
|
294 if (aData != KNullDesC) |
|
295 { |
|
296 INFO_PRINTF1(_L("Got - X3P MOLR - NetSim Notify Register Lcs MoLr - Event.")); |
|
297 SetCurrentSeqEvent(EX3P_PUSH_MOLR_NetSim_Got_NotifyRegisterLcsMoLr); |
|
298 |
|
299 // Verify telephone number. |
|
300 if (aData.Compare(KTransmitDestination)) |
|
301 { |
|
302 INFO_PRINTF1(_L("Failed test, bad X3P register data.")); |
|
303 SetTestStepResult(EFail); |
|
304 } |
|
305 |
|
306 iState = EReqX3P; |
|
307 |
|
308 } |
|
309 |
|
310 else if (aData == KNullDesC) |
|
311 { |
|
312 iState = EReqPosUpdate; |
|
313 INFO_PRINTF1(_L("Got - Self MOLR - NetSim Notify Register Lcs MoLr - Event.")); |
|
314 SetCurrentSeqEvent(ESelf_MOLR_NetSim_Got_NotifyRegisterLcsMoLr); |
|
315 } |
|
316 |
|
317 |
|
318 } |
|
319 |
|
320 |
|
321 void CT_LbsConflictStepx3ppushselflocate::NotifyReleaseLcsMoLr(TInt aReason) |
|
322 { |
|
323 TInt expectedErr = KErrNone; |
|
324 |
|
325 // Determine and set sequence event. |
|
326 if (iState == EReqPosUpdate) |
|
327 { |
|
328 INFO_PRINTF1(_L("Got - Self MOLR - NetSim Notify Release Lcs MoLr - Event.")); |
|
329 SetCurrentSeqEvent(ESelf_MOLR_NetSim_Got_NotifyReleaseLcsMoLr); |
|
330 |
|
331 expectedErr = KErrPositionHighPriorityReceive; |
|
332 } |
|
333 |
|
334 else if(iState == EReqX3P) |
|
335 { |
|
336 INFO_PRINTF1(_L("Got - X3P MOLR - NetSim Notify Release Lcs MoLr - Event.")); |
|
337 SetCurrentSeqEvent(EX3P_PUSH_MOLR_NetSim_Got_NotifyReleaseLcsMoLr); |
|
338 |
|
339 iState = EWaiting; // End of test. |
|
340 } |
|
341 |
|
342 // Verify reason code. |
|
343 if (aReason != expectedErr) |
|
344 { |
|
345 INFO_PRINTF2(_L("Failed test, bad release reason %d."), aReason); |
|
346 SetTestStepResult(EFail); |
|
347 } |
|
348 } |
|
349 |
|
350 |
|
351 void CT_LbsConflictStepx3ppushselflocate::NotifyMeasurementControlLocation(const TPositionInfo& aPosition, |
|
352 const RLbsAssistanceDataBuilderSet& aData, |
|
353 const TLbsNetPosRequestQuality& aQuality) |
|
354 { |
|
355 T_LbsUtils utils; |
|
356 TInt err; |
|
357 |
|
358 // Determine and record sequence event. |
|
359 if (iState == EReqPosUpdate) |
|
360 { |
|
361 INFO_PRINTF1(_L("Got - Self MOLR - NetSim Notify Measurement Control Location - Event.")); |
|
362 SetCurrentSeqEvent(ESelf_MOLR_NetSim_Got_NotifyMeasurementControlLocation); |
|
363 } |
|
364 |
|
365 else if(iState == EReqX3P) |
|
366 { |
|
367 INFO_PRINTF1(_L("Got - X3P MOLR - NetSim Notify Measurement Control Location - Event.")); |
|
368 SetCurrentSeqEvent(EX3P_PUSH_MOLR_NetSim_Got_NotifyMeasurementControlLocation); |
|
369 } |
|
370 |
|
371 |
|
372 // Verify the reference position. |
|
373 TPositionInfo verifyRefPosInfo; |
|
374 |
|
375 verifyRefPosInfo.SetPosition(iRefPos); |
|
376 if (!utils.Compare_PosInfo(verifyRefPosInfo, aPosition)) |
|
377 { |
|
378 INFO_PRINTF1(_L("Failed test, position incorrect.")); |
|
379 SetTestStepResult(EFail); |
|
380 } |
|
381 |
|
382 |
|
383 // Verify the assistance data. |
|
384 RLbsAssistanceDataBuilderSet& data = const_cast<RLbsAssistanceDataBuilderSet&>(aData); |
|
385 RUEPositioningGpsReferenceTimeBuilder* refTimeBuilder = NULL; |
|
386 |
|
387 data.GetDataBuilder(refTimeBuilder); |
|
388 |
|
389 // Create a reader from the builder's data to allow us to verify the actual |
|
390 // assistance data. |
|
391 RUEPositioningGpsReferenceTimeReader refTimeReader; |
|
392 |
|
393 TRAP(err, refTimeReader.OpenL()); |
|
394 if (err == KErrNone) |
|
395 { |
|
396 refTimeReader.DataBuffer() = refTimeBuilder->DataBuffer(); |
|
397 |
|
398 if (!utils.VerifySimpleAssistanceData(refTimeReader)) |
|
399 { |
|
400 INFO_PRINTF1(_L("Failed test, assistance data incorrect.")); |
|
401 SetTestStepResult(EFail); |
|
402 } |
|
403 refTimeReader.Close(); |
|
404 } |
|
405 |
|
406 else |
|
407 { |
|
408 INFO_PRINTF2(_L("Failed test, assistance data reader err %d."), err); |
|
409 SetTestStepResult(EFail); |
|
410 } |
|
411 |
|
412 |
|
413 |
|
414 // Start the self locate |
|
415 // Create a posinfo and store in our shared array for later verification. |
|
416 RPointerArray<TAny>& posInfoArr = iParent.iSharedData->iCurrentPosInfoArr; |
|
417 TPositionInfo* posInfo = new(ELeave) TPositionInfo(); |
|
418 |
|
419 posInfoArr.Append(posInfo); |
|
420 |
|
421 // Kick off self locate pos update. |
|
422 |
|
423 #if 0 |
|
424 T_LbsUtils utils; |
|
425 |
|
426 utils.WaitForModuleToRequestAssistanceDataL(); |
|
427 #endif |
|
428 |
|
429 iDoPosUpdate->StartL(*posInfo); |
|
430 |
|
431 |
|
432 |
|
433 |
|
434 |
|
435 |
|
436 // TODO: Check if we can verify aQuality in any way. |
|
437 (void)aQuality; |
|
438 } |
|
439 |
|
440 |
|
441 void CT_LbsConflictStepx3ppushselflocate::NotifyReleaseLcsLocationNotification(const CLbsNetworkProtocolBase::TLbsPrivacyResponse& aResult) |
|
442 { |
|
443 (void)aResult; |
|
444 |
|
445 // Unexpected callback for this test log the sequence event to fail test. |
|
446 if (iState == EReqPosUpdate) |
|
447 { |
|
448 INFO_PRINTF1(_L("Got - Self MOLR - NetSim Notify Release Lcs Location Notification - Event.")); |
|
449 SetCurrentSeqEvent(ESelf_MOLR_NetSim_Got_NotifyReleaseLcsLocationNotification); |
|
450 } |
|
451 |
|
452 else |
|
453 { |
|
454 INFO_PRINTF1(_L("Got - X3P MOLR - NetSim Notify Release Lcs Location Notification - Event.")); |
|
455 SetCurrentSeqEvent(ESelf_MOLR_NetSim_Got_NotifyReleaseLcsLocationNotification); |
|
456 } |
|
457 } |
|
458 |
|
459 |
|
460 void CT_LbsConflictStepx3ppushselflocate::NotifyFacilityLcsMoLrResult(TInt aReason, const TPositionInfo& aPosition) |
|
461 { |
|
462 |
|
463 // Determine and record sequence event |
|
464 if (iState == EReqPosUpdate) |
|
465 { |
|
466 INFO_PRINTF1(_L("Got - Self MOLR - NetSim Notify Facility Lcs MoLr Result - Event.")); |
|
467 SetCurrentSeqEvent(ESelf_MOLR_NetSim_Got_NotifyFacilityLcsMoLrResult); |
|
468 } |
|
469 |
|
470 else if(iState == EReqX3P) |
|
471 { |
|
472 INFO_PRINTF1(_L("Got - X3P MOLR - NetSim Notify Facility Lcs MoLr Result - Event.")); |
|
473 SetCurrentSeqEvent(EX3P_PUSH_MOLR_NetSim_Got_NotifyFacilityLcsMoLrResult); |
|
474 } |
|
475 |
|
476 |
|
477 // Verify reason code.. |
|
478 if (aReason != KErrNone) |
|
479 { |
|
480 INFO_PRINTF2(_L("Failed test, bad release reason %d."), aReason); |
|
481 SetTestStepResult(EFail); |
|
482 } |
|
483 |
|
484 // Verify the real position returned from the network, this will be the same position |
|
485 // we sent to the network as the result of the MO-LR, thus use the entry given by |
|
486 // the test module. |
|
487 T_LbsUtils utils; |
|
488 RPointerArray<TAny>& verifyPosInfoArr = iParent.iSharedData->iVerifyPosInfoArr; |
|
489 TPositionInfo* verifyRealPosInfo = reinterpret_cast<TPositionInfo*>(verifyPosInfoArr[0]); |
|
490 |
|
491 if (!utils.Compare_PosInfo(*verifyRealPosInfo, aPosition)) |
|
492 { |
|
493 INFO_PRINTF1(_L("Failed test, position incorrect.")); |
|
494 SetTestStepResult(EFail); |
|
495 } |
|
496 } |
|
497 |
|
498 |
|
499 |
|
500 void CT_LbsConflictStepx3ppushselflocate::NotifyMeasurementReportLocation(const TPositionInfo& aPosition) |
|
501 { |
|
502 // Determine and record sequence event. |
|
503 if (iState == EReqPosUpdate) |
|
504 { |
|
505 INFO_PRINTF1(_L("Got - Self MOLR - NetSim Notify Measurement Report - Event.")); |
|
506 SetCurrentSeqEvent(ESelf_MOLR_NetSim_Got_NotifyMeasurementReportLocation); |
|
507 } |
|
508 |
|
509 else if(iState == EReqX3P) |
|
510 { |
|
511 INFO_PRINTF1(_L("Got - X3P MOLR - NetSim Notify Measurement Report - Event.")); |
|
512 SetCurrentSeqEvent(EX3P_PUSH_MOLR_NetSim_Got_NotifyMeasurementReportLocation); |
|
513 } |
|
514 |
|
515 |
|
516 // Verify the real position given to the network, this will be the same position |
|
517 // returned as the result of the MO-LR, thus use the entry given by |
|
518 // the test module. |
|
519 T_LbsUtils utils; |
|
520 RPointerArray<TAny>& verifyPosInfoArr = iParent.iSharedData->iVerifyPosInfoArr; |
|
521 TPositionInfo* verifyRealPosInfo = reinterpret_cast<TPositionInfo*>(verifyPosInfoArr[0]); |
|
522 |
|
523 if (!utils.Compare_PosInfo(*verifyRealPosInfo, aPosition)) |
|
524 { |
|
525 INFO_PRINTF1(_L("Failed test, position incorrect.")); |
|
526 SetTestStepResult(EFail); |
|
527 } |
|
528 } |
|
529 |
|
530 |
|
531 void CT_LbsConflictStepx3ppushselflocate::NotifyMeasurementReportRequestMoreAssistanceData(const TLbsAssistanceDataGroup& aFilter) |
|
532 { |
|
533 (void)aFilter; |
|
534 |
|
535 // Unexpected callback for this test, record the sequence event to fail test. |
|
536 if (iState == EReqPosUpdate) |
|
537 { |
|
538 INFO_PRINTF1(_L("Got - Self MOLR - NetSim Notify Measurement Report Request More Assistance Data - Event.")); |
|
539 SetCurrentSeqEvent(ESelf_MOLR_NetSim_Got_NotifyMeasurementReportRequestMoreAssistanceData); |
|
540 } |
|
541 |
|
542 else |
|
543 { |
|
544 INFO_PRINTF1(_L("Got - X3P MOLR - NetSim Notify Measurement Report Request More Assistance Data - Event.")); |
|
545 SetCurrentSeqEvent(EX3P_PUSH_MOLR_NetSim_Got_NotifyMeasurementReportRequestMoreAssistanceData); |
|
546 } |
|
547 } |
|
548 |
|
549 |
|
550 void CT_LbsConflictStepx3ppushselflocate::NotifyMeasurementReportControlFailure(TInt aReason) |
|
551 { |
|
552 // Unexpected callback for this test, record the sequence event to fail test. |
|
553 if (iState == EReqPosUpdate) |
|
554 { |
|
555 INFO_PRINTF2(_L("Got - Self MOLR - Net Sim Notify Measurement Report Control Failure - Event. Reason = %d"), aReason); |
|
556 SetCurrentSeqEvent(ESelf_MOLR_NetSim_Got_NotifyMeasurementReportControlFailure); |
|
557 } |
|
558 |
|
559 else |
|
560 { |
|
561 INFO_PRINTF2(_L("Got - X3P MOLR - Net Sim Notify Measurement Report Control Failure - Event. Reason = %d"), aReason); |
|
562 SetCurrentSeqEvent(EX3P_PUSH_MOLR_NetSim_Got_NotifyMeasurementReportControlFailure); |
|
563 } |
|
564 } |
|
565 |
|
566 |
|
567 /** Notify position update callback. |
|
568 |
|
569 The notify position update has completed. |
|
570 */ |
|
571 void CT_LbsConflictStepx3ppushselflocate::MT_LbsDoPosUpdateCallback(TRequestStatus& aStatus) |
|
572 { |
|
573 INFO_PRINTF1(_L("Got - Client Notify Update Complete - Callback Event.")); |
|
574 SetCurrentSeqEvent(EClient_Got_PosUpdate_Complete); |
|
575 |
|
576 // Expect the self locate MOLR to be stopped because of the X3P. |
|
577 if (KErrServerBusy != aStatus.Int()) |
|
578 { |
|
579 INFO_PRINTF2(_L("Failed test, pos info request err = %d."), aStatus.Int()); |
|
580 SetTestStepResult(EFail); |
|
581 } |
|
582 else |
|
583 { |
|
584 INFO_PRINTF2(_L("Got KErrServerBusy as expected err = %d."), aStatus.Int()); |
|
585 } |
|
586 } |
|
587 |
|
588 |
|
589 /** X3P transmit callback. |
|
590 |
|
591 The X3P transmit request has completed. |
|
592 */ |
|
593 void CT_LbsConflictStepx3ppushselflocate::MT_LbsDoX3PCallback(TInt aTransmitId, TRequestStatus& aStatus) |
|
594 { |
|
595 (void)aTransmitId; |
|
596 |
|
597 INFO_PRINTF1(_L("Got - Client X3P Complete - Callback Event.")); |
|
598 SetCurrentSeqEvent(EClient_Got_X3P_Complete); |
|
599 |
|
600 if (KErrNone != aStatus.Int()) |
|
601 { |
|
602 |
|
603 INFO_PRINTF2(_L("Failed test, X3P transmit request err = %d."), aStatus.Int()); |
|
604 SetTestStepResult(EFail); |
|
605 } |
|
606 } |
|
607 |
|
608 |