|
1 // Copyright (c) 2002-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 // This tests the GSM Supplementary services functions including |
|
15 // Call Barring, call forwarding and identity services |
|
16 // |
|
17 // |
|
18 |
|
19 /** |
|
20 @file |
|
21 */ |
|
22 |
|
23 |
|
24 #include "Te_SimSS.h" |
|
25 |
|
26 /**************************************************************/ |
|
27 // |
|
28 // Testing asynchronous retrieve of Call Barring list |
|
29 // |
|
30 /**************************************************************/ |
|
31 |
|
32 CTestGetCBList* CTestGetCBList::NewLC(RMobilePhone& aPhone, CTestCallBarring* aTest) |
|
33 { |
|
34 CTestGetCBList* r=new(ELeave) CTestGetCBList(aPhone, aTest); |
|
35 CleanupStack::PushL(r); |
|
36 r->ConstructL(); |
|
37 CleanupStack::Pop(); |
|
38 return r; |
|
39 } |
|
40 |
|
41 CTestGetCBList::CTestGetCBList(RMobilePhone& aPhone, CTestCallBarring* aTest) |
|
42 : CActive(EPriorityNormal), |
|
43 iPhone(aPhone), |
|
44 iTest(aTest) |
|
45 {} |
|
46 |
|
47 void CTestGetCBList::ConstructL() |
|
48 { |
|
49 CActiveScheduler::Add(this); |
|
50 iRetrieveCB=CRetrieveMobilePhoneCBList::NewL(iPhone); |
|
51 |
|
52 } |
|
53 |
|
54 void CTestGetCBList::Start(RMobilePhone::TMobilePhoneCBCondition aCondition) |
|
55 { |
|
56 iRetrieveCB->Start(iStatus, aCondition); |
|
57 SetActive(); |
|
58 } |
|
59 |
|
60 void CTestGetCBList::RunL() |
|
61 { |
|
62 TInt ret=iStatus.Int(); |
|
63 |
|
64 User::LeaveIfError(ret); |
|
65 ret=CheckResultsL(); |
|
66 User::LeaveIfError(ret); |
|
67 CActiveScheduler::Stop(); |
|
68 } |
|
69 |
|
70 void CTestGetCBList::DoCancel() |
|
71 { |
|
72 iRetrieveCB->Cancel(); |
|
73 } |
|
74 |
|
75 TInt CTestGetCBList::SetExpectedResultsL(RMobilePhone::TMobilePhoneCBInfoEntryV1 aExpectedEntry) |
|
76 { |
|
77 if (!iChecked) |
|
78 iExpectedcbList=CMobilePhoneCBList::NewL(); |
|
79 TRAPD(ret,iExpectedcbList->AddEntryL(aExpectedEntry);); |
|
80 if(ret!=KErrNone) |
|
81 return ret; |
|
82 iChecked = ETrue; |
|
83 return KErrNone; |
|
84 } |
|
85 |
|
86 void CTestGetCBList::PrintEntry(RMobilePhone::TMobilePhoneCBInfoEntryV1 aCfEntry, TInt aEntryNumber) |
|
87 { |
|
88 TBuf<200> EntryCondition; |
|
89 TBuf<200> EntryServiceGroup; |
|
90 TBuf<200> EntryStatus; |
|
91 |
|
92 switch (aCfEntry.iCondition) |
|
93 { |
|
94 case RMobilePhone::EBarUnspecified: |
|
95 EntryCondition = _L("EBarUnspecified"); |
|
96 break; |
|
97 case RMobilePhone::EBarAllIncoming: |
|
98 EntryCondition = _L("EBarAllIncoming"); |
|
99 break; |
|
100 case RMobilePhone::EBarIncomingRoaming: |
|
101 EntryCondition = _L("EBarIncomingRoaming"); |
|
102 break; |
|
103 case RMobilePhone::EBarAllOutgoing: |
|
104 EntryCondition = _L("EBarAllOutgoing"); |
|
105 break; |
|
106 case RMobilePhone::EBarOutgoingInternational: |
|
107 EntryCondition = _L("EBarOutgoingInternational"); |
|
108 break; |
|
109 case RMobilePhone::EBarOutgoingInternationalExHC: |
|
110 EntryCondition = _L("EBarOutgoingInternationalExHC"); |
|
111 break; |
|
112 case RMobilePhone::EBarAllCases: |
|
113 EntryCondition = _L("EBarAllCases"); |
|
114 break; |
|
115 case RMobilePhone::EBarAllOutgoingServices: |
|
116 EntryCondition = _L("EBarAllOutgoingServices"); |
|
117 break; |
|
118 case RMobilePhone::EBarAllIncomingServices: |
|
119 EntryCondition = _L("EBarAllIncomingServices"); |
|
120 break; |
|
121 default: |
|
122 break; |
|
123 } |
|
124 |
|
125 switch (aCfEntry.iServiceGroup) |
|
126 { |
|
127 case RMobilePhone::EServiceUnspecified: |
|
128 EntryServiceGroup = _L("EServiceUnspecified"); |
|
129 break; |
|
130 case RMobilePhone::EVoiceService: |
|
131 EntryServiceGroup = _L("EVoiceService"); |
|
132 break; |
|
133 case RMobilePhone::EAuxVoiceService: |
|
134 EntryServiceGroup = _L("EAuxVoiceService"); |
|
135 break; |
|
136 case RMobilePhone::ECircuitDataService: |
|
137 EntryServiceGroup = _L("ECircuitDataService"); |
|
138 break; |
|
139 case RMobilePhone::EPacketDataService: |
|
140 EntryServiceGroup = _L("EPacketDataService"); |
|
141 break; |
|
142 case RMobilePhone::EFaxService: |
|
143 EntryServiceGroup = _L("EFaxService"); |
|
144 break; |
|
145 case RMobilePhone::EShortMessageService: |
|
146 EntryServiceGroup = _L("EShortMessageService"); |
|
147 break; |
|
148 case RMobilePhone::EAllServices: |
|
149 EntryServiceGroup = _L("EAllServices"); |
|
150 break; |
|
151 case RMobilePhone::EAllTele: |
|
152 EntryServiceGroup = _L("EAllTele"); |
|
153 break; |
|
154 case RMobilePhone::ETelephony: |
|
155 EntryServiceGroup = _L("ETelephony"); |
|
156 break; |
|
157 case RMobilePhone::EAllDataTele: |
|
158 EntryServiceGroup = _L("EAllDataTele"); |
|
159 break; |
|
160 case RMobilePhone::EAllDataExSms: |
|
161 EntryServiceGroup = _L("EBarUnspecified"); |
|
162 break; |
|
163 case RMobilePhone::EAllTeleExcSms: |
|
164 EntryServiceGroup = _L("EAllTeleExcSms"); |
|
165 break; |
|
166 case RMobilePhone::EAllPlmnTele: |
|
167 EntryServiceGroup = _L("EAllPlmnTele"); |
|
168 break; |
|
169 case RMobilePhone::EPlmnTele1: |
|
170 EntryServiceGroup = _L("EPlmnTele1"); |
|
171 break; |
|
172 case RMobilePhone::EPlmnTele2: |
|
173 EntryServiceGroup = _L("EPlmnTele2"); |
|
174 break; |
|
175 case RMobilePhone::EPlmnTele3: |
|
176 EntryServiceGroup = _L("EPlmnTele3"); |
|
177 break; |
|
178 case RMobilePhone::EPlmnTele4: |
|
179 EntryServiceGroup = _L("EPlmnTele4"); |
|
180 break; |
|
181 case RMobilePhone::EPlmnTele5: |
|
182 EntryServiceGroup = _L("EPlmnTele5"); |
|
183 break; |
|
184 case RMobilePhone::EPlmnTele6: |
|
185 EntryServiceGroup = _L("EPlmnTele6"); |
|
186 break; |
|
187 case RMobilePhone::EPlmnTele7: |
|
188 EntryServiceGroup = _L("EPlmnTele7"); |
|
189 break; |
|
190 case RMobilePhone::EPlmnTele8: |
|
191 EntryServiceGroup = _L("EPlmnTele8"); |
|
192 break; |
|
193 case RMobilePhone::EPlmnTele9: |
|
194 EntryServiceGroup = _L("EPlmnTele9"); |
|
195 break; |
|
196 case RMobilePhone::EPlmnTeleA: |
|
197 EntryServiceGroup = _L("EPlmnTeleA"); |
|
198 break; |
|
199 case RMobilePhone::EPlmnTeleB: |
|
200 EntryServiceGroup = _L("EPlmnTeleB"); |
|
201 break; |
|
202 case RMobilePhone::EPlmnTeleC: |
|
203 EntryServiceGroup = _L("EPlmnTeleC"); |
|
204 break; |
|
205 case RMobilePhone::EPlmnTeleD: |
|
206 EntryServiceGroup = _L("EPlmnTeleD"); |
|
207 break; |
|
208 case RMobilePhone::EPlmnTeleE: |
|
209 EntryServiceGroup = _L("EPlmnTeleE"); |
|
210 break; |
|
211 case RMobilePhone::EPlmnTeleF: |
|
212 EntryServiceGroup = _L("EPlmnTeleF"); |
|
213 break; |
|
214 case RMobilePhone::EAllBearer: |
|
215 EntryServiceGroup = _L("EAllBearer"); |
|
216 break; |
|
217 case RMobilePhone::EAllAsync: |
|
218 EntryServiceGroup = _L("EAllAsync"); |
|
219 break; |
|
220 case RMobilePhone::EAllSync: |
|
221 EntryServiceGroup = _L("EAllSync"); |
|
222 break; |
|
223 case RMobilePhone::ESyncData: |
|
224 EntryServiceGroup = _L("ESyncData"); |
|
225 break; |
|
226 case RMobilePhone::EAsyncData: |
|
227 EntryServiceGroup = _L("EAsyncData"); |
|
228 break; |
|
229 case RMobilePhone::EPacketData: |
|
230 EntryServiceGroup = _L("EPacketData"); |
|
231 break; |
|
232 case RMobilePhone::EPadAccess: |
|
233 EntryServiceGroup = _L("EPadAccess"); |
|
234 break; |
|
235 case RMobilePhone::EAllPlmnBearer: |
|
236 EntryServiceGroup = _L("EAllPlmnBearer"); |
|
237 break; |
|
238 case RMobilePhone::EPlmnBearerServ1: |
|
239 EntryServiceGroup = _L("EPlmnBearerServ1"); |
|
240 break; |
|
241 case RMobilePhone::EPlmnBearerServ2: |
|
242 EntryServiceGroup = _L("EPlmnBearerServ2"); |
|
243 break; |
|
244 case RMobilePhone::EPlmnBearerServ3: |
|
245 EntryServiceGroup = _L("EPlmnBearerServ3"); |
|
246 break; |
|
247 case RMobilePhone::EPlmnBearerServ4: |
|
248 EntryServiceGroup = _L("EPlmnBearerServ4"); |
|
249 break; |
|
250 case RMobilePhone::EPlmnBearerServ5: |
|
251 EntryServiceGroup = _L("EPlmnBearerServ5"); |
|
252 break; |
|
253 case RMobilePhone::EPlmnBearerServ6: |
|
254 EntryServiceGroup = _L("EPlmnBearerServ6"); |
|
255 break; |
|
256 case RMobilePhone::EPlmnBearerServ7: |
|
257 EntryServiceGroup = _L("EPlmnBearerServ7"); |
|
258 break; |
|
259 case RMobilePhone::EPlmnBearerServ8: |
|
260 EntryServiceGroup = _L("EPlmnBearerServ8"); |
|
261 break; |
|
262 case RMobilePhone::EPlmnBearerServ9: |
|
263 EntryServiceGroup = _L("EPlmnBearerServ9"); |
|
264 break; |
|
265 case RMobilePhone::EPlmnBearerServA: |
|
266 EntryServiceGroup = _L("EPlmnBearerServA"); |
|
267 break; |
|
268 case RMobilePhone::EPlmnBearerServB: |
|
269 EntryServiceGroup = _L("EPlmnBearerServB"); |
|
270 break; |
|
271 case RMobilePhone::EPlmnBearerServC: |
|
272 EntryServiceGroup = _L("EPlmnBearerServC"); |
|
273 break; |
|
274 case RMobilePhone::EPlmnBearerServD: |
|
275 EntryServiceGroup = _L("EPlmnBearerServD"); |
|
276 break; |
|
277 case RMobilePhone::EPlmnBearerServE: |
|
278 EntryServiceGroup = _L("EPlmnBearerServE"); |
|
279 break; |
|
280 case RMobilePhone::EPlmnBearerServF: |
|
281 EntryServiceGroup = _L("EPlmnBearerServF"); |
|
282 break; |
|
283 case RMobilePhone::EAltTele: |
|
284 EntryServiceGroup = _L("EAltTele"); |
|
285 break; |
|
286 case RMobilePhone::EVoiceGroupCall: |
|
287 EntryServiceGroup = _L("EVoiceGroupCall"); |
|
288 break; |
|
289 case RMobilePhone::EVoiceBroadcast: |
|
290 EntryServiceGroup = _L("EVoiceBroadcast"); |
|
291 break; |
|
292 case RMobilePhone::EAllGprsBearer: |
|
293 EntryServiceGroup = _L("EAllGprsBearer"); |
|
294 break; |
|
295 default: |
|
296 break; |
|
297 } |
|
298 |
|
299 switch (aCfEntry.iStatus) |
|
300 { |
|
301 case RMobilePhone::ECallBarringStatusActive: |
|
302 EntryStatus = _L("ECallBarringStatusActive"); |
|
303 break; |
|
304 case RMobilePhone::ECallBarringStatusNotActive: |
|
305 EntryStatus = _L("ECallBarringStatusNotActive"); |
|
306 break; |
|
307 case RMobilePhone::ECallBarringStatusNotProvisioned: |
|
308 EntryStatus = _L("ECallBarringStatusNotProvisioned"); |
|
309 break; |
|
310 case RMobilePhone::ECallBarringStatusNotAvailable: |
|
311 EntryStatus = _L("ECallBarringStatusNotAvailable"); |
|
312 break; |
|
313 case RMobilePhone::ECallBarringStatusUnknown: |
|
314 EntryStatus = _L("ECallBarringStatusUnknown"); |
|
315 break; |
|
316 default: |
|
317 break; |
|
318 } |
|
319 iTest->INFO_PRINTF3(_L("Entry %d: condition = >%S<"),aEntryNumber,&EntryCondition); |
|
320 iTest->INFO_PRINTF3(_L("Entry %d: service group = >%S<"),aEntryNumber,&EntryServiceGroup); |
|
321 iTest->INFO_PRINTF3(_L("Entry %d: status = >%S<"),aEntryNumber,&EntryStatus); |
|
322 |
|
323 } |
|
324 |
|
325 void CTestGetCBList::PrintCondition(RMobilePhone::TMobilePhoneCBCondition aCondition) |
|
326 { |
|
327 TBuf<200> EntryCondition; |
|
328 |
|
329 switch (aCondition) |
|
330 { |
|
331 case RMobilePhone::EBarUnspecified: |
|
332 EntryCondition = _L("EBarUnspecified"); |
|
333 break; |
|
334 case RMobilePhone::EBarAllIncoming: |
|
335 EntryCondition = _L("EBarAllIncoming"); |
|
336 break; |
|
337 case RMobilePhone::EBarIncomingRoaming: |
|
338 EntryCondition = _L("EBarIncomingRoaming"); |
|
339 break; |
|
340 case RMobilePhone::EBarAllOutgoing: |
|
341 EntryCondition = _L("EBarAllOutgoing"); |
|
342 break; |
|
343 case RMobilePhone::EBarOutgoingInternational: |
|
344 EntryCondition = _L("EBarOutgoingInternational"); |
|
345 break; |
|
346 case RMobilePhone::EBarOutgoingInternationalExHC: |
|
347 EntryCondition = _L("EBarOutgoingInternationalExHC"); |
|
348 break; |
|
349 case RMobilePhone::EBarAllCases: |
|
350 EntryCondition = _L("EBarAllCases"); |
|
351 break; |
|
352 case RMobilePhone::EBarAllOutgoingServices: |
|
353 EntryCondition = _L("EBarAllOutgoingServices"); |
|
354 break; |
|
355 case RMobilePhone::EBarAllIncomingServices: |
|
356 EntryCondition = _L("EBarAllIncomingServices"); |
|
357 break; |
|
358 default: |
|
359 break; |
|
360 } |
|
361 iTest->INFO_PRINTF2(_L("Retrive for condition = >%S<"),&EntryCondition); |
|
362 |
|
363 } |
|
364 |
|
365 TInt CTestGetCBList::CheckResultsL() |
|
366 { |
|
367 CMobilePhoneCBList* cbList=NULL; |
|
368 TRAPD(ret,cbList=iRetrieveCB->RetrieveListL()); |
|
369 if(ret!=KErrNone) |
|
370 { |
|
371 iTest->INFO_PRINTF2( _L("CMobilePhoneCBList::RetrieveListL returned with %d"),ret); |
|
372 // see if we know of such errors |
|
373 // if so then they are expected by the test cases |
|
374 if ( (ret==KErrNotFound) |
|
375 || (ret==KErrAccessDenied) |
|
376 || (ret==KErrArgument)) |
|
377 { |
|
378 return KErrNone; |
|
379 } |
|
380 else |
|
381 { |
|
382 return ret; |
|
383 } |
|
384 } |
|
385 |
|
386 TInt cnt=cbList->Enumerate(); |
|
387 TInt expctcnt(0); |
|
388 if (iChecked) |
|
389 { |
|
390 expctcnt=iExpectedcbList->Enumerate(); |
|
391 if (expctcnt != cnt) |
|
392 { |
|
393 iTest->INFO_PRINTF3(_L("The number of entries %d doesnt match with the number of the expected ones %d"),cnt, expctcnt); |
|
394 iTest->TEST(0); |
|
395 } |
|
396 } |
|
397 |
|
398 for(TInt i=0;i<cnt;i++) |
|
399 { |
|
400 RMobilePhone::TMobilePhoneCBInfoEntryV1 entry=cbList->GetEntryL(i); |
|
401 if (expctcnt == cnt) |
|
402 { |
|
403 if (iChecked) |
|
404 { |
|
405 for(TInt j=0;j<expctcnt;j++) |
|
406 { |
|
407 RMobilePhone::TMobilePhoneCBInfoEntryV1 ExpectedEntry=iExpectedcbList->GetEntryL(j); |
|
408 if (entry.iCondition == ExpectedEntry.iCondition) |
|
409 break; |
|
410 if (j == (expctcnt-1)) |
|
411 iTest->TEST(entry.iCondition == ExpectedEntry.iCondition); |
|
412 } |
|
413 for(TInt k=0;k<expctcnt;k++) |
|
414 { |
|
415 RMobilePhone::TMobilePhoneCBInfoEntryV1 ExpectedEntry=iExpectedcbList->GetEntryL(k); |
|
416 if (entry.iServiceGroup == ExpectedEntry.iServiceGroup) |
|
417 break; |
|
418 if (k == (expctcnt-1)) |
|
419 iTest->TEST(entry.iServiceGroup == ExpectedEntry.iServiceGroup); |
|
420 } |
|
421 for(TInt l=0;l<expctcnt;l++) |
|
422 { |
|
423 RMobilePhone::TMobilePhoneCBInfoEntryV1 ExpectedEntry=iExpectedcbList->GetEntryL(l); |
|
424 if (entry.iStatus == ExpectedEntry.iStatus) |
|
425 break; |
|
426 if (l == (expctcnt-1)) |
|
427 iTest->TEST(entry.iStatus == ExpectedEntry.iStatus); |
|
428 } |
|
429 } |
|
430 } |
|
431 PrintEntry(entry,i); |
|
432 iTest->INFO_PRINTF1(_L("Opened Call object")); |
|
433 } |
|
434 |
|
435 if (iChecked) |
|
436 { |
|
437 delete iExpectedcbList; |
|
438 iChecked = EFalse; |
|
439 } |
|
440 |
|
441 delete cbList; |
|
442 return KErrNone; |
|
443 } |
|
444 |
|
445 CTestGetCBList::~CTestGetCBList() |
|
446 { |
|
447 delete iRetrieveCB; |
|
448 } |
|
449 |
|
450 /**************************************************************/ |
|
451 // |
|
452 // Testing asynchronous retrieve of Call Forwarding list |
|
453 // |
|
454 /**************************************************************/ |
|
455 |
|
456 CTestGetCFList* CTestGetCFList::NewLC(RMobilePhone& aPhone, CTestCallForwarding* aTest) |
|
457 { |
|
458 CTestGetCFList* r=new(ELeave) CTestGetCFList(aPhone, aTest); |
|
459 CleanupStack::PushL(r); |
|
460 r->ConstructL(); |
|
461 CleanupStack::Pop(); |
|
462 return r; |
|
463 } |
|
464 |
|
465 CTestGetCFList::CTestGetCFList(RMobilePhone& aPhone, CTestCallForwarding* aTest) |
|
466 : CActive(EPriorityNormal), |
|
467 iPhone(aPhone), |
|
468 iTest(aTest) |
|
469 {} |
|
470 |
|
471 void CTestGetCFList::ConstructL() |
|
472 { |
|
473 CActiveScheduler::Add(this); |
|
474 iRetrieveCF=CRetrieveMobilePhoneCFList::NewL(iPhone); |
|
475 } |
|
476 |
|
477 void CTestGetCFList::Start(RMobilePhone::TMobilePhoneCFCondition aCondition) |
|
478 { |
|
479 iRetrieveCF->Start(iStatus, aCondition); |
|
480 SetActive(); |
|
481 } |
|
482 |
|
483 void CTestGetCFList::Start(RMobilePhone::TMobilePhoneCFCondition aCondition, |
|
484 RMobilePhone::TMobileService aServiceGroup) |
|
485 { |
|
486 iRetrieveCF->Start(iStatus, aCondition, aServiceGroup); |
|
487 SetActive(); |
|
488 } |
|
489 |
|
490 |
|
491 void CTestGetCFList::RunL() |
|
492 { |
|
493 TInt ret=iStatus.Int(); |
|
494 // we expect some error codes - KErrArgument |
|
495 if (!(ret == KErrArgument)) |
|
496 User::LeaveIfError(ret); |
|
497 |
|
498 ret=CheckResultsL(); |
|
499 User::LeaveIfError(ret); |
|
500 CActiveScheduler::Stop(); |
|
501 } |
|
502 |
|
503 void CTestGetCFList::DoCancel() |
|
504 { |
|
505 iRetrieveCF->Cancel(); |
|
506 } |
|
507 |
|
508 TInt CTestGetCFList::SetExpectedResultsL(RMobilePhone::TMobilePhoneCFInfoEntryV1 aExpectedEntry) |
|
509 { |
|
510 if (!iChecked) |
|
511 iExpectedCfList=CMobilePhoneCFList::NewL(); |
|
512 TRAPD(ret,iExpectedCfList->AddEntryL(aExpectedEntry);); |
|
513 if(ret!=KErrNone) |
|
514 return ret; |
|
515 iChecked = ETrue; |
|
516 return KErrNone; |
|
517 } |
|
518 |
|
519 void CTestGetCFList::PrintEntry(RMobilePhone::TMobilePhoneCFInfoEntryV1 aCfEntry, TInt aEntryNumber) |
|
520 { |
|
521 TBuf<200> EntryCondition; |
|
522 TBuf<200> EntryServiceGroup; |
|
523 TBuf<200> EntryStatus; |
|
524 |
|
525 switch (aCfEntry.iCondition) |
|
526 { |
|
527 case RMobilePhone::ECallForwardingUnspecified: |
|
528 EntryCondition = _L("ECallForwardingUnspecified"); |
|
529 break; |
|
530 case RMobilePhone::ECallForwardingUnconditional: |
|
531 EntryCondition = _L("ECallForwardingUnconditional"); |
|
532 break; |
|
533 case RMobilePhone::ECallForwardingBusy: |
|
534 EntryCondition = _L("ECallForwardingBusy"); |
|
535 break; |
|
536 case RMobilePhone::ECallForwardingNoReply: |
|
537 EntryCondition = _L("ECallForwardingNoReply"); |
|
538 break; |
|
539 case RMobilePhone::ECallForwardingNotReachable: |
|
540 EntryCondition = _L("ECallForwardingNotReachable"); |
|
541 break; |
|
542 case RMobilePhone::ECallForwardingAllCases: |
|
543 EntryCondition = _L("ECallForwardingAllCases"); |
|
544 break; |
|
545 case RMobilePhone::ECallForwardingAllConditionalCases: |
|
546 EntryCondition = _L("ECallForwardingAllConditionalCases"); |
|
547 break; |
|
548 default: |
|
549 break; |
|
550 } |
|
551 |
|
552 switch (aCfEntry.iServiceGroup) |
|
553 { |
|
554 case RMobilePhone::EServiceUnspecified: |
|
555 EntryServiceGroup = _L("EServiceUnspecified"); |
|
556 break; |
|
557 case RMobilePhone::EVoiceService: |
|
558 EntryServiceGroup = _L("EVoiceService"); |
|
559 break; |
|
560 case RMobilePhone::EAuxVoiceService: |
|
561 EntryServiceGroup = _L("EAuxVoiceService"); |
|
562 break; |
|
563 case RMobilePhone::ECircuitDataService: |
|
564 EntryServiceGroup = _L("ECircuitDataService"); |
|
565 break; |
|
566 case RMobilePhone::EPacketDataService: |
|
567 EntryServiceGroup = _L("EPacketDataService"); |
|
568 break; |
|
569 case RMobilePhone::EFaxService: |
|
570 EntryServiceGroup = _L("EFaxService"); |
|
571 break; |
|
572 case RMobilePhone::EShortMessageService: |
|
573 EntryServiceGroup = _L("EShortMessageService"); |
|
574 break; |
|
575 case RMobilePhone::EAllServices: |
|
576 EntryServiceGroup = _L("EAllServices"); |
|
577 break; |
|
578 case RMobilePhone::EAllTele: |
|
579 EntryServiceGroup = _L("EAllTele"); |
|
580 break; |
|
581 case RMobilePhone::ETelephony: |
|
582 EntryServiceGroup = _L("ETelephony"); |
|
583 break; |
|
584 case RMobilePhone::EAllDataTele: |
|
585 EntryServiceGroup = _L("EAllDataTele"); |
|
586 break; |
|
587 case RMobilePhone::EAllDataExSms: |
|
588 EntryServiceGroup = _L("EBarUnspecified"); |
|
589 break; |
|
590 case RMobilePhone::EAllTeleExcSms: |
|
591 EntryServiceGroup = _L("EAllTeleExcSms"); |
|
592 break; |
|
593 case RMobilePhone::EAllPlmnTele: |
|
594 EntryServiceGroup = _L("EAllPlmnTele"); |
|
595 break; |
|
596 case RMobilePhone::EPlmnTele1: |
|
597 EntryServiceGroup = _L("EPlmnTele1"); |
|
598 break; |
|
599 case RMobilePhone::EPlmnTele2: |
|
600 EntryServiceGroup = _L("EPlmnTele2"); |
|
601 break; |
|
602 case RMobilePhone::EPlmnTele3: |
|
603 EntryServiceGroup = _L("EPlmnTele3"); |
|
604 break; |
|
605 case RMobilePhone::EPlmnTele4: |
|
606 EntryServiceGroup = _L("EPlmnTele4"); |
|
607 break; |
|
608 case RMobilePhone::EPlmnTele5: |
|
609 EntryServiceGroup = _L("EPlmnTele5"); |
|
610 break; |
|
611 case RMobilePhone::EPlmnTele6: |
|
612 EntryServiceGroup = _L("EPlmnTele6"); |
|
613 break; |
|
614 case RMobilePhone::EPlmnTele7: |
|
615 EntryServiceGroup = _L("EPlmnTele7"); |
|
616 break; |
|
617 case RMobilePhone::EPlmnTele8: |
|
618 EntryServiceGroup = _L("EPlmnTele8"); |
|
619 break; |
|
620 case RMobilePhone::EPlmnTele9: |
|
621 EntryServiceGroup = _L("EPlmnTele9"); |
|
622 break; |
|
623 case RMobilePhone::EPlmnTeleA: |
|
624 EntryServiceGroup = _L("EPlmnTeleA"); |
|
625 break; |
|
626 case RMobilePhone::EPlmnTeleB: |
|
627 EntryServiceGroup = _L("EPlmnTeleB"); |
|
628 break; |
|
629 case RMobilePhone::EPlmnTeleC: |
|
630 EntryServiceGroup = _L("EPlmnTeleC"); |
|
631 break; |
|
632 case RMobilePhone::EPlmnTeleD: |
|
633 EntryServiceGroup = _L("EPlmnTeleD"); |
|
634 break; |
|
635 case RMobilePhone::EPlmnTeleE: |
|
636 EntryServiceGroup = _L("EPlmnTeleE"); |
|
637 break; |
|
638 case RMobilePhone::EPlmnTeleF: |
|
639 EntryServiceGroup = _L("EPlmnTeleF"); |
|
640 break; |
|
641 case RMobilePhone::EAllBearer: |
|
642 EntryServiceGroup = _L("EAllBearer"); |
|
643 break; |
|
644 case RMobilePhone::EAllAsync: |
|
645 EntryServiceGroup = _L("EAllAsync"); |
|
646 break; |
|
647 case RMobilePhone::EAllSync: |
|
648 EntryServiceGroup = _L("EAllSync"); |
|
649 break; |
|
650 case RMobilePhone::ESyncData: |
|
651 EntryServiceGroup = _L("ESyncData"); |
|
652 break; |
|
653 case RMobilePhone::EAsyncData: |
|
654 EntryServiceGroup = _L("EAsyncData"); |
|
655 break; |
|
656 case RMobilePhone::EPacketData: |
|
657 EntryServiceGroup = _L("EPacketData"); |
|
658 break; |
|
659 case RMobilePhone::EPadAccess: |
|
660 EntryServiceGroup = _L("EPadAccess"); |
|
661 break; |
|
662 case RMobilePhone::EAllPlmnBearer: |
|
663 EntryServiceGroup = _L("EAllPlmnBearer"); |
|
664 break; |
|
665 case RMobilePhone::EPlmnBearerServ1: |
|
666 EntryServiceGroup = _L("EPlmnBearerServ1"); |
|
667 break; |
|
668 case RMobilePhone::EPlmnBearerServ2: |
|
669 EntryServiceGroup = _L("EPlmnBearerServ2"); |
|
670 break; |
|
671 case RMobilePhone::EPlmnBearerServ3: |
|
672 EntryServiceGroup = _L("EPlmnBearerServ3"); |
|
673 break; |
|
674 case RMobilePhone::EPlmnBearerServ4: |
|
675 EntryServiceGroup = _L("EPlmnBearerServ4"); |
|
676 break; |
|
677 case RMobilePhone::EPlmnBearerServ5: |
|
678 EntryServiceGroup = _L("EPlmnBearerServ5"); |
|
679 break; |
|
680 case RMobilePhone::EPlmnBearerServ6: |
|
681 EntryServiceGroup = _L("EPlmnBearerServ6"); |
|
682 break; |
|
683 case RMobilePhone::EPlmnBearerServ7: |
|
684 EntryServiceGroup = _L("EPlmnBearerServ7"); |
|
685 break; |
|
686 case RMobilePhone::EPlmnBearerServ8: |
|
687 EntryServiceGroup = _L("EPlmnBearerServ8"); |
|
688 break; |
|
689 case RMobilePhone::EPlmnBearerServ9: |
|
690 EntryServiceGroup = _L("EPlmnBearerServ9"); |
|
691 break; |
|
692 case RMobilePhone::EPlmnBearerServA: |
|
693 EntryServiceGroup = _L("EPlmnBearerServA"); |
|
694 break; |
|
695 case RMobilePhone::EPlmnBearerServB: |
|
696 EntryServiceGroup = _L("EPlmnBearerServB"); |
|
697 break; |
|
698 case RMobilePhone::EPlmnBearerServC: |
|
699 EntryServiceGroup = _L("EPlmnBearerServC"); |
|
700 break; |
|
701 case RMobilePhone::EPlmnBearerServD: |
|
702 EntryServiceGroup = _L("EPlmnBearerServD"); |
|
703 break; |
|
704 case RMobilePhone::EPlmnBearerServE: |
|
705 EntryServiceGroup = _L("EPlmnBearerServE"); |
|
706 break; |
|
707 case RMobilePhone::EPlmnBearerServF: |
|
708 EntryServiceGroup = _L("EPlmnBearerServF"); |
|
709 break; |
|
710 case RMobilePhone::EAltTele: |
|
711 EntryServiceGroup = _L("EAltTele"); |
|
712 break; |
|
713 case RMobilePhone::EVoiceGroupCall: |
|
714 EntryServiceGroup = _L("EVoiceGroupCall"); |
|
715 break; |
|
716 case RMobilePhone::EVoiceBroadcast: |
|
717 EntryServiceGroup = _L("EVoiceBroadcast"); |
|
718 break; |
|
719 case RMobilePhone::EAllGprsBearer: |
|
720 EntryServiceGroup = _L("EAllGprsBearer"); |
|
721 break; |
|
722 default: |
|
723 break; |
|
724 } |
|
725 |
|
726 switch (aCfEntry.iStatus) |
|
727 { |
|
728 case RMobilePhone::ECallForwardingStatusActive: |
|
729 EntryStatus = _L("ECallForwardingStatusActive"); |
|
730 break; |
|
731 case RMobilePhone::ECallForwardingStatusNotActive: |
|
732 EntryStatus = _L("ECallForwardingStatusNotActive"); |
|
733 break; |
|
734 case RMobilePhone::ECallForwardingStatusNotRegistered: |
|
735 EntryStatus = _L("ECallForwardingStatusNotRegistered"); |
|
736 break; |
|
737 case RMobilePhone::ECallForwardingStatusNotProvisioned: |
|
738 EntryStatus = _L("ECallForwardingStatusNotProvisioned"); |
|
739 break; |
|
740 case RMobilePhone::ECallForwardingStatusNotAvailable: |
|
741 EntryStatus = _L("ECallForwardingStatusNotAvailable"); |
|
742 break; |
|
743 case RMobilePhone::ECallForwardingStatusUnknown: |
|
744 EntryStatus = _L("ECallForwardingStatusUnknown"); |
|
745 break; |
|
746 case RMobilePhone::ECallForwardingStatusActivePIAllowed: |
|
747 EntryStatus = _L("ECallForwardingStatusActivePIAllowed"); |
|
748 break; |
|
749 case RMobilePhone::ECallForwardingStatusActivePINotAvailable: |
|
750 EntryStatus = _L("ECallForwardingStatusActivePINotAvailable"); |
|
751 break; |
|
752 case RMobilePhone::ECallForwardingStatusActivePIClir: |
|
753 EntryStatus = _L("ECallForwardingStatusActivePIClir"); |
|
754 break; |
|
755 case RMobilePhone::ECallForwardingStatusActivePIClirSIVerified: |
|
756 EntryStatus = _L("ECallForwardingStatusActivePIClirSIVerified"); |
|
757 break; |
|
758 case RMobilePhone::ECallForwardingStatusActivePIClirSINotScreened: |
|
759 EntryStatus = _L("ECallForwardingStatusActivePIClirSINotScreened"); |
|
760 break; |
|
761 case RMobilePhone::ECallForwardingStatusActivePIClirSINetwork: |
|
762 EntryStatus = _L("ECallForwardingStatusActivePIClirSINetwork"); |
|
763 break; |
|
764 case RMobilePhone::ECallForwardingStatusQuiescent: |
|
765 EntryStatus = _L("ECallForwardingStatusQuiescent"); |
|
766 break; |
|
767 default: |
|
768 break; |
|
769 } |
|
770 iTest->INFO_PRINTF3(_L("Entry %d: condition = >%S<"),aEntryNumber,&EntryCondition); |
|
771 iTest->INFO_PRINTF3(_L("Entry %d: service group = >%S<"),aEntryNumber,&EntryServiceGroup); |
|
772 iTest->INFO_PRINTF3(_L("Entry %d: status = >%S<"),aEntryNumber,&EntryStatus); |
|
773 iTest->INFO_PRINTF3(_L("Entry %d: Mobile address = >%S<"),aEntryNumber,&aCfEntry.iNumber.iTelNumber ); |
|
774 iTest->INFO_PRINTF3(_L("Entry %d: Timeout = >%d<"),aEntryNumber,aCfEntry.iTimeout); |
|
775 } |
|
776 |
|
777 void CTestGetCFList::PrintCondition(RMobilePhone::TMobilePhoneCFCondition aCondition) |
|
778 { |
|
779 TBuf<200> EntryCondition; |
|
780 |
|
781 switch (aCondition) |
|
782 { |
|
783 case RMobilePhone::ECallForwardingUnspecified: |
|
784 EntryCondition = _L("ECallForwardingUnspecified"); |
|
785 break; |
|
786 case RMobilePhone::ECallForwardingUnconditional: |
|
787 EntryCondition = _L("ECallForwardingUnconditional"); |
|
788 break; |
|
789 case RMobilePhone::ECallForwardingBusy: |
|
790 EntryCondition = _L("ECallForwardingBusy"); |
|
791 break; |
|
792 case RMobilePhone::ECallForwardingNoReply: |
|
793 EntryCondition = _L("ECallForwardingNoReply"); |
|
794 break; |
|
795 case RMobilePhone::ECallForwardingNotReachable: |
|
796 EntryCondition = _L("ECallForwardingNotReachable"); |
|
797 break; |
|
798 case RMobilePhone::ECallForwardingAllCases: |
|
799 EntryCondition = _L("ECallForwardingAllCases"); |
|
800 break; |
|
801 case RMobilePhone::ECallForwardingAllConditionalCases: |
|
802 EntryCondition = _L("ECallForwardingAllConditionalCases"); |
|
803 break; |
|
804 default: |
|
805 break; |
|
806 } |
|
807 iTest->INFO_PRINTF2(_L("Retrieve for condition = >%S<"),&EntryCondition); |
|
808 |
|
809 } |
|
810 |
|
811 |
|
812 TInt CTestGetCFList::CheckResultsL() |
|
813 { |
|
814 CMobilePhoneCFList* cfList=NULL; |
|
815 TRAPD(ret,cfList=iRetrieveCF->RetrieveListL()); |
|
816 |
|
817 if(ret!=KErrNone) |
|
818 { |
|
819 iTest->INFO_PRINTF2( _L("CMobilePhoneCBList::RetrieveListL returned with %d"),ret); |
|
820 // see if we know of such errors |
|
821 // if so then they are expected by the test cases |
|
822 if ((ret==KErrNotFound) |
|
823 || (ret==KErrAccessDenied) |
|
824 || (ret==KErrArgument)) |
|
825 { |
|
826 return KErrNone; |
|
827 } |
|
828 else |
|
829 { |
|
830 return ret; |
|
831 } |
|
832 } |
|
833 |
|
834 TInt cnt=cfList->Enumerate(); |
|
835 TInt expctcnt(0); |
|
836 if (iChecked) |
|
837 { |
|
838 expctcnt=iExpectedCfList->Enumerate(); |
|
839 if (expctcnt != cnt) |
|
840 { |
|
841 iTest->INFO_PRINTF1(_L("The number of entries doesnt match with the number of the expected ones")); |
|
842 iTest->TEST(0); |
|
843 } |
|
844 } |
|
845 for(TInt i=0;i<cnt;i++) |
|
846 { |
|
847 RMobilePhone::TMobilePhoneCFInfoEntryV1 entry=cfList->GetEntryL(i); |
|
848 if (expctcnt == cnt) |
|
849 { |
|
850 if (iChecked) |
|
851 { |
|
852 for(TInt j=0;j<expctcnt;j++) |
|
853 { |
|
854 RMobilePhone::TMobilePhoneCFInfoEntryV1 ExpectedEntry=iExpectedCfList->GetEntryL(j); |
|
855 if (entry.iCondition == ExpectedEntry.iCondition) |
|
856 break; |
|
857 if (j == (expctcnt-1)) |
|
858 iTest->TEST(entry.iCondition == ExpectedEntry.iCondition); |
|
859 } |
|
860 for(TInt k=0;k<expctcnt;k++) |
|
861 { |
|
862 RMobilePhone::TMobilePhoneCFInfoEntryV1 ExpectedEntry=iExpectedCfList->GetEntryL(k); |
|
863 if (entry.iServiceGroup == ExpectedEntry.iServiceGroup) |
|
864 break; |
|
865 if (k == (expctcnt-1)) |
|
866 iTest->TEST(entry.iServiceGroup == ExpectedEntry.iServiceGroup); |
|
867 } |
|
868 for(TInt l=0;l<expctcnt;l++) |
|
869 { |
|
870 RMobilePhone::TMobilePhoneCFInfoEntryV1 ExpectedEntry=iExpectedCfList->GetEntryL(l); |
|
871 if (entry.iStatus == ExpectedEntry.iStatus) |
|
872 break; |
|
873 if (l == (expctcnt-1)) |
|
874 iTest->TEST(entry.iStatus == ExpectedEntry.iStatus); |
|
875 } |
|
876 } |
|
877 } |
|
878 PrintEntry(entry,i); |
|
879 iTest->INFO_PRINTF1(_L("Opened Call object")); |
|
880 |
|
881 } |
|
882 if (iChecked) |
|
883 { |
|
884 delete iExpectedCfList; |
|
885 iChecked = EFalse; |
|
886 } |
|
887 delete cfList; |
|
888 return KErrNone; |
|
889 } |
|
890 |
|
891 CTestGetCFList::~CTestGetCFList() |
|
892 { |
|
893 delete iRetrieveCF; |
|
894 } |
|
895 |
|
896 |
|
897 /**************************************************************/ |
|
898 // |
|
899 // Testing asynchronous retrieve of Call Waiting list |
|
900 // |
|
901 /**************************************************************/ |
|
902 |
|
903 CTestGetCWList* CTestGetCWList::NewLC(RMobilePhone& aPhone, CTestCallWaiting* aTest) |
|
904 { |
|
905 CTestGetCWList* r=new(ELeave) CTestGetCWList(aPhone, aTest); |
|
906 CleanupStack::PushL(r); |
|
907 r->ConstructL(); |
|
908 CleanupStack::Pop(); |
|
909 return r; |
|
910 } |
|
911 |
|
912 CTestGetCWList::CTestGetCWList(RMobilePhone& aPhone, CTestCallWaiting* aTest) |
|
913 : CActive(EPriorityNormal), |
|
914 iPhone(aPhone), |
|
915 iTest(aTest) |
|
916 {} |
|
917 |
|
918 void CTestGetCWList::ConstructL() |
|
919 { |
|
920 CActiveScheduler::Add(this); |
|
921 iRetrieveCW=CRetrieveMobilePhoneCWList::NewL(iPhone); |
|
922 |
|
923 } |
|
924 |
|
925 void CTestGetCWList::Start() |
|
926 { |
|
927 iRetrieveCW->Start(iStatus); |
|
928 SetActive(); |
|
929 } |
|
930 |
|
931 void CTestGetCWList::RunL() |
|
932 { |
|
933 TInt ret=iStatus.Int(); |
|
934 |
|
935 User::LeaveIfError(ret); |
|
936 ret=CheckResultsL(); |
|
937 User::LeaveIfError(ret); |
|
938 CActiveScheduler::Stop(); |
|
939 } |
|
940 |
|
941 void CTestGetCWList::DoCancel() |
|
942 { |
|
943 iRetrieveCW->Cancel(); |
|
944 } |
|
945 |
|
946 TInt CTestGetCWList::SetExpectedResultsL(RMobilePhone::TMobilePhoneCWInfoEntryV1 aExpectedEntry) |
|
947 { |
|
948 if (!iChecked) |
|
949 iExpectedcwList=CMobilePhoneCWList::NewL(); |
|
950 TRAPD(ret,iExpectedcwList->AddEntryL(aExpectedEntry);); |
|
951 if(ret!=KErrNone) |
|
952 return ret; |
|
953 iChecked = ETrue; |
|
954 return KErrNone; |
|
955 } |
|
956 |
|
957 void CTestGetCWList::PrintEntry(RMobilePhone::TMobilePhoneCWInfoEntryV1 aCwEntry, TInt aEntryNumber) |
|
958 { |
|
959 TBuf<200> EntryServiceGroup; |
|
960 TBuf<200> EntryStatus; |
|
961 |
|
962 switch (aCwEntry.iServiceGroup) |
|
963 { |
|
964 case RMobilePhone::EServiceUnspecified: |
|
965 EntryServiceGroup = _L("EServiceUnspecified"); |
|
966 break; |
|
967 case RMobilePhone::EVoiceService: |
|
968 EntryServiceGroup = _L("EVoiceService"); |
|
969 break; |
|
970 case RMobilePhone::EAuxVoiceService: |
|
971 EntryServiceGroup = _L("EAuxVoiceService"); |
|
972 break; |
|
973 case RMobilePhone::ECircuitDataService: |
|
974 EntryServiceGroup = _L("ECircuitDataService"); |
|
975 break; |
|
976 case RMobilePhone::EPacketDataService: |
|
977 EntryServiceGroup = _L("EPacketDataService"); |
|
978 break; |
|
979 case RMobilePhone::EFaxService: |
|
980 EntryServiceGroup = _L("EFaxService"); |
|
981 break; |
|
982 case RMobilePhone::EShortMessageService: |
|
983 EntryServiceGroup = _L("EShortMessageService"); |
|
984 break; |
|
985 case RMobilePhone::EAllServices: |
|
986 EntryServiceGroup = _L("EAllServices"); |
|
987 break; |
|
988 case RMobilePhone::EAllTele: |
|
989 EntryServiceGroup = _L("EAllTele"); |
|
990 break; |
|
991 case RMobilePhone::ETelephony: |
|
992 EntryServiceGroup = _L("ETelephony"); |
|
993 break; |
|
994 case RMobilePhone::EAllDataTele: |
|
995 EntryServiceGroup = _L("EAllDataTele"); |
|
996 break; |
|
997 case RMobilePhone::EAllDataExSms: |
|
998 EntryServiceGroup = _L("EBarUnspecified"); |
|
999 break; |
|
1000 case RMobilePhone::EAllTeleExcSms: |
|
1001 EntryServiceGroup = _L("EAllTeleExcSms"); |
|
1002 break; |
|
1003 case RMobilePhone::EAllPlmnTele: |
|
1004 EntryServiceGroup = _L("EAllPlmnTele"); |
|
1005 break; |
|
1006 case RMobilePhone::EPlmnTele1: |
|
1007 EntryServiceGroup = _L("EPlmnTele1"); |
|
1008 break; |
|
1009 case RMobilePhone::EPlmnTele2: |
|
1010 EntryServiceGroup = _L("EPlmnTele2"); |
|
1011 break; |
|
1012 case RMobilePhone::EPlmnTele3: |
|
1013 EntryServiceGroup = _L("EPlmnTele3"); |
|
1014 break; |
|
1015 case RMobilePhone::EPlmnTele4: |
|
1016 EntryServiceGroup = _L("EPlmnTele4"); |
|
1017 break; |
|
1018 case RMobilePhone::EPlmnTele5: |
|
1019 EntryServiceGroup = _L("EPlmnTele5"); |
|
1020 break; |
|
1021 case RMobilePhone::EPlmnTele6: |
|
1022 EntryServiceGroup = _L("EPlmnTele6"); |
|
1023 break; |
|
1024 case RMobilePhone::EPlmnTele7: |
|
1025 EntryServiceGroup = _L("EPlmnTele7"); |
|
1026 break; |
|
1027 case RMobilePhone::EPlmnTele8: |
|
1028 EntryServiceGroup = _L("EPlmnTele8"); |
|
1029 break; |
|
1030 case RMobilePhone::EPlmnTele9: |
|
1031 EntryServiceGroup = _L("EPlmnTele9"); |
|
1032 break; |
|
1033 case RMobilePhone::EPlmnTeleA: |
|
1034 EntryServiceGroup = _L("EPlmnTeleA"); |
|
1035 break; |
|
1036 case RMobilePhone::EPlmnTeleB: |
|
1037 EntryServiceGroup = _L("EPlmnTeleB"); |
|
1038 break; |
|
1039 case RMobilePhone::EPlmnTeleC: |
|
1040 EntryServiceGroup = _L("EPlmnTeleC"); |
|
1041 break; |
|
1042 case RMobilePhone::EPlmnTeleD: |
|
1043 EntryServiceGroup = _L("EPlmnTeleD"); |
|
1044 break; |
|
1045 case RMobilePhone::EPlmnTeleE: |
|
1046 EntryServiceGroup = _L("EPlmnTeleE"); |
|
1047 break; |
|
1048 case RMobilePhone::EPlmnTeleF: |
|
1049 EntryServiceGroup = _L("EPlmnTeleF"); |
|
1050 break; |
|
1051 case RMobilePhone::EAllBearer: |
|
1052 EntryServiceGroup = _L("EAllBearer"); |
|
1053 break; |
|
1054 case RMobilePhone::EAllAsync: |
|
1055 EntryServiceGroup = _L("EAllAsync"); |
|
1056 break; |
|
1057 case RMobilePhone::EAllSync: |
|
1058 EntryServiceGroup = _L("EAllSync"); |
|
1059 break; |
|
1060 case RMobilePhone::ESyncData: |
|
1061 EntryServiceGroup = _L("ESyncData"); |
|
1062 break; |
|
1063 case RMobilePhone::EAsyncData: |
|
1064 EntryServiceGroup = _L("EAsyncData"); |
|
1065 break; |
|
1066 case RMobilePhone::EPacketData: |
|
1067 EntryServiceGroup = _L("EPacketData"); |
|
1068 break; |
|
1069 case RMobilePhone::EPadAccess: |
|
1070 EntryServiceGroup = _L("EPadAccess"); |
|
1071 break; |
|
1072 case RMobilePhone::EAllPlmnBearer: |
|
1073 EntryServiceGroup = _L("EAllPlmnBearer"); |
|
1074 break; |
|
1075 case RMobilePhone::EPlmnBearerServ1: |
|
1076 EntryServiceGroup = _L("EPlmnBearerServ1"); |
|
1077 break; |
|
1078 case RMobilePhone::EPlmnBearerServ2: |
|
1079 EntryServiceGroup = _L("EPlmnBearerServ2"); |
|
1080 break; |
|
1081 case RMobilePhone::EPlmnBearerServ3: |
|
1082 EntryServiceGroup = _L("EPlmnBearerServ3"); |
|
1083 break; |
|
1084 case RMobilePhone::EPlmnBearerServ4: |
|
1085 EntryServiceGroup = _L("EPlmnBearerServ4"); |
|
1086 break; |
|
1087 case RMobilePhone::EPlmnBearerServ5: |
|
1088 EntryServiceGroup = _L("EPlmnBearerServ5"); |
|
1089 break; |
|
1090 case RMobilePhone::EPlmnBearerServ6: |
|
1091 EntryServiceGroup = _L("EPlmnBearerServ6"); |
|
1092 break; |
|
1093 case RMobilePhone::EPlmnBearerServ7: |
|
1094 EntryServiceGroup = _L("EPlmnBearerServ7"); |
|
1095 break; |
|
1096 case RMobilePhone::EPlmnBearerServ8: |
|
1097 EntryServiceGroup = _L("EPlmnBearerServ8"); |
|
1098 break; |
|
1099 case RMobilePhone::EPlmnBearerServ9: |
|
1100 EntryServiceGroup = _L("EPlmnBearerServ9"); |
|
1101 break; |
|
1102 case RMobilePhone::EPlmnBearerServA: |
|
1103 EntryServiceGroup = _L("EPlmnBearerServA"); |
|
1104 break; |
|
1105 case RMobilePhone::EPlmnBearerServB: |
|
1106 EntryServiceGroup = _L("EPlmnBearerServB"); |
|
1107 break; |
|
1108 case RMobilePhone::EPlmnBearerServC: |
|
1109 EntryServiceGroup = _L("EPlmnBearerServC"); |
|
1110 break; |
|
1111 case RMobilePhone::EPlmnBearerServD: |
|
1112 EntryServiceGroup = _L("EPlmnBearerServD"); |
|
1113 break; |
|
1114 case RMobilePhone::EPlmnBearerServE: |
|
1115 EntryServiceGroup = _L("EPlmnBearerServE"); |
|
1116 break; |
|
1117 case RMobilePhone::EPlmnBearerServF: |
|
1118 EntryServiceGroup = _L("EPlmnBearerServF"); |
|
1119 break; |
|
1120 case RMobilePhone::EAltTele: |
|
1121 EntryServiceGroup = _L("EAltTele"); |
|
1122 break; |
|
1123 case RMobilePhone::EVoiceGroupCall: |
|
1124 EntryServiceGroup = _L("EVoiceGroupCall"); |
|
1125 break; |
|
1126 case RMobilePhone::EVoiceBroadcast: |
|
1127 EntryServiceGroup = _L("EVoiceBroadcast"); |
|
1128 break; |
|
1129 case RMobilePhone::EAllGprsBearer: |
|
1130 EntryServiceGroup = _L("EAllGprsBearer"); |
|
1131 break; |
|
1132 default: |
|
1133 break; |
|
1134 } |
|
1135 |
|
1136 switch (aCwEntry.iStatus) |
|
1137 { |
|
1138 case RMobilePhone::ECallWaitingStatusActive: |
|
1139 EntryStatus = _L("ECallWaitingStatusActive"); |
|
1140 break; |
|
1141 case RMobilePhone::ECallWaitingStatusNotActive: |
|
1142 EntryStatus = _L("ECallWaitingStatusNotActive"); |
|
1143 break; |
|
1144 case RMobilePhone::ECallWaitingStatusNotProvisioned: |
|
1145 EntryStatus = _L("ECallWaitingStatusNotProvisioned"); |
|
1146 break; |
|
1147 case RMobilePhone::ECallWaitingStatusNotAvailable: |
|
1148 EntryStatus = _L("ECallBarringStatusNotAvailable"); |
|
1149 break; |
|
1150 case RMobilePhone::ECallWaitingStatusUnknown: |
|
1151 EntryStatus = _L("ECallWaitingStatusUnknown"); |
|
1152 break; |
|
1153 default: |
|
1154 break; |
|
1155 } |
|
1156 iTest->INFO_PRINTF3(_L("Entry %d: service group = >%S<"),aEntryNumber,&EntryServiceGroup); |
|
1157 iTest->INFO_PRINTF3(_L("Entry %d: status = >%S<"),aEntryNumber,&EntryStatus); |
|
1158 |
|
1159 } |
|
1160 |
|
1161 |
|
1162 TInt CTestGetCWList::CheckResultsL() |
|
1163 { |
|
1164 CMobilePhoneCWList* cwList=NULL; |
|
1165 TRAPD(ret,cwList=iRetrieveCW->RetrieveListL()); |
|
1166 if(ret!=KErrNone) |
|
1167 { |
|
1168 iTest->INFO_PRINTF2( _L("CMobilePhoneCWList::RetrieveListL left with %d"),ret); |
|
1169 if ( ret == KErrNotFound ) |
|
1170 return KErrNone; |
|
1171 else |
|
1172 return ret; |
|
1173 } |
|
1174 |
|
1175 TInt cnt=cwList->Enumerate(); |
|
1176 TInt expctcnt(0); |
|
1177 if (iChecked) |
|
1178 { |
|
1179 expctcnt=iExpectedcwList->Enumerate(); |
|
1180 if (expctcnt != cnt) |
|
1181 { |
|
1182 iTest->INFO_PRINTF3(_L("The number of entries %d doesnt match with the number of the expected ones %d "),cnt, expctcnt); |
|
1183 iTest->TEST(0); |
|
1184 } |
|
1185 } |
|
1186 for(TInt i=0;i<cnt;i++) |
|
1187 { |
|
1188 RMobilePhone::TMobilePhoneCWInfoEntryV1 entry=cwList->GetEntryL(i); |
|
1189 if (expctcnt == cnt) |
|
1190 { |
|
1191 if (iChecked) |
|
1192 { |
|
1193 for(TInt k=0;k<expctcnt;k++) |
|
1194 { |
|
1195 RMobilePhone::TMobilePhoneCWInfoEntryV1 ExpectedEntry=iExpectedcwList->GetEntryL(k); |
|
1196 if (entry.iServiceGroup == ExpectedEntry.iServiceGroup) |
|
1197 break; |
|
1198 if (k == (expctcnt-1)) |
|
1199 iTest->TEST(entry.iServiceGroup == ExpectedEntry.iServiceGroup); |
|
1200 } |
|
1201 for(TInt l=0;l<expctcnt;l++) |
|
1202 { |
|
1203 RMobilePhone::TMobilePhoneCWInfoEntryV1 ExpectedEntry=iExpectedcwList->GetEntryL(l); |
|
1204 if (entry.iStatus == ExpectedEntry.iStatus) |
|
1205 break; |
|
1206 if (l == (expctcnt-1)) |
|
1207 iTest->TEST(entry.iStatus == ExpectedEntry.iStatus); |
|
1208 } |
|
1209 } |
|
1210 } |
|
1211 PrintEntry(entry,i); |
|
1212 } |
|
1213 |
|
1214 if (iChecked) |
|
1215 { |
|
1216 delete iExpectedcwList; |
|
1217 iChecked = EFalse; |
|
1218 } |
|
1219 |
|
1220 delete cwList; |
|
1221 return KErrNone; |
|
1222 } |
|
1223 |
|
1224 CTestGetCWList::~CTestGetCWList() |
|
1225 { |
|
1226 delete iRetrieveCW; |
|
1227 } |
|
1228 |
|
1229 |
|
1230 |
|
1231 //------------------------------------------------------------------ |
|
1232 // ** TEST STEPS *** |
|
1233 //------------------------------------------------------------------ |
|
1234 |
|
1235 CTestCallBarring::CTestCallBarring() |
|
1236 { |
|
1237 SetTestStepName(_L("TestCallBarring")); |
|
1238 } |
|
1239 |
|
1240 enum TVerdict CTestCallBarring::doTestStepL() |
|
1241 /** |
|
1242 * Local function that creates a CTestData object. |
|
1243 * Connects to the ETel Server, loads the phone module (SIM TSY), calls the BeginTest() |
|
1244 * function (which runs the tests) and then disconnects from the ETel Server at |
|
1245 * the end of the tests. |
|
1246 */ |
|
1247 { |
|
1248 CActiveScheduler* actSched=new(ELeave) CActiveScheduler(); |
|
1249 CleanupStack::PushL(actSched); |
|
1250 CActiveScheduler::Install(actSched); |
|
1251 |
|
1252 SetTestNumberL(0); |
|
1253 |
|
1254 INFO_PRINTF1(_L("CTestCallBarring")); |
|
1255 TRequestStatus reqStat=KErrNone; |
|
1256 TRequestStatus reqStat2=KErrNone; |
|
1257 _LIT8(pswrd1, "1111"); |
|
1258 _LIT8(pswrd2, "2222"); |
|
1259 RMobilePhone::TMobilePhoneCBCondition condition=RMobilePhone::EBarAllOutgoing; |
|
1260 RMobilePhone::TMobilePhoneCBChangeV1 changeInfo; |
|
1261 |
|
1262 CTestGetCBList* retrieveCBList=NULL; |
|
1263 |
|
1264 retrieveCBList = CTestGetCBList::NewLC(iPhone, this); |
|
1265 |
|
1266 RMobilePhone::TMobilePhoneCBInfoEntryV1 ExpectedEntry1; |
|
1267 |
|
1268 // position is important! |
|
1269 // Test case: K.17 - Cancel notification with no previous reposts |
|
1270 INFO_PRINTF1(_L("Test case: K.17 - Cancel notification with no previous reposts")); |
|
1271 //register notification |
|
1272 iPhone.NotifyCallBarringStatusChange(reqStat2,condition); |
|
1273 |
|
1274 // disable EMobilePhoneNotifyCallBarringStatusChange |
|
1275 iPhone.CancelAsyncRequest(EMobilePhoneNotifyCallBarringStatusChange); |
|
1276 |
|
1277 User::WaitForRequest(reqStat2); |
|
1278 TEST(reqStat2==KErrCancel); |
|
1279 // because it is assumed no previous CTestGetCBList |
|
1280 INFO_PRINTF2(_L("The notify change returned %d"), reqStat2.Int()); |
|
1281 |
|
1282 |
|
1283 // Test case: K.1 - Retrieve the status - preset |
|
1284 INFO_PRINTF1(_L("Test case: K.1 - Retrieve the status from config")); |
|
1285 ExpectedEntry1.iCondition=RMobilePhone::EBarAllOutgoing; |
|
1286 ExpectedEntry1.iServiceGroup=RMobilePhone::EVoiceService; |
|
1287 ExpectedEntry1.iStatus=RMobilePhone::ECallBarringStatusActive; |
|
1288 retrieveCBList->SetExpectedResultsL(ExpectedEntry1); |
|
1289 |
|
1290 condition = RMobilePhone::EBarUnspecified; |
|
1291 retrieveCBList->PrintCondition(condition); |
|
1292 retrieveCBList->Start(condition); |
|
1293 CActiveScheduler::Start(); |
|
1294 |
|
1295 // Test case: K.2 - Disable Call barring for Voice :EBarAllOutgoingServices |
|
1296 INFO_PRINTF1(_L("Test case: K.2 - De-activate Call Barring for all outgoing voice services")); |
|
1297 condition = RMobilePhone::EBarAllOutgoingServices; |
|
1298 changeInfo.iServiceGroup=RMobilePhone::EVoiceService; |
|
1299 changeInfo.iAction=RMobilePhone::EServiceActionDeactivate; |
|
1300 changeInfo.iPassword.Copy(pswrd1); |
|
1301 iPhone.SetCallBarringStatus(reqStat,condition, changeInfo); |
|
1302 User::WaitForRequest(reqStat); |
|
1303 TEST(reqStat==KErrNone); |
|
1304 |
|
1305 // should not have anything here - empty list |
|
1306 // as we are asking for a specific condition -EBarAllOutgoing |
|
1307 condition = RMobilePhone::EBarAllOutgoing; |
|
1308 retrieveCBList->PrintCondition(condition); |
|
1309 retrieveCBList->Start(condition); |
|
1310 CActiveScheduler::Start(); |
|
1311 INFO_PRINTF1(_L("")); |
|
1312 |
|
1313 // Test case: K.3 - Erase all services and request info for all services |
|
1314 INFO_PRINTF1(_L("Test case: K.3 - Erase all services and request info for all services")); |
|
1315 condition=RMobilePhone::EBarAllCases; |
|
1316 changeInfo.iServiceGroup=RMobilePhone::EAllServices; |
|
1317 changeInfo.iAction=RMobilePhone::EServiceActionErase; |
|
1318 changeInfo.iPassword.Copy(pswrd1); |
|
1319 iPhone.SetCallBarringStatus(reqStat,condition, changeInfo); |
|
1320 User::WaitForRequest(reqStat); |
|
1321 TEST(reqStat==KErrNone); |
|
1322 condition=RMobilePhone::EBarUnspecified; |
|
1323 ExpectedEntry1.iCondition=RMobilePhone::EBarAllCases; |
|
1324 ExpectedEntry1.iServiceGroup=RMobilePhone::EAllServices; |
|
1325 ExpectedEntry1.iStatus=RMobilePhone::ECallBarringStatusNotActive; |
|
1326 retrieveCBList->SetExpectedResultsL(ExpectedEntry1); |
|
1327 |
|
1328 retrieveCBList->PrintCondition(condition); |
|
1329 retrieveCBList->Start(condition); |
|
1330 CActiveScheduler::Start(); |
|
1331 |
|
1332 // Test case: K.4 - Enable Call barring for Voice :EBarAllOutgoing |
|
1333 INFO_PRINTF1(_L("Test case: K.4 - Activate Call Barring for all outgoing voice services")); |
|
1334 condition = RMobilePhone::EBarAllOutgoing; |
|
1335 changeInfo.iServiceGroup=RMobilePhone::EVoiceService; |
|
1336 changeInfo.iAction=RMobilePhone::EServiceActionActivate; |
|
1337 changeInfo.iPassword.Copy(pswrd1); |
|
1338 iPhone.SetCallBarringStatus(reqStat,condition,changeInfo); |
|
1339 User::WaitForRequest(reqStat); |
|
1340 TEST(reqStat==KErrNone); |
|
1341 |
|
1342 //Retrieve again |
|
1343 ExpectedEntry1.iCondition=RMobilePhone::EBarAllOutgoing; |
|
1344 ExpectedEntry1.iServiceGroup=RMobilePhone::EVoiceService; |
|
1345 ExpectedEntry1.iStatus=RMobilePhone::ECallBarringStatusActive; |
|
1346 retrieveCBList->SetExpectedResultsL(ExpectedEntry1); |
|
1347 |
|
1348 retrieveCBList->PrintCondition(condition); |
|
1349 retrieveCBList->Start(condition); |
|
1350 CActiveScheduler::Start(); |
|
1351 |
|
1352 // Test case: K.5 - Enable Call barring for Voice but :EBarOutgoingInternational |
|
1353 INFO_PRINTF1(_L("Test case: K.5 - Activate Call Barring (intl only) for outgoing Voice services")); |
|
1354 condition = RMobilePhone::EBarOutgoingInternational; |
|
1355 changeInfo.iServiceGroup=RMobilePhone::EVoiceService; |
|
1356 changeInfo.iAction=RMobilePhone::EServiceActionActivate; |
|
1357 changeInfo.iPassword.Copy(pswrd1); |
|
1358 iPhone.SetCallBarringStatus(reqStat,condition, changeInfo); |
|
1359 User::WaitForRequest(reqStat); |
|
1360 TEST(reqStat==KErrNone); |
|
1361 |
|
1362 //Retrieve again |
|
1363 ExpectedEntry1.iCondition=RMobilePhone::EBarOutgoingInternational; |
|
1364 ExpectedEntry1.iServiceGroup=RMobilePhone::EVoiceService; |
|
1365 ExpectedEntry1.iStatus=RMobilePhone::ECallBarringStatusActive; |
|
1366 retrieveCBList->SetExpectedResultsL(ExpectedEntry1); |
|
1367 |
|
1368 retrieveCBList->PrintCondition(condition); |
|
1369 retrieveCBList->Start(condition); |
|
1370 CActiveScheduler::Start(); |
|
1371 |
|
1372 // Test case: K.5 - Enable Call barring for Voice but :EBarOutgoingInternational again |
|
1373 INFO_PRINTF1(_L("Test case: K.5 - Activate Call Barring (intl only) for outgoing Voice services again")); |
|
1374 condition = RMobilePhone::EBarOutgoingInternational; |
|
1375 changeInfo.iServiceGroup=RMobilePhone::EVoiceService; |
|
1376 changeInfo.iAction=RMobilePhone::EServiceActionActivate; |
|
1377 changeInfo.iPassword.Copy(pswrd1); |
|
1378 iPhone.SetCallBarringStatus(reqStat,condition, changeInfo); |
|
1379 User::WaitForRequest(reqStat); |
|
1380 TEST(reqStat==KErrNone); |
|
1381 |
|
1382 //Retrieve again |
|
1383 ExpectedEntry1.iCondition=RMobilePhone::EBarOutgoingInternational; |
|
1384 ExpectedEntry1.iServiceGroup=RMobilePhone::EVoiceService; |
|
1385 ExpectedEntry1.iStatus=RMobilePhone::ECallBarringStatusActive; |
|
1386 retrieveCBList->SetExpectedResultsL(ExpectedEntry1); |
|
1387 |
|
1388 retrieveCBList->PrintCondition(condition); |
|
1389 retrieveCBList->Start(condition); |
|
1390 CActiveScheduler::Start(); |
|
1391 |
|
1392 // Test case: K.6 - Set Call Barring Status for all outgoing services |
|
1393 INFO_PRINTF1(_L("Activate Call Barring for all outgoing services")); |
|
1394 condition = RMobilePhone::EBarAllOutgoing; |
|
1395 changeInfo.iServiceGroup=RMobilePhone::EAllServices; |
|
1396 changeInfo.iAction=RMobilePhone::EServiceActionActivate; |
|
1397 changeInfo.iPassword.Copy(pswrd1); |
|
1398 iPhone.SetCallBarringStatus(reqStat,condition, changeInfo); |
|
1399 User::WaitForRequest(reqStat); |
|
1400 TEST(reqStat==KErrNone); |
|
1401 |
|
1402 //Retrieve again |
|
1403 ExpectedEntry1.iCondition=RMobilePhone::EBarAllOutgoing; |
|
1404 ExpectedEntry1.iServiceGroup=RMobilePhone::EAllServices; |
|
1405 ExpectedEntry1.iStatus=RMobilePhone::ECallBarringStatusActive; |
|
1406 retrieveCBList->SetExpectedResultsL(ExpectedEntry1); |
|
1407 |
|
1408 retrieveCBList->PrintCondition(condition); |
|
1409 retrieveCBList->Start(condition); |
|
1410 CActiveScheduler::Start(); |
|
1411 |
|
1412 // Test case: K.6 - Set Call Barring Status for all outgoing services again |
|
1413 INFO_PRINTF1(_L("Test case: K.6 - Activate Call Barring for all outgoing services again")); |
|
1414 condition = RMobilePhone::EBarAllOutgoing; |
|
1415 changeInfo.iServiceGroup=RMobilePhone::EAllServices; |
|
1416 changeInfo.iAction=RMobilePhone::EServiceActionActivate; |
|
1417 changeInfo.iPassword.Copy(pswrd1); |
|
1418 iPhone.SetCallBarringStatus(reqStat,condition, changeInfo); |
|
1419 User::WaitForRequest(reqStat); |
|
1420 TEST(reqStat==KErrNone); |
|
1421 |
|
1422 //Retrieve again |
|
1423 ExpectedEntry1.iCondition=RMobilePhone::EBarAllOutgoing; |
|
1424 ExpectedEntry1.iServiceGroup=RMobilePhone::EAllServices; |
|
1425 ExpectedEntry1.iStatus=RMobilePhone::ECallBarringStatusActive; |
|
1426 retrieveCBList->SetExpectedResultsL(ExpectedEntry1); |
|
1427 |
|
1428 retrieveCBList->PrintCondition(condition); |
|
1429 retrieveCBList->Start(condition); |
|
1430 CActiveScheduler::Start(); |
|
1431 |
|
1432 // Test case: K.7 - deactivate for voice service & notification with different condition |
|
1433 INFO_PRINTF1(_L("Test case: K.7 - Deactivate for outgoing voice service & notification with diferent condition")); |
|
1434 condition = RMobilePhone::EBarAllOutgoing; |
|
1435 iPhone.NotifyCallBarringStatusChange(reqStat2,condition); |
|
1436 User::After(2000000); |
|
1437 changeInfo.iServiceGroup=RMobilePhone::EVoiceService; |
|
1438 changeInfo.iAction=RMobilePhone::EServiceActionDeactivate; |
|
1439 changeInfo.iPassword.Copy(pswrd1); |
|
1440 condition=RMobilePhone::EBarAllOutgoingServices; |
|
1441 iPhone.SetCallBarringStatus(reqStat,condition, changeInfo); |
|
1442 User::WaitForRequest(reqStat); |
|
1443 TEST(reqStat==KErrNone); |
|
1444 User::After(2000000); |
|
1445 User::WaitForRequest(reqStat2); |
|
1446 TEST(reqStat2==KErrNone);//notification did not complete(wrong condition) |
|
1447 retrieveCBList->PrintCondition(condition); |
|
1448 TEST(condition==RMobilePhone::EBarAllOutgoingServices); |
|
1449 |
|
1450 //Retrieve again |
|
1451 ExpectedEntry1.iCondition=RMobilePhone::EBarAllOutgoing; |
|
1452 ExpectedEntry1.iServiceGroup=RMobilePhone::EFaxService; |
|
1453 ExpectedEntry1.iStatus=RMobilePhone::ECallBarringStatusActive; |
|
1454 retrieveCBList->SetExpectedResultsL(ExpectedEntry1); |
|
1455 ExpectedEntry1.iServiceGroup=RMobilePhone::ECircuitDataService; |
|
1456 retrieveCBList->SetExpectedResultsL(ExpectedEntry1); |
|
1457 ExpectedEntry1.iServiceGroup=RMobilePhone::EPacketDataService; |
|
1458 retrieveCBList->SetExpectedResultsL(ExpectedEntry1); |
|
1459 ExpectedEntry1.iServiceGroup=RMobilePhone::EAuxVoiceService; |
|
1460 retrieveCBList->SetExpectedResultsL(ExpectedEntry1); |
|
1461 ExpectedEntry1.iServiceGroup=RMobilePhone::EShortMessageService; |
|
1462 retrieveCBList->SetExpectedResultsL(ExpectedEntry1); |
|
1463 |
|
1464 condition=RMobilePhone::EBarAllOutgoing; |
|
1465 retrieveCBList->PrintCondition(condition); |
|
1466 retrieveCBList->Start(condition); |
|
1467 CActiveScheduler::Start(); |
|
1468 |
|
1469 // Test case: K.7 - deactivate for voice service & notification with different condition |
|
1470 INFO_PRINTF1(_L("Test case: K.7 - Deactivate for outgoing voice service & notification with diferent condition")); |
|
1471 condition = RMobilePhone::EBarAllOutgoing; |
|
1472 iPhone.NotifyCallBarringStatusChange(reqStat2,condition); |
|
1473 User::After(2000000); |
|
1474 changeInfo.iServiceGroup=RMobilePhone::EVoiceService; |
|
1475 changeInfo.iAction=RMobilePhone::EServiceActionDeactivate; |
|
1476 changeInfo.iPassword.Copy(pswrd1); |
|
1477 condition=RMobilePhone::EBarAllOutgoingServices; |
|
1478 iPhone.SetCallBarringStatus(reqStat,condition, changeInfo); |
|
1479 User::WaitForRequest(reqStat); |
|
1480 TEST(reqStat==KErrNone); |
|
1481 User::After(2000000); |
|
1482 User::WaitForRequest(reqStat2); |
|
1483 TEST(reqStat2==KErrNone);//notification did not complete(wrong condition) |
|
1484 retrieveCBList->PrintCondition(condition); |
|
1485 TEST(condition==RMobilePhone::EBarAllOutgoingServices); |
|
1486 |
|
1487 //Retrieve again |
|
1488 ExpectedEntry1.iCondition=RMobilePhone::EBarAllOutgoing; |
|
1489 ExpectedEntry1.iServiceGroup=RMobilePhone::EFaxService; |
|
1490 ExpectedEntry1.iStatus=RMobilePhone::ECallBarringStatusActive; |
|
1491 retrieveCBList->SetExpectedResultsL(ExpectedEntry1); |
|
1492 ExpectedEntry1.iServiceGroup=RMobilePhone::ECircuitDataService; |
|
1493 retrieveCBList->SetExpectedResultsL(ExpectedEntry1); |
|
1494 ExpectedEntry1.iServiceGroup=RMobilePhone::EPacketDataService; |
|
1495 retrieveCBList->SetExpectedResultsL(ExpectedEntry1); |
|
1496 ExpectedEntry1.iServiceGroup=RMobilePhone::EAuxVoiceService; |
|
1497 retrieveCBList->SetExpectedResultsL(ExpectedEntry1); |
|
1498 ExpectedEntry1.iServiceGroup=RMobilePhone::EShortMessageService; |
|
1499 retrieveCBList->SetExpectedResultsL(ExpectedEntry1); |
|
1500 |
|
1501 condition=RMobilePhone::EBarAllOutgoing; |
|
1502 retrieveCBList->PrintCondition(condition); |
|
1503 retrieveCBList->Start(condition); |
|
1504 CActiveScheduler::Start(); |
|
1505 |
|
1506 // Test case: K.8 - Activate EAuxVoiceService Service for outgoing international condition |
|
1507 INFO_PRINTF1(_L("Test case: K.8 - Activate EAuxVoiceService Service for outgoing international condition")); |
|
1508 changeInfo.iServiceGroup=RMobilePhone::EAuxVoiceService; |
|
1509 changeInfo.iAction=RMobilePhone::EServiceActionActivate; |
|
1510 changeInfo.iPassword.Copy(pswrd1); |
|
1511 condition=RMobilePhone::EBarOutgoingInternational; |
|
1512 iPhone.SetCallBarringStatus(reqStat,condition, changeInfo); |
|
1513 User::WaitForRequest(reqStat); |
|
1514 TEST(reqStat==KErrNone); |
|
1515 |
|
1516 condition=RMobilePhone::EBarUnspecified; |
|
1517 retrieveCBList->PrintCondition(condition); |
|
1518 retrieveCBList->Start(condition); |
|
1519 CActiveScheduler::Start(); |
|
1520 |
|
1521 //Retrieve again |
|
1522 ExpectedEntry1.iCondition=RMobilePhone::EBarAllOutgoing; |
|
1523 ExpectedEntry1.iServiceGroup=RMobilePhone::ECircuitDataService; |
|
1524 ExpectedEntry1.iStatus=RMobilePhone::ECallBarringStatusActive; |
|
1525 retrieveCBList->SetExpectedResultsL(ExpectedEntry1); |
|
1526 ExpectedEntry1.iServiceGroup=RMobilePhone::EPacketDataService; |
|
1527 retrieveCBList->SetExpectedResultsL(ExpectedEntry1); |
|
1528 ExpectedEntry1.iServiceGroup=RMobilePhone::EShortMessageService; |
|
1529 retrieveCBList->SetExpectedResultsL(ExpectedEntry1); |
|
1530 ExpectedEntry1.iServiceGroup=RMobilePhone::EFaxService; |
|
1531 retrieveCBList->SetExpectedResultsL(ExpectedEntry1); |
|
1532 |
|
1533 condition=RMobilePhone::EBarAllOutgoing; |
|
1534 retrieveCBList->PrintCondition(condition); |
|
1535 retrieveCBList->Start(condition); |
|
1536 CActiveScheduler::Start(); |
|
1537 |
|
1538 // Test case: K.9 - Activate for ECircuitDataService service, different conditions :EBarIncomingRoaming & notify |
|
1539 INFO_PRINTF1(_L("Test case: K.9 - Activate for ECircuitDataService service, different conditions :EBarIncomingRoaming & notify")); |
|
1540 changeInfo.iServiceGroup=RMobilePhone::ECircuitDataService; |
|
1541 changeInfo.iAction=RMobilePhone::EServiceActionActivate; |
|
1542 condition=RMobilePhone::EBarIncomingRoaming; |
|
1543 changeInfo.iPassword.Copy(pswrd1); |
|
1544 iPhone.SetCallBarringStatus(reqStat,condition, changeInfo); |
|
1545 User::WaitForRequest(reqStat); |
|
1546 TEST(reqStat==KErrNone); |
|
1547 |
|
1548 //Retrieve for this condition |
|
1549 ExpectedEntry1.iCondition=RMobilePhone::EBarIncomingRoaming; |
|
1550 ExpectedEntry1.iServiceGroup=RMobilePhone::ECircuitDataService; |
|
1551 ExpectedEntry1.iStatus=RMobilePhone::ECallBarringStatusActive; |
|
1552 retrieveCBList->SetExpectedResultsL(ExpectedEntry1); |
|
1553 |
|
1554 retrieveCBList->PrintCondition(condition); |
|
1555 retrieveCBList->Start(condition); |
|
1556 CActiveScheduler::Start(); |
|
1557 |
|
1558 // Test case: K.10 - Retrieve for all conditions |
|
1559 INFO_PRINTF1(_L("Test case: K.10 - Now retrieve for all conditions")); |
|
1560 condition=RMobilePhone::EBarUnspecified; |
|
1561 |
|
1562 ExpectedEntry1.iCondition=RMobilePhone::EBarAllOutgoing; |
|
1563 ExpectedEntry1.iServiceGroup=RMobilePhone::ECircuitDataService; |
|
1564 ExpectedEntry1.iStatus=RMobilePhone::ECallBarringStatusActive; |
|
1565 retrieveCBList->SetExpectedResultsL(ExpectedEntry1); |
|
1566 ExpectedEntry1.iServiceGroup=RMobilePhone::EFaxService; |
|
1567 retrieveCBList->SetExpectedResultsL(ExpectedEntry1); |
|
1568 ExpectedEntry1.iServiceGroup=RMobilePhone::EPacketDataService; |
|
1569 retrieveCBList->SetExpectedResultsL(ExpectedEntry1); |
|
1570 ExpectedEntry1.iServiceGroup=RMobilePhone::EShortMessageService; |
|
1571 retrieveCBList->SetExpectedResultsL(ExpectedEntry1); |
|
1572 ExpectedEntry1.iServiceGroup=RMobilePhone::ECircuitDataService; |
|
1573 ExpectedEntry1.iCondition=RMobilePhone::EBarIncomingRoaming; |
|
1574 retrieveCBList->SetExpectedResultsL(ExpectedEntry1); |
|
1575 ExpectedEntry1.iServiceGroup=RMobilePhone::EAuxVoiceService; |
|
1576 ExpectedEntry1.iCondition=RMobilePhone::EBarOutgoingInternational; |
|
1577 retrieveCBList->SetExpectedResultsL(ExpectedEntry1); |
|
1578 |
|
1579 retrieveCBList->PrintCondition(condition); |
|
1580 retrieveCBList->Start(condition); |
|
1581 CActiveScheduler::Start(); |
|
1582 |
|
1583 // Test case: K.11 - Deactivate EBarAllIncomingServices general condition and retrieve for all |
|
1584 INFO_PRINTF1(_L("Test case: K.11 - Deactivate EBarAllIncomingServices general condition and retrieve for all")); |
|
1585 changeInfo.iServiceGroup=RMobilePhone::EAllServices; |
|
1586 changeInfo.iAction=RMobilePhone::EServiceActionDeactivate; |
|
1587 changeInfo.iPassword.Copy(pswrd1); |
|
1588 condition=RMobilePhone::EBarAllIncomingServices; |
|
1589 iPhone.SetCallBarringStatus(reqStat,condition, changeInfo); |
|
1590 User::WaitForRequest(reqStat); |
|
1591 TEST(reqStat==KErrNone); |
|
1592 |
|
1593 condition=RMobilePhone::EBarUnspecified; |
|
1594 ExpectedEntry1.iCondition=RMobilePhone::EBarAllOutgoing; |
|
1595 ExpectedEntry1.iServiceGroup=RMobilePhone::ECircuitDataService; |
|
1596 ExpectedEntry1.iStatus=RMobilePhone::ECallBarringStatusActive; |
|
1597 retrieveCBList->SetExpectedResultsL(ExpectedEntry1); |
|
1598 ExpectedEntry1.iServiceGroup=RMobilePhone::EFaxService; |
|
1599 retrieveCBList->SetExpectedResultsL(ExpectedEntry1); |
|
1600 ExpectedEntry1.iServiceGroup=RMobilePhone::EPacketDataService; |
|
1601 retrieveCBList->SetExpectedResultsL(ExpectedEntry1); |
|
1602 ExpectedEntry1.iServiceGroup=RMobilePhone::EShortMessageService; |
|
1603 retrieveCBList->SetExpectedResultsL(ExpectedEntry1); |
|
1604 ExpectedEntry1.iServiceGroup=RMobilePhone::EAuxVoiceService; |
|
1605 ExpectedEntry1.iCondition=RMobilePhone::EBarOutgoingInternational; |
|
1606 retrieveCBList->SetExpectedResultsL(ExpectedEntry1); |
|
1607 |
|
1608 retrieveCBList->PrintCondition(condition); |
|
1609 retrieveCBList->Start(condition); |
|
1610 CActiveScheduler::Start(); |
|
1611 |
|
1612 // Test case: K.11 - Deactivate EBarAllIncomingServices general condition and retrieve for all |
|
1613 INFO_PRINTF1(_L("Test case: K.11 - Deactivate EBarAllIncomingServices general condition and retrieve all")); |
|
1614 changeInfo.iServiceGroup=RMobilePhone::EAllServices; |
|
1615 changeInfo.iAction=RMobilePhone::EServiceActionDeactivate; |
|
1616 changeInfo.iPassword.Copy(pswrd1); |
|
1617 condition=RMobilePhone::EBarAllIncomingServices; |
|
1618 iPhone.SetCallBarringStatus(reqStat,condition, changeInfo); |
|
1619 User::WaitForRequest(reqStat); |
|
1620 TEST(reqStat==KErrNone); |
|
1621 |
|
1622 condition=RMobilePhone::EBarUnspecified; |
|
1623 ExpectedEntry1.iCondition=RMobilePhone::EBarAllOutgoing; |
|
1624 ExpectedEntry1.iServiceGroup=RMobilePhone::ECircuitDataService; |
|
1625 ExpectedEntry1.iStatus=RMobilePhone::ECallBarringStatusActive; |
|
1626 retrieveCBList->SetExpectedResultsL(ExpectedEntry1); |
|
1627 ExpectedEntry1.iServiceGroup=RMobilePhone::EFaxService; |
|
1628 retrieveCBList->SetExpectedResultsL(ExpectedEntry1); |
|
1629 ExpectedEntry1.iServiceGroup=RMobilePhone::EPacketDataService; |
|
1630 retrieveCBList->SetExpectedResultsL(ExpectedEntry1); |
|
1631 ExpectedEntry1.iServiceGroup=RMobilePhone::EShortMessageService; |
|
1632 retrieveCBList->SetExpectedResultsL(ExpectedEntry1); |
|
1633 ExpectedEntry1.iServiceGroup=RMobilePhone::EAuxVoiceService; |
|
1634 ExpectedEntry1.iCondition=RMobilePhone::EBarOutgoingInternational; |
|
1635 retrieveCBList->SetExpectedResultsL(ExpectedEntry1); |
|
1636 |
|
1637 retrieveCBList->PrintCondition(condition); |
|
1638 retrieveCBList->Start(condition); |
|
1639 CActiveScheduler::Start(); |
|
1640 |
|
1641 // Test case: K.12 - Set Call Barring Status for all services with wrong password |
|
1642 INFO_PRINTF1(_L("Test case: K.12 - Set Call Barring Status for all services with wrong password")); |
|
1643 changeInfo.iServiceGroup=RMobilePhone::EAllServices; |
|
1644 changeInfo.iAction=RMobilePhone::EServiceActionActivate; |
|
1645 changeInfo.iPassword.Copy(pswrd2); |
|
1646 condition=RMobilePhone::EBarAllOutgoing; |
|
1647 iPhone.SetCallBarringStatus(reqStat,condition, changeInfo); |
|
1648 User::WaitForRequest(reqStat); |
|
1649 TEST(reqStat==KErrAccessDenied); |
|
1650 |
|
1651 // Test case: K.13 - Change Call Barrring Password |
|
1652 INFO_PRINTF1(_L("Test case: K.13 - Change Call Barrring Password")); |
|
1653 RMobilePhone::TMobilePhonePasswordChangeV1 passChange; |
|
1654 passChange.iOldPassword.Copy(pswrd1); |
|
1655 passChange.iNewPassword.Copy(pswrd2); |
|
1656 iPhone.SetCallBarringPassword(reqStat,passChange); |
|
1657 User::WaitForRequest(reqStat); |
|
1658 TEST(reqStat==KErrNone); |
|
1659 |
|
1660 // Test case: K.12 - Set Call Barring Status for all services with wrong (original) password |
|
1661 INFO_PRINTF1(_L("Test case: K.12 - Set Call Barring Status for all services with wrong (original) password")); |
|
1662 changeInfo.iServiceGroup=RMobilePhone::EAllServices; |
|
1663 changeInfo.iAction=RMobilePhone::EServiceActionActivate; |
|
1664 changeInfo.iPassword.Copy(pswrd1); |
|
1665 condition=RMobilePhone::EBarAllOutgoing; |
|
1666 iPhone.SetCallBarringStatus(reqStat,condition, changeInfo); |
|
1667 User::WaitForRequest(reqStat); |
|
1668 TEST(reqStat==KErrAccessDenied); |
|
1669 |
|
1670 // Test case: K.14 - Set Call Barring Status for all services with correct password |
|
1671 INFO_PRINTF1(_L("Test case: K.14 - Set Call Barring Status for all services with correct password")); |
|
1672 changeInfo.iServiceGroup=RMobilePhone::EAllServices; |
|
1673 changeInfo.iAction=RMobilePhone::EServiceActionActivate; |
|
1674 changeInfo.iPassword.Copy(pswrd2); |
|
1675 condition=RMobilePhone::EBarAllOutgoing; |
|
1676 iPhone.SetCallBarringStatus(reqStat,condition, changeInfo); |
|
1677 User::WaitForRequest(reqStat); |
|
1678 TEST(reqStat==KErrNone); |
|
1679 |
|
1680 // Test case: K.15 - Set wrong parameter - EBarAllCases - for activation |
|
1681 INFO_PRINTF1(_L("Test case: K.15 - Set wrong parameters - EBarAllCases - for activation")); |
|
1682 reqStat = KErrNone; |
|
1683 changeInfo.iServiceGroup=RMobilePhone::EAllServices; |
|
1684 changeInfo.iAction=RMobilePhone::EServiceActionActivate; |
|
1685 changeInfo.iPassword.Copy(pswrd2); |
|
1686 condition=RMobilePhone::EBarAllCases; |
|
1687 iPhone.SetCallBarringStatus(reqStat,condition, changeInfo); |
|
1688 User::WaitForRequest(reqStat); |
|
1689 TEST(reqStat==KErrArgument); |
|
1690 |
|
1691 // Test case: K.16 - Cancel notification |
|
1692 INFO_PRINTF1(_L("Test case: K.16 - Cancel notification")); |
|
1693 |
|
1694 //register notification |
|
1695 iPhone.NotifyCallBarringStatusChange(reqStat2,condition); |
|
1696 |
|
1697 // do a set |
|
1698 changeInfo.iServiceGroup=RMobilePhone::EAllServices; |
|
1699 changeInfo.iAction=RMobilePhone::EServiceActionActivate; |
|
1700 changeInfo.iPassword.Copy(pswrd2); |
|
1701 condition=RMobilePhone::EBarAllOutgoing; |
|
1702 iPhone.SetCallBarringStatus(reqStat,condition, changeInfo); |
|
1703 |
|
1704 // disable EMobilePhoneNotifyCallBarringStatusChange |
|
1705 iPhone.CancelAsyncRequest(EMobilePhoneNotifyCallBarringStatusChange); |
|
1706 |
|
1707 User::WaitForRequest(reqStat2); |
|
1708 TEST((reqStat2==KErrCancel)||(reqStat2==KErrNone));//notification did not complete(wrong condition) |
|
1709 INFO_PRINTF2(_L("The notify change returned %d"), reqStat2.Int()); |
|
1710 User::WaitForRequest(reqStat); |
|
1711 TEST(reqStat==KErrNone); |
|
1712 |
|
1713 // cleanup phase; remove |
|
1714 CActiveScheduler::Install(NULL); |
|
1715 CleanupStack::PopAndDestroy(); |
|
1716 delete retrieveCBList; |
|
1717 |
|
1718 INFO_PRINTF1(_L("End CB test")); |
|
1719 return TestStepResult(); |
|
1720 } |
|
1721 |
|
1722 |
|
1723 CTestCallForwarding::CTestCallForwarding() |
|
1724 { |
|
1725 SetTestStepName(_L("TestCallForwarding")); |
|
1726 } |
|
1727 |
|
1728 enum TVerdict CTestCallForwarding::doTestStepL() |
|
1729 /** |
|
1730 * Local function that creates a CTestData object. |
|
1731 * Connects to the ETel Server, loads the phone module (SIM TSY), calls the BeginTest() |
|
1732 * function (which runs the tests) and then disconnects from the ETel Server at |
|
1733 * the end of the tests. |
|
1734 */ |
|
1735 { |
|
1736 CActiveScheduler* actSched = new(ELeave) CActiveScheduler(); |
|
1737 CleanupStack::PushL(actSched); |
|
1738 CActiveScheduler::Install(actSched); |
|
1739 |
|
1740 SetTestNumberL(0); |
|
1741 INFO_PRINTF1(_L("CTestCallForwarding")); |
|
1742 |
|
1743 TRequestStatus reqStat = KErrNone; |
|
1744 TRequestStatus reqStat2 = KErrNone; |
|
1745 |
|
1746 _LIT8(newCFNumber, "01632960000"); |
|
1747 _LIT8(newCFNumber1, "01632960000"); |
|
1748 |
|
1749 CTestGetCFList* retrieveCFList = NULL; |
|
1750 retrieveCFList = CTestGetCFList::NewLC(iPhone, this); |
|
1751 |
|
1752 RMobilePhone::TMobilePhoneCFCondition condition = RMobilePhone::ECallForwardingUnconditional; |
|
1753 |
|
1754 // ******************* NOTE: Position is important! ************************************** |
|
1755 |
|
1756 // Test case: L.1 - Cancel notification with no previous reposts |
|
1757 INFO_PRINTF1(_L("Test case: L.1 - Cancel notification with no previous reposts")); |
|
1758 |
|
1759 //register notification |
|
1760 iPhone.NotifyCallForwardingStatusChange(reqStat2, condition); |
|
1761 |
|
1762 // disable EMobilePhoneNotifyCallForwardingStatusChange |
|
1763 iPhone.CancelAsyncRequest(EMobilePhoneNotifyCallForwardingStatusChange); |
|
1764 User::WaitForRequest(reqStat2); |
|
1765 TEST(reqStat2 == KErrCancel); |
|
1766 |
|
1767 // because it is assumed no previous CTestGetCFList |
|
1768 INFO_PRINTF2(_L("The notify change returned %d"), reqStat2.Int()); |
|
1769 |
|
1770 // Test case: L.2 - Retrieve the status for all basic services for a specific condition |
|
1771 INFO_PRINTF1(_L("Test case: L.2 - Retrieve the status for all basic services for a specific condition")); |
|
1772 condition = RMobilePhone::ECallForwardingUnconditional; |
|
1773 |
|
1774 RMobilePhone::TMobilePhoneCFInfoEntryV1 ExpectedEntry1; |
|
1775 |
|
1776 // there should be only one entry |
|
1777 ExpectedEntry1.iCondition = RMobilePhone::ECallForwardingUnconditional; |
|
1778 ExpectedEntry1.iServiceGroup = RMobilePhone::EVoiceService; |
|
1779 ExpectedEntry1.iStatus = RMobilePhone::ECallForwardingStatusActive; |
|
1780 retrieveCFList->SetExpectedResultsL(ExpectedEntry1); |
|
1781 |
|
1782 retrieveCFList->PrintCondition(condition); |
|
1783 retrieveCFList->Start(condition); |
|
1784 CActiveScheduler::Start(); |
|
1785 |
|
1786 // Test case: L.3 - Retrieve the status for all basic services for a specific condition |
|
1787 INFO_PRINTF1(_L("Test case: L.3 - Retrieve the status for all basic services for a specific condition")); |
|
1788 condition = RMobilePhone::ECallForwardingNotReachable; |
|
1789 |
|
1790 // there should be only one entry |
|
1791 ExpectedEntry1.iCondition = RMobilePhone::ECallForwardingNotReachable; |
|
1792 ExpectedEntry1.iServiceGroup = RMobilePhone::EPacketDataService; |
|
1793 ExpectedEntry1.iStatus = RMobilePhone::ECallForwardingStatusNotActive; |
|
1794 retrieveCFList->SetExpectedResultsL(ExpectedEntry1); |
|
1795 |
|
1796 retrieveCFList->PrintCondition(condition); |
|
1797 retrieveCFList->Start(condition); |
|
1798 CActiveScheduler::Start(); |
|
1799 |
|
1800 // Test case: L.4 - Retrieve the configuration for erroneous condition |
|
1801 //there should be no entries |
|
1802 INFO_PRINTF1(_L("Test case: L.4 - Retrieve the configuration for erroneous condition")); |
|
1803 condition = RMobilePhone::ECallForwardingAllCases; |
|
1804 retrieveCFList->PrintCondition(condition); |
|
1805 retrieveCFList->Start(condition); |
|
1806 CActiveScheduler::Start(); |
|
1807 |
|
1808 // Test case: L.5 - Retrieve the configuration for correct condition but for which there are no registered services |
|
1809 INFO_PRINTF1(_L("Test case: L.5 - Retrieve the configuration for correct condition but for which there are no registered services")); |
|
1810 condition = RMobilePhone::ECallForwardingNoReply; |
|
1811 retrieveCFList->PrintCondition(condition); |
|
1812 retrieveCFList->Start(condition); |
|
1813 CActiveScheduler::Start(); |
|
1814 INFO_PRINTF1(_L("")); |
|
1815 |
|
1816 RMobilePhone::TMobileService serviceGroup = RMobilePhone::EVoiceService; |
|
1817 |
|
1818 // Test case: L.6 - Retrieve the configuration for correct condition but for specific registered group |
|
1819 INFO_PRINTF1(_L("Test case: L.6 - Retrieve the configuration for correct condition but for specific registered group")); |
|
1820 condition = RMobilePhone::ECallForwardingUnconditional; |
|
1821 retrieveCFList->PrintCondition(condition); |
|
1822 retrieveCFList->Start(condition, serviceGroup); |
|
1823 CActiveScheduler::Start(); |
|
1824 |
|
1825 // Test case: L.7 - Retrieve the configuration for correct condition but for specific non registered group |
|
1826 INFO_PRINTF1(_L("Test case: L.7 - Retrieve the configuration for correct condition but for specific non registered group")); |
|
1827 serviceGroup = RMobilePhone::EAuxVoiceService; |
|
1828 condition=RMobilePhone::ECallForwardingUnconditional; |
|
1829 retrieveCFList->PrintCondition(condition); |
|
1830 retrieveCFList->Start(condition, serviceGroup); |
|
1831 CActiveScheduler::Start(); |
|
1832 INFO_PRINTF1(_L("")); |
|
1833 |
|
1834 // *********** Now we have retrieved our conditions list. Now modify the list. ************* |
|
1835 |
|
1836 RMobilePhone::TMobilePhoneCFChangeV1 changeInfo; |
|
1837 |
|
1838 // Test case: L.8 - Register a previously not registered CF condition for all services to registered |
|
1839 INFO_PRINTF1(_L("Test case: L.8 - Register a previously CF condition for all services to registered")); |
|
1840 condition = RMobilePhone::ECallForwardingNoReply; |
|
1841 changeInfo.iServiceGroup = RMobilePhone::EAllServices; |
|
1842 changeInfo.iAction = RMobilePhone::EServiceActionRegister; |
|
1843 changeInfo.iNumber.iTelNumber.Copy(newCFNumber); |
|
1844 changeInfo.iTimeout=30; |
|
1845 iPhone.SetCallForwardingStatus(reqStat,condition, changeInfo); |
|
1846 User::WaitForRequest(reqStat); |
|
1847 TEST(reqStat == KErrNone); |
|
1848 |
|
1849 //Retrieve again |
|
1850 ExpectedEntry1.iCondition = RMobilePhone::ECallForwardingNoReply; |
|
1851 ExpectedEntry1.iServiceGroup = RMobilePhone::EAllServices; |
|
1852 ExpectedEntry1.iStatus = RMobilePhone::ECallForwardingStatusNotActive; |
|
1853 retrieveCFList->SetExpectedResultsL(ExpectedEntry1); |
|
1854 |
|
1855 condition = RMobilePhone::ECallForwardingNoReply; |
|
1856 retrieveCFList->PrintCondition(condition); |
|
1857 retrieveCFList->Start(condition); |
|
1858 CActiveScheduler::Start(); |
|
1859 |
|
1860 // Test case: L.9 - Activate a previously not active CF condition for all services |
|
1861 INFO_PRINTF1(_L("Test case: L.9 - De-activate a previously active CF condition for all services")); |
|
1862 condition = RMobilePhone::ECallForwardingNoReply; |
|
1863 changeInfo.iServiceGroup = RMobilePhone::EAllServices; |
|
1864 changeInfo.iAction = RMobilePhone::EServiceActionActivate; |
|
1865 iPhone.SetCallForwardingStatus(reqStat,condition, changeInfo); |
|
1866 User::WaitForRequest(reqStat); |
|
1867 TEST(reqStat==KErrNone); |
|
1868 |
|
1869 //Retrieve again |
|
1870 ExpectedEntry1.iCondition = RMobilePhone::ECallForwardingNoReply; |
|
1871 ExpectedEntry1.iServiceGroup = RMobilePhone::EAllServices; |
|
1872 ExpectedEntry1.iStatus = RMobilePhone::ECallForwardingStatusActive; |
|
1873 retrieveCFList->SetExpectedResultsL(ExpectedEntry1); |
|
1874 |
|
1875 serviceGroup = RMobilePhone::EAllServices; |
|
1876 condition = RMobilePhone::ECallForwardingNoReply; |
|
1877 retrieveCFList->PrintCondition(condition); |
|
1878 retrieveCFList->Start(condition,serviceGroup); |
|
1879 CActiveScheduler::Start(); |
|
1880 |
|
1881 // Test case: L.10 - De-activate a previously active CF condition for all services |
|
1882 INFO_PRINTF1(_L("Test case: L.10 - De-activate a previously active CF condition for all services")); |
|
1883 condition = RMobilePhone::ECallForwardingNoReply; |
|
1884 changeInfo.iServiceGroup = RMobilePhone::EAllServices; |
|
1885 changeInfo.iAction = RMobilePhone::EServiceActionDeactivate; |
|
1886 iPhone.SetCallForwardingStatus(reqStat,condition, changeInfo); |
|
1887 User::WaitForRequest(reqStat); |
|
1888 TEST(reqStat==KErrNone); |
|
1889 |
|
1890 //Retrieve again |
|
1891 ExpectedEntry1.iCondition = RMobilePhone::ECallForwardingNoReply; |
|
1892 ExpectedEntry1.iServiceGroup = RMobilePhone::EAllServices; |
|
1893 ExpectedEntry1.iStatus = RMobilePhone::ECallForwardingStatusNotActive; |
|
1894 retrieveCFList->SetExpectedResultsL(ExpectedEntry1); |
|
1895 |
|
1896 serviceGroup = RMobilePhone::EAllServices; |
|
1897 condition = RMobilePhone::ECallForwardingNoReply; |
|
1898 retrieveCFList->PrintCondition(condition); |
|
1899 retrieveCFList->Start(condition,serviceGroup); |
|
1900 CActiveScheduler::Start(); |
|
1901 |
|
1902 // Test case: L.11 - Erase a previously non active CF condition for all services |
|
1903 INFO_PRINTF1(_L("Test case: L.11 - Erase a previously non active CF condition for all services")); |
|
1904 condition = RMobilePhone::ECallForwardingNoReply; |
|
1905 changeInfo.iServiceGroup = RMobilePhone::EAllServices; |
|
1906 changeInfo.iAction = RMobilePhone::EServiceActionErase; |
|
1907 iPhone.SetCallForwardingStatus(reqStat,condition, changeInfo); |
|
1908 User::WaitForRequest(reqStat); |
|
1909 TEST(reqStat==KErrNone); |
|
1910 |
|
1911 serviceGroup = RMobilePhone::EAllServices; |
|
1912 condition = RMobilePhone::ECallForwardingNoReply; |
|
1913 retrieveCFList->PrintCondition(condition); |
|
1914 retrieveCFList->Start(condition,serviceGroup); |
|
1915 CActiveScheduler::Start(); |
|
1916 |
|
1917 // Test case: L.12 - Register a previously not registered CF condition for a single service |
|
1918 INFO_PRINTF1(_L("Test case: L.12 - Register a previously not registered CF condition for a single service")); |
|
1919 condition=RMobilePhone::ECallForwardingUnconditional; |
|
1920 changeInfo.iServiceGroup = RMobilePhone::EAuxVoiceService; |
|
1921 changeInfo.iAction = RMobilePhone::EServiceActionRegister; |
|
1922 changeInfo.iNumber.iTelNumber.Copy(newCFNumber); |
|
1923 changeInfo.iTimeout = 30; |
|
1924 iPhone.SetCallForwardingStatus(reqStat,condition, changeInfo); |
|
1925 User::WaitForRequest(reqStat); |
|
1926 TEST(reqStat == KErrNone); |
|
1927 |
|
1928 //Retrieve again |
|
1929 ExpectedEntry1.iCondition = RMobilePhone::ECallForwardingUnconditional; |
|
1930 ExpectedEntry1.iServiceGroup = RMobilePhone::EAuxVoiceService; |
|
1931 ExpectedEntry1.iStatus = RMobilePhone::ECallForwardingStatusNotActive; |
|
1932 retrieveCFList->SetExpectedResultsL(ExpectedEntry1); |
|
1933 |
|
1934 serviceGroup = RMobilePhone::EAuxVoiceService; |
|
1935 condition = RMobilePhone::ECallForwardingUnconditional; |
|
1936 retrieveCFList->PrintCondition(condition); |
|
1937 retrieveCFList->Start(condition,serviceGroup); |
|
1938 CActiveScheduler::Start(); |
|
1939 |
|
1940 // Test case: L.13 - Activate a previously not registered CF condition for a single service |
|
1941 INFO_PRINTF1(_L("Test case: L.13 - Activate a previously not registered CF condition for a single service")); |
|
1942 condition = RMobilePhone::ECallForwardingUnconditional; |
|
1943 changeInfo.iServiceGroup = RMobilePhone::EFaxService; |
|
1944 changeInfo.iAction = RMobilePhone::EServiceActionActivate; |
|
1945 changeInfo.iNumber.iTelNumber.Copy(newCFNumber); |
|
1946 changeInfo.iTimeout = 25; |
|
1947 iPhone.SetCallForwardingStatus(reqStat,condition, changeInfo); |
|
1948 User::WaitForRequest(reqStat); |
|
1949 TEST(reqStat==KErrNone); |
|
1950 |
|
1951 serviceGroup = RMobilePhone::EFaxService; |
|
1952 condition = RMobilePhone::ECallForwardingUnconditional; |
|
1953 retrieveCFList->PrintCondition(condition); |
|
1954 // should not return anything as cannot activate |
|
1955 retrieveCFList->Start(condition,serviceGroup); |
|
1956 CActiveScheduler::Start(); |
|
1957 INFO_PRINTF1(_L("")); |
|
1958 |
|
1959 // Test case: L.14 - Register a previously not registered CF condition for a single service |
|
1960 INFO_PRINTF1(_L("Test case: L.14 - Register a previously not registered CF condition for a single service")); |
|
1961 condition = RMobilePhone::ECallForwardingUnconditional; |
|
1962 changeInfo.iServiceGroup=RMobilePhone::EFaxService; |
|
1963 changeInfo.iAction=RMobilePhone::EServiceActionRegister; |
|
1964 changeInfo.iNumber.iTelNumber.Copy(newCFNumber); |
|
1965 changeInfo.iTimeout=30; |
|
1966 iPhone.SetCallForwardingStatus(reqStat,condition, changeInfo); |
|
1967 User::WaitForRequest(reqStat); |
|
1968 TEST(reqStat==KErrNone); |
|
1969 |
|
1970 //Retrieve again |
|
1971 ExpectedEntry1.iCondition = RMobilePhone::ECallForwardingUnconditional; |
|
1972 ExpectedEntry1.iServiceGroup = RMobilePhone::EFaxService; |
|
1973 ExpectedEntry1.iStatus = RMobilePhone::ECallForwardingStatusNotActive; |
|
1974 retrieveCFList->SetExpectedResultsL(ExpectedEntry1); |
|
1975 |
|
1976 serviceGroup = RMobilePhone::EFaxService; |
|
1977 condition = RMobilePhone::ECallForwardingUnconditional; |
|
1978 retrieveCFList->PrintCondition(condition); |
|
1979 retrieveCFList->Start(condition,serviceGroup); |
|
1980 CActiveScheduler::Start(); |
|
1981 |
|
1982 // Test case: L.15 - Activate a previously registered CF condition for a single service |
|
1983 INFO_PRINTF1(_L("Test case: L.15 - Activate a previously not registered CF condition for a single service")); |
|
1984 condition=RMobilePhone::ECallForwardingUnconditional; |
|
1985 changeInfo.iServiceGroup = RMobilePhone::EFaxService; |
|
1986 changeInfo.iAction = RMobilePhone::EServiceActionActivate; |
|
1987 changeInfo.iNumber.iTelNumber.Copy(newCFNumber); |
|
1988 changeInfo.iTimeout = 25; |
|
1989 iPhone.SetCallForwardingStatus(reqStat,condition, changeInfo); |
|
1990 User::WaitForRequest(reqStat); |
|
1991 TEST(reqStat==KErrNone); |
|
1992 |
|
1993 //Retrieve again |
|
1994 ExpectedEntry1.iCondition = RMobilePhone::ECallForwardingUnconditional; |
|
1995 ExpectedEntry1.iServiceGroup = RMobilePhone::EFaxService; |
|
1996 ExpectedEntry1.iStatus = RMobilePhone::ECallForwardingStatusActive; |
|
1997 retrieveCFList->SetExpectedResultsL(ExpectedEntry1); |
|
1998 |
|
1999 serviceGroup = RMobilePhone::EFaxService; |
|
2000 condition = RMobilePhone::ECallForwardingUnconditional; |
|
2001 retrieveCFList->PrintCondition(condition); |
|
2002 retrieveCFList->Start(condition,serviceGroup); |
|
2003 CActiveScheduler::Start(); |
|
2004 |
|
2005 // Test case: L.16 - De-activate a previously active CF condition for a single service |
|
2006 INFO_PRINTF1(_L("Test case: L.16 - De-activate a previously active CF condition for a single service")); |
|
2007 condition=RMobilePhone::ECallForwardingUnconditional; |
|
2008 changeInfo.iServiceGroup = RMobilePhone::EFaxService; |
|
2009 changeInfo.iAction = RMobilePhone::EServiceActionDeactivate; |
|
2010 iPhone.SetCallForwardingStatus(reqStat,condition, changeInfo); |
|
2011 User::WaitForRequest(reqStat); |
|
2012 TEST(reqStat==KErrNone); |
|
2013 |
|
2014 //Retrieve again |
|
2015 ExpectedEntry1.iCondition = RMobilePhone::ECallForwardingUnconditional; |
|
2016 ExpectedEntry1.iServiceGroup = RMobilePhone::EFaxService; |
|
2017 ExpectedEntry1.iStatus = RMobilePhone::ECallForwardingStatusNotActive; |
|
2018 retrieveCFList->SetExpectedResultsL(ExpectedEntry1); |
|
2019 |
|
2020 serviceGroup = RMobilePhone::EFaxService; |
|
2021 condition = RMobilePhone::ECallForwardingUnconditional; |
|
2022 retrieveCFList->PrintCondition(condition); |
|
2023 retrieveCFList->Start(condition,serviceGroup); |
|
2024 CActiveScheduler::Start(); |
|
2025 |
|
2026 // Test case: L.17 - Erase a previously active CF condition for a single service |
|
2027 INFO_PRINTF1(_L("Test case: L.17 - Erase a previously active CF condition for a single service")); |
|
2028 condition=RMobilePhone::ECallForwardingUnconditional; |
|
2029 changeInfo.iServiceGroup=RMobilePhone::EAuxVoiceService; |
|
2030 changeInfo.iAction=RMobilePhone::EServiceActionErase; |
|
2031 iPhone.SetCallForwardingStatus(reqStat,condition, changeInfo); |
|
2032 User::WaitForRequest(reqStat); |
|
2033 TEST(reqStat==KErrNone); |
|
2034 |
|
2035 serviceGroup = RMobilePhone::EAuxVoiceService; |
|
2036 condition=RMobilePhone::ECallForwardingUnconditional; |
|
2037 retrieveCFList->PrintCondition(condition); |
|
2038 retrieveCFList->Start(condition,serviceGroup); |
|
2039 CActiveScheduler::Start(); |
|
2040 |
|
2041 // Test case: L.18 - Erase a previously not active CF condition for a single service |
|
2042 INFO_PRINTF1(_L("Test case: L.18 - Erase a previously not active CF condition for a single service")); |
|
2043 condition = RMobilePhone::ECallForwardingUnconditional; |
|
2044 changeInfo.iServiceGroup = RMobilePhone::EFaxService; |
|
2045 changeInfo.iAction = RMobilePhone::EServiceActionErase; |
|
2046 iPhone.SetCallForwardingStatus(reqStat,condition, changeInfo); |
|
2047 User::WaitForRequest(reqStat); |
|
2048 TEST(reqStat==KErrNone); |
|
2049 |
|
2050 serviceGroup = RMobilePhone::EFaxService; |
|
2051 condition=RMobilePhone::ECallForwardingUnconditional; |
|
2052 retrieveCFList->PrintCondition(condition); |
|
2053 retrieveCFList->Start(condition,serviceGroup); |
|
2054 CActiveScheduler::Start(); |
|
2055 //there should be no entries printed as the service is deactivated |
|
2056 INFO_PRINTF1(_L("")); |
|
2057 |
|
2058 // Tests on Quiescent state // |
|
2059 |
|
2060 // Test case: L.19 - De-activate a previously active CF condition for a single service |
|
2061 INFO_PRINTF1(_L("Test case: L.19 - De-activate a previously active CF condition for a single service")); |
|
2062 condition=RMobilePhone::ECallForwardingBusy; |
|
2063 changeInfo.iServiceGroup = RMobilePhone::ECircuitDataService; |
|
2064 changeInfo.iAction = RMobilePhone::EServiceActionRegister; |
|
2065 iPhone.SetCallForwardingStatus(reqStat,condition, changeInfo); |
|
2066 User::WaitForRequest(reqStat); |
|
2067 TEST(reqStat==KErrNone); |
|
2068 |
|
2069 //Retrieve again |
|
2070 ExpectedEntry1.iCondition = RMobilePhone::ECallForwardingBusy; |
|
2071 ExpectedEntry1.iServiceGroup = RMobilePhone::ECircuitDataService; |
|
2072 ExpectedEntry1.iStatus = RMobilePhone::ECallForwardingStatusNotActive; |
|
2073 retrieveCFList->SetExpectedResultsL(ExpectedEntry1); |
|
2074 |
|
2075 serviceGroup = RMobilePhone::ECircuitDataService; |
|
2076 condition = RMobilePhone::ECallForwardingBusy; |
|
2077 retrieveCFList->PrintCondition(condition); |
|
2078 retrieveCFList->Start(condition,serviceGroup); |
|
2079 CActiveScheduler::Start(); |
|
2080 |
|
2081 // Test case: L.20 - Try and activate a single CF service |
|
2082 // is active |
|
2083 INFO_PRINTF1(_L("Test case: L.20 - Activate a single CF service")); |
|
2084 condition=RMobilePhone::ECallForwardingBusy; |
|
2085 changeInfo.iServiceGroup = RMobilePhone::ECircuitDataService; |
|
2086 changeInfo.iAction = RMobilePhone::EServiceActionActivate; |
|
2087 iPhone.SetCallForwardingStatus(reqStat,condition, changeInfo); |
|
2088 User::WaitForRequest(reqStat); |
|
2089 TEST(reqStat==KErrNone); |
|
2090 |
|
2091 //Retrieve again |
|
2092 ExpectedEntry1.iCondition = RMobilePhone::ECallForwardingBusy; |
|
2093 ExpectedEntry1.iServiceGroup = RMobilePhone::ECircuitDataService; |
|
2094 ExpectedEntry1.iStatus = RMobilePhone::ECallForwardingStatusNotActive; |
|
2095 retrieveCFList->SetExpectedResultsL(ExpectedEntry1); |
|
2096 |
|
2097 serviceGroup = RMobilePhone::ECircuitDataService; |
|
2098 condition = RMobilePhone::ECallForwardingBusy; |
|
2099 retrieveCFList->PrintCondition(condition); |
|
2100 retrieveCFList->Start(condition,serviceGroup); |
|
2101 CActiveScheduler::Start(); |
|
2102 |
|
2103 // Test case: L.21 - De-activate active call forwarding unconditional service |
|
2104 // is active |
|
2105 INFO_PRINTF1(_L("Test case: L.21 - De-activate a previously active CF condition for a single service")); |
|
2106 condition=RMobilePhone::ECallForwardingUnconditional; |
|
2107 changeInfo.iServiceGroup = RMobilePhone::EVoiceService; |
|
2108 changeInfo.iAction = RMobilePhone::EServiceActionDeactivate; |
|
2109 iPhone.SetCallForwardingStatus(reqStat,condition, changeInfo); |
|
2110 User::WaitForRequest(reqStat); |
|
2111 TEST(reqStat==KErrNone); |
|
2112 |
|
2113 //Retrieve again |
|
2114 ExpectedEntry1.iCondition = RMobilePhone::ECallForwardingUnconditional; |
|
2115 ExpectedEntry1.iServiceGroup = RMobilePhone::EVoiceService; |
|
2116 ExpectedEntry1.iStatus = RMobilePhone::ECallForwardingStatusNotActive; |
|
2117 retrieveCFList->SetExpectedResultsL(ExpectedEntry1); |
|
2118 |
|
2119 serviceGroup = RMobilePhone::EVoiceService; |
|
2120 condition = RMobilePhone::ECallForwardingUnconditional; |
|
2121 retrieveCFList->PrintCondition(condition); |
|
2122 retrieveCFList->Start(condition,serviceGroup); |
|
2123 CActiveScheduler::Start(); |
|
2124 |
|
2125 // Test case: L.22 - Try and activate call forwarding busy when call forwarding unconditional not active |
|
2126 INFO_PRINTF1(_L("Test case: L.22 - Activate a previously active CF condition for a single service")); |
|
2127 condition=RMobilePhone::ECallForwardingBusy; |
|
2128 changeInfo.iServiceGroup = RMobilePhone::ECircuitDataService; |
|
2129 changeInfo.iAction = RMobilePhone::EServiceActionActivate; |
|
2130 iPhone.SetCallForwardingStatus(reqStat,condition, changeInfo); |
|
2131 User::WaitForRequest(reqStat); |
|
2132 TEST(reqStat==KErrNone); |
|
2133 |
|
2134 //Retrieve again |
|
2135 ExpectedEntry1.iCondition = RMobilePhone::ECallForwardingBusy; |
|
2136 ExpectedEntry1.iServiceGroup = RMobilePhone::ECircuitDataService; |
|
2137 ExpectedEntry1.iStatus = RMobilePhone::ECallForwardingStatusActive; |
|
2138 retrieveCFList->SetExpectedResultsL(ExpectedEntry1); |
|
2139 |
|
2140 serviceGroup = RMobilePhone::ECircuitDataService; |
|
2141 condition = RMobilePhone::ECallForwardingBusy; |
|
2142 retrieveCFList->PrintCondition(condition); |
|
2143 retrieveCFList->Start(condition,serviceGroup); |
|
2144 CActiveScheduler::Start(); |
|
2145 |
|
2146 // Test case: L.23 - Activate call forwarding unconditional when call forwarding busy active |
|
2147 INFO_PRINTF1(_L("Test case: L.23 - Activate a previously active CF condition for a single service")); |
|
2148 condition = RMobilePhone::ECallForwardingUnconditional; |
|
2149 changeInfo.iServiceGroup = RMobilePhone::EVoiceService; |
|
2150 changeInfo.iAction = RMobilePhone::EServiceActionActivate; |
|
2151 iPhone.SetCallForwardingStatus(reqStat,condition, changeInfo); |
|
2152 User::WaitForRequest(reqStat); |
|
2153 TEST(reqStat==KErrNone); |
|
2154 |
|
2155 //Retrieve again |
|
2156 ExpectedEntry1.iCondition = RMobilePhone::ECallForwardingUnconditional; |
|
2157 ExpectedEntry1.iServiceGroup = RMobilePhone::EVoiceService; |
|
2158 ExpectedEntry1.iStatus = RMobilePhone::ECallForwardingStatusActive; |
|
2159 retrieveCFList->SetExpectedResultsL(ExpectedEntry1); |
|
2160 |
|
2161 serviceGroup = RMobilePhone::EVoiceService; |
|
2162 condition = RMobilePhone::ECallForwardingUnconditional; |
|
2163 retrieveCFList->PrintCondition(condition); |
|
2164 retrieveCFList->Start(condition,serviceGroup); |
|
2165 CActiveScheduler::Start(); |
|
2166 |
|
2167 //Retrieve again |
|
2168 ExpectedEntry1.iCondition = RMobilePhone::ECallForwardingBusy; |
|
2169 ExpectedEntry1.iServiceGroup = RMobilePhone::ECircuitDataService; |
|
2170 ExpectedEntry1.iStatus = RMobilePhone::ECallForwardingStatusQuiescent; |
|
2171 retrieveCFList->SetExpectedResultsL(ExpectedEntry1); |
|
2172 |
|
2173 serviceGroup = RMobilePhone::ECircuitDataService; |
|
2174 condition = RMobilePhone::ECallForwardingBusy; |
|
2175 retrieveCFList->PrintCondition(condition); |
|
2176 retrieveCFList->Start(condition,serviceGroup); |
|
2177 CActiveScheduler::Start(); |
|
2178 |
|
2179 // Test case: L.24 - De-activate call forwarding unconditional |
|
2180 INFO_PRINTF1(_L("Test case: L.24 - De-activate a previously active CF condition for a single service")); |
|
2181 condition = RMobilePhone::ECallForwardingUnconditional; |
|
2182 changeInfo.iServiceGroup = RMobilePhone::EVoiceService; |
|
2183 changeInfo.iAction = RMobilePhone::EServiceActionDeactivate; |
|
2184 iPhone.SetCallForwardingStatus(reqStat,condition, changeInfo); |
|
2185 User::WaitForRequest(reqStat); |
|
2186 TEST(reqStat==KErrNone); |
|
2187 |
|
2188 //Retrieve again |
|
2189 ExpectedEntry1.iCondition = RMobilePhone::ECallForwardingUnconditional; |
|
2190 ExpectedEntry1.iServiceGroup = RMobilePhone::EVoiceService; |
|
2191 ExpectedEntry1.iStatus = RMobilePhone::ECallForwardingStatusNotActive; |
|
2192 retrieveCFList->SetExpectedResultsL(ExpectedEntry1); |
|
2193 |
|
2194 serviceGroup = RMobilePhone::EVoiceService; |
|
2195 condition = RMobilePhone::ECallForwardingUnconditional; |
|
2196 retrieveCFList->PrintCondition(condition); |
|
2197 retrieveCFList->Start(condition,serviceGroup); |
|
2198 CActiveScheduler::Start(); |
|
2199 |
|
2200 //Retrieve again |
|
2201 ExpectedEntry1.iCondition = RMobilePhone::ECallForwardingBusy; |
|
2202 ExpectedEntry1.iServiceGroup = RMobilePhone::ECircuitDataService; |
|
2203 ExpectedEntry1.iStatus = RMobilePhone::ECallForwardingStatusActive; |
|
2204 retrieveCFList->SetExpectedResultsL(ExpectedEntry1); |
|
2205 |
|
2206 serviceGroup = RMobilePhone::ECircuitDataService; |
|
2207 condition = RMobilePhone::ECallForwardingBusy; |
|
2208 retrieveCFList->PrintCondition(condition); |
|
2209 retrieveCFList->Start(condition,serviceGroup); |
|
2210 CActiveScheduler::Start(); |
|
2211 |
|
2212 //Tests on Notifications// |
|
2213 |
|
2214 INFO_PRINTF1(_L("Change simtsy config number")); |
|
2215 SetTestNumberL(1); |
|
2216 |
|
2217 // Test case: L.25 - Register all services for a CF condition, whilst there are some previously reistered/non-active |
|
2218 INFO_PRINTF1(_L("Test case: L.25 - Register all services for a CF condition, whilst there are some previously reistered/non-active")); |
|
2219 changeInfo.iServiceGroup = RMobilePhone::EAllServices; |
|
2220 changeInfo.iAction = RMobilePhone::EServiceActionRegister; |
|
2221 changeInfo.iNumber.iTelNumber.Copy(newCFNumber1); |
|
2222 condition = RMobilePhone::ECallForwardingNoReply; |
|
2223 iPhone.SetCallForwardingStatus(reqStat,condition, changeInfo); |
|
2224 User::WaitForRequest(reqStat); |
|
2225 TEST(reqStat==KErrNone); |
|
2226 |
|
2227 //Retrieve again |
|
2228 ExpectedEntry1.iCondition = RMobilePhone::ECallForwardingNoReply; |
|
2229 ExpectedEntry1.iServiceGroup = RMobilePhone::EAllServices; |
|
2230 ExpectedEntry1.iStatus = RMobilePhone::ECallForwardingStatusNotActive; |
|
2231 retrieveCFList->SetExpectedResultsL(ExpectedEntry1); |
|
2232 |
|
2233 condition = RMobilePhone::ECallForwardingNoReply; |
|
2234 retrieveCFList->PrintCondition(condition); |
|
2235 retrieveCFList->Start(condition); |
|
2236 CActiveScheduler::Start(); |
|
2237 |
|
2238 // Test case: L.26 - Activate all services for a CF condition, whilst there are some previously reistered/non-active |
|
2239 INFO_PRINTF1(_L("Test case: L.26 - Activate all services for a CF condition, whilst there are some previously reistered/non-active")); |
|
2240 changeInfo.iServiceGroup = RMobilePhone::EAllServices; |
|
2241 changeInfo.iAction = RMobilePhone::EServiceActionActivate; |
|
2242 changeInfo.iNumber.iTelNumber.Copy(newCFNumber1); |
|
2243 condition = RMobilePhone::ECallForwardingNoReply; |
|
2244 iPhone.SetCallForwardingStatus(reqStat,condition, changeInfo); |
|
2245 User::WaitForRequest(reqStat); |
|
2246 TEST(reqStat==KErrNone); |
|
2247 |
|
2248 //Retrieve again |
|
2249 ExpectedEntry1.iCondition = RMobilePhone::ECallForwardingNoReply; |
|
2250 ExpectedEntry1.iServiceGroup = RMobilePhone::EAllServices; |
|
2251 ExpectedEntry1.iStatus = RMobilePhone::ECallForwardingStatusActive; |
|
2252 retrieveCFList->SetExpectedResultsL(ExpectedEntry1); |
|
2253 |
|
2254 condition = RMobilePhone::ECallForwardingNoReply; |
|
2255 retrieveCFList->PrintCondition(condition); |
|
2256 retrieveCFList->Start(condition); |
|
2257 CActiveScheduler::Start(); |
|
2258 |
|
2259 // Test case: L.27 - Enable notification whilst disable a service enabled for that condition |
|
2260 INFO_PRINTF1(_L("Test case: L.27 - Enable notification whilst disable a service enabled for that condition")); |
|
2261 condition = RMobilePhone::ECallForwardingNoReply; |
|
2262 iPhone.NotifyCallForwardingStatusChange(reqStat2,condition); |
|
2263 User::After(2000000); |
|
2264 changeInfo.iServiceGroup = RMobilePhone::ECircuitDataService; |
|
2265 changeInfo.iAction = RMobilePhone::EServiceActionDeactivate; |
|
2266 condition = RMobilePhone::ECallForwardingNoReply; |
|
2267 iPhone.SetCallForwardingStatus(reqStat,condition, changeInfo); |
|
2268 |
|
2269 condition = RMobilePhone::ECallForwardingUnconditional; |
|
2270 User::WaitForRequest(reqStat); |
|
2271 TEST(reqStat==KErrNone); |
|
2272 User::WaitForRequest(reqStat2); |
|
2273 TEST(reqStat2==KErrNone); |
|
2274 //notification should be |
|
2275 INFO_PRINTF1(_L("Notification condition")); |
|
2276 retrieveCFList->PrintCondition(condition); |
|
2277 |
|
2278 //Retrieve again |
|
2279 ExpectedEntry1.iCondition=RMobilePhone::ECallForwardingNoReply; |
|
2280 ExpectedEntry1.iServiceGroup=RMobilePhone::EFaxService; |
|
2281 ExpectedEntry1.iStatus=RMobilePhone::ECallForwardingStatusActive; |
|
2282 retrieveCFList->SetExpectedResultsL(ExpectedEntry1); |
|
2283 ExpectedEntry1.iServiceGroup=RMobilePhone::EVoiceService; |
|
2284 retrieveCFList->SetExpectedResultsL(ExpectedEntry1); |
|
2285 ExpectedEntry1.iServiceGroup=RMobilePhone::EAuxVoiceService; |
|
2286 retrieveCFList->SetExpectedResultsL(ExpectedEntry1); |
|
2287 ExpectedEntry1.iServiceGroup=RMobilePhone::EPacketDataService; |
|
2288 retrieveCFList->SetExpectedResultsL(ExpectedEntry1); |
|
2289 ExpectedEntry1.iServiceGroup=RMobilePhone::EShortMessageService; |
|
2290 retrieveCFList->SetExpectedResultsL(ExpectedEntry1); |
|
2291 ExpectedEntry1.iStatus=RMobilePhone::ECallForwardingStatusNotActive; |
|
2292 ExpectedEntry1.iServiceGroup=RMobilePhone::ECircuitDataService; |
|
2293 retrieveCFList->SetExpectedResultsL(ExpectedEntry1); |
|
2294 |
|
2295 condition=RMobilePhone::ECallForwardingNoReply; |
|
2296 retrieveCFList->PrintCondition(condition); |
|
2297 retrieveCFList->Start(condition); |
|
2298 CActiveScheduler::Start(); |
|
2299 |
|
2300 // activate for 1 service but different condition |
|
2301 |
|
2302 // Test case: L.28 - Enable notification whilst disable a service enabled for other condition |
|
2303 INFO_PRINTF1(_L("Test case: L.28 - Enable notification whilst disable a service enabled for other condition")); |
|
2304 |
|
2305 iPhone.NotifyCallForwardingStatusChange(reqStat2,condition); |
|
2306 User::After(2000000); |
|
2307 |
|
2308 changeInfo.iServiceGroup=RMobilePhone::EVoiceService; |
|
2309 changeInfo.iAction=RMobilePhone::EServiceActionRegister; |
|
2310 condition=RMobilePhone::ECallForwardingBusy; |
|
2311 iPhone.SetCallForwardingStatus(reqStat,condition, changeInfo); |
|
2312 User::WaitForRequest(reqStat); |
|
2313 TEST(reqStat==KErrNone); |
|
2314 User::WaitForRequest(reqStat2); |
|
2315 TEST(reqStat2==KErrNone); |
|
2316 //notification should be |
|
2317 INFO_PRINTF1(_L("Notification condition")); |
|
2318 retrieveCFList->PrintCondition(condition); |
|
2319 |
|
2320 //Retrieve again |
|
2321 ExpectedEntry1.iCondition=RMobilePhone::ECallForwardingBusy; |
|
2322 ExpectedEntry1.iServiceGroup=RMobilePhone::EAuxVoiceService; |
|
2323 ExpectedEntry1.iStatus=RMobilePhone::ECallForwardingStatusActive; |
|
2324 retrieveCFList->SetExpectedResultsL(ExpectedEntry1); |
|
2325 |
|
2326 ExpectedEntry1.iServiceGroup=RMobilePhone::ECircuitDataService; |
|
2327 ExpectedEntry1.iStatus=RMobilePhone::ECallForwardingStatusActive; |
|
2328 retrieveCFList->SetExpectedResultsL(ExpectedEntry1); |
|
2329 |
|
2330 ExpectedEntry1.iServiceGroup=RMobilePhone::EVoiceService; |
|
2331 ExpectedEntry1.iStatus=RMobilePhone::ECallForwardingStatusNotActive; |
|
2332 retrieveCFList->SetExpectedResultsL(ExpectedEntry1); |
|
2333 |
|
2334 retrieveCFList->PrintCondition(condition); |
|
2335 retrieveCFList->Start(condition); |
|
2336 CActiveScheduler::Start(); |
|
2337 |
|
2338 // Test case: L.29 - Cancel notification with previous reposts |
|
2339 INFO_PRINTF1(_L("Test case: L.29 - Cancel notification with previous reposts")); |
|
2340 //register notification |
|
2341 iPhone.NotifyCallForwardingStatusChange(reqStat2,condition); |
|
2342 |
|
2343 //set |
|
2344 changeInfo.iServiceGroup=RMobilePhone::EVoiceService; |
|
2345 changeInfo.iAction=RMobilePhone::EServiceActionRegister; |
|
2346 condition=RMobilePhone::ECallForwardingBusy; |
|
2347 iPhone.SetCallForwardingStatus(reqStat,condition, changeInfo); |
|
2348 |
|
2349 // disable EMobilePhoneNotifyCallForwardingStatusChange |
|
2350 iPhone.CancelAsyncRequest(EMobilePhoneNotifyCallForwardingStatusChange); |
|
2351 |
|
2352 User::WaitForRequest(reqStat2); |
|
2353 TEST((reqStat2==KErrCancel)||(reqStat2==KErrNone)); |
|
2354 // because it is NOT assumed no previous CTestGetCFList |
|
2355 INFO_PRINTF2(_L("The notify change returned %d"), reqStat2.Int()); |
|
2356 User::WaitForRequest(reqStat); |
|
2357 TEST(reqStat==KErrNone); |
|
2358 |
|
2359 //Tests on Specific Actions// |
|
2360 |
|
2361 INFO_PRINTF1(_L("Change simtsy config number")); |
|
2362 SetTestNumberL(2); |
|
2363 // there is just a single entry |
|
2364 |
|
2365 // Test case: L.30 - Retrieve the status for all basic services for a specific condition |
|
2366 INFO_PRINTF1(_L("Test case: L.30 - Retrieve the status for all basic services for a specific condition")); |
|
2367 condition=RMobilePhone::ECallForwardingBusy; |
|
2368 // there should be only one entry |
|
2369 ExpectedEntry1.iCondition=RMobilePhone::ECallForwardingBusy; |
|
2370 ExpectedEntry1.iServiceGroup=RMobilePhone::EShortMessageService;//EAllServices;//ECircuitDataService; |
|
2371 ExpectedEntry1.iStatus=RMobilePhone::ECallForwardingStatusActive; |
|
2372 retrieveCFList->SetExpectedResultsL(ExpectedEntry1); |
|
2373 |
|
2374 retrieveCFList->PrintCondition(condition); |
|
2375 retrieveCFList->Start(condition); |
|
2376 CActiveScheduler::Start(); |
|
2377 |
|
2378 // Test case: L.31 - Register a CF condition for all services to registered, whilst there is an active service for that condition |
|
2379 INFO_PRINTF1(_L("Test case: L.31 - Register a CF condition for all services to registered, whilst there is an active service for that condition")); |
|
2380 condition=RMobilePhone::ECallForwardingBusy; |
|
2381 changeInfo.iServiceGroup=RMobilePhone::EAllServices; |
|
2382 changeInfo.iAction=RMobilePhone::EServiceActionRegister; |
|
2383 changeInfo.iNumber.iTelNumber.Copy(newCFNumber); |
|
2384 changeInfo.iTimeout=30; |
|
2385 iPhone.SetCallForwardingStatus(reqStat,condition, changeInfo); |
|
2386 User::WaitForRequest(reqStat); |
|
2387 TEST(reqStat==KErrNone); |
|
2388 |
|
2389 //Retrieve again |
|
2390 ExpectedEntry1.iCondition=RMobilePhone::ECallForwardingBusy; |
|
2391 ExpectedEntry1.iServiceGroup=RMobilePhone::EAllServices; |
|
2392 ExpectedEntry1.iStatus=RMobilePhone::ECallForwardingStatusNotActive; |
|
2393 retrieveCFList->SetExpectedResultsL(ExpectedEntry1); |
|
2394 |
|
2395 condition=RMobilePhone::ECallForwardingBusy; |
|
2396 retrieveCFList->PrintCondition(condition); |
|
2397 retrieveCFList->Start(condition); |
|
2398 CActiveScheduler::Start(); |
|
2399 |
|
2400 // Test case: L.32 - Register a CF condition for one services, whilst all services are registered for that condition |
|
2401 INFO_PRINTF1(_L("Test case: L.32 -Register a CF condition for one services, whilst all services are registered for that condition")); |
|
2402 condition=RMobilePhone::ECallForwardingBusy; |
|
2403 changeInfo.iServiceGroup=RMobilePhone::EFaxService; |
|
2404 changeInfo.iAction=RMobilePhone::EServiceActionRegister; |
|
2405 changeInfo.iNumber.iTelNumber.Copy(newCFNumber1); |
|
2406 changeInfo.iTimeout=20; |
|
2407 iPhone.SetCallForwardingStatus(reqStat,condition, changeInfo); |
|
2408 User::WaitForRequest(reqStat); |
|
2409 TEST(reqStat==KErrNone); |
|
2410 |
|
2411 //Retrieve again for the specific |
|
2412 ExpectedEntry1.iCondition=RMobilePhone::ECallForwardingBusy; |
|
2413 ExpectedEntry1.iServiceGroup=RMobilePhone::EAuxVoiceService; |
|
2414 ExpectedEntry1.iStatus=RMobilePhone::ECallForwardingStatusNotActive; |
|
2415 retrieveCFList->SetExpectedResultsL(ExpectedEntry1); |
|
2416 ExpectedEntry1.iServiceGroup=RMobilePhone::EPacketDataService; |
|
2417 retrieveCFList->SetExpectedResultsL(ExpectedEntry1); |
|
2418 ExpectedEntry1.iServiceGroup=RMobilePhone::EFaxService; |
|
2419 retrieveCFList->SetExpectedResultsL(ExpectedEntry1); |
|
2420 ExpectedEntry1.iServiceGroup=RMobilePhone::EShortMessageService; |
|
2421 retrieveCFList->SetExpectedResultsL(ExpectedEntry1); |
|
2422 ExpectedEntry1.iServiceGroup=RMobilePhone::ECircuitDataService; |
|
2423 retrieveCFList->SetExpectedResultsL(ExpectedEntry1); |
|
2424 ExpectedEntry1.iServiceGroup=RMobilePhone::EVoiceService; |
|
2425 retrieveCFList->SetExpectedResultsL(ExpectedEntry1); |
|
2426 |
|
2427 //retrieve for all - in fact here should return all as enabled |
|
2428 condition=RMobilePhone::ECallForwardingBusy; |
|
2429 retrieveCFList->PrintCondition(condition); |
|
2430 retrieveCFList->Start(condition); |
|
2431 CActiveScheduler::Start(); |
|
2432 |
|
2433 // Test case: L.33 - incorporates L.6 and L.9 with the outcome that there |
|
2434 // are N-1 active service entries in the list and all with the same settings |
|
2435 // as those for all groups. |
|
2436 INFO_PRINTF1(_L("Test case:L.33 - incorporates L.6 and L.9")); |
|
2437 |
|
2438 // Test case: L.34 - Register a previously not registered CF condition for all services to registered |
|
2439 INFO_PRINTF1(_L("Test case: L.34 - Register a previously not registered CF condition for all services to registered")); |
|
2440 changeInfo.iServiceGroup=RMobilePhone::EAllServices; |
|
2441 changeInfo.iAction=RMobilePhone::EServiceActionRegister; |
|
2442 changeInfo.iNumber.iTelNumber.Copy(newCFNumber); |
|
2443 condition=RMobilePhone::ECallForwardingNotReachable; |
|
2444 iPhone.SetCallForwardingStatus(reqStat,condition, changeInfo); |
|
2445 User::WaitForRequest(reqStat); |
|
2446 TEST(reqStat==KErrNone); |
|
2447 |
|
2448 //Retrieve again |
|
2449 ExpectedEntry1.iCondition=RMobilePhone::ECallForwardingNotReachable; |
|
2450 ExpectedEntry1.iServiceGroup=RMobilePhone::EAllServices; |
|
2451 ExpectedEntry1.iStatus=RMobilePhone::ECallForwardingStatusNotActive; |
|
2452 retrieveCFList->SetExpectedResultsL(ExpectedEntry1); |
|
2453 |
|
2454 condition=RMobilePhone::ECallForwardingNotReachable; |
|
2455 retrieveCFList->PrintCondition(condition); |
|
2456 retrieveCFList->Start(condition); |
|
2457 CActiveScheduler::Start(); |
|
2458 |
|
2459 |
|
2460 // Test case: L.35 - Register a previously not registered CF condition for all services to registered |
|
2461 INFO_PRINTF1(_L("Test case: L.35 - Register a previously not registered CF condition for all services to registered")); |
|
2462 changeInfo.iServiceGroup = RMobilePhone::EVoiceService; |
|
2463 changeInfo.iAction=RMobilePhone::EServiceActionActivate; |
|
2464 changeInfo.iNumber.iTelNumber.Copy(newCFNumber); |
|
2465 condition=RMobilePhone::ECallForwardingNotReachable; |
|
2466 iPhone.SetCallForwardingStatus(reqStat,condition, changeInfo); |
|
2467 User::WaitForRequest(reqStat); |
|
2468 TEST(reqStat==KErrNone); |
|
2469 |
|
2470 //Retrieve again |
|
2471 ExpectedEntry1.iCondition=RMobilePhone::ECallForwardingNotReachable; |
|
2472 ExpectedEntry1.iServiceGroup=RMobilePhone::EVoiceService; |
|
2473 ExpectedEntry1.iStatus=RMobilePhone::ECallForwardingStatusActive; |
|
2474 retrieveCFList->SetExpectedResultsL(ExpectedEntry1); |
|
2475 ExpectedEntry1.iStatus=RMobilePhone::ECallForwardingStatusNotActive; |
|
2476 ExpectedEntry1.iServiceGroup=RMobilePhone::EPacketDataService; |
|
2477 retrieveCFList->SetExpectedResultsL(ExpectedEntry1); |
|
2478 ExpectedEntry1.iServiceGroup=RMobilePhone::EFaxService; |
|
2479 retrieveCFList->SetExpectedResultsL(ExpectedEntry1); |
|
2480 ExpectedEntry1.iServiceGroup=RMobilePhone::EShortMessageService; |
|
2481 retrieveCFList->SetExpectedResultsL(ExpectedEntry1); |
|
2482 ExpectedEntry1.iServiceGroup=RMobilePhone::ECircuitDataService; |
|
2483 retrieveCFList->SetExpectedResultsL(ExpectedEntry1); |
|
2484 ExpectedEntry1.iServiceGroup=RMobilePhone::EAuxVoiceService; |
|
2485 retrieveCFList->SetExpectedResultsL(ExpectedEntry1); |
|
2486 |
|
2487 condition=RMobilePhone::ECallForwardingNotReachable; |
|
2488 retrieveCFList->PrintCondition(condition); |
|
2489 retrieveCFList->Start(condition); |
|
2490 CActiveScheduler::Start(); |
|
2491 |
|
2492 //Deactivate call forwarding not reachable active for voice service |
|
2493 // Test case: L.36 - De-activate a previously active CF condition for a single service |
|
2494 INFO_PRINTF1(_L("Test case: L.36 - De-activate a previously active CF condition for a single service")); |
|
2495 changeInfo.iServiceGroup=RMobilePhone::EVoiceService; |
|
2496 changeInfo.iAction=RMobilePhone::EServiceActionDeactivate; |
|
2497 iPhone.SetCallForwardingStatus(reqStat,condition, changeInfo); |
|
2498 User::WaitForRequest(reqStat); |
|
2499 TEST(reqStat==KErrNone); |
|
2500 |
|
2501 // Test case Final Result Retrieve again - in this case the output is different - all services are active bar one |
|
2502 ExpectedEntry1.iCondition=RMobilePhone::ECallForwardingNotReachable; |
|
2503 ExpectedEntry1.iServiceGroup=RMobilePhone::EVoiceService; |
|
2504 ExpectedEntry1.iStatus=RMobilePhone::ECallForwardingStatusNotActive; |
|
2505 retrieveCFList->SetExpectedResultsL(ExpectedEntry1); |
|
2506 ExpectedEntry1.iStatus=RMobilePhone::ECallForwardingStatusNotActive; |
|
2507 ExpectedEntry1.iServiceGroup=RMobilePhone::EPacketDataService; |
|
2508 retrieveCFList->SetExpectedResultsL(ExpectedEntry1); |
|
2509 ExpectedEntry1.iServiceGroup=RMobilePhone::EFaxService; |
|
2510 retrieveCFList->SetExpectedResultsL(ExpectedEntry1); |
|
2511 ExpectedEntry1.iServiceGroup=RMobilePhone::EShortMessageService; |
|
2512 retrieveCFList->SetExpectedResultsL(ExpectedEntry1); |
|
2513 ExpectedEntry1.iServiceGroup=RMobilePhone::ECircuitDataService; |
|
2514 retrieveCFList->SetExpectedResultsL(ExpectedEntry1); |
|
2515 ExpectedEntry1.iServiceGroup=RMobilePhone::EAuxVoiceService; |
|
2516 retrieveCFList->SetExpectedResultsL(ExpectedEntry1); |
|
2517 |
|
2518 condition=RMobilePhone::ECallForwardingNotReachable; |
|
2519 retrieveCFList->PrintCondition(condition); |
|
2520 retrieveCFList->Start(condition); |
|
2521 CActiveScheduler::Start(); |
|
2522 |
|
2523 // just to show that we can deactivate other services |
|
2524 // Test case: L.37 - De-activate a previously active CF condition for a single service |
|
2525 INFO_PRINTF1(_L("Test case: L.37 - De-activate a previously active CF condition for a single service")); |
|
2526 //Deactivate call forwarding not reachable actif for data service |
|
2527 changeInfo.iServiceGroup=RMobilePhone::ECircuitDataService; |
|
2528 changeInfo.iAction=RMobilePhone::EServiceActionDeactivate; |
|
2529 iPhone.SetCallForwardingStatus(reqStat,condition, changeInfo); |
|
2530 User::WaitForRequest(reqStat); |
|
2531 TEST(reqStat==KErrNone); |
|
2532 //Retrieve again |
|
2533 ExpectedEntry1.iCondition=RMobilePhone::ECallForwardingNotReachable; |
|
2534 ExpectedEntry1.iServiceGroup=RMobilePhone::EAuxVoiceService; |
|
2535 ExpectedEntry1.iStatus=RMobilePhone::ECallForwardingStatusActive; |
|
2536 retrieveCFList->SetExpectedResultsL(ExpectedEntry1); |
|
2537 ExpectedEntry1.iServiceGroup=RMobilePhone::EPacketDataService; |
|
2538 retrieveCFList->SetExpectedResultsL(ExpectedEntry1); |
|
2539 ExpectedEntry1.iServiceGroup=RMobilePhone::EFaxService; |
|
2540 retrieveCFList->SetExpectedResultsL(ExpectedEntry1); |
|
2541 ExpectedEntry1.iServiceGroup=RMobilePhone::EShortMessageService; |
|
2542 retrieveCFList->SetExpectedResultsL(ExpectedEntry1); |
|
2543 ExpectedEntry1.iServiceGroup=RMobilePhone::EVoiceService; |
|
2544 ExpectedEntry1.iStatus=RMobilePhone::ECallForwardingStatusNotActive; |
|
2545 retrieveCFList->SetExpectedResultsL(ExpectedEntry1); |
|
2546 ExpectedEntry1.iServiceGroup=RMobilePhone::ECircuitDataService; |
|
2547 retrieveCFList->SetExpectedResultsL(ExpectedEntry1); |
|
2548 |
|
2549 condition=RMobilePhone::ECallForwardingNotReachable; |
|
2550 retrieveCFList->PrintCondition(condition); |
|
2551 retrieveCFList->Start(condition); |
|
2552 CActiveScheduler::Start(); |
|
2553 |
|
2554 // just to show that we can deactivate all services |
|
2555 // Test case: L.38 - De-activate previously active CF condition for a set of single services |
|
2556 INFO_PRINTF1(_L("Test case: L.38 - De-activate previously active CF condition for a set of single services")); |
|
2557 condition=RMobilePhone::ECallForwardingNotReachable; |
|
2558 |
|
2559 changeInfo.iServiceGroup=RMobilePhone::EAllServices; |
|
2560 changeInfo.iAction=RMobilePhone::EServiceActionDeactivate; |
|
2561 iPhone.SetCallForwardingStatus(reqStat,condition, changeInfo); |
|
2562 User::WaitForRequest(reqStat); |
|
2563 TEST(reqStat==KErrNone); |
|
2564 |
|
2565 //Retrieve again |
|
2566 ExpectedEntry1.iCondition=RMobilePhone::ECallForwardingNotReachable; |
|
2567 ExpectedEntry1.iServiceGroup=RMobilePhone::EAuxVoiceService; |
|
2568 ExpectedEntry1.iStatus=RMobilePhone::ECallForwardingStatusNotActive; |
|
2569 retrieveCFList->SetExpectedResultsL(ExpectedEntry1); |
|
2570 ExpectedEntry1.iServiceGroup=RMobilePhone::EPacketDataService; |
|
2571 retrieveCFList->SetExpectedResultsL(ExpectedEntry1); |
|
2572 ExpectedEntry1.iServiceGroup=RMobilePhone::EFaxService; |
|
2573 retrieveCFList->SetExpectedResultsL(ExpectedEntry1); |
|
2574 ExpectedEntry1.iServiceGroup=RMobilePhone::EShortMessageService; |
|
2575 retrieveCFList->SetExpectedResultsL(ExpectedEntry1); |
|
2576 ExpectedEntry1.iServiceGroup=RMobilePhone::EVoiceService; |
|
2577 retrieveCFList->SetExpectedResultsL(ExpectedEntry1); |
|
2578 ExpectedEntry1.iServiceGroup=RMobilePhone::ECircuitDataService; |
|
2579 retrieveCFList->SetExpectedResultsL(ExpectedEntry1); |
|
2580 |
|
2581 condition=RMobilePhone::ECallForwardingNotReachable; |
|
2582 retrieveCFList->PrintCondition(condition); |
|
2583 retrieveCFList->Start(condition); |
|
2584 CActiveScheduler::Start(); |
|
2585 |
|
2586 // cleanup phase; remove |
|
2587 CActiveScheduler::Install(NULL); |
|
2588 CleanupStack::PopAndDestroy(); |
|
2589 delete retrieveCFList; |
|
2590 |
|
2591 INFO_PRINTF1(_L("End CF test")); |
|
2592 return TestStepResult(); |
|
2593 } |
|
2594 |
|
2595 |
|
2596 CTestCallWaiting::CTestCallWaiting() |
|
2597 { |
|
2598 SetTestStepName(_L("TestCallWaiting")); |
|
2599 } |
|
2600 |
|
2601 enum TVerdict CTestCallWaiting::doTestStepL() |
|
2602 /** |
|
2603 * Local function that creates a CTestData object. |
|
2604 * Connects to the ETel Server, loads the phone module (SIM TSY), calls the BeginTest() |
|
2605 * function (which runs the tests) and then disconnects from the ETel Server at |
|
2606 * the end of the tests. |
|
2607 */ |
|
2608 { |
|
2609 CActiveScheduler* actSched=new(ELeave) CActiveScheduler(); |
|
2610 CleanupStack::PushL(actSched); |
|
2611 CActiveScheduler::Install(actSched); |
|
2612 |
|
2613 INFO_PRINTF1(_L("CTestCallWaiting")); |
|
2614 |
|
2615 SetTestNumberL(0); |
|
2616 |
|
2617 TRequestStatus reqStat=KErrNone; |
|
2618 TRequestStatus reqStat2=KErrNone; |
|
2619 |
|
2620 |
|
2621 // Test case: M.1 -retrieve CW status |
|
2622 //expect 1 entry: active for voice as defined in config file |
|
2623 INFO_PRINTF1(_L("Test case: M.1 - Retrieve CW status from config file")); |
|
2624 |
|
2625 CTestGetCWList* retrieveCWList=NULL; |
|
2626 INFO_PRINTF1(_L("Step 1")); |
|
2627 |
|
2628 retrieveCWList = CTestGetCWList::NewLC(iPhone, this); |
|
2629 |
|
2630 RMobilePhone::TMobilePhoneCWInfoEntryV1 ExpectedEntry1; |
|
2631 |
|
2632 ExpectedEntry1.iServiceGroup=RMobilePhone::EVoiceService; |
|
2633 ExpectedEntry1.iStatus=RMobilePhone::ECallWaitingStatusActive; |
|
2634 retrieveCWList->SetExpectedResultsL(ExpectedEntry1); |
|
2635 |
|
2636 retrieveCWList->Start(); |
|
2637 CActiveScheduler::Start(); |
|
2638 |
|
2639 |
|
2640 // Test case: M.2 activate data, notify |
|
2641 //and retrieve list with 2 entries |
|
2642 INFO_PRINTF1(_L("Test case: M.2 - Activate data, notify and retrieve list with 2 entries")); |
|
2643 |
|
2644 RMobilePhone::TMobilePhoneCWInfoEntryV1 aCWInfo; |
|
2645 RMobilePhone::TMobilePhoneCWInfoEntryV1Pckg aCWInfoBufPckg(aCWInfo); |
|
2646 iPhone.NotifyCallWaitingStatusChange(reqStat2,aCWInfoBufPckg); |
|
2647 |
|
2648 iPhone.SetCallWaitingStatus(reqStat,RMobilePhone::ECircuitDataService,RMobilePhone::EServiceActionActivate ); |
|
2649 |
|
2650 User::WaitForRequest(reqStat); |
|
2651 User::WaitForRequest(reqStat2); |
|
2652 TEST(reqStat==KErrNone); |
|
2653 TEST(reqStat2==KErrNone); |
|
2654 TEST(aCWInfo.iServiceGroup == RMobilePhone::ECircuitDataService); |
|
2655 TEST(aCWInfo.iStatus == RMobilePhone::ECallWaitingStatusActive); |
|
2656 |
|
2657 iPhone.NotifyCallWaitingStatusChange(reqStat2,aCWInfoBufPckg); |
|
2658 |
|
2659 ExpectedEntry1.iServiceGroup=RMobilePhone::EVoiceService; |
|
2660 ExpectedEntry1.iStatus=RMobilePhone::ECallWaitingStatusActive; |
|
2661 retrieveCWList->SetExpectedResultsL(ExpectedEntry1); |
|
2662 |
|
2663 ExpectedEntry1.iServiceGroup=RMobilePhone::ECircuitDataService; |
|
2664 ExpectedEntry1.iStatus=RMobilePhone::ECallWaitingStatusActive; |
|
2665 retrieveCWList->SetExpectedResultsL(ExpectedEntry1); |
|
2666 |
|
2667 retrieveCWList->Start(); |
|
2668 CActiveScheduler::Start(); |
|
2669 |
|
2670 // Test case: M.3 - - cancel notification, deactivate voice, |
|
2671 //and retrieve list that contains 1 entry |
|
2672 INFO_PRINTF1(_L("Test case: M.3 - Cancel notification, deactivate voice,and retrieve list that contains 1 entry")); |
|
2673 |
|
2674 //deregister the notification reposted previously |
|
2675 iPhone.CancelAsyncRequest(EMobilePhoneNotifyCallWaitingStatusChange); |
|
2676 User::WaitForRequest(reqStat2); |
|
2677 TEST(reqStat2==KErrCancel); |
|
2678 |
|
2679 iPhone.SetCallWaitingStatus(reqStat,RMobilePhone::EVoiceService,RMobilePhone::EServiceActionDeactivate ); |
|
2680 User::WaitForRequest(reqStat); |
|
2681 |
|
2682 ExpectedEntry1.iServiceGroup=RMobilePhone::ECircuitDataService; |
|
2683 ExpectedEntry1.iStatus=RMobilePhone::ECallWaitingStatusActive; |
|
2684 retrieveCWList->SetExpectedResultsL(ExpectedEntry1); |
|
2685 |
|
2686 retrieveCWList->Start(); |
|
2687 CActiveScheduler::Start(); |
|
2688 |
|
2689 |
|
2690 // Test case: M.4 - activate all and retrieve list that contains 1 entry |
|
2691 INFO_PRINTF1(_L("Test case: M.4 - activate all and retrieve list that contains 1 entry")); |
|
2692 |
|
2693 iPhone.SetCallWaitingStatus(reqStat,RMobilePhone::EAllServices,RMobilePhone::EServiceActionActivate ); |
|
2694 User::WaitForRequest(reqStat); |
|
2695 |
|
2696 ExpectedEntry1.iServiceGroup=RMobilePhone::EAllServices; |
|
2697 ExpectedEntry1.iStatus=RMobilePhone::ECallWaitingStatusActive; |
|
2698 retrieveCWList->SetExpectedResultsL(ExpectedEntry1); |
|
2699 |
|
2700 retrieveCWList->Start(); |
|
2701 CActiveScheduler::Start(); |
|
2702 |
|
2703 |
|
2704 // Test case: M.5 - Deactivate 1 and retrieve list that active entries for all but this one |
|
2705 INFO_PRINTF1(_L("Test case: M.5 - Deactivate 1 and retrieve list that active entries for all but this oney")); |
|
2706 |
|
2707 iPhone.SetCallWaitingStatus(reqStat,RMobilePhone::EPacketDataService,RMobilePhone::EServiceActionDeactivate ); |
|
2708 User::WaitForRequest(reqStat); |
|
2709 |
|
2710 ExpectedEntry1.iServiceGroup=RMobilePhone::EVoiceService; |
|
2711 ExpectedEntry1.iStatus=RMobilePhone::ECallWaitingStatusActive; |
|
2712 retrieveCWList->SetExpectedResultsL(ExpectedEntry1); |
|
2713 |
|
2714 ExpectedEntry1.iServiceGroup=RMobilePhone::EAuxVoiceService; |
|
2715 retrieveCWList->SetExpectedResultsL(ExpectedEntry1); |
|
2716 |
|
2717 ExpectedEntry1.iServiceGroup=RMobilePhone::ECircuitDataService; |
|
2718 retrieveCWList->SetExpectedResultsL(ExpectedEntry1); |
|
2719 |
|
2720 ExpectedEntry1.iServiceGroup=RMobilePhone::EFaxService; |
|
2721 retrieveCWList->SetExpectedResultsL(ExpectedEntry1); |
|
2722 |
|
2723 retrieveCWList->Start(); |
|
2724 CActiveScheduler::Start(); |
|
2725 |
|
2726 |
|
2727 // Test case: M.6 - deactivate all and retrieve list that contains 1 entries |
|
2728 INFO_PRINTF1(_L("Test case: M.6 - Deactivate all and retrieve list that contains 1 entries")); |
|
2729 |
|
2730 iPhone.SetCallWaitingStatus(reqStat,RMobilePhone::EAllServices,RMobilePhone::EServiceActionDeactivate ); |
|
2731 User::WaitForRequest(reqStat); |
|
2732 |
|
2733 ExpectedEntry1.iServiceGroup=RMobilePhone::EAllServices; |
|
2734 ExpectedEntry1.iStatus=RMobilePhone::ECallWaitingStatusNotActive; |
|
2735 retrieveCWList->SetExpectedResultsL(ExpectedEntry1); |
|
2736 |
|
2737 retrieveCWList->Start(); |
|
2738 CActiveScheduler::Start(); |
|
2739 |
|
2740 // cleanup phase; remove |
|
2741 CActiveScheduler::Install(NULL); |
|
2742 CleanupStack::PopAndDestroy(); |
|
2743 delete retrieveCWList; |
|
2744 |
|
2745 INFO_PRINTF1(_L("End CW test")); |
|
2746 return TestStepResult(); |
|
2747 } |
|
2748 |
|
2749 CTestIdentityService::CTestIdentityService() |
|
2750 { |
|
2751 SetTestStepName(_L("TestIdentityService")); |
|
2752 } |
|
2753 |
|
2754 enum TVerdict CTestIdentityService::doTestStepL() |
|
2755 /** |
|
2756 * Local function that creates a CTestData object. |
|
2757 * Connects to the ETel Server, loads the phone module (SIM TSY), calls the BeginTest() |
|
2758 * function (which runs the tests) and then disconnects from the ETel Server at |
|
2759 * the end of the tests. |
|
2760 */ |
|
2761 { |
|
2762 CActiveScheduler* actSched=new(ELeave) CActiveScheduler(); |
|
2763 CleanupStack::PushL(actSched); |
|
2764 CActiveScheduler::Install(actSched); |
|
2765 |
|
2766 INFO_PRINTF1(_L("CTestIdentityService")); |
|
2767 INFO_PRINTF1(_L("Change simtsy config number")); |
|
2768 |
|
2769 SetTestNumberL(3); |
|
2770 TRequestStatus reqStat=KErrNone; |
|
2771 RMobilePhone::TMobilePhoneIdServiceStatus IdServiceStat; |
|
2772 RMobilePhone::TMobilePhoneIdService IdService=RMobilePhone::EIdServiceCallerPresentation; |
|
2773 |
|
2774 // Test case: N.1 - Get Caller presentation status |
|
2775 INFO_PRINTF1(_L("Test case: N.1 - Get Caller presentation status")); |
|
2776 iPhone.GetIdentityServiceStatus(reqStat, IdService, IdServiceStat, RMobilePhone::EInfoLocationNetwork); |
|
2777 User::WaitForRequest(reqStat); |
|
2778 TEST(reqStat==KErrNone); |
|
2779 TEST(IdServiceStat==RMobilePhone::EIdServiceActivePermanent); |
|
2780 PrintIdServiceStatus(IdServiceStat, IdService); |
|
2781 |
|
2782 // Test case: N.2 - Get Caller restriction status |
|
2783 INFO_PRINTF1(_L("Test case: N.2 - Get Caller restriction status")); |
|
2784 IdService=RMobilePhone::EIdServiceCallerRestriction; |
|
2785 iPhone.GetIdentityServiceStatus(reqStat, IdService, IdServiceStat, RMobilePhone::EInfoLocationNetwork); |
|
2786 User::WaitForRequest(reqStat); |
|
2787 TEST(reqStat==KErrNone); |
|
2788 TEST(IdServiceStat==RMobilePhone::EIdServiceActiveDefaultRestricted); |
|
2789 PrintIdServiceStatus(IdServiceStat, IdService); |
|
2790 |
|
2791 // Test case: N.3 - Get connected presentation status |
|
2792 INFO_PRINTF1(_L("Test case: N.3 - Get connected presentation status")); |
|
2793 IdService=RMobilePhone::EIdServiceConnectedPresentation; |
|
2794 iPhone.GetIdentityServiceStatus(reqStat, IdService, IdServiceStat, RMobilePhone::EInfoLocationNetwork); |
|
2795 User::WaitForRequest(reqStat); |
|
2796 TEST(reqStat==KErrNone); |
|
2797 TEST(IdServiceStat==RMobilePhone::EIdServiceActiveDefaultAllowed); |
|
2798 PrintIdServiceStatus(IdServiceStat, IdService); |
|
2799 |
|
2800 // Test case: N.4 - Get connected restriction status |
|
2801 INFO_PRINTF1(_L("Test case: N.4 - Get connected restriction status")); |
|
2802 IdService=RMobilePhone::EIdServiceConnectedRestriction; |
|
2803 iPhone.GetIdentityServiceStatus(reqStat, IdService, IdServiceStat, RMobilePhone::EInfoLocationNetwork); |
|
2804 User::WaitForRequest(reqStat); |
|
2805 TEST(reqStat==KErrNone); |
|
2806 TEST(IdServiceStat==RMobilePhone::EIdServiceNotProvisioned); |
|
2807 PrintIdServiceStatus(IdServiceStat, IdService); |
|
2808 |
|
2809 // Test case: N.5 - Get caller name status |
|
2810 INFO_PRINTF1(_L("Test case: N.5 - Get caller name status")); |
|
2811 IdService=RMobilePhone::EIdServiceCallerName; |
|
2812 iPhone.GetIdentityServiceStatus(reqStat, IdService, IdServiceStat, RMobilePhone::EInfoLocationNetwork); |
|
2813 User::WaitForRequest(reqStat); |
|
2814 TEST(reqStat==KErrNone); |
|
2815 TEST(IdServiceStat==RMobilePhone::EIdServiceActivePermanent); |
|
2816 PrintIdServiceStatus(IdServiceStat, IdService); |
|
2817 |
|
2818 // Test case: N.6 - Get called presentation status |
|
2819 INFO_PRINTF1(_L("Test case: N.6 - Get called presentation status")); |
|
2820 IdService=RMobilePhone::EIdServiceCalledPresentation; |
|
2821 iPhone.GetIdentityServiceStatus(reqStat, IdService, IdServiceStat, RMobilePhone::EInfoLocationNetwork); |
|
2822 User::WaitForRequest(reqStat); |
|
2823 TEST(reqStat==KErrNone); |
|
2824 TEST(IdServiceStat==RMobilePhone::EIdServiceActiveDefaultRestricted); |
|
2825 PrintIdServiceStatus(IdServiceStat, IdService); |
|
2826 INFO_PRINTF1(_L("")); |
|
2827 |
|
2828 CActiveScheduler::Install(NULL); |
|
2829 CleanupStack::PopAndDestroy(actSched); |
|
2830 //Retrieve the status |
|
2831 return TestStepResult(); |
|
2832 |
|
2833 } |
|
2834 |
|
2835 void CTestIdentityService::PrintIdServiceStatus(RMobilePhone::TMobilePhoneIdServiceStatus aIdServiceStat, RMobilePhone::TMobilePhoneIdService aIdService) |
|
2836 { |
|
2837 TBuf<200> IdServiceStatus; |
|
2838 TBuf<200> IdService; |
|
2839 |
|
2840 switch (aIdServiceStat) |
|
2841 { |
|
2842 case RMobilePhone::EIdServiceActivePermanent: |
|
2843 IdServiceStatus = _L("EIdServiceActivePermanent"); |
|
2844 break; |
|
2845 case RMobilePhone::EIdServiceActiveDefaultRestricted: |
|
2846 IdServiceStatus = _L("EIdServiceActiveDefaultRestricted"); |
|
2847 break; |
|
2848 case RMobilePhone::EIdServiceActiveDefaultAllowed: |
|
2849 IdServiceStatus = _L("EIdServiceActiveDefaultAllowed"); |
|
2850 break; |
|
2851 case RMobilePhone::EIdServiceNotProvisioned: |
|
2852 IdServiceStatus = _L("EIdServiceNotProvisioned"); |
|
2853 break; |
|
2854 case RMobilePhone::EIdServiceUnknown: |
|
2855 IdServiceStatus = _L("EIdServiceUnknown"); |
|
2856 break; |
|
2857 default: |
|
2858 break; |
|
2859 } |
|
2860 |
|
2861 switch (aIdService) |
|
2862 { |
|
2863 case RMobilePhone::EIdServiceUnspecified: |
|
2864 IdService = _L("EIdServiceUnspecified"); |
|
2865 break; |
|
2866 case RMobilePhone::EIdServiceCallerPresentation: |
|
2867 IdService = _L("EIdServiceCallerPresentation"); |
|
2868 break; |
|
2869 case RMobilePhone::EIdServiceCallerRestriction: |
|
2870 IdService = _L("EIdServiceCallerRestriction"); |
|
2871 break; |
|
2872 case RMobilePhone::EIdServiceConnectedPresentation: |
|
2873 IdService = _L("EIdServiceConnectedPresentation"); |
|
2874 break; |
|
2875 case RMobilePhone::EIdServiceConnectedRestriction: |
|
2876 IdService = _L("EIdServiceConnectedRestriction"); |
|
2877 break; |
|
2878 case RMobilePhone::EIdServiceCallerName: |
|
2879 IdService = _L("EIdServiceCallerName"); |
|
2880 break; |
|
2881 case RMobilePhone::EIdServiceCalledPresentation: |
|
2882 IdService = _L("EIdServiceCalledPresentation"); |
|
2883 break; |
|
2884 default: |
|
2885 break; |
|
2886 } |
|
2887 |
|
2888 INFO_PRINTF3(_L("Phone Identity Status for >%S< = >%S<"),&IdService,&IdServiceStatus); |
|
2889 } |