|
1 // |
|
2 // Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 // All rights reserved. |
|
4 // This component and the accompanying materials are made available |
|
5 // under the terms of "Eclipse Public License v1.0" |
|
6 // which accompanies this distribution, and is available |
|
7 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 // |
|
9 // Initial Contributors: |
|
10 // Nokia Corporation - initial contribution. |
|
11 // |
|
12 // Contributors: |
|
13 // |
|
14 // Description: |
|
15 // |
|
16 // |
|
17 // |
|
18 // This contains CommDb Unit Test Cases 024.XX |
|
19 |
|
20 // EPOC includes |
|
21 #include <e32base.h> |
|
22 #include <commdb.h> |
|
23 #include <d32comm.h> |
|
24 |
|
25 // Test system includes |
|
26 #include "Teststepcommdb.h" |
|
27 #include "Step_024_xx.h" |
|
28 |
|
29 |
|
30 |
|
31 ///////////////////// |
|
32 // Test step 024.01 |
|
33 ///////////////////// |
|
34 |
|
35 // constructor |
|
36 CCommDbTest024_01::CCommDbTest024_01() |
|
37 { |
|
38 // store the name of this test case |
|
39 SetTestStepName(_L("step_024_01")); |
|
40 } |
|
41 |
|
42 // destructor |
|
43 CCommDbTest024_01::~CCommDbTest024_01() |
|
44 { |
|
45 } |
|
46 |
|
47 |
|
48 TVerdict CCommDbTest024_01::doTestStepPreambleL() |
|
49 { |
|
50 // Have a temp copy of database |
|
51 openDbL(); |
|
52 SetTestStepResult(EPass); return TestStepResult(); |
|
53 } |
|
54 |
|
55 TInt CCommDbTest024_01::executeStepL() |
|
56 { |
|
57 TInt ret=KErrGeneral; |
|
58 |
|
59 //Now test the settings |
|
60 TUint32 value; |
|
61 TRAPD(r,iTheDb->GetCurrentDialOutSettingL( TPtrC(MODEM_BEARER),value)); |
|
62 |
|
63 if(r==KErrNotSupported) |
|
64 { |
|
65 return KErrNotSupported; |
|
66 } |
|
67 |
|
68 return ret; |
|
69 } |
|
70 |
|
71 |
|
72 TVerdict CCommDbTest024_01::doTestStepL( ) |
|
73 { |
|
74 INFO_PRINTF1(_L("Step 024.03 called ")); |
|
75 |
|
76 |
|
77 if ( executeStepL() == KErrNotSupported ) |
|
78 SetTestStepResult(EPass); else |
|
79 SetTestStepResult(EFail); |
|
80 return TestStepResult(); |
|
81 } |
|
82 |
|
83 |
|
84 ///////////////////// |
|
85 // Test step 024.02 |
|
86 ///////////////////// |
|
87 |
|
88 // constructor |
|
89 CCommDbTest024_02::CCommDbTest024_02() |
|
90 { |
|
91 // store the name of this test case |
|
92 SetTestStepName(_L("step_024_02")); |
|
93 } |
|
94 |
|
95 // destructor |
|
96 CCommDbTest024_02::~CCommDbTest024_02() |
|
97 { |
|
98 } |
|
99 |
|
100 |
|
101 TVerdict CCommDbTest024_02::doTestStepPreambleL() |
|
102 { |
|
103 openDbL(); |
|
104 SetTestStepResult(EPass); return TestStepResult(); |
|
105 } |
|
106 |
|
107 TInt CCommDbTest024_02::executeStepL() |
|
108 { |
|
109 TInt ret=KErrGeneral; |
|
110 |
|
111 //Now test the settings |
|
112 TUint32 value; |
|
113 TRAPD(r,iTheDb->GetCurrentDialOutSettingL( TPtrC(LOCATION), value )); |
|
114 |
|
115 if(r==KErrNotSupported) |
|
116 { |
|
117 return KErrNotSupported; |
|
118 } |
|
119 |
|
120 return ret; |
|
121 } |
|
122 |
|
123 |
|
124 TVerdict CCommDbTest024_02::doTestStepL( ) |
|
125 { |
|
126 INFO_PRINTF1(_L("Step 024.04 called ")); |
|
127 |
|
128 |
|
129 if ( executeStepL() == KErrNotSupported ) |
|
130 SetTestStepResult(EPass); else |
|
131 SetTestStepResult(EFail); |
|
132 return TestStepResult(); |
|
133 } |
|
134 |
|
135 |
|
136 |
|
137 |
|
138 ///////////////////// |
|
139 // Test step 024.03 |
|
140 ///////////////////// |
|
141 |
|
142 // constructor |
|
143 CCommDbTest024_03::CCommDbTest024_03() |
|
144 { |
|
145 // store the name of this test case |
|
146 SetTestStepName(_L("step_024_03")); |
|
147 } |
|
148 |
|
149 // destructor |
|
150 CCommDbTest024_03::~CCommDbTest024_03() |
|
151 { |
|
152 } |
|
153 |
|
154 |
|
155 TVerdict CCommDbTest024_03::doTestStepPreambleL() |
|
156 { |
|
157 openDbL(); |
|
158 SetTestStepResult(EPass); return TestStepResult(); |
|
159 } |
|
160 |
|
161 TInt CCommDbTest024_03::executeStepL() |
|
162 { |
|
163 TInt ret=KErrGeneral; |
|
164 |
|
165 //Point to an IAP record |
|
166 iTheDb->SetGlobalSettingL( TPtrC(DEFAULT_NETWORK), 0 ); |
|
167 |
|
168 //Now test the settings |
|
169 TUint32 value; |
|
170 TRAPD(r1,iTheDb->GetCurrentDialOutSettingL( TPtrC(IAP_SERVICE), value )); |
|
171 |
|
172 if(r1==KErrNotSupported) |
|
173 { |
|
174 return KErrNotSupported; |
|
175 } |
|
176 |
|
177 return ret; |
|
178 } |
|
179 |
|
180 |
|
181 TVerdict CCommDbTest024_03::doTestStepL( ) |
|
182 { |
|
183 INFO_PRINTF1(_L("Step 024.03 called ")); |
|
184 |
|
185 |
|
186 if ( executeStepL() == KErrNotSupported ) |
|
187 SetTestStepResult(EPass); else |
|
188 SetTestStepResult(EFail); |
|
189 return TestStepResult(); |
|
190 } |
|
191 |
|
192 |
|
193 |
|
194 ///////////////////// |
|
195 // Test step 024.04 |
|
196 ///////////////////// |
|
197 |
|
198 // constructor |
|
199 CCommDbTest024_04::CCommDbTest024_04() |
|
200 { |
|
201 // store the name of this test case |
|
202 SetTestStepName(_L("step_024_04")); |
|
203 } |
|
204 |
|
205 // destructor |
|
206 CCommDbTest024_04::~CCommDbTest024_04() |
|
207 { |
|
208 } |
|
209 |
|
210 |
|
211 TVerdict CCommDbTest024_04::doTestStepPreambleL() |
|
212 { |
|
213 openDbL(); |
|
214 SetTestStepResult(EPass); return TestStepResult(); |
|
215 } |
|
216 |
|
217 TInt CCommDbTest024_04::executeStepL() |
|
218 { |
|
219 TInt ret=KErrGeneral; |
|
220 |
|
221 //Point to an IAP record |
|
222 iTheDb->SetGlobalSettingL( TPtrC(DEFAULT_NETWORK), 0 ); |
|
223 |
|
224 //Now test the settings |
|
225 TUint32 value; |
|
226 TRAPD(r1,iTheDb->GetCurrentDialOutSettingL( TPtrC(IAP_NETWORK),value)); |
|
227 |
|
228 if(r1==KErrNotSupported) |
|
229 { |
|
230 return KErrNotSupported; |
|
231 } |
|
232 |
|
233 return ret; |
|
234 } |
|
235 |
|
236 |
|
237 TVerdict CCommDbTest024_04::doTestStepL( ) |
|
238 { |
|
239 INFO_PRINTF1(_L("Step 024.02 called ")); |
|
240 |
|
241 |
|
242 if ( executeStepL() == KErrNotSupported ) |
|
243 SetTestStepResult(EPass); else |
|
244 SetTestStepResult(EFail); |
|
245 return TestStepResult(); |
|
246 } |
|
247 |
|
248 |
|
249 ///////////////////// |
|
250 // Test step 024.05 |
|
251 ///////////////////// |
|
252 |
|
253 // constructor |
|
254 CCommDbTest024_05::CCommDbTest024_05() |
|
255 { |
|
256 // store the name of this test case |
|
257 SetTestStepName(_L("step_024_05")); |
|
258 } |
|
259 |
|
260 // destructor |
|
261 CCommDbTest024_05::~CCommDbTest024_05() |
|
262 { |
|
263 } |
|
264 |
|
265 |
|
266 TVerdict CCommDbTest024_05::doTestStepPreambleL() |
|
267 { |
|
268 openDbL(); |
|
269 SetTestStepResult(EPass); return TestStepResult(); |
|
270 } |
|
271 |
|
272 TInt CCommDbTest024_05::executeStepL() |
|
273 { |
|
274 TInt ret=KErrGeneral; |
|
275 |
|
276 //Now test the settings |
|
277 TUint32 value; |
|
278 TRAPD(r1,iTheDb->GetCurrentDialInSettingL( TPtrC(MODEM_BEARER), value)); |
|
279 |
|
280 if(r1==KErrNotSupported) |
|
281 { |
|
282 return KErrNotSupported; |
|
283 } |
|
284 |
|
285 return ret; |
|
286 } |
|
287 |
|
288 |
|
289 TVerdict CCommDbTest024_05::doTestStepL( ) |
|
290 { |
|
291 INFO_PRINTF1(_L("Step 024.03 called ")); |
|
292 |
|
293 |
|
294 if ( executeStepL() == KErrNotSupported ) |
|
295 SetTestStepResult(EPass); else |
|
296 SetTestStepResult(EFail); |
|
297 return TestStepResult(); |
|
298 } |
|
299 |
|
300 |
|
301 |
|
302 ///////////////////// |
|
303 // Test step 024.06 |
|
304 ///////////////////// |
|
305 |
|
306 // constructor |
|
307 CCommDbTest024_06::CCommDbTest024_06() |
|
308 { |
|
309 // store the name of this test case |
|
310 SetTestStepName(_L("step_024_06")); |
|
311 } |
|
312 |
|
313 // destructor |
|
314 CCommDbTest024_06::~CCommDbTest024_06() |
|
315 { |
|
316 } |
|
317 |
|
318 |
|
319 TVerdict CCommDbTest024_06::doTestStepPreambleL() |
|
320 { |
|
321 openDbL(); |
|
322 SetTestStepResult(EPass); return TestStepResult(); |
|
323 } |
|
324 |
|
325 TInt CCommDbTest024_06::executeStepL() |
|
326 { |
|
327 TInt ret=KErrGeneral; |
|
328 |
|
329 //Now test the settings |
|
330 TUint32 value; |
|
331 TRAPD(r1,iTheDb->GetCurrentDialInSettingL( TPtrC(LOCATION), value)); |
|
332 |
|
333 if(r1==KErrNotSupported) |
|
334 { |
|
335 return KErrNotSupported; |
|
336 } |
|
337 |
|
338 return ret; |
|
339 } |
|
340 |
|
341 |
|
342 TVerdict CCommDbTest024_06::doTestStepL( ) |
|
343 { |
|
344 INFO_PRINTF1(_L("Step 024.04 called ")); |
|
345 |
|
346 |
|
347 if ( executeStepL() == KErrNotSupported ) |
|
348 SetTestStepResult(EPass); else |
|
349 SetTestStepResult(EFail); |
|
350 return TestStepResult(); |
|
351 } |
|
352 |
|
353 |
|
354 |
|
355 |
|
356 ///////////////////// |
|
357 // Test step 024.07 |
|
358 ///////////////////// |
|
359 |
|
360 // constructor |
|
361 CCommDbTest024_07::CCommDbTest024_07() |
|
362 { |
|
363 // store the name of this test case |
|
364 SetTestStepName(_L("step_024_07")); |
|
365 } |
|
366 |
|
367 // destructor |
|
368 CCommDbTest024_07::~CCommDbTest024_07() |
|
369 { |
|
370 } |
|
371 |
|
372 |
|
373 TVerdict CCommDbTest024_07::doTestStepPreambleL() |
|
374 { |
|
375 openDbL(); |
|
376 SetTestStepResult(EPass); return TestStepResult(); |
|
377 } |
|
378 |
|
379 TInt CCommDbTest024_07::executeStepL() |
|
380 { |
|
381 TInt ret=KErrGeneral; |
|
382 |
|
383 //Point to an IAP record |
|
384 iTheDb->SetGlobalSettingL( TPtrC(DEFAULT_NETWORK), 0 ); |
|
385 |
|
386 //Now test the settings |
|
387 TUint32 value; |
|
388 TRAPD(r1,iTheDb->GetCurrentDialInSettingL( TPtrC(IAP_SERVICE),value)); |
|
389 |
|
390 if(r1==KErrNotSupported) |
|
391 { |
|
392 return KErrNotSupported; |
|
393 } |
|
394 |
|
395 return ret; |
|
396 } |
|
397 |
|
398 |
|
399 TVerdict CCommDbTest024_07::doTestStepL( ) |
|
400 { |
|
401 INFO_PRINTF1(_L("Step 024.01 called ")); |
|
402 |
|
403 |
|
404 if ( executeStepL() == KErrNotSupported ) |
|
405 SetTestStepResult(EPass); else |
|
406 SetTestStepResult(EFail); |
|
407 return TestStepResult(); |
|
408 } |
|
409 |
|
410 |
|
411 |
|
412 ///////////////////// |
|
413 // Test step 024.08 |
|
414 ///////////////////// |
|
415 |
|
416 // constructor |
|
417 CCommDbTest024_08::CCommDbTest024_08() |
|
418 { |
|
419 // store the name of this test case |
|
420 SetTestStepName(_L("step_024_08")); |
|
421 } |
|
422 |
|
423 // destructor |
|
424 CCommDbTest024_08::~CCommDbTest024_08() |
|
425 { |
|
426 } |
|
427 |
|
428 |
|
429 TVerdict CCommDbTest024_08::doTestStepPreambleL() |
|
430 { |
|
431 openDbL(); |
|
432 SetTestStepResult(EPass); return TestStepResult(); |
|
433 } |
|
434 |
|
435 TInt CCommDbTest024_08::executeStepL() |
|
436 { |
|
437 TInt ret=KErrGeneral; |
|
438 |
|
439 //Point to an IAP record |
|
440 iTheDb->SetGlobalSettingL( TPtrC(DEFAULT_NETWORK), 0 ); |
|
441 |
|
442 //Now test the settings |
|
443 TUint32 value; |
|
444 TRAPD(r1,iTheDb->GetCurrentDialInSettingL( TPtrC(IAP_SERVICE),value)); |
|
445 |
|
446 if(r1==KErrNotSupported) |
|
447 { |
|
448 return KErrNotSupported; |
|
449 } |
|
450 |
|
451 return ret; |
|
452 } |
|
453 |
|
454 |
|
455 TVerdict CCommDbTest024_08::doTestStepL( ) |
|
456 { |
|
457 INFO_PRINTF1(_L("Step 024.02 called ")); |
|
458 |
|
459 |
|
460 if ( executeStepL() == KErrNotSupported ) |
|
461 SetTestStepResult(EPass); else |
|
462 SetTestStepResult(EFail); |
|
463 return TestStepResult(); |
|
464 } |
|
465 |
|
466 |
|
467 ///////////////////// |
|
468 // Test step 024.09 |
|
469 ///////////////////// |
|
470 |
|
471 // constructor |
|
472 CCommDbTest024_09::CCommDbTest024_09() |
|
473 { |
|
474 // store the name of this test case |
|
475 SetTestStepName(_L("step_024_09")); |
|
476 } |
|
477 |
|
478 // destructor |
|
479 CCommDbTest024_09::~CCommDbTest024_09() |
|
480 { |
|
481 } |
|
482 |
|
483 TVerdict CCommDbTest024_09::doTestStepL( ) |
|
484 { |
|
485 INFO_PRINTF1(_L("Step 024.09 called ")); |
|
486 |
|
487 SetTestStepResult(EPass); |
|
488 // Heap test for 024.01 |
|
489 |
|
490 CCommDbTest024_01* step024_01 = new(ELeave) CCommDbTest024_01; |
|
491 CleanupStack::PushL(step024_01); |
|
492 if ( doTestStepWithHeapFailureL( *step024_01, KErrNotSupported) == EFail ) |
|
493 SetTestStepResult(EFail); CleanupStack::PopAndDestroy(step024_01); |
|
494 |
|
495 |
|
496 // Heap test for 024.02 |
|
497 |
|
498 CCommDbTest024_02* step024_02 = new CCommDbTest024_02; |
|
499 CleanupStack::PushL(step024_02); |
|
500 if ( doTestStepWithHeapFailureL( *step024_02, KErrNotSupported) == EFail ) |
|
501 SetTestStepResult(EFail); CleanupStack::PopAndDestroy(step024_02); |
|
502 |
|
503 // Heap test for 024.03 |
|
504 |
|
505 CCommDbTest024_03* step024_03 = new CCommDbTest024_03; |
|
506 CleanupStack::PushL(step024_03); |
|
507 if ( doTestStepWithHeapFailureL( *step024_03, KErrNotSupported) == EFail ) |
|
508 SetTestStepResult(EFail); CleanupStack::PopAndDestroy(step024_03); |
|
509 |
|
510 |
|
511 // Heap test for 024.04 |
|
512 |
|
513 CCommDbTest024_04* step024_04 = new CCommDbTest024_04; |
|
514 CleanupStack::PushL(step024_04); |
|
515 if ( doTestStepWithHeapFailureL( *step024_04, KErrNotSupported) == EFail ) |
|
516 SetTestStepResult(EFail); CleanupStack::PopAndDestroy(step024_04); |
|
517 |
|
518 // Heap test for 024.05 |
|
519 |
|
520 CCommDbTest024_05* step024_05 = new CCommDbTest024_05; |
|
521 CleanupStack::PushL(step024_05); |
|
522 if ( doTestStepWithHeapFailureL( *step024_05, KErrNotSupported) == EFail ) |
|
523 SetTestStepResult(EFail); CleanupStack::PopAndDestroy(step024_05); |
|
524 |
|
525 // Heap test for 024.06 |
|
526 |
|
527 CCommDbTest024_06* step024_06 = new CCommDbTest024_06; |
|
528 CleanupStack::PushL(step024_06); |
|
529 if ( doTestStepWithHeapFailureL( *step024_06, KErrNotSupported) == EFail ) |
|
530 SetTestStepResult(EFail); CleanupStack::PopAndDestroy(step024_06); |
|
531 |
|
532 // Heap test for 024.07 |
|
533 |
|
534 CCommDbTest024_07* step024_07 = new CCommDbTest024_07; |
|
535 CleanupStack::PushL(step024_07); |
|
536 if ( doTestStepWithHeapFailureL( *step024_07, KErrNotSupported) == EFail ) |
|
537 SetTestStepResult(EFail); CleanupStack::PopAndDestroy(step024_07); |
|
538 |
|
539 |
|
540 // Heap test for 024.08 |
|
541 |
|
542 CCommDbTest024_08* step024_08 = new CCommDbTest024_08; |
|
543 CleanupStack::PushL(step024_08); |
|
544 if ( doTestStepWithHeapFailureL( *step024_08, KErrNotSupported) == EFail ) |
|
545 SetTestStepResult(EFail); CleanupStack::PopAndDestroy(step024_08); |
|
546 |
|
547 return TestStepResult(); |
|
548 |
|
549 } |