|
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 ctlbsconflictstepx3pushmenu.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 "ctlbsconflictstepx3ppushmenu.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_X3PPushMenu* CT_LbsConflictStep_X3PPushMenu::New(CT_LbsConflictServer& aParent) |
|
72 { |
|
73 // Note the lack of ELeave. |
|
74 // This means that having insufficient memory will return NULL; |
|
75 CT_LbsConflictStep_X3PPushMenu* testStep = new CT_LbsConflictStep_X3PPushMenu(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_X3PPushMenu::CT_LbsConflictStep_X3PPushMenu(CT_LbsConflictServer& aParent) : CT_LbsConflictStep(aParent) |
|
95 { |
|
96 SetTestStepName(KLbsConflictStep_X3PPushMenu); |
|
97 } |
|
98 |
|
99 |
|
100 void CT_LbsConflictStep_X3PPushMenu::ConstructL() |
|
101 { |
|
102 // Create the base class objects. |
|
103 CT_LbsConflictStep::ConstructL(); |
|
104 |
|
105 // X3P async wrappers. |
|
106 iDoX3PMenu = CT_LbsDoX3P::NewL(this, KLbsConflictX3PMenuId); |
|
107 iDoX3PPush = CT_LbsDoX3P::NewL(this, KLbsConflictX3PPushId); |
|
108 } |
|
109 |
|
110 |
|
111 /** |
|
112 * Destructor |
|
113 */ |
|
114 CT_LbsConflictStep_X3PPushMenu::~CT_LbsConflictStep_X3PPushMenu() |
|
115 { |
|
116 iDoX3PMenu->Cancel(); |
|
117 delete iDoX3PMenu; |
|
118 |
|
119 iDoX3PPush->Cancel(); |
|
120 delete iDoX3PPush; |
|
121 } |
|
122 |
|
123 |
|
124 /** Expected sequence events. |
|
125 */ |
|
126 void CT_LbsConflictStep_X3PPushMenu::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 Menu (after X3P Menu register iState = ERegX3PMenu), |
|
137 // X3P(Menu) should be queued and handled after the X3P(Push) |
|
138 SetVerifySeqEvent(EX3P_MENU_MOLR_NetSim_Got_NotifyRegisterLcsMoLr); // --> To Net |
|
139 SetVerifySeqEvent(EX3P_MENU_MOLR_NetSim_Got_NotifyMeasurementControlLocation); // <-- From Net |
|
140 SetVerifySeqEvent(EX3P_MENU_MOLR_NetSim_Got_NotifyMeasurementReportLocation); // --> To Net |
|
141 SetVerifySeqEvent(EX3P_MENU_MOLR_NetSim_Got_NotifyFacilityLcsMoLrResult); |
|
142 |
|
143 SetVerifySeqEvent(EX3P_MENU_MOLR_NetSim_Got_NotifyReleaseLcsMoLr); // --> To Net |
|
144 |
|
145 SetVerifyAdhocEvent(EClient_Got_X3P_Complete); |
|
146 SetVerifyAdhocEvent(EClient_Got_X3P_Complete); |
|
147 |
|
148 } |
|
149 |
|
150 |
|
151 |
|
152 /** Called at the end of the test to verify the correct position data has been returned to the |
|
153 client. |
|
154 |
|
155 Each test case SHOULD implement a version of this. |
|
156 */ |
|
157 void CT_LbsConflictStep_X3PPushMenu::VerifyPosInfos() |
|
158 { |
|
159 T_LbsUtils utils; |
|
160 RPointerArray<TAny>& verifyPosInfoArr = iParent.iSharedData->iVerifyPosInfoArr; |
|
161 RPointerArray<TAny>& currPosInfoArr = iParent.iSharedData->iCurrentPosInfoArr; |
|
162 TPositionInfo* currPosInfo; |
|
163 |
|
164 |
|
165 // Verify entry 0 for the X3P PUSH. |
|
166 // We expect a real location value, compare using the data |
|
167 // sent to the test APGS module. |
|
168 TPositionInfo* verifyPosInfo = reinterpret_cast<TPositionInfo*>(verifyPosInfoArr[0]); |
|
169 currPosInfo = reinterpret_cast<TPositionInfo*>(currPosInfoArr[0]); |
|
170 if (!utils.Compare_PosInfo(*verifyPosInfo, *currPosInfo)) |
|
171 { |
|
172 INFO_PRINTF1(_L("Failed test, X3P(PUSH) position incorrect.")); |
|
173 SetTestStepResult(EFail); |
|
174 } |
|
175 |
|
176 // Verify entry 1 for the X3P MENU. |
|
177 // We expect a real location value, compare using the data |
|
178 // sent to the test APGS module. |
|
179 |
|
180 currPosInfo = reinterpret_cast<TPositionInfo*>(currPosInfoArr[1]); |
|
181 if (!utils.Compare_PosInfo(*verifyPosInfo, *currPosInfo)) |
|
182 { |
|
183 INFO_PRINTF1(_L("Failed test, X3P(MENU) position incorrect.")); |
|
184 SetTestStepResult(EFail); |
|
185 } |
|
186 } |
|
187 |
|
188 |
|
189 /** Helper function to start X3Ps. |
|
190 */ |
|
191 void CT_LbsConflictStep_X3PPushMenu::StartX3PL(TInt aTransmitId) |
|
192 { |
|
193 INFO_PRINTF1(_L(">>CT_LbsConflictStep_X3PPushMenu::StartX3PL()")); |
|
194 |
|
195 // Create a posinfo and store in our shared array for later verification. |
|
196 RPointerArray<TAny>& posInfoArr = iParent.iSharedData->iCurrentPosInfoArr; |
|
197 TPositionInfo* posInfo = new(ELeave) TPositionInfo(); |
|
198 |
|
199 posInfoArr.Append(posInfo); |
|
200 |
|
201 |
|
202 // Start X3P, |
|
203 TLbsTransmitPositionOptions transOpts; // Set timeout value to 0 (done by the default constructor), to disable the timeout. |
|
204 |
|
205 // Menu. |
|
206 if (aTransmitId == KLbsConflictX3PMenuId) |
|
207 { |
|
208 INFO_PRINTF1(_L("Starting X3P(MENU)")); |
|
209 iDoX3PMenu->SetOptions(transOpts); |
|
210 iDoX3PMenu->StartL(KTransmitMenuDestination, KTransmitMenuPriority, *posInfo); |
|
211 } |
|
212 |
|
213 // Push. |
|
214 else if (aTransmitId == KLbsConflictX3PPushId) |
|
215 { |
|
216 INFO_PRINTF1(_L("Starting X3P(PUSH)")); |
|
217 iDoX3PPush->SetOptions(transOpts); |
|
218 iDoX3PPush->StartL(KTransmitPushDestination, KTransmitPushPriority, *posInfo); |
|
219 } |
|
220 |
|
221 else |
|
222 { |
|
223 User::LeaveIfError(KErrNotSupported); |
|
224 } |
|
225 INFO_PRINTF1(_L("<<CT_LbsConflictStep_X3PPushMenu::StartX3PL()")); |
|
226 } |
|
227 |
|
228 |
|
229 /** Run the test. |
|
230 */ |
|
231 TVerdict CT_LbsConflictStep_X3PPushMenu::doTestStepL() |
|
232 { |
|
233 INFO_PRINTF1(_L(">>CT_LbsConflictStep_X3PPushMenu::doTestStepL()")); |
|
234 |
|
235 if (TestStepResult() == EPass) |
|
236 { |
|
237 // Setup the expected sequence events for the test. |
|
238 SetExpectedSeq(); |
|
239 |
|
240 // Open and setup net sim. |
|
241 OpenNetSim(this); |
|
242 |
|
243 // Kick off the test abort and keep alive timers. |
|
244 TTimeIntervalMicroSeconds32 abortInterval(KLbsAbortPeriod); |
|
245 TTimeIntervalMicroSeconds32 keepAliveInterval(KLbsKeepAlivePeriod); |
|
246 |
|
247 iAbortTimer->SetTimer(abortInterval); |
|
248 iKeepAliveTimer->SetTimer(keepAliveInterval); |
|
249 |
|
250 // Kick off test. |
|
251 CActiveScheduler::Start(); |
|
252 |
|
253 // Verify location data. |
|
254 VerifyPosInfos(); |
|
255 |
|
256 // Clean up. |
|
257 CloseNetSim(); |
|
258 } |
|
259 |
|
260 INFO_PRINTF1(_L("<<CT_LbsConflictStep_X3PPushMenu::doTestStepL()")); |
|
261 |
|
262 return TestStepResult(); |
|
263 } |
|
264 |
|
265 |
|
266 /** NetSim callbacks given for a MoLr, which we invoke as a result of the notify position update. |
|
267 */ |
|
268 void CT_LbsConflictStep_X3PPushMenu::Connected() |
|
269 { |
|
270 // Call base implementation. |
|
271 CT_LbsConflictStep::Connected(); |
|
272 |
|
273 RPointerArray<TAny>& posInfoArr = iParent.iSharedData->iCurrentPosInfoArr; |
|
274 |
|
275 T_LbsUtils utils; |
|
276 utils.ResetAndDestroy_PosInfoArr(posInfoArr); // Clear previous entries before new entry is appended. |
|
277 |
|
278 // Kick off first X3P. |
|
279 StartX3PL(KLbsConflictX3PPushId); |
|
280 iState = EReqX3PPush; |
|
281 } |
|
282 |
|
283 |
|
284 void CT_LbsConflictStep_X3PPushMenu::Disconnected() |
|
285 { |
|
286 // Call base implementation. |
|
287 CT_LbsConflictStep::Disconnected(); |
|
288 } |
|
289 |
|
290 |
|
291 void CT_LbsConflictStep_X3PPushMenu::NotifyRegisterLcsMoLr(const TDesC& aData) |
|
292 { |
|
293 // Determine and record the sequence event. A blank aData indicates a self locate |
|
294 // un-expected MOLR, otherwise we have a X3P MOLR. |
|
295 if (aData != KNullDesC) |
|
296 { |
|
297 // Process X3P Push register. |
|
298 if (iState == EReqX3PPush) |
|
299 { |
|
300 INFO_PRINTF1(_L("Got - X3P(PUSH) MOLR - NetSim Notify Register Lcs MoLr - Event.")); |
|
301 SetCurrentSeqEvent(EX3P_PUSH_MOLR_NetSim_Got_NotifyRegisterLcsMoLr); |
|
302 |
|
303 // Verify telephone number. |
|
304 if (aData.Compare(KTransmitPushDestination)) |
|
305 { |
|
306 INFO_PRINTF1(_L("Failed test, bad X3P Push register data.")); |
|
307 SetTestStepResult(EFail); |
|
308 } |
|
309 |
|
310 // Start X3P Menu (second X3P). |
|
311 StartX3PL(KLbsConflictX3PMenuId); |
|
312 } |
|
313 |
|
314 // Process X3P Menu register. |
|
315 else |
|
316 { |
|
317 INFO_PRINTF1(_L("Got - X3P(MENU) MOLR - NetSim Notify Register Lcs MoLr - Event.")); |
|
318 SetCurrentSeqEvent(EX3P_MENU_MOLR_NetSim_Got_NotifyRegisterLcsMoLr); |
|
319 |
|
320 // Verify telephone number. |
|
321 if (aData.Compare(KTransmitMenuDestination)) |
|
322 { |
|
323 INFO_PRINTF1(_L("Failed test, bad X3P Menu register data.")); |
|
324 SetTestStepResult(EFail); |
|
325 } |
|
326 } |
|
327 } |
|
328 |
|
329 else |
|
330 { |
|
331 INFO_PRINTF1(_L("Got unexpected - Self MOLR - NetSim Notify Register Lcs MoLr - Event.")); |
|
332 SetCurrentSeqEvent(ESelf_MOLR_NetSim_Got_NotifyRegisterLcsMoLr); |
|
333 } |
|
334 } |
|
335 |
|
336 |
|
337 void CT_LbsConflictStep_X3PPushMenu::NotifyReleaseLcsMoLr(TInt aReason) |
|
338 { |
|
339 TInt expectedErr = KErrNone; |
|
340 |
|
341 // Determine and set sequence event. |
|
342 if (iState == EReqX3PMenu) |
|
343 { |
|
344 INFO_PRINTF1(_L("Got - X3P(MENU) MOLR - NetSim Notify Release Lcs MoLr - Event.")); |
|
345 SetCurrentSeqEvent(EX3P_MENU_MOLR_NetSim_Got_NotifyReleaseLcsMoLr); |
|
346 |
|
347 // expectedErr = KErrPositionHighPriorityReceive; |
|
348 iState = EWaiting; // End of test. |
|
349 } |
|
350 |
|
351 else if(iState == EReqX3PPush) |
|
352 { |
|
353 INFO_PRINTF1(_L("Got - X3P(PUSH) MOLR - NetSim Notify Release Lcs MoLr - Event.")); |
|
354 SetCurrentSeqEvent(EX3P_PUSH_MOLR_NetSim_Got_NotifyReleaseLcsMoLr); |
|
355 |
|
356 |
|
357 // Indicate we have really started the second X3P. |
|
358 iState = EReqX3PMenu; |
|
359 } |
|
360 |
|
361 // Verify reason code. |
|
362 if (aReason != expectedErr) |
|
363 { |
|
364 INFO_PRINTF2(_L("Failed test, bad release reason %d."), aReason); |
|
365 SetTestStepResult(EFail); |
|
366 } |
|
367 } |
|
368 |
|
369 |
|
370 void CT_LbsConflictStep_X3PPushMenu::NotifyMeasurementControlLocation(const TPositionInfo& aPosition, |
|
371 const RLbsAssistanceDataBuilderSet& aData, |
|
372 const TLbsNetPosRequestQuality& aQuality) |
|
373 { |
|
374 T_LbsUtils utils; |
|
375 TInt err; |
|
376 |
|
377 // Determine and record sequence event. |
|
378 if (iState == EReqX3PMenu) |
|
379 { |
|
380 INFO_PRINTF1(_L("Got - X3P(MENU) MOLR - NetSim Notify Measurement Control Location - Event.")); |
|
381 SetCurrentSeqEvent(EX3P_MENU_MOLR_NetSim_Got_NotifyMeasurementControlLocation); |
|
382 } |
|
383 |
|
384 else if(iState == EReqX3PPush) |
|
385 { |
|
386 INFO_PRINTF1(_L("Got - X3P(PUSH) MOLR - NetSim Notify Measurement Control Location - Event.")); |
|
387 SetCurrentSeqEvent(EX3P_PUSH_MOLR_NetSim_Got_NotifyMeasurementControlLocation); |
|
388 } |
|
389 |
|
390 // Verify the reference position. |
|
391 TPositionInfo verifyRefPosInfo; |
|
392 |
|
393 verifyRefPosInfo.SetPosition(iRefPos); |
|
394 if (!utils.Compare_PosInfo(verifyRefPosInfo, aPosition)) |
|
395 { |
|
396 INFO_PRINTF1(_L("Failed test, position incorrect.")); |
|
397 SetTestStepResult(EFail); |
|
398 } |
|
399 |
|
400 |
|
401 // Verify the assistance data. |
|
402 RLbsAssistanceDataBuilderSet& data = const_cast<RLbsAssistanceDataBuilderSet&>(aData); |
|
403 RUEPositioningGpsReferenceTimeBuilder* refTimeBuilder = NULL; |
|
404 |
|
405 data.GetDataBuilder(refTimeBuilder); |
|
406 |
|
407 // Create a reader from the builder's data to allow us to verify the actual |
|
408 // assistance data. |
|
409 RUEPositioningGpsReferenceTimeReader refTimeReader; |
|
410 |
|
411 TRAP(err, refTimeReader.OpenL()); |
|
412 if (err == KErrNone) |
|
413 { |
|
414 refTimeReader.DataBuffer() = refTimeBuilder->DataBuffer(); |
|
415 |
|
416 if (!utils.VerifySimpleAssistanceData(refTimeReader)) |
|
417 { |
|
418 INFO_PRINTF1(_L("Failed test, assistance data incorrect.")); |
|
419 SetTestStepResult(EFail); |
|
420 } |
|
421 refTimeReader.Close(); |
|
422 } |
|
423 |
|
424 else |
|
425 { |
|
426 INFO_PRINTF2(_L("Failed test, assistance data reader err %d."), err); |
|
427 SetTestStepResult(EFail); |
|
428 } |
|
429 |
|
430 |
|
431 // TODO: Check if we can verify aQuality in any way. |
|
432 (void)aQuality; |
|
433 } |
|
434 |
|
435 |
|
436 void CT_LbsConflictStep_X3PPushMenu::NotifyReleaseLcsLocationNotification(const CLbsNetworkProtocolBase::TLbsPrivacyResponse& aResult) |
|
437 { |
|
438 (void)aResult; |
|
439 |
|
440 // Unexpected callback for this test log the sequence event to fail test. |
|
441 if (iState == EReqX3PMenu) |
|
442 { |
|
443 INFO_PRINTF1(_L("Got - X3P(MENU) MOLR - NetSim Notify Release Lcs Location Notification - Event.")); |
|
444 //SetCurrentSeqEvent(EX3P_MENU_MOLR_NetSim_Got_NotifyReleaseLcsLocationNotification); |
|
445 } |
|
446 |
|
447 else |
|
448 { |
|
449 INFO_PRINTF1(_L("Got - X3P(PUSH) MOLR - NetSim Notify Release Lcs Location Notification - Event.")); |
|
450 //SetCurrentSeqEvent(EX3P_PUSH_MOLR_NetSim_Got_NotifyReleaseLcsLocationNotification); |
|
451 } |
|
452 } |
|
453 |
|
454 |
|
455 void CT_LbsConflictStep_X3PPushMenu::NotifyFacilityLcsMoLrResult(TInt aReason, const TPositionInfo& aPosition) |
|
456 { |
|
457 // Determine and record sequence event. |
|
458 if (iState == EReqX3PMenu) |
|
459 { |
|
460 INFO_PRINTF1(_L("Got - X3P(MENU) MOLR - NetSim Notify Facility Lcs MoLr Result - Event.")); |
|
461 SetCurrentSeqEvent(EX3P_MENU_MOLR_NetSim_Got_NotifyFacilityLcsMoLrResult); |
|
462 } |
|
463 |
|
464 else |
|
465 { |
|
466 INFO_PRINTF1(_L("Got - X3P(PUSH) MOLR - NetSim Notify Facility Lcs MoLr Result - Event.")); |
|
467 SetCurrentSeqEvent(EX3P_PUSH_MOLR_NetSim_Got_NotifyFacilityLcsMoLrResult); |
|
468 } |
|
469 |
|
470 // Verify reason code.. |
|
471 if (aReason != KErrNone) |
|
472 { |
|
473 INFO_PRINTF2(_L("Failed test, bad release reason %d."), aReason); |
|
474 SetTestStepResult(EFail); |
|
475 } |
|
476 |
|
477 |
|
478 // Verify the real position returned from the network, this will be the same position |
|
479 // we sent to the network as the result of the MO-LR, thus use the entry given by |
|
480 // the test module. |
|
481 T_LbsUtils utils; |
|
482 RPointerArray<TAny>& verifyPosInfoArr = iParent.iSharedData->iVerifyPosInfoArr; |
|
483 TPositionInfo* verifyRealPosInfo = reinterpret_cast<TPositionInfo*>(verifyPosInfoArr[0]); |
|
484 |
|
485 if (!utils.Compare_PosInfo(*verifyRealPosInfo, aPosition)) |
|
486 { |
|
487 INFO_PRINTF1(_L("Failed test, position incorrect.")); |
|
488 SetTestStepResult(EFail); |
|
489 } |
|
490 } |
|
491 |
|
492 |
|
493 void CT_LbsConflictStep_X3PPushMenu::NotifyMeasurementReportLocation(const TPositionInfo& aPosition) |
|
494 { |
|
495 // Determine and record sequence event. |
|
496 if (iState == EReqX3PMenu) |
|
497 { |
|
498 INFO_PRINTF1(_L("Got - X3P(MENU) MOLR - NetSim Notify Measurement Report - Event.")); |
|
499 SetCurrentSeqEvent(EX3P_MENU_MOLR_NetSim_Got_NotifyMeasurementReportLocation); |
|
500 } |
|
501 |
|
502 else |
|
503 { |
|
504 INFO_PRINTF1(_L("Got - X3P(PUSH) MOLR - NetSim Notify Measurement Report - Event.")); |
|
505 SetCurrentSeqEvent(EX3P_PUSH_MOLR_NetSim_Got_NotifyMeasurementReportLocation); |
|
506 } |
|
507 |
|
508 |
|
509 // Verify the real position returned from the network, this will be the same position |
|
510 // we sent to the network as the result of the MO-LR, thus use the entry given by |
|
511 // the test module. |
|
512 T_LbsUtils utils; |
|
513 RPointerArray<TAny>& verifyPosInfoArr = iParent.iSharedData->iVerifyPosInfoArr; |
|
514 TPositionInfo* verifyRealPosInfo = reinterpret_cast<TPositionInfo*>(verifyPosInfoArr[0]); |
|
515 |
|
516 if (!utils.Compare_PosInfo(*verifyRealPosInfo, aPosition)) |
|
517 { |
|
518 INFO_PRINTF1(_L("Failed test, position incorrect.")); |
|
519 SetTestStepResult(EFail); |
|
520 } |
|
521 } |
|
522 |
|
523 |
|
524 void CT_LbsConflictStep_X3PPushMenu::NotifyMeasurementReportRequestMoreAssistanceData(const TLbsAssistanceDataGroup& aFilter) |
|
525 { |
|
526 (void)aFilter; |
|
527 |
|
528 // Unexpected callback for this test, record the sequence event to fail test. |
|
529 if (iState == EReqX3PMenu) |
|
530 { |
|
531 INFO_PRINTF1(_L("Got - X3P(MENU) MOLR - NetSim Notify Measurement Report Request More Assistance Data - Event.")); |
|
532 SetCurrentSeqEvent(EX3P_MENU_MOLR_NetSim_Got_NotifyMeasurementReportRequestMoreAssistanceData); |
|
533 } |
|
534 |
|
535 else |
|
536 { |
|
537 INFO_PRINTF1(_L("Got - X3P(PUSH) MOLR - NetSim Notify Measurement Report Request More Assistance Data - Event.")); |
|
538 SetCurrentSeqEvent(EX3P_PUSH_MOLR_NetSim_Got_NotifyMeasurementReportRequestMoreAssistanceData); |
|
539 } |
|
540 } |
|
541 |
|
542 |
|
543 void CT_LbsConflictStep_X3PPushMenu::NotifyMeasurementReportControlFailure(TInt aReason) |
|
544 { |
|
545 // Unexpected callback for this test, record the sequence event to fail test. |
|
546 if (iState == EReqX3PMenu) |
|
547 { |
|
548 INFO_PRINTF2(_L("Got - X3P(MENU) MOLR - Net Sim Notify Measurement Report Control Failure - Event. Reason = %d"), aReason); |
|
549 SetCurrentSeqEvent(EX3P_MENU_MOLR_NetSim_Got_NotifyMeasurementReportControlFailure); |
|
550 } |
|
551 |
|
552 else |
|
553 { |
|
554 INFO_PRINTF2(_L("Got - X3P(PUSH) MOLR - Net Sim Notify Measurement Report Control Failure - Event. Reason = %d"), aReason); |
|
555 SetCurrentSeqEvent(EX3P_PUSH_MOLR_NetSim_Got_NotifyMeasurementReportControlFailure); |
|
556 } |
|
557 } |
|
558 |
|
559 |
|
560 /** X3P transmit callback. |
|
561 |
|
562 The X3P transmit request has completed. |
|
563 */ |
|
564 void CT_LbsConflictStep_X3PPushMenu::MT_LbsDoX3PCallback(TInt aTransmitId, TRequestStatus& aStatus) |
|
565 { |
|
566 TInt expectedErr = KErrNone; |
|
567 SetCurrentSeqEvent(EClient_Got_X3P_Complete); |
|
568 |
|
569 if (aTransmitId == KLbsConflictX3PMenuId) |
|
570 { |
|
571 INFO_PRINTF1(_L("Got - Client X3P(MENU) Complete - Callback Event.")); |
|
572 } |
|
573 |
|
574 else if (aTransmitId == KLbsConflictX3PPushId) |
|
575 { |
|
576 INFO_PRINTF1(_L("Got - Client X3P(PUSH) 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 |