|
1 // Copyright (c) 1997-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 // Dial API Test main test code. |
|
15 // |
|
16 // |
|
17 |
|
18 |
|
19 |
|
20 /** |
|
21 @file |
|
22 */ |
|
23 #include "DIALUTIL.H" |
|
24 |
|
25 #include "TE_DialBase.h" |
|
26 #include "TE_DialTest.h" |
|
27 |
|
28 |
|
29 // |
|
30 // Constants... |
|
31 // |
|
32 _LIT(KUkIntlPrefCode, "00"); |
|
33 _LIT(KUkNatPrefCode, "0"); |
|
34 _LIT(KUkNatCode, "44"); |
|
35 _LIT(KUkLondonAreaCode, "20"); |
|
36 _LIT(KUkBirminghamAreaCode, "121"); |
|
37 |
|
38 |
|
39 /** |
|
40 * Each test step initialises it's own name |
|
41 */ |
|
42 CDialTestTest1::CDialTestTest1() |
|
43 { |
|
44 // |
|
45 // Store the name of this test case. This is the name that is used by |
|
46 // the script file. |
|
47 // |
|
48 SetTestStepName(_L("Test1")); |
|
49 } // CDialTestTest1::CDialTestTest1 |
|
50 |
|
51 |
|
52 /** |
|
53 * This test performs Test 1 of the Dial API. |
|
54 * |
|
55 * @return Test verdict for this test. |
|
56 */ |
|
57 enum TVerdict CDialTestTest1::doTestStepL() |
|
58 { |
|
59 INFO_PRINTF1(_L("At home calling Joan")); |
|
60 |
|
61 TChargeCard chargeCard; |
|
62 TDialLocation dialLocation; |
|
63 |
|
64 dialLocation.SetIntlPrefCode(KUkIntlPrefCode); |
|
65 dialLocation.SetNatPrefCode(KUkNatPrefCode); |
|
66 dialLocation.SetNatCode(KUkNatCode); |
|
67 dialLocation.SetAreaCode(KUkLondonAreaCode); |
|
68 |
|
69 TDialString dialString; |
|
70 TPhoneNumber numberToDial = _L("+44 (163) 296 0000"); // call Birmingham UK |
|
71 |
|
72 TInt ret = TelephoneNumber::Parse(dialString, dialLocation, |
|
73 chargeCard, numberToDial, EForDialing); |
|
74 TESTCHECK(ret, KErrNone); |
|
75 _LIT(KExpectedDialString1, "T01632960000"); |
|
76 TESTCHECKSTR(dialString, KExpectedDialString1); |
|
77 |
|
78 // next test |
|
79 INFO_PRINTF1(_L("Office-Long distance")); |
|
80 |
|
81 dialLocation.SetDialOutLongDistanceCode(_L("9")); |
|
82 ret = TelephoneNumber::Parse(dialString, dialLocation, |
|
83 chargeCard, numberToDial, EForDialing); |
|
84 TESTCHECK(ret, KErrNone); |
|
85 _LIT(KExpectedDialString2, "T9,01632960000"); |
|
86 TESTCHECKSTR(dialString, KExpectedDialString2); |
|
87 |
|
88 //next |
|
89 INFO_PRINTF1(_L("Office-local")); |
|
90 dialLocation.SetAreaCode(KUkBirminghamAreaCode); |
|
91 dialLocation.SetDialOutLocalCode(_L("8")); |
|
92 |
|
93 ret = TelephoneNumber::Parse(dialString, dialLocation, |
|
94 chargeCard, numberToDial, EForDialing); |
|
95 TESTCHECK(ret, KErrNone); |
|
96 _LIT(KExpectedDialString3, "T9,01632960000"); |
|
97 TESTCHECKSTR(dialString, KExpectedDialString3); |
|
98 |
|
99 //next |
|
100 INFO_PRINTF1(_L("Office-Long")); |
|
101 dialLocation.SetAreaCode(KUkLondonAreaCode); |
|
102 dialLocation.SetDialLocationFlags(KPhoneNumberPbxUsePulseDial); |
|
103 |
|
104 ret = TelephoneNumber::Parse(dialString, dialLocation, |
|
105 chargeCard, numberToDial, EForDialing); |
|
106 TESTCHECK(ret, KErrNone); |
|
107 _LIT(KExpectedDialString4, "P9,T01632960000"); |
|
108 TESTCHECKSTR(dialString, KExpectedDialString4); |
|
109 |
|
110 return TestStepResult(); |
|
111 } // CDialTestTest1::CDialTestTest1 |
|
112 |
|
113 |
|
114 /** |
|
115 * Each test step initialises it's own name |
|
116 */ |
|
117 CDialTestTest2::CDialTestTest2() |
|
118 { |
|
119 // |
|
120 // Store the name of this test case. This is the name that is used by |
|
121 // the script file. |
|
122 // |
|
123 SetTestStepName(_L("Test2")); |
|
124 } // CDialTestTest2::CDialTestTest2 |
|
125 |
|
126 |
|
127 /** |
|
128 * This test performs Test 2 of the Dial API. |
|
129 * |
|
130 * @return Test verdict for this test. |
|
131 */ |
|
132 enum TVerdict CDialTestTest2::doTestStepL() |
|
133 { |
|
134 INFO_PRINTF1(_L("Using mobile phone")); |
|
135 |
|
136 TChargeCard chargeCard; |
|
137 TDialLocation dialLocation; |
|
138 |
|
139 dialLocation.SetIntlPrefCode(KUkIntlPrefCode); |
|
140 dialLocation.SetNatPrefCode(KUkNatPrefCode); |
|
141 dialLocation.SetNatCode(KUkNatCode); |
|
142 dialLocation.SetAreaCode(KUkLondonAreaCode); |
|
143 |
|
144 TDialString dialString; |
|
145 TPhoneNumber numberToDialInUK = _L("+44 (163) 296 0000"); |
|
146 TPhoneNumber numberToDialInUSA = _L("+1 (163) 296 0000"); |
|
147 TPhoneNumber numberToDialInLondon = _L("+44 (16) 3296 0000"); |
|
148 |
|
149 INFO_PRINTF1(_L("Mobile - Long distance")); |
|
150 dialLocation.SetDialLocationFlags(KPhoneNumberMobile); |
|
151 |
|
152 TInt ret = TelephoneNumber::Parse(dialString, dialLocation, chargeCard, |
|
153 numberToDialInUK, EForDialing); |
|
154 TESTCHECK(ret, KErrNone); |
|
155 _LIT(KExpectedDialString1, "01632960000"); |
|
156 TESTCHECKSTR(dialString, KExpectedDialString1); |
|
157 |
|
158 // for release 012 |
|
159 dialLocation.SetDialLocationFlags(KReturnPhoneNumberWithPlusFormat); |
|
160 ret = TelephoneNumber::Parse(dialString, dialLocation, chargeCard, |
|
161 numberToDialInUK, EForDialing); |
|
162 TESTCHECK(ret, KErrNone); |
|
163 _LIT(KExpectedDialString2, "+441632960000"); |
|
164 TESTCHECKSTR(dialString, KExpectedDialString2); |
|
165 dialLocation.ClearDialLocationFlags(KReturnPhoneNumberWithPlusFormat); |
|
166 |
|
167 INFO_PRINTF1(_L("Mobile - Intl call")); |
|
168 ret = TelephoneNumber::Parse(dialString, dialLocation, |
|
169 chargeCard, numberToDialInUSA, EForDialing); |
|
170 TESTCHECK(ret, KErrNone); |
|
171 _LIT(KExpectedDialString3, "0011632960000"); |
|
172 TESTCHECKSTR(dialString, KExpectedDialString3); |
|
173 |
|
174 // for release 012 |
|
175 dialLocation.SetDialLocationFlags(KReturnPhoneNumberWithPlusFormat); |
|
176 ret = TelephoneNumber::Parse(dialString, dialLocation, |
|
177 chargeCard, numberToDialInUSA, EForDialing); |
|
178 TESTCHECK(ret, KErrNone); |
|
179 _LIT(KExpectedDialString4, "+11632960000"); |
|
180 TESTCHECKSTR(dialString, KExpectedDialString4); |
|
181 dialLocation.ClearDialLocationFlags(KReturnPhoneNumberWithPlusFormat); |
|
182 |
|
183 // this should be the same as long distance call |
|
184 // no concept of a local call using mobile phone ! |
|
185 INFO_PRINTF1(_L("Mobile - Call in same area")); |
|
186 ret = TelephoneNumber::Parse(dialString,dialLocation, chargeCard, |
|
187 numberToDialInLondon, EForDialing); |
|
188 TESTCHECK(ret, KErrNone); |
|
189 _LIT(KExpectedDialString5, "01632960000"); |
|
190 TESTCHECKSTR(dialString, KExpectedDialString5); |
|
191 |
|
192 // for release 012 |
|
193 dialLocation.SetDialLocationFlags(KReturnPhoneNumberWithPlusFormat); |
|
194 ret = TelephoneNumber::Parse(dialString, dialLocation, chargeCard, |
|
195 numberToDialInLondon, EForDialing); |
|
196 TESTCHECK(ret, KErrNone); |
|
197 _LIT(KExpectedDialString6, "+441632960000"); |
|
198 TESTCHECKSTR(dialString, KExpectedDialString6); |
|
199 dialLocation.ClearDialLocationFlags(KReturnPhoneNumberWithPlusFormat); |
|
200 |
|
201 return TestStepResult(); |
|
202 } // CDialTestTest2::CDialTestTest2 |
|
203 |
|
204 |
|
205 /** |
|
206 * Each test step initialises it's own name |
|
207 */ |
|
208 CDialTestTest3::CDialTestTest3() |
|
209 { |
|
210 // |
|
211 // Store the name of this test case. This is the name that is used by |
|
212 // the script file. |
|
213 // |
|
214 SetTestStepName(_L("Test3")); |
|
215 } // CDialTestTest3::CDialTestTest3 |
|
216 |
|
217 |
|
218 /** |
|
219 * This test performs Test 3 of the Dial API. |
|
220 * |
|
221 * @return Test verdict for this test. |
|
222 */ |
|
223 enum TVerdict CDialTestTest3::doTestStepL() |
|
224 { |
|
225 INFO_PRINTF1(_L("Test Calling card")); |
|
226 |
|
227 // This is a BT charge card |
|
228 TChargeCard chargeCard; |
|
229 TDialLocation dialLocation; |
|
230 |
|
231 dialLocation.SetIntlPrefCode(KUkIntlPrefCode); |
|
232 dialLocation.SetNatPrefCode(KUkNatPrefCode); |
|
233 dialLocation.SetNatCode(KUkNatCode); |
|
234 dialLocation.SetAreaCode(KUkLondonAreaCode); |
|
235 |
|
236 TDialString dialString; |
|
237 |
|
238 chargeCard.SetNumber(_L("123456")); //iNumber |
|
239 chargeCard.SetPin(_L("3681")); //iPin |
|
240 chargeCard.SetLocalRule(_L("144,,H,0FG")); //iLocalRule |
|
241 chargeCard.SetNatRule(_L("144,,H,0FG")); //iLongDistanceRule |
|
242 chargeCard.SetIntlRule(_L("144,,H,00EFG")); //iIntlRule |
|
243 |
|
244 TPhoneNumber numberInLondon = _L("+44 (16) 3296 0000"); |
|
245 TInt ret = TelephoneNumber::Parse(dialString, dialLocation, chargeCard, |
|
246 numberInLondon, EForDialing); |
|
247 TESTCHECK(ret, KErrNone); |
|
248 _LIT(KExpectedDialString1, "T144,,1234563681,01632960000"); |
|
249 TESTCHECKSTR(dialString, KExpectedDialString1); |
|
250 |
|
251 INFO_PRINTF1(_L("Call inter. with charge card")); |
|
252 |
|
253 TPhoneNumber numberToDialInUSA = _L("+1 (163) 296 0000"); |
|
254 ret = TelephoneNumber::Parse(dialString, dialLocation, chargeCard, |
|
255 numberToDialInUSA, EForDialing); |
|
256 TESTCHECK(ret, KErrNone); |
|
257 _LIT(KExpectedDialString2, "T144,,1234563681,0011632960000"); |
|
258 TESTCHECKSTR(dialString, KExpectedDialString2); |
|
259 |
|
260 return TestStepResult(); |
|
261 } // CDialTestTest3::CDialTestTest3 |
|
262 |
|
263 |
|
264 /** |
|
265 * Each test step initialises it's own name |
|
266 */ |
|
267 CDialTestTest4::CDialTestTest4() |
|
268 { |
|
269 // |
|
270 // Store the name of this test case. This is the name that is used by |
|
271 // the script file. |
|
272 // |
|
273 SetTestStepName(_L("Test4")); |
|
274 } // CDialTestTest4::CDialTestTest4 |
|
275 |
|
276 |
|
277 /** |
|
278 * This test performs Test 4 of the Dial API. |
|
279 * |
|
280 * @return Test verdict for this test. |
|
281 */ |
|
282 enum TVerdict CDialTestTest4::doTestStepL() |
|
283 { |
|
284 INFO_PRINTF1(_L("Test Calling with Letter dialing")); |
|
285 |
|
286 #if 0 |
|
287 // This is a BT charge card |
|
288 TChargeCard chargeCard; |
|
289 TDialLocation dialLocation; |
|
290 |
|
291 dialLocation.SetIntlPrefCode(KUkIntlPrefCode); |
|
292 dialLocation.SetNatPrefCode(KUkNatPrefCode); |
|
293 dialLocation.SetNatCode(KUkNatCode); |
|
294 dialLocation.SetAreaCode(KUkLondonAreaCode); |
|
295 |
|
296 TDialString dialString; |
|
297 |
|
298 chargeCard.SetNumber(_L("112233")); //iNumber |
|
299 chargeCard.SetPin(_L("3681")); //iPin |
|
300 chargeCard.SetLocalRule(_L("144,,H,0FG")); //iLocalRule |
|
301 chargeCard.SetNatRule(_L("144,,H,0FG")); //iLongDistanceRule |
|
302 chargeCard.SetIntlRule(_L("144,,H,00EFG")); //iIntlRule |
|
303 |
|
304 TPhoneNumber telNumber = _L("+44 (20) 7PSION3A"); |
|
305 TInt ret = TelephoneNumber::Parse(dialString, dialLocation, |
|
306 chargeCard, telNumber, EForDialing); |
|
307 TESTCHECK(ret, KErrNone); |
|
308 _LIT(KExpectedDialString1, "T144,,1122333681,01632960000"); |
|
309 TESTCHECKSTR(dialString, KExpectedDialString1); |
|
310 |
|
311 |
|
312 INFO_PRINTF1(_L("Call inter. with charge card")); |
|
313 telNumber = _L("+1 (510) HAVE FUN"); |
|
314 ret = TelephoneNumber::Parse(dialString, dialLocation, |
|
315 chargeCard, telNumber, EForDialing); |
|
316 TESTCHECK(ret, KErrNone) |
|
317 _LIT(KExpectedDialString2, "T144,,1122333681,01632960000"); |
|
318 TESTCHECKSTR(dialString, KExpectedDialString2); |
|
319 |
|
320 _LIT(KExpectedTelNumber, "+1 (510) HAVE FUN"); |
|
321 TESTCHECKSTR(telNumber, KExpectedTelNumber); |
|
322 #else |
|
323 INFO_PRINTF1(_L("This test has been deactivated")); |
|
324 #endif |
|
325 |
|
326 return TestStepResult(); |
|
327 } // CDialTestTest4::CDialTestTest4 |
|
328 |
|
329 |
|
330 /** |
|
331 * Each test step initialises it's own name |
|
332 */ |
|
333 CDialTestTest5::CDialTestTest5() |
|
334 { |
|
335 // |
|
336 // Store the name of this test case. This is the name that is used by |
|
337 // the script file. |
|
338 // |
|
339 SetTestStepName(_L("Test5")); |
|
340 } // CDialTestTest5::CDialTestTest5 |
|
341 |
|
342 |
|
343 /** |
|
344 * This test performs Test 5 of the Dial API. |
|
345 * |
|
346 * @return Test verdict for this test. |
|
347 */ |
|
348 enum TVerdict CDialTestTest5::doTestStepL() |
|
349 { |
|
350 TPhoneNumber numberList[2] = {_L("+44(163)2960000"), _L("+44 (163) 2960000")}; |
|
351 TInt index; |
|
352 |
|
353 for (index = 0; index < 2; index++) |
|
354 { |
|
355 INFO_PRINTF1(_L("At home calling Joan")); |
|
356 |
|
357 TChargeCard chargeCard; |
|
358 TDialLocation dialLocation; |
|
359 |
|
360 dialLocation.SetIntlPrefCode(KUkIntlPrefCode); |
|
361 dialLocation.SetNatPrefCode(KUkNatPrefCode); |
|
362 dialLocation.SetNatCode(KUkNatCode); |
|
363 dialLocation.SetAreaCode(KUkLondonAreaCode); |
|
364 |
|
365 TDialString dialString ; |
|
366 TPhoneNumber numberToDial = numberList[index]; |
|
367 |
|
368 TInt ret = TelephoneNumber::Parse(dialString, dialLocation, |
|
369 chargeCard, numberToDial, EForDialing); |
|
370 TESTCHECK(ret, KErrNone); |
|
371 _LIT(KExpectedDialString1, "T01632960000"); |
|
372 TESTCHECKSTR(dialString, KExpectedDialString1); |
|
373 |
|
374 // next test |
|
375 INFO_PRINTF1(_L("Office-Long distance")); |
|
376 dialLocation.SetDialOutLongDistanceCode(_L("9")); |
|
377 ret = TelephoneNumber::Parse(dialString, dialLocation, |
|
378 chargeCard, numberToDial, EForDialing); |
|
379 TESTCHECK(ret, KErrNone); |
|
380 _LIT(KExpectedDialString2, "T9,01632960000"); |
|
381 TESTCHECKSTR(dialString,KExpectedDialString2); |
|
382 |
|
383 //next |
|
384 INFO_PRINTF1(_L("Office-local")); |
|
385 dialLocation.SetAreaCode(KUkBirminghamAreaCode); |
|
386 dialLocation.SetDialOutLocalCode(_L("8")); |
|
387 ret = TelephoneNumber::Parse(dialString, dialLocation, |
|
388 chargeCard, numberToDial, EForDialing); |
|
389 TESTCHECK(ret, KErrNone) |
|
390 _LIT(KExpectedDialString3, "T9,01632960000"); |
|
391 TESTCHECKSTR(dialString, KExpectedDialString3); |
|
392 |
|
393 //next |
|
394 INFO_PRINTF1(_L("Office-Long")); |
|
395 dialLocation.SetAreaCode(KUkLondonAreaCode); |
|
396 dialLocation.SetDialLocationFlags(KPhoneNumberPbxUsePulseDial); |
|
397 ret = TelephoneNumber::Parse(dialString, dialLocation, |
|
398 chargeCard, numberToDial, EForDialing); |
|
399 TESTCHECK(ret, KErrNone); |
|
400 _LIT(KExpectedDialString4, "P9,T01632960000"); |
|
401 TESTCHECKSTR(dialString, KExpectedDialString4); |
|
402 } |
|
403 |
|
404 return TestStepResult(); |
|
405 } // CDialTestTest5::CDialTestTest5 |
|
406 |
|
407 |
|
408 /** |
|
409 * Each test step initialises it's own name |
|
410 */ |
|
411 CDialTestTest6::CDialTestTest6() |
|
412 { |
|
413 // |
|
414 // Store the name of this test case. This is the name that is used by |
|
415 // the script file. |
|
416 // |
|
417 SetTestStepName(_L("Test6")); |
|
418 } // CDialTestTest6::CDialTestTest6 |
|
419 |
|
420 |
|
421 /** |
|
422 * This test performs Test 6 of the Dial API. |
|
423 * |
|
424 * @return Test verdict for this test. |
|
425 */ |
|
426 enum TVerdict CDialTestTest6::doTestStepL() |
|
427 { |
|
428 INFO_PRINTF1(_L("Dialing for Time World Phone resolution")); |
|
429 |
|
430 TDialString dialString; |
|
431 TChar codeSeparator = KCharSpace; |
|
432 |
|
433 TCityDialCodes londonUK; // London |
|
434 londonUK.iAreaCode = KUkLondonAreaCode; |
|
435 londonUK.iNatCode = KUkNatCode; |
|
436 londonUK.iNatPref = KUkNatPrefCode; |
|
437 londonUK.iIntlPref = KUkIntlPrefCode; |
|
438 |
|
439 TCityDialCodes birmingham ; // Birmingham |
|
440 birmingham.iAreaCode = KUkBirminghamAreaCode; |
|
441 birmingham.iNatCode = KUkNatCode; |
|
442 birmingham.iNatPref = KUkNatPrefCode; |
|
443 birmingham.iIntlPref = KUkIntlPrefCode; |
|
444 |
|
445 TCityDialCodes sanFr ; // San Francisco |
|
446 sanFr.iAreaCode = _L("415"); |
|
447 sanFr.iNatCode = _L("1"); |
|
448 sanFr.iNatPref = _L("1"); |
|
449 sanFr.iIntlPref = _L("011"); |
|
450 |
|
451 TCityDialCodes washingtonDC ; |
|
452 washingtonDC.iAreaCode = _L("202"); |
|
453 washingtonDC.iNatCode = _L("1"); |
|
454 washingtonDC.iNatPref = _L("1"); |
|
455 washingtonDC.iIntlPref = _L("011"); |
|
456 |
|
457 TCityDialCodes kingstonJam ; |
|
458 kingstonJam.iAreaCode = _L("80992"); |
|
459 kingstonJam.iNatCode = _L("1"); |
|
460 kingstonJam.iNatPref = _L("1"); |
|
461 kingstonJam.iIntlPref = _L("011"); |
|
462 |
|
463 // |
|
464 // International dialing... |
|
465 // |
|
466 INFO_PRINTF1(_L("International dialing")); |
|
467 TInt ret = TelephoneNumber::CalculateDialCityPrefix( |
|
468 dialString, londonUK, sanFr, |
|
469 EDialCityStripDuplicateAreaCode, codeSeparator , |
|
470 EPlusFormatDialNotAllow); |
|
471 TESTCHECK(ret, KErrNone); |
|
472 _LIT(KExpectedDialString1, "00 1 415"); |
|
473 TESTCHECKSTR(dialString, KExpectedDialString1); |
|
474 |
|
475 // no diff |
|
476 ret = TelephoneNumber::CalculateDialCityPrefix( |
|
477 dialString, londonUK, sanFr, |
|
478 EDialCityAllowDuplicateAreaCode, codeSeparator, |
|
479 EPlusFormatDialNotAllow); |
|
480 TESTCHECK(ret, KErrNone); |
|
481 _LIT(KExpectedDialString2, "00 1 415"); |
|
482 TESTCHECKSTR(dialString, KExpectedDialString2); |
|
483 |
|
484 ret = TelephoneNumber::CalculateDialCityPrefix( |
|
485 dialString, sanFr, londonUK , |
|
486 EDialCityStripDuplicateAreaCode, codeSeparator, |
|
487 EPlusFormatDialNotAllow); |
|
488 TESTCHECK(ret, KErrNone); |
|
489 _LIT(KExpectedDialString3, "011 44 20"); |
|
490 TESTCHECKSTR(dialString, KExpectedDialString3); |
|
491 |
|
492 // no diff |
|
493 ret = TelephoneNumber::CalculateDialCityPrefix( |
|
494 dialString, sanFr , londonUK, |
|
495 EDialCityAllowDuplicateAreaCode, codeSeparator, |
|
496 EPlusFormatDialNotAllow); |
|
497 TESTCHECK(ret, KErrNone); |
|
498 _LIT(KExpectedDialString4, "011 44 20"); |
|
499 TESTCHECKSTR(dialString, KExpectedDialString4); |
|
500 |
|
501 // |
|
502 // National dialing... |
|
503 // |
|
504 INFO_PRINTF1(_L("National dialing")); |
|
505 ret = TelephoneNumber::CalculateDialCityPrefix( |
|
506 dialString, londonUK, birmingham, |
|
507 EDialCityStripDuplicateAreaCode, codeSeparator, |
|
508 EPlusFormatDialNotAllow); |
|
509 TESTCHECK(ret, KErrNone); |
|
510 _LIT(KExpectedDialString5, "0 121"); |
|
511 TESTCHECKSTR(dialString, KExpectedDialString5); |
|
512 |
|
513 ret = TelephoneNumber::CalculateDialCityPrefix( |
|
514 dialString, londonUK, birmingham, |
|
515 EDialCityAllowDuplicateAreaCode, codeSeparator, |
|
516 EPlusFormatDialNotAllow); |
|
517 TESTCHECK(ret, KErrNone); |
|
518 _LIT(KExpectedDialString6, "0 121"); |
|
519 TESTCHECKSTR(dialString, KExpectedDialString6); |
|
520 |
|
521 // |
|
522 // Same area code dialing... |
|
523 // |
|
524 INFO_PRINTF1(_L("Same area dialling")); |
|
525 ret = TelephoneNumber::CalculateDialCityPrefix( |
|
526 dialString, birmingham, birmingham, |
|
527 EDialCityStripDuplicateAreaCode, codeSeparator, |
|
528 EPlusFormatDialNotAllow); |
|
529 TESTCHECK(ret, KErrNone); |
|
530 _LIT(KExpectedDialString7, ""); |
|
531 TESTCHECKSTR(dialString, KExpectedDialString7); |
|
532 |
|
533 ret = TelephoneNumber::CalculateDialCityPrefix( |
|
534 dialString, birmingham, birmingham, |
|
535 EDialCityAllowDuplicateAreaCode, codeSeparator, |
|
536 EPlusFormatDialNotAllow); |
|
537 TESTCHECK(ret, KErrNone); |
|
538 _LIT(KExpectedDialString8, "0 121"); |
|
539 TESTCHECKSTR(dialString, KExpectedDialString8); |
|
540 |
|
541 ret = TelephoneNumber::CalculateDialCityPrefix( |
|
542 dialString, sanFr, sanFr, |
|
543 EDialCityStripDuplicateAreaCode, codeSeparator, |
|
544 EPlusFormatDialNotAllow); |
|
545 TESTCHECK(ret, KErrNone); |
|
546 _LIT(KExpectedDialString9, ""); |
|
547 TESTCHECKSTR(dialString, KExpectedDialString9); |
|
548 |
|
549 ret = TelephoneNumber::CalculateDialCityPrefix( |
|
550 dialString, sanFr, sanFr , |
|
551 EDialCityAllowDuplicateAreaCode, codeSeparator, |
|
552 EPlusFormatDialNotAllow); |
|
553 TESTCHECK(ret, KErrNone); |
|
554 _LIT(KExpectedDialString10, "1 415"); |
|
555 TESTCHECKSTR(dialString, KExpectedDialString10); |
|
556 |
|
557 // |
|
558 // Test Code separator... |
|
559 // |
|
560 INFO_PRINTF1(_L("Test Code separator")); |
|
561 codeSeparator = KCharStar; |
|
562 ret = TelephoneNumber::CalculateDialCityPrefix( |
|
563 dialString, londonUK, sanFr, |
|
564 EDialCityStripDuplicateAreaCode, codeSeparator, |
|
565 EPlusFormatDialNotAllow); |
|
566 TESTCHECK(ret, KErrNone); |
|
567 _LIT(KExpectedDialString11, "00*1*415"); |
|
568 TESTCHECKSTR(dialString, KExpectedDialString11); |
|
569 |
|
570 codeSeparator = KCharUnderscore; |
|
571 ret = TelephoneNumber::CalculateDialCityPrefix( |
|
572 dialString, londonUK, birmingham, |
|
573 EDialCityAllowDuplicateAreaCode, codeSeparator, |
|
574 EPlusFormatDialNotAllow); |
|
575 TESTCHECK(ret, KErrNone); |
|
576 _LIT(KExpectedDialString12, "0_121"); |
|
577 TESTCHECKSTR(dialString, KExpectedDialString12); |
|
578 |
|
579 codeSeparator = KCharMinus; |
|
580 ret = TelephoneNumber::CalculateDialCityPrefix( |
|
581 dialString, sanFr, sanFr , |
|
582 EDialCityAllowDuplicateAreaCode, codeSeparator, |
|
583 EPlusFormatDialNotAllow); |
|
584 TESTCHECK(ret, KErrNone); |
|
585 _LIT(KExpectedDialString13, "1-415"); |
|
586 TESTCHECKSTR(dialString, KExpectedDialString13); |
|
587 |
|
588 // |
|
589 // Kingston Jamaica - Washington DC... |
|
590 // |
|
591 INFO_PRINTF1(_L("From Kingston Jamaica to Washington DC")); |
|
592 codeSeparator = KCharSpace; |
|
593 ret = TelephoneNumber::CalculateDialCityPrefix( |
|
594 dialString, kingstonJam , washingtonDC , |
|
595 EDialCityStripDuplicateAreaCode, codeSeparator, |
|
596 EPlusFormatDialNotAllow); |
|
597 TESTCHECK(ret, KErrNone); |
|
598 _LIT(KExpectedDialString14, "1 202"); |
|
599 TESTCHECKSTR(dialString, KExpectedDialString14); |
|
600 |
|
601 ret = TelephoneNumber::CalculateDialCityPrefix( |
|
602 dialString, kingstonJam , washingtonDC , |
|
603 EDialCityAllowDuplicateAreaCode, codeSeparator, |
|
604 EPlusFormatDialNotAllow); |
|
605 TESTCHECK(ret, KErrNone); |
|
606 _LIT(KExpectedDialString15, "1 202"); |
|
607 TESTCHECKSTR(dialString, KExpectedDialString15); |
|
608 |
|
609 INFO_PRINTF1(_L("From Washington DC to Kingston Jamaica")); |
|
610 codeSeparator = KCharSpace; |
|
611 ret = TelephoneNumber::CalculateDialCityPrefix( |
|
612 dialString, washingtonDC , kingstonJam , |
|
613 EDialCityStripDuplicateAreaCode, codeSeparator, |
|
614 EPlusFormatDialNotAllow); |
|
615 TESTCHECK(ret, KErrNone); |
|
616 _LIT(KExpectedDialString16, "1 80992"); |
|
617 TESTCHECKSTR(dialString, KExpectedDialString16); |
|
618 |
|
619 ret = TelephoneNumber::CalculateDialCityPrefix( |
|
620 dialString, washingtonDC ,kingstonJam , |
|
621 EDialCityAllowDuplicateAreaCode, codeSeparator, |
|
622 EPlusFormatDialNotAllow); |
|
623 TESTCHECK(ret, KErrNone); |
|
624 _LIT(KExpectedDialString17, "1 80992"); |
|
625 TESTCHECKSTR(dialString, KExpectedDialString17); |
|
626 |
|
627 // |
|
628 // Dialling String in Plus(+) format... |
|
629 // |
|
630 INFO_PRINTF1(_L("Dialling String in Plus(+) format")); |
|
631 codeSeparator = KCharSpace; |
|
632 ret = TelephoneNumber::CalculateDialCityPrefix( |
|
633 dialString, londonUK , washingtonDC , |
|
634 EDialCityStripDuplicateAreaCode, codeSeparator, |
|
635 EPlusFormatDialAllow); |
|
636 TESTCHECK(ret, KErrNone); |
|
637 _LIT(KExpectedDialString18, "+1 202"); |
|
638 TESTCHECKSTR(dialString, KExpectedDialString18); |
|
639 |
|
640 ret = TelephoneNumber::CalculateDialCityPrefix( |
|
641 dialString, washingtonDC , londonUK, |
|
642 EDialCityAllowDuplicateAreaCode, codeSeparator, |
|
643 EPlusFormatDialAllow); |
|
644 TESTCHECK(ret, KErrNone); |
|
645 _LIT(KExpectedDialString19, "+44 20"); |
|
646 TESTCHECKSTR(dialString, KExpectedDialString19); |
|
647 |
|
648 codeSeparator = KCharSpace; |
|
649 ret = TelephoneNumber::CalculateDialCityPrefix( |
|
650 dialString, washingtonDC , kingstonJam , |
|
651 EDialCityStripDuplicateAreaCode, codeSeparator, |
|
652 EPlusFormatDialAllow); |
|
653 TESTCHECK(ret, KErrNone); |
|
654 _LIT(KExpectedDialString20, "1 80992"); |
|
655 TESTCHECKSTR(dialString, KExpectedDialString20); |
|
656 |
|
657 ret = TelephoneNumber::CalculateDialCityPrefix( |
|
658 dialString, kingstonJam , birmingham, |
|
659 EDialCityAllowDuplicateAreaCode, codeSeparator, |
|
660 EPlusFormatDialAllow); |
|
661 TESTCHECK(ret, KErrNone); |
|
662 _LIT(KExpectedDialString21, "+44 121"); |
|
663 TESTCHECKSTR(dialString, KExpectedDialString21); |
|
664 |
|
665 codeSeparator = KCharUnderscore; |
|
666 ret = TelephoneNumber::CalculateDialCityPrefix( |
|
667 dialString, londonUK , washingtonDC , |
|
668 EDialCityStripDuplicateAreaCode, codeSeparator, |
|
669 EPlusFormatDialAllow); |
|
670 TESTCHECK(ret, KErrNone); |
|
671 _LIT(KExpectedDialString22, "+1_202"); |
|
672 TESTCHECKSTR(dialString, KExpectedDialString22); |
|
673 |
|
674 return TestStepResult(); |
|
675 } // CDialTestTest6::CDialTestTest6 |
|
676 |
|
677 |
|
678 /** |
|
679 * Each test step initialises it's own name |
|
680 */ |
|
681 CDialTestTestDtmf2::CDialTestTestDtmf2() |
|
682 { |
|
683 // |
|
684 // Store the name of this test case. This is the name that is used by |
|
685 // the script file. |
|
686 // |
|
687 SetTestStepName(_L("TestDtmf2")); |
|
688 } // CDialTestTestDtmf2::CDialTestTestDtmf2 |
|
689 |
|
690 |
|
691 /** |
|
692 * This test performs DTMF Test 2 of the Dial API. |
|
693 * |
|
694 * @return Test verdict for this test. |
|
695 */ |
|
696 enum TVerdict CDialTestTestDtmf2::doTestStepL() |
|
697 { |
|
698 INFO_PRINTF1(_L("DTMF dialling test for space separator format!!!")); |
|
699 |
|
700 INFO_PRINTF1(_L("Call Birmingham UK")); |
|
701 TDialLocation dialLocation; |
|
702 |
|
703 dialLocation.SetIntlPrefCode(KUkIntlPrefCode); |
|
704 dialLocation.SetNatPrefCode(KUkNatPrefCode); |
|
705 dialLocation.SetNatCode(KUkNatCode); |
|
706 dialLocation.SetAreaCode(KUkLondonAreaCode); |
|
707 |
|
708 TDialString dialString ; |
|
709 TPhoneNumber numberToDial = _L("+44 163 2960000"); |
|
710 |
|
711 TInt ret = TelephoneNumber::Parse(dialString, dialLocation, numberToDial); |
|
712 |
|
713 TESTCHECK(ret, KErrNone); |
|
714 _LIT(KExpectedDialString1, "01632960000"); |
|
715 TESTCHECKSTR(dialString, KExpectedDialString1); |
|
716 |
|
717 numberToDial = _L(" +44 163 2960000"); // does not effect the dial string |
|
718 TESTCHECK(ret, KErrNone); |
|
719 _LIT(KExpectedDialString2, "01632960000"); |
|
720 TESTCHECKSTR(dialString, KExpectedDialString2); |
|
721 |
|
722 numberToDial = _L(" +44 163 296 0000"); // does not effect the dial string |
|
723 TESTCHECK(ret, KErrNone); |
|
724 _LIT(KExpectedDialString3, "01632960000"); |
|
725 TESTCHECKSTR(dialString, KExpectedDialString3); |
|
726 |
|
727 // |
|
728 INFO_PRINTF1(_L("Number to dial in London inner - UK")); |
|
729 numberToDial = _L(" +44 2016 3296 0000"); |
|
730 ret = TelephoneNumber::Parse(dialString, dialLocation, numberToDial); |
|
731 TESTCHECK(ret, KErrNone); |
|
732 _LIT(KExpectedDialString4, "0201632960000"); |
|
733 TESTCHECKSTR(dialString, KExpectedDialString4); |
|
734 |
|
735 numberToDial = _L(" +44 16 32960000"); |
|
736 ret = TelephoneNumber::Parse(dialString, dialLocation, numberToDial); |
|
737 TESTCHECK(ret, KErrNone); |
|
738 _LIT(KExpectedDialString5, "01632960000"); |
|
739 TESTCHECKSTR(dialString, KExpectedDialString5); |
|
740 |
|
741 numberToDial = _L(" +44 16 3296 0000"); |
|
742 ret = TelephoneNumber::Parse(dialString, dialLocation, numberToDial); |
|
743 TESTCHECK(ret, KErrNone); |
|
744 _LIT(KExpectedDialString6, "01632960000"); |
|
745 TESTCHECKSTR(dialString, KExpectedDialString6); |
|
746 |
|
747 // |
|
748 INFO_PRINTF1(_L("Number to dial in USA")); |
|
749 numberToDial = _L("+1 163 296 0000"); |
|
750 ret = TelephoneNumber::Parse(dialString, dialLocation, numberToDial); |
|
751 TESTCHECK(ret, KErrNone); |
|
752 _LIT(KExpectedDialString7, "0011632960000"); |
|
753 TESTCHECKSTR(dialString, KExpectedDialString7); |
|
754 |
|
755 numberToDial = _L("+1 163 32960000"); |
|
756 ret = TelephoneNumber::Parse(dialString, dialLocation, numberToDial); |
|
757 TESTCHECK(ret, KErrNone); |
|
758 _LIT(KExpectedDialString8, "00116332960000"); |
|
759 TESTCHECKSTR(dialString, KExpectedDialString8); |
|
760 |
|
761 numberToDial = _L("+1 163 329 60000"); |
|
762 ret = TelephoneNumber::Parse(dialString, dialLocation, numberToDial); |
|
763 TESTCHECK(ret, KErrNone); |
|
764 _LIT(KExpectedDialString9, "00116332960000"); |
|
765 TESTCHECKSTR(dialString, KExpectedDialString9); |
|
766 |
|
767 // |
|
768 numberToDial = _L("+1 163 32960000"); |
|
769 ret = TelephoneNumber::Parse(dialString, dialLocation, numberToDial); |
|
770 TESTCHECK(ret, KErrNone); |
|
771 _LIT(KExpectedDialString10, "00116332960000"); |
|
772 TESTCHECKSTR(dialString, KExpectedDialString10); |
|
773 |
|
774 // |
|
775 // set home location in San Francisco - USA and dial back to UK |
|
776 // |
|
777 dialLocation.SetNatCode(_L("1")); |
|
778 dialLocation.SetNatPrefCode(_L("1")); |
|
779 dialLocation.SetIntlPrefCode(_L("011")); |
|
780 dialLocation.SetAreaCode(_L("415")); |
|
781 |
|
782 numberToDial = _L(" +44 16 3296 0000"); |
|
783 ret = TelephoneNumber::Parse(dialString, dialLocation, numberToDial); |
|
784 TESTCHECK(ret, KErrNone); |
|
785 _LIT(KExpectedDialString11, "011441632960000"); |
|
786 TESTCHECKSTR(dialString, KExpectedDialString11); |
|
787 |
|
788 numberToDial = _L(" +44 16 32960000 "); // empty spaces at the end to see it can cope ? |
|
789 ret = TelephoneNumber::Parse(dialString, dialLocation, numberToDial); |
|
790 TESTCHECK(ret, KErrNone); |
|
791 _LIT(KExpectedDialString12, "011441632960000"); |
|
792 TESTCHECKSTR(dialString, KExpectedDialString12); |
|
793 |
|
794 // call Los Angeles |
|
795 numberToDial = _L("+1 163 3296 0000"); |
|
796 ret = TelephoneNumber::Parse(dialString, dialLocation, numberToDial); |
|
797 TESTCHECK(ret, KErrNone); |
|
798 _LIT(KExpectedDialString13, "116332960000"); |
|
799 TESTCHECKSTR(dialString, KExpectedDialString13); |
|
800 |
|
801 numberToDial = _L("+1 163 2960000"); |
|
802 ret = TelephoneNumber::Parse(dialString, dialLocation, numberToDial); |
|
803 TESTCHECK(ret, KErrNone); |
|
804 _LIT(KExpectedDialString14, "11632960000"); |
|
805 TESTCHECKSTR(dialString, KExpectedDialString14); |
|
806 |
|
807 // French dialling stuff ! |
|
808 TDialLocation ukLocation ; |
|
809 ukLocation.SetIntlPrefCode(KUkIntlPrefCode); |
|
810 ukLocation.SetNatPrefCode(KUkNatPrefCode); |
|
811 ukLocation.SetNatCode(KUkNatCode); |
|
812 ukLocation.SetAreaCode(KUkLondonAreaCode); |
|
813 |
|
814 INFO_PRINTF1(_L("Calling from London to somewhere in France(not Paris)")); |
|
815 numberToDial = _L("+16 32960000"); |
|
816 ret = TelephoneNumber::Parse(dialString, ukLocation, numberToDial); |
|
817 TESTCHECK(ret, KErrNone); |
|
818 _LIT(KExpectedDialString15, "001632960000"); |
|
819 TESTCHECKSTR(dialString, KExpectedDialString15); |
|
820 |
|
821 INFO_PRINTF1(_L("Calling from London to somewhere in Paris")); |
|
822 numberToDial = _L("+01 6 32960000"); |
|
823 ret = TelephoneNumber::Parse(dialString, ukLocation, numberToDial); |
|
824 TESTCHECK(ret, KErrNone); |
|
825 _LIT(KExpectedDialString16, "0001632960000"); |
|
826 TESTCHECKSTR(dialString, KExpectedDialString16); |
|
827 |
|
828 INFO_PRINTF1(_L("Calling from London to somewhere in Paris")); |
|
829 numberToDial = _L("+01 6 3 2 9 6 0 0 0 0"); |
|
830 ret = TelephoneNumber::Parse(dialString, ukLocation, numberToDial); |
|
831 TESTCHECK(ret, KErrNone); |
|
832 _LIT(KExpectedDialString17, "0001632960000"); |
|
833 TESTCHECKSTR(dialString, KExpectedDialString17); |
|
834 |
|
835 return TestStepResult(); |
|
836 } // CDialTestTestDtmf2::CDialTestTestDtmf2 |
|
837 |
|
838 |
|
839 /** |
|
840 * Each test step initialises it's own name |
|
841 */ |
|
842 CDialTestTest7::CDialTestTest7() |
|
843 { |
|
844 // |
|
845 // Store the name of this test case. This is the name that is used by |
|
846 // the script file. |
|
847 // |
|
848 SetTestStepName(_L("Test7")); |
|
849 } // CDialTestTest7::CDialTestTest7 |
|
850 |
|
851 |
|
852 /** |
|
853 * This test performs Test 7 of the Dial API. |
|
854 * |
|
855 * @return Test verdict for this test. |
|
856 */ |
|
857 enum TVerdict CDialTestTest7::doTestStepL() |
|
858 { |
|
859 INFO_PRINTF1(_L("DTMF dialling")); |
|
860 |
|
861 INFO_PRINTF1(_L("Call Birmingham UK")); |
|
862 |
|
863 TDialLocation dialLocation; |
|
864 |
|
865 dialLocation.SetIntlPrefCode(KUkIntlPrefCode); |
|
866 dialLocation.SetNatPrefCode(KUkNatPrefCode); |
|
867 dialLocation.SetNatCode(KUkNatCode); |
|
868 dialLocation.SetAreaCode(KUkLondonAreaCode); |
|
869 |
|
870 TDialString dialString; |
|
871 |
|
872 TPhoneNumber numberToDial = _L("+44 (163) 296 0000"); |
|
873 |
|
874 TInt ret = TelephoneNumber::Parse(dialString, dialLocation, numberToDial); |
|
875 TESTCHECK(ret, KErrNone); |
|
876 _LIT(KExpectedDialString1, "01632960000"); |
|
877 TESTCHECKSTR(dialString, KExpectedDialString1); |
|
878 |
|
879 numberToDial = _L("+44(163)2960000"); // does not effect the dial string |
|
880 ret = TelephoneNumber::Parse(dialString, dialLocation, numberToDial); |
|
881 TESTCHECK(ret, KErrNone); |
|
882 _LIT(KExpectedDialString2, "01632960000"); |
|
883 TESTCHECKSTR(dialString, KExpectedDialString2); |
|
884 |
|
885 numberToDial = _L("+44 (163) 296 0000"); // does not effect the dial string |
|
886 ret = TelephoneNumber::Parse(dialString, dialLocation, numberToDial); |
|
887 TESTCHECK(ret, KErrNone); |
|
888 _LIT(KExpectedDialString3, "01632960000"); |
|
889 TESTCHECKSTR(dialString, KExpectedDialString3); |
|
890 |
|
891 // |
|
892 INFO_PRINTF1(_L("Number to dial in London inner - UK")); |
|
893 numberToDial = _L("+44 (16) 3296 0000"); |
|
894 ret = TelephoneNumber::Parse(dialString, dialLocation, numberToDial); |
|
895 TESTCHECK(ret, KErrNone); |
|
896 _LIT(KExpectedDialString4, "01632960000"); |
|
897 TESTCHECKSTR(dialString, KExpectedDialString4); |
|
898 |
|
899 numberToDial = _L("+44(16)32960000"); |
|
900 ret = TelephoneNumber::Parse(dialString, dialLocation, numberToDial); |
|
901 TESTCHECK(ret, KErrNone); |
|
902 _LIT(KExpectedDialString5, "01632960000"); |
|
903 TESTCHECKSTR(dialString, KExpectedDialString5); |
|
904 |
|
905 numberToDial = _L("+44(16) 3296 0000"); |
|
906 ret = TelephoneNumber::Parse(dialString, dialLocation, numberToDial); |
|
907 TESTCHECK(ret, KErrNone); |
|
908 _LIT(KExpectedDialString6, "01632960000"); |
|
909 TESTCHECKSTR(dialString, KExpectedDialString6); |
|
910 |
|
911 // |
|
912 INFO_PRINTF1(_L("Number to dial in USA")); |
|
913 numberToDial = _L("+1 (163) 296 0000"); |
|
914 ret = TelephoneNumber::Parse(dialString, dialLocation, numberToDial); |
|
915 TESTCHECK(ret, KErrNone); |
|
916 _LIT(KExpectedDialString7, "0011632960000"); |
|
917 TESTCHECKSTR(dialString, KExpectedDialString7); |
|
918 |
|
919 numberToDial = _L("+1 (163) 2960000"); |
|
920 ret = TelephoneNumber::Parse(dialString, dialLocation, numberToDial); |
|
921 TESTCHECK(ret, KErrNone); |
|
922 _LIT(KExpectedDialString8, "0011632960000"); |
|
923 TESTCHECKSTR(dialString, KExpectedDialString8); |
|
924 |
|
925 numberToDial = _L("+1 (163) 296 0000"); |
|
926 ret = TelephoneNumber::Parse(dialString, dialLocation, numberToDial); |
|
927 TESTCHECK(ret, KErrNone); |
|
928 _LIT(KExpectedDialString9, "0011632960000"); |
|
929 TESTCHECKSTR(dialString, KExpectedDialString9); |
|
930 |
|
931 numberToDial = _L("+1(163)2960000"); |
|
932 ret = TelephoneNumber::Parse(dialString, dialLocation, numberToDial); |
|
933 TESTCHECK(ret, KErrNone); |
|
934 _LIT(KExpectedDialString10, "0011632960000"); |
|
935 TESTCHECKSTR(dialString, KExpectedDialString10); |
|
936 |
|
937 // |
|
938 // Set home location in San Francisco - USA and dial back to UK... |
|
939 // |
|
940 dialLocation.SetNatCode(_L("1")); |
|
941 dialLocation.SetNatPrefCode(_L("1")); |
|
942 dialLocation.SetIntlPrefCode(_L("011")); |
|
943 dialLocation.SetAreaCode(_L("415")); |
|
944 |
|
945 numberToDial = _L("+44 (16) 3296 0000"); |
|
946 ret = TelephoneNumber::Parse(dialString, dialLocation, numberToDial); |
|
947 TESTCHECK(ret, KErrNone); |
|
948 _LIT(KExpectedDialString11, "011441632960000"); |
|
949 TESTCHECKSTR(dialString, KExpectedDialString11); |
|
950 |
|
951 numberToDial = _L("+44(16)32960000 "); // empty spaces at the end to see it can cope ? |
|
952 ret = TelephoneNumber::Parse(dialString, dialLocation, numberToDial); |
|
953 TESTCHECK(ret, KErrNone); |
|
954 _LIT(KExpectedDialString12, "011441632960000"); |
|
955 TESTCHECKSTR(dialString, KExpectedDialString12); |
|
956 |
|
957 // call Los Angeles |
|
958 numberToDial = _L("+1 (163) 296 0000"); |
|
959 ret = TelephoneNumber::Parse(dialString, dialLocation, numberToDial); |
|
960 TESTCHECK(ret, KErrNone); |
|
961 _LIT(KExpectedDialString13, "11632960000"); |
|
962 TESTCHECKSTR(dialString, KExpectedDialString13); |
|
963 |
|
964 numberToDial = _L("+1(163) 296 0000"); |
|
965 ret = TelephoneNumber::Parse(dialString, dialLocation, numberToDial); |
|
966 TESTCHECK(ret, KErrNone); |
|
967 _LIT(KExpectedDialString14, "11632960000"); |
|
968 TESTCHECKSTR(dialString, KExpectedDialString14); |
|
969 |
|
970 // |
|
971 // Testing Parser with option to strip/allow areacode... |
|
972 // |
|
973 INFO_PRINTF1(_L("Call Birmingham UK")); |
|
974 dialLocation.SetIntlPrefCode(KUkIntlPrefCode); |
|
975 dialLocation.SetNatPrefCode(KUkNatPrefCode); |
|
976 dialLocation.SetNatCode(KUkNatCode); |
|
977 dialLocation.SetAreaCode(KUkLondonAreaCode); |
|
978 |
|
979 numberToDial = _L("+44 (163) 296 0000"); |
|
980 |
|
981 // |
|
982 // 1) Strip duplicate area code should not make any difference to dial string |
|
983 // |
|
984 ret = TelephoneNumber::Parse(dialString, dialLocation, numberToDial, |
|
985 EDialCityStripDuplicateAreaCode); |
|
986 TESTCHECK(ret, KErrNone); |
|
987 _LIT(KExpectedDialString15, "01632960000"); |
|
988 TESTCHECKSTR(dialString, KExpectedDialString15); |
|
989 |
|
990 // |
|
991 // 2) Allow duplicate area code should not make any difference to dial string |
|
992 // |
|
993 ret = TelephoneNumber::Parse(dialString, dialLocation, numberToDial, |
|
994 EDialCityAllowDuplicateAreaCode); |
|
995 TESTCHECK(ret, KErrNone); |
|
996 _LIT(KExpectedDialString16, "01632960000"); |
|
997 TESTCHECKSTR(dialString, KExpectedDialString16); |
|
998 |
|
999 // |
|
1000 // 3) Strip duplicate area code should not make any difference to dial string |
|
1001 // |
|
1002 numberToDial = _L("+44(163)2960000"); // does not effect the dial string |
|
1003 ret = TelephoneNumber::Parse(dialString, dialLocation, numberToDial, |
|
1004 EDialCityStripDuplicateAreaCode); |
|
1005 TESTCHECK(ret, KErrNone); |
|
1006 _LIT(KExpectedDialString17, "01632960000"); |
|
1007 TESTCHECKSTR(dialString, KExpectedDialString17); |
|
1008 |
|
1009 // |
|
1010 // 4) Allow duplicate area code should not make any difference to dial string |
|
1011 // |
|
1012 numberToDial = _L("+44 (163) 296 0000"); // does not effect the dial string |
|
1013 ret = TelephoneNumber::Parse(dialString, dialLocation, numberToDial, |
|
1014 EDialCityAllowDuplicateAreaCode); |
|
1015 TESTCHECK(ret, KErrNone); |
|
1016 _LIT(KExpectedDialString18, "01632960000"); |
|
1017 TESTCHECKSTR(dialString, KExpectedDialString18); |
|
1018 |
|
1019 // |
|
1020 // 5) Strip areacode |
|
1021 // |
|
1022 INFO_PRINTF1(_L("Number to dial in London inner - UK")); |
|
1023 numberToDial = _L("+44 (16) 3296 0000"); |
|
1024 ret = TelephoneNumber::Parse(dialString, dialLocation, numberToDial, |
|
1025 EDialCityStripDuplicateAreaCode); |
|
1026 TESTCHECK(ret, KErrNone); |
|
1027 _LIT(KExpectedDialString19, "01632960000"); |
|
1028 TESTCHECKSTR(dialString, KExpectedDialString19); |
|
1029 |
|
1030 // |
|
1031 // 6) Allow areacode |
|
1032 // |
|
1033 INFO_PRINTF1(_L("Number to dial in London inner - UK")); |
|
1034 numberToDial = _L("+44 (16) 3296 0000"); |
|
1035 ret = TelephoneNumber::Parse(dialString, dialLocation, numberToDial, |
|
1036 EDialCityAllowDuplicateAreaCode); |
|
1037 TESTCHECK(ret, KErrNone); |
|
1038 _LIT(KExpectedDialString20, "01632960000"); |
|
1039 TESTCHECKSTR(dialString, KExpectedDialString20); |
|
1040 |
|
1041 // |
|
1042 // 7) Strip areacode |
|
1043 // |
|
1044 numberToDial = _L("+44(16)32960000"); |
|
1045 ret = TelephoneNumber::Parse(dialString, dialLocation, numberToDial, |
|
1046 EDialCityStripDuplicateAreaCode); |
|
1047 TESTCHECK(ret, KErrNone); |
|
1048 _LIT(KExpectedDialString21, "01632960000"); |
|
1049 TESTCHECKSTR(dialString, KExpectedDialString21); |
|
1050 |
|
1051 // |
|
1052 // 8) Allow areacode |
|
1053 // |
|
1054 numberToDial = _L("+44(16) 3296 0000"); |
|
1055 ret = TelephoneNumber::Parse(dialString, dialLocation, numberToDial, |
|
1056 EDialCityAllowDuplicateAreaCode); |
|
1057 TESTCHECK(ret, KErrNone); |
|
1058 _LIT(KExpectedDialString22, "01632960000"); |
|
1059 TESTCHECKSTR(dialString, KExpectedDialString22); |
|
1060 |
|
1061 // |
|
1062 // 9a) Allow duplicate area code should not make any difference to dial string |
|
1063 // in international call |
|
1064 // |
|
1065 INFO_PRINTF1(_L("Number to dial in USA")); |
|
1066 numberToDial = _L("+1 (163) 296 0000"); |
|
1067 ret = TelephoneNumber::Parse(dialString, dialLocation, numberToDial, |
|
1068 EDialCityAllowDuplicateAreaCode); |
|
1069 TESTCHECK(ret, KErrNone); |
|
1070 _LIT(KExpectedDialString23, "0011632960000"); |
|
1071 TESTCHECKSTR(dialString, KExpectedDialString23); |
|
1072 |
|
1073 // |
|
1074 // 9b) Strip duplicate area code should not make any difference to dial string |
|
1075 // in international call |
|
1076 // |
|
1077 numberToDial = _L("+1 (163) 296 0000"); |
|
1078 ret = TelephoneNumber::Parse(dialString, dialLocation, numberToDial, |
|
1079 EDialCityStripDuplicateAreaCode); |
|
1080 TESTCHECK(ret, KErrNone); |
|
1081 _LIT(KExpectedDialString24, "0011632960000"); |
|
1082 TESTCHECKSTR(dialString, KExpectedDialString24); |
|
1083 |
|
1084 return TestStepResult(); |
|
1085 } // CDialTestTest7::CDialTestTest7 |
|
1086 |
|
1087 |
|
1088 /** |
|
1089 * Each test step initialises it's own name |
|
1090 */ |
|
1091 CDialTestTest8::CDialTestTest8() |
|
1092 { |
|
1093 // |
|
1094 // Store the name of this test case. This is the name that is used by |
|
1095 // the script file. |
|
1096 // |
|
1097 SetTestStepName(_L("Test8")); |
|
1098 } // CDialTestTest8::CDialTestTest8 |
|
1099 |
|
1100 |
|
1101 /** |
|
1102 * This test performs Test 8 of the Dial API. |
|
1103 * |
|
1104 * @return Test verdict for this test. |
|
1105 */ |
|
1106 enum TVerdict CDialTestTest8::doTestStepL() |
|
1107 { |
|
1108 INFO_PRINTF1(_L("DTMF dialling ")); |
|
1109 |
|
1110 INFO_PRINTF1(_L("Call Birmingham UK")); |
|
1111 |
|
1112 TDialLocation dialLocation; |
|
1113 |
|
1114 dialLocation.SetIntlPrefCode(KUkIntlPrefCode); |
|
1115 dialLocation.SetNatPrefCode(KUkNatPrefCode); |
|
1116 dialLocation.SetNatCode(KUkNatCode); |
|
1117 dialLocation.SetAreaCode(KUkLondonAreaCode); |
|
1118 |
|
1119 TDialString dialString ; |
|
1120 TPhoneNumber numberToDial = _L("+1 (163) 2960000"); |
|
1121 |
|
1122 // |
|
1123 // 10) Strip duplicate area code should not make any difference to dial string |
|
1124 // in international call |
|
1125 // |
|
1126 INFO_PRINTF1(_L("Number to dial in USA (Multiple tests)")); |
|
1127 TInt ret = TelephoneNumber::Parse(dialString, dialLocation, numberToDial, |
|
1128 EDialCityStripDuplicateAreaCode); |
|
1129 TESTCHECK(ret, KErrNone); |
|
1130 _LIT(KExpectedDialString25, "0011632960000"); |
|
1131 TESTCHECKSTR(dialString, KExpectedDialString25); |
|
1132 |
|
1133 // |
|
1134 // 11) Allow duplicate area code should not make any difference to dial string |
|
1135 // in international call |
|
1136 // |
|
1137 numberToDial = _L("+1 (163) 2960000"); |
|
1138 ret = TelephoneNumber::Parse(dialString, dialLocation, numberToDial, |
|
1139 EDialCityAllowDuplicateAreaCode); |
|
1140 TESTCHECK(ret, KErrNone); |
|
1141 _LIT(KExpectedDialString26, "0011632960000"); |
|
1142 TESTCHECKSTR(dialString, KExpectedDialString26); |
|
1143 |
|
1144 // |
|
1145 // 12) Allow duplicate area code should not make any difference to dial string |
|
1146 // in international call |
|
1147 // |
|
1148 numberToDial = _L("+1 (163) 2960000"); |
|
1149 ret = TelephoneNumber::Parse(dialString, dialLocation, numberToDial, |
|
1150 EDialCityAllowDuplicateAreaCode); |
|
1151 TESTCHECK(ret, KErrNone); |
|
1152 _LIT(KExpectedDialString27, "0011632960000"); |
|
1153 TESTCHECKSTR(dialString, KExpectedDialString27); |
|
1154 |
|
1155 // |
|
1156 // 12) Strip duplicate area code should not make any difference to dial string |
|
1157 // in international call |
|
1158 // |
|
1159 numberToDial = _L("+1 (163) 296 0000"); |
|
1160 ret = TelephoneNumber::Parse(dialString, dialLocation, numberToDial, |
|
1161 EDialCityStripDuplicateAreaCode); |
|
1162 TESTCHECK(ret, KErrNone); |
|
1163 _LIT(KExpectedDialString28, "0011632960000"); |
|
1164 TESTCHECKSTR(dialString, KExpectedDialString28); |
|
1165 |
|
1166 // |
|
1167 // 13) Strip duplicate area code should not make any difference to dial string |
|
1168 // in international call |
|
1169 // |
|
1170 numberToDial = _L("+1(163)2960000"); |
|
1171 ret = TelephoneNumber::Parse(dialString, dialLocation, numberToDial, |
|
1172 EDialCityStripDuplicateAreaCode); |
|
1173 TESTCHECK(ret, KErrNone); |
|
1174 _LIT(KExpectedDialString29, "0011632960000"); |
|
1175 TESTCHECKSTR(dialString, KExpectedDialString29); |
|
1176 |
|
1177 // |
|
1178 // 14) Allow duplicate area code should not make any difference to dial string |
|
1179 // in international call |
|
1180 // |
|
1181 numberToDial = _L("+1(163)2960000"); |
|
1182 ret = TelephoneNumber::Parse(dialString, dialLocation, numberToDial, |
|
1183 EDialCityAllowDuplicateAreaCode); |
|
1184 TESTCHECK(ret, KErrNone); |
|
1185 _LIT(KExpectedDialString30, "0011632960000"); |
|
1186 TESTCHECKSTR(dialString, KExpectedDialString30); |
|
1187 |
|
1188 // |
|
1189 // set home location in San Francisco - USA and dial back to UK |
|
1190 // |
|
1191 dialLocation.SetNatCode(_L("1")); |
|
1192 dialLocation.SetNatPrefCode(_L("1")); |
|
1193 dialLocation.SetIntlPrefCode(_L("011")); |
|
1194 dialLocation.SetAreaCode(_L("415")); |
|
1195 |
|
1196 // |
|
1197 numberToDial = _L("+44 (16) 3296 0000"); |
|
1198 ret = TelephoneNumber::Parse(dialString, dialLocation, numberToDial, |
|
1199 EDialCityAllowDuplicateAreaCode); |
|
1200 TESTCHECK(ret, KErrNone); |
|
1201 _LIT(KExpectedDialString31, "011441632960000"); |
|
1202 TESTCHECKSTR(dialString, KExpectedDialString31); |
|
1203 |
|
1204 // |
|
1205 numberToDial = _L("+44 (16) 3296 0000"); |
|
1206 ret = TelephoneNumber::Parse(dialString, dialLocation, numberToDial, |
|
1207 EDialCityStripDuplicateAreaCode); |
|
1208 TESTCHECK(ret, KErrNone); |
|
1209 _LIT(KExpectedDialString32, "011441632960000"); |
|
1210 TESTCHECKSTR(dialString, KExpectedDialString32); |
|
1211 |
|
1212 // |
|
1213 numberToDial = _L("+44(16)32960000 "); // empty spaces at the end to see it can cope ? |
|
1214 ret = TelephoneNumber::Parse(dialString, dialLocation, numberToDial, |
|
1215 EDialCityAllowDuplicateAreaCode); |
|
1216 TESTCHECK(ret, KErrNone); |
|
1217 _LIT(KExpectedDialString33, "011441632960000"); |
|
1218 TESTCHECKSTR(dialString, KExpectedDialString33); |
|
1219 |
|
1220 // |
|
1221 numberToDial = _L("+44(16)32960000 "); // empty spaces at the end to see it can cope ? |
|
1222 ret = TelephoneNumber::Parse(dialString, dialLocation, numberToDial, |
|
1223 EDialCityAllowDuplicateAreaCode); |
|
1224 TESTCHECK(ret, KErrNone); |
|
1225 _LIT(KExpectedDialString34, "011441632960000"); |
|
1226 TESTCHECKSTR(dialString, KExpectedDialString34); |
|
1227 |
|
1228 // |
|
1229 numberToDial = _L("+44(16)32960000 "); // empty spaces at the end to see it can cope ? |
|
1230 ret = TelephoneNumber::Parse(dialString, dialLocation, numberToDial, |
|
1231 EDialCityStripDuplicateAreaCode); |
|
1232 TESTCHECK(ret, KErrNone); |
|
1233 _LIT(KExpectedDialString35, "011441632960000"); |
|
1234 TESTCHECKSTR(dialString, KExpectedDialString35); |
|
1235 |
|
1236 // call Los Angeles |
|
1237 numberToDial = _L("+1 (163) 296 0000"); |
|
1238 ret = TelephoneNumber::Parse(dialString, dialLocation, numberToDial, |
|
1239 EDialCityAllowDuplicateAreaCode); |
|
1240 TESTCHECK(ret, KErrNone); |
|
1241 _LIT(KExpectedDialString36, "11632960000"); |
|
1242 TESTCHECKSTR(dialString, KExpectedDialString36); |
|
1243 |
|
1244 // call Los Angeles |
|
1245 numberToDial = _L("+1 (163) 296 0000"); |
|
1246 ret = TelephoneNumber::Parse(dialString, dialLocation, numberToDial, |
|
1247 EDialCityStripDuplicateAreaCode); |
|
1248 TESTCHECK(ret, KErrNone); |
|
1249 _LIT(KExpectedDialString37, "11632960000"); |
|
1250 TESTCHECKSTR(dialString, KExpectedDialString37); |
|
1251 |
|
1252 // |
|
1253 numberToDial = _L("+1(163)2960000"); |
|
1254 ret = TelephoneNumber::Parse(dialString, dialLocation, numberToDial, |
|
1255 EDialCityAllowDuplicateAreaCode); |
|
1256 TESTCHECK(ret, KErrNone); |
|
1257 _LIT(KExpectedDialString38, "11632960000"); |
|
1258 TESTCHECKSTR(dialString, KExpectedDialString38); |
|
1259 |
|
1260 // |
|
1261 numberToDial = _L("+1(163)2960000"); |
|
1262 ret = TelephoneNumber::Parse(dialString, dialLocation, numberToDial, |
|
1263 EDialCityStripDuplicateAreaCode); |
|
1264 TESTCHECK(ret, KErrNone); |
|
1265 _LIT(KExpectedDialString39, "11632960000"); |
|
1266 TESTCHECKSTR(dialString, KExpectedDialString39); |
|
1267 |
|
1268 // |
|
1269 numberToDial = _L("+11 6 32 96 00 00 (Symbian's Phone)"); |
|
1270 ret = TelephoneNumber::Parse(dialString, dialLocation, numberToDial, |
|
1271 EDialCityStripDuplicateAreaCode); |
|
1272 TESTCHECK(ret, KErrNone); |
|
1273 _LIT(KExpectedDialString40, "01111632960000"); |
|
1274 TESTCHECKSTR(dialString, KExpectedDialString40); |
|
1275 |
|
1276 numberToDial = _L("+11 6 32 96 00 00 (Symbian's Phone a() )"); |
|
1277 ret = TelephoneNumber::Parse(dialString, dialLocation, numberToDial, |
|
1278 EDialCityStripDuplicateAreaCode); |
|
1279 TESTCHECK(ret, KErrNone); |
|
1280 _LIT(KExpectedDialString41, "01111632960000"); |
|
1281 TESTCHECKSTR(dialString, KExpectedDialString41); |
|
1282 |
|
1283 numberToDial = _L("+11 6 32 96 00 00 ( () Symbian's Phone)"); |
|
1284 ret = TelephoneNumber::Parse(dialString, dialLocation, numberToDial, |
|
1285 EDialCityStripDuplicateAreaCode); |
|
1286 TESTCHECK(ret, KErrNone); |
|
1287 _LIT(KExpectedDialString42, "01111632960000"); |
|
1288 TESTCHECKSTR(dialString, KExpectedDialString42); |
|
1289 |
|
1290 numberToDial = _L("+11 6 32 96 00 00 ( (Symbi(((an's Phone)"); |
|
1291 ret = TelephoneNumber::Parse(dialString, dialLocation, numberToDial, |
|
1292 EDialCityStripDuplicateAreaCode); |
|
1293 TESTCHECK(ret, KErrNone); |
|
1294 _LIT(KExpectedDialString43, "01111632960000"); |
|
1295 TESTCHECKSTR(dialString, KExpectedDialString43); |
|
1296 |
|
1297 numberToDial = _L("+11 6 32 96 00 00 ( Symbian's Pho)))ne)"); |
|
1298 ret = TelephoneNumber::Parse(dialString, dialLocation, numberToDial, |
|
1299 EDialCityStripDuplicateAreaCode); |
|
1300 TESTCHECK(ret, KErrNone); |
|
1301 _LIT(KExpectedDialString44, "01111632960000"); |
|
1302 TESTCHECKSTR(dialString, KExpectedDialString44); |
|
1303 |
|
1304 // |
|
1305 dialLocation.SetIntlPrefCode(KUkIntlPrefCode); |
|
1306 dialLocation.SetNatPrefCode(KUkNatPrefCode); |
|
1307 dialLocation.SetNatCode(KUkNatCode); |
|
1308 dialLocation.SetAreaCode(KUkLondonAreaCode); |
|
1309 |
|
1310 numberToDial = _L("+44 (16) 3296 0000 (Symbian's Office Phone Number)"); |
|
1311 ret = TelephoneNumber::Parse(dialString, dialLocation, numberToDial, |
|
1312 EDialCityStripDuplicateAreaCode); |
|
1313 TESTCHECK(ret, KErrNone); |
|
1314 _LIT(KExpectedDialString45, "01632960000"); |
|
1315 TESTCHECKSTR(dialString, KExpectedDialString45); |
|
1316 |
|
1317 numberToDial = _L("+44 (16) 3296 0000 (Symbian's Office Phone Number)"); |
|
1318 ret = TelephoneNumber::Parse(dialString, dialLocation, numberToDial, |
|
1319 EDialCityAllowDuplicateAreaCode); |
|
1320 TESTCHECK(ret, KErrNone); |
|
1321 _LIT(KExpectedDialString46, "01632960000"); |
|
1322 TESTCHECKSTR(dialString, KExpectedDialString46); |
|
1323 |
|
1324 numberToDial = _L("+11 6 32 96 00 00 ("); |
|
1325 ret = TelephoneNumber::Parse(dialString, dialLocation, numberToDial, |
|
1326 EDialCityAllowDuplicateAreaCode); |
|
1327 TESTCHECK(ret, KErrNone); |
|
1328 _LIT(KExpectedDialString47, "0011632960000"); |
|
1329 TESTCHECKSTR(dialString, KExpectedDialString47); |
|
1330 |
|
1331 return TestStepResult(); |
|
1332 } // CDialTestTest8::CDialTestTest8 |
|
1333 |
|
1334 |
|
1335 /** |
|
1336 * Each test step initialises it's own name |
|
1337 */ |
|
1338 CDialTestIllegalTest::CDialTestIllegalTest() |
|
1339 { |
|
1340 // |
|
1341 // Store the name of this test case. This is the name that is used by |
|
1342 // the script file. |
|
1343 // |
|
1344 SetTestStepName(_L("IllegalTest")); |
|
1345 } // CDialTestIllegalTest::CDialTestIllegalTest |
|
1346 |
|
1347 |
|
1348 /** |
|
1349 * This test performs an illegal test of the Dial API. |
|
1350 * |
|
1351 * @return Test verdict for this test. |
|
1352 */ |
|
1353 enum TVerdict CDialTestIllegalTest::doTestStepL() |
|
1354 { |
|
1355 INFO_PRINTF1(_L("Illegalformat!!!")); |
|
1356 |
|
1357 // |
|
1358 INFO_PRINTF1(_L("Phone with KCharOpenBracket but missing KCharcloseBracket char")); |
|
1359 TDialLocation dialLocation; // default at London Inner |
|
1360 TDialString dialString; |
|
1361 TPhoneNumber numberToDial = _L("+44(163 2960000"); |
|
1362 TInt ret = TelephoneNumber::Parse(dialString, dialLocation, numberToDial); |
|
1363 #ifdef ORIGINAL_TEST_CODE |
|
1364 TESTCHECK(ret, KErrNotSupported); |
|
1365 #else |
|
1366 TESTCHECK(ret, KErrNone); |
|
1367 _LIT(KExpectedDialString1, "441632960000"); |
|
1368 TESTCHECKSTR(dialString, KExpectedDialString1); |
|
1369 #endif |
|
1370 |
|
1371 // |
|
1372 INFO_PRINTF1(_L("Phone Number with KCharcloseBracket but not KCharOpenBracket ")); |
|
1373 numberToDial = _L(" +44 16) 3296 0000"); |
|
1374 ret = TelephoneNumber::Parse(dialString, dialLocation, numberToDial); |
|
1375 #ifdef ORIGINAL_TEST_CODE |
|
1376 TESTCHECK(ret, KErrNotSupported); |
|
1377 #else |
|
1378 TESTCHECK(ret, KErrNone); |
|
1379 _LIT(KExpectedDialString2, "441632960000"); |
|
1380 TESTCHECKSTR(dialString, KExpectedDialString2); |
|
1381 #endif |
|
1382 |
|
1383 // |
|
1384 INFO_PRINTF1(_L("a funny Phone Number ")); |
|
1385 numberToDial = _L("+44)16(32960000"); |
|
1386 ret = TelephoneNumber::Parse(dialString, dialLocation, numberToDial); |
|
1387 TESTCHECK(ret, KErrNone); |
|
1388 _LIT(KExpectedDialString3, "441632960000"); |
|
1389 TESTCHECKSTR(dialString, KExpectedDialString3); |
|
1390 |
|
1391 // |
|
1392 // Yes supported but take 56 as area code and 78 as |
|
1393 // the remain of the number |
|
1394 // |
|
1395 INFO_PRINTF1(_L("Phone Number wrong format")); |
|
1396 numberToDial = _L("+33 1234(56)00"); |
|
1397 ret = TelephoneNumber::Parse(dialString, dialLocation, numberToDial); |
|
1398 TESTCHECK(ret, KErrNone); |
|
1399 |
|
1400 INFO_PRINTF1(_L("Phone Number wrong format")); |
|
1401 numberToDial = _L(" 33 1234(56)78"); |
|
1402 ret = TelephoneNumber::Parse(dialString, dialLocation, numberToDial); |
|
1403 TESTCHECK(ret, KErrNone); |
|
1404 |
|
1405 // for spaces |
|
1406 INFO_PRINTF1(_L("Phone Number wrong format")); |
|
1407 numberToDial = _L(" 33 12345678"); |
|
1408 ret = TelephoneNumber::Parse(dialString, dialLocation, numberToDial); |
|
1409 TESTCHECK(ret, KErrNone); |
|
1410 |
|
1411 INFO_PRINTF1(_L("Phone Number wrong format")); |
|
1412 numberToDial = _L("+441632960000"); |
|
1413 ret = TelephoneNumber::Parse(dialString, dialLocation, numberToDial); |
|
1414 TESTCHECK(ret, KErrNone); |
|
1415 |
|
1416 INFO_PRINTF1(_L("Phone Number wrong format")); |
|
1417 numberToDial = _L("+441632960000 1 "); |
|
1418 ret = TelephoneNumber::Parse(dialString, dialLocation, numberToDial); |
|
1419 TESTCHECK(ret, KErrNone); |
|
1420 |
|
1421 INFO_PRINTF1(_L("Phone Number wrong format")); |
|
1422 numberToDial = _L("+123441156789 1234111115678 1234566789"); |
|
1423 ret = TelephoneNumber::Parse(dialString, dialLocation, numberToDial); |
|
1424 TESTCHECK(ret, KErrNone); |
|
1425 |
|
1426 // for bracket |
|
1427 INFO_PRINTF1(_L("Phone Number wrong format")); |
|
1428 numberToDial = _L(" 33 (12345678)"); |
|
1429 ret = TelephoneNumber::Parse(dialString, dialLocation, numberToDial); |
|
1430 TESTCHECK(ret, KErrNone); |
|
1431 |
|
1432 INFO_PRINTF1(_L("Phone Number wrong format")); |
|
1433 numberToDial = _L("+441632960000()"); |
|
1434 ret = TelephoneNumber::Parse(dialString, dialLocation, numberToDial); |
|
1435 TESTCHECK(ret, KErrNone); |
|
1436 |
|
1437 INFO_PRINTF1(_L("Phone Number wrong format")); |
|
1438 numberToDial = _L("+441632960000 (1) "); |
|
1439 ret = TelephoneNumber::Parse(dialString, dialLocation, numberToDial); |
|
1440 TESTCHECK(ret, KErrNone); |
|
1441 |
|
1442 INFO_PRINTF1(_L("Phone Number wrong format")); |
|
1443 numberToDial = _L("+123441156789 (1234111115678) 1234566789"); |
|
1444 ret = TelephoneNumber::Parse(dialString, dialLocation, numberToDial); |
|
1445 TESTCHECK(ret, KErrNone); |
|
1446 |
|
1447 return TestStepResult(); |
|
1448 } // CDialTestIllegalTest::CDialTestIllegalTest |