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