|
1 // Copyright (c) 2001-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 contains CommDb Unit Test Cases 022.XX |
|
15 // |
|
16 // |
|
17 |
|
18 // EPOC includes |
|
19 #include <e32base.h> |
|
20 #include <commdb.h> |
|
21 #include <d32comm.h> |
|
22 |
|
23 // Test system includes |
|
24 #include <networking/log.h> |
|
25 #include <networking/teststep.h> |
|
26 #include "Teststepcommdb.h" |
|
27 #include "TestSuiteCommdb.h" |
|
28 #include "Step_022_xx.h" |
|
29 |
|
30 |
|
31 // |
|
32 // Test step 022.01 |
|
33 // |
|
34 |
|
35 // constructor |
|
36 CCommDbTest022_01::CCommDbTest022_01() |
|
37 { |
|
38 // store the name of this test case |
|
39 iTestStepName = _L("step_022_01"); |
|
40 } |
|
41 |
|
42 // destructor |
|
43 CCommDbTest022_01::~CCommDbTest022_01() |
|
44 { |
|
45 } |
|
46 |
|
47 |
|
48 TVerdict CCommDbTest022_01::doTestStepPreambleL() |
|
49 { |
|
50 openDbL(); |
|
51 return EPass; |
|
52 } |
|
53 |
|
54 TInt CCommDbTest022_01::executeStepL() |
|
55 { |
|
56 TInt ret=KErrGeneral; |
|
57 |
|
58 //Open a view on the IAP table, then check the records returned |
|
59 iTheView = iTheDb->OpenIAPTableViewMatchingBearerSetLC( KCommDbBearerCSD, ECommDbConnectionDirectionOutgoing); |
|
60 CleanupStack::Pop(); |
|
61 |
|
62 CDBLEAVE( iTheView->GotoFirstRecord(), KErrNone ); |
|
63 TBuf<KCommsDbSvrMaxFieldLength> value; |
|
64 iTheView->ReadTextL( TPtrC(COMMDB_NAME), value ); |
|
65 if( !value.Compare(_L("Record #1")) ) |
|
66 { |
|
67 CDBLEAVE( iTheView->GotoNextRecord(), KErrNone ); |
|
68 iTheView->ReadTextL( TPtrC(COMMDB_NAME), value); |
|
69 if ( !value.Compare(_L("Record #2")) ) |
|
70 { |
|
71 //There should be no more records |
|
72 CDBLEAVE( iTheView->GotoNextRecord(), KErrNotFound ); |
|
73 ret = KErrNone; |
|
74 } |
|
75 } |
|
76 |
|
77 return ret; |
|
78 } |
|
79 |
|
80 |
|
81 TVerdict CCommDbTest022_01::doTestStepL( ) |
|
82 { |
|
83 Log(_L("Step 022.01 called ")); |
|
84 |
|
85 |
|
86 if ( executeStepL() == KErrNone ) |
|
87 iTestStepResult = EPass; |
|
88 else |
|
89 iTestStepResult = EFail; |
|
90 |
|
91 return iTestStepResult; |
|
92 } |
|
93 |
|
94 |
|
95 |
|
96 |
|
97 // |
|
98 // Test step 022.02 |
|
99 // |
|
100 |
|
101 // constructor |
|
102 CCommDbTest022_02::CCommDbTest022_02() |
|
103 { |
|
104 // store the name of this test case |
|
105 iTestStepName = _L("step_022_02"); |
|
106 } |
|
107 |
|
108 // destructor |
|
109 CCommDbTest022_02::~CCommDbTest022_02() |
|
110 { |
|
111 } |
|
112 |
|
113 |
|
114 TVerdict CCommDbTest022_02::doTestStepPreambleL() |
|
115 { |
|
116 openDbL(); |
|
117 return EPass; |
|
118 } |
|
119 |
|
120 TInt CCommDbTest022_02::executeStepL() |
|
121 { |
|
122 TInt ret=KErrGeneral; |
|
123 |
|
124 //Open a view on the IAP table, then check the records returned |
|
125 iTheView = iTheDb->OpenIAPTableViewMatchingBearerSetLC( KCommDbBearerCSD, ECommDbConnectionDirectionIncoming); |
|
126 CleanupStack::Pop(); |
|
127 |
|
128 CDBLEAVE( iTheView->GotoFirstRecord(), KErrNone ); |
|
129 TBuf<KCommsDbSvrMaxFieldLength> value; |
|
130 iTheView->ReadTextL( TPtrC(COMMDB_NAME), value ); |
|
131 if( !value.Compare(_L("Record #3")) ) |
|
132 { |
|
133 CDBLEAVE( iTheView->GotoNextRecord(), KErrNone ); |
|
134 iTheView->ReadTextL( TPtrC(COMMDB_NAME), value); |
|
135 if ( !value.Compare(_L("Record #4")) ) |
|
136 { |
|
137 CDBLEAVE( iTheView->GotoNextRecord(), KErrNone ); |
|
138 iTheView->ReadTextL( TPtrC(COMMDB_NAME), value); |
|
139 if ( !value.Compare(_L("Record #6")) ) |
|
140 { |
|
141 //There should be no more records |
|
142 CDBLEAVE( iTheView->GotoNextRecord(), KErrNotFound ); |
|
143 ret = KErrNone; |
|
144 } |
|
145 } |
|
146 } |
|
147 |
|
148 return ret; |
|
149 } |
|
150 |
|
151 |
|
152 TVerdict CCommDbTest022_02::doTestStepL( ) |
|
153 { |
|
154 Log(_L("Step 022.02 called ")); |
|
155 |
|
156 |
|
157 if ( executeStepL() == KErrNone ) |
|
158 iTestStepResult = EPass; |
|
159 else |
|
160 iTestStepResult = EFail; |
|
161 |
|
162 return iTestStepResult; |
|
163 } |
|
164 |
|
165 |
|
166 |
|
167 // |
|
168 // Test step 022.03 |
|
169 // |
|
170 |
|
171 // constructor |
|
172 CCommDbTest022_03::CCommDbTest022_03() |
|
173 { |
|
174 // store the name of this test case |
|
175 iTestStepName = _L("step_022_03"); |
|
176 } |
|
177 |
|
178 // destructor |
|
179 CCommDbTest022_03::~CCommDbTest022_03() |
|
180 { |
|
181 } |
|
182 |
|
183 |
|
184 TVerdict CCommDbTest022_03::doTestStepPreambleL() |
|
185 { |
|
186 openDbL(); |
|
187 return EPass; |
|
188 } |
|
189 |
|
190 TInt CCommDbTest022_03::executeStepL() |
|
191 { |
|
192 TInt ret=KErrGeneral; |
|
193 |
|
194 //Open a view on the IAP table, then check the records returned |
|
195 iTheView = iTheDb->OpenIAPTableViewMatchingBearerSetLC( KCommDbBearerWcdma, ECommDbConnectionDirectionOutgoing); |
|
196 CleanupStack::Pop(); |
|
197 |
|
198 CDBLEAVE( iTheView->GotoFirstRecord(), KErrNone ); |
|
199 TBuf<KCommsDbSvrMaxFieldLength> value; |
|
200 iTheView->ReadTextL( TPtrC(COMMDB_NAME), value ); |
|
201 if( !value.Compare(_L("Record #5")) ) |
|
202 { |
|
203 CDBLEAVE( iTheView->GotoNextRecord(), KErrNone ); |
|
204 iTheView->ReadTextL( TPtrC(COMMDB_NAME), value); |
|
205 if ( !value.Compare(_L("Record #7")) ) |
|
206 { |
|
207 //There should be no more records |
|
208 CDBLEAVE( iTheView->GotoNextRecord(), KErrNotFound ); |
|
209 ret = KErrNone; |
|
210 } |
|
211 } |
|
212 |
|
213 return ret; |
|
214 } |
|
215 |
|
216 |
|
217 TVerdict CCommDbTest022_03::doTestStepL( ) |
|
218 { |
|
219 Log(_L("Step 022.03 called ")); |
|
220 |
|
221 |
|
222 if ( executeStepL() == KErrNone ) |
|
223 iTestStepResult = EPass; |
|
224 else |
|
225 iTestStepResult = EFail; |
|
226 |
|
227 return iTestStepResult; |
|
228 } |
|
229 |
|
230 |
|
231 |
|
232 // |
|
233 // Test step 022.04 |
|
234 // |
|
235 |
|
236 // constructor |
|
237 CCommDbTest022_04::CCommDbTest022_04() |
|
238 { |
|
239 // store the name of this test case |
|
240 iTestStepName = _L("step_022_04"); |
|
241 } |
|
242 |
|
243 // destructor |
|
244 CCommDbTest022_04::~CCommDbTest022_04() |
|
245 { |
|
246 } |
|
247 |
|
248 |
|
249 TVerdict CCommDbTest022_04::doTestStepPreambleL() |
|
250 { |
|
251 openDbL(); |
|
252 return EPass; |
|
253 } |
|
254 |
|
255 TInt CCommDbTest022_04::executeStepL() |
|
256 { |
|
257 TInt ret=KErrGeneral; |
|
258 |
|
259 //Open a view on the IAP table, then check the records returned |
|
260 iTheView = iTheDb->OpenIAPTableViewMatchingBearerSetLC( KCommDbBearerCSD, ECommDbConnectionDirectionOutgoing); |
|
261 CleanupStack::Pop(); |
|
262 |
|
263 CDBLEAVE( iTheView->GotoFirstRecord(), KErrNone ); |
|
264 TBuf<KCommsDbSvrMaxFieldLength> value; |
|
265 iTheView->ReadTextL( TPtrC(COMMDB_NAME), value ); |
|
266 if( !value.Compare(_L("Record #1")) ) |
|
267 { |
|
268 CDBLEAVE( iTheView->GotoNextRecord(), KErrNone ); |
|
269 iTheView->ReadTextL( TPtrC(COMMDB_NAME), value); |
|
270 if ( !value.Compare(_L("Record #2")) ) |
|
271 { |
|
272 //There should be no more records |
|
273 CDBLEAVE( iTheView->GotoNextRecord(), KErrNotFound ); |
|
274 ret = KErrNone; |
|
275 } |
|
276 } |
|
277 |
|
278 return ret; |
|
279 } |
|
280 |
|
281 |
|
282 TVerdict CCommDbTest022_04::doTestStepL( ) |
|
283 { |
|
284 Log(_L("Step 022.04 called ")); |
|
285 |
|
286 |
|
287 if ( executeStepL() == KErrNone ) |
|
288 iTestStepResult = EPass; |
|
289 else |
|
290 iTestStepResult = EFail; |
|
291 |
|
292 return iTestStepResult; |
|
293 } |
|
294 |
|
295 |
|
296 |
|
297 |
|
298 // |
|
299 // Test step 022.05 |
|
300 // |
|
301 |
|
302 // constructor |
|
303 CCommDbTest022_05::CCommDbTest022_05() |
|
304 { |
|
305 // store the name of this test case |
|
306 iTestStepName = _L("step_022_05"); |
|
307 } |
|
308 |
|
309 // destructor |
|
310 CCommDbTest022_05::~CCommDbTest022_05() |
|
311 { |
|
312 } |
|
313 |
|
314 |
|
315 TVerdict CCommDbTest022_05::doTestStepPreambleL() |
|
316 { |
|
317 openDbL(); |
|
318 return EPass; |
|
319 } |
|
320 |
|
321 TInt CCommDbTest022_05::executeStepL() |
|
322 { |
|
323 TInt ret=KErrGeneral; |
|
324 |
|
325 //Open a view on the IAP table, then check the records returned |
|
326 iTheView = iTheDb->OpenIAPTableViewMatchingBearerSetLC( KCommDbBearerWcdma, ECommDbConnectionDirectionIncoming); |
|
327 CleanupStack::Pop(); |
|
328 |
|
329 CDBLEAVE( iTheView->GotoFirstRecord(), KErrNone ); |
|
330 TBuf<KCommsDbSvrMaxFieldLength> value; |
|
331 iTheView->ReadTextL( TPtrC(COMMDB_NAME), value ); |
|
332 if( !value.Compare(_L("Record #9")) ) |
|
333 { |
|
334 CDBLEAVE( iTheView->GotoNextRecord(), KErrNone ); |
|
335 iTheView->ReadTextL( TPtrC(COMMDB_NAME), value); |
|
336 if ( !value.Compare(_L("Record #10")) ) |
|
337 { |
|
338 //There should be no more records |
|
339 CDBLEAVE( iTheView->GotoNextRecord(), KErrNotFound ); |
|
340 ret = KErrNone; |
|
341 } |
|
342 } |
|
343 |
|
344 return ret; |
|
345 } |
|
346 |
|
347 |
|
348 TVerdict CCommDbTest022_05::doTestStepL( ) |
|
349 { |
|
350 Log(_L("Step 022.05 called ")); |
|
351 |
|
352 |
|
353 if ( executeStepL() == KErrNone ) |
|
354 iTestStepResult = EPass; |
|
355 else |
|
356 iTestStepResult = EFail; |
|
357 |
|
358 return iTestStepResult; |
|
359 } |
|
360 |
|
361 |
|
362 |
|
363 // |
|
364 // Test step 022.06 |
|
365 // |
|
366 |
|
367 // constructor |
|
368 CCommDbTest022_06::CCommDbTest022_06() |
|
369 { |
|
370 // store the name of this test case |
|
371 iTestStepName = _L("step_022_06"); |
|
372 } |
|
373 |
|
374 // destructor |
|
375 CCommDbTest022_06::~CCommDbTest022_06() |
|
376 { |
|
377 } |
|
378 |
|
379 |
|
380 TVerdict CCommDbTest022_06::doTestStepPreambleL() |
|
381 { |
|
382 openDbL(); |
|
383 return EPass; |
|
384 } |
|
385 |
|
386 TInt CCommDbTest022_06::executeStepL() |
|
387 { |
|
388 TInt ret=KErrGeneral; |
|
389 |
|
390 //Open a view on the IAP table, then check the records returned |
|
391 iTheView = iTheDb->OpenIAPTableViewMatchingBearerSetLC( KCommDbBearerWcdma, ECommDbConnectionDirectionIncoming); |
|
392 CleanupStack::Pop(); |
|
393 |
|
394 CDBLEAVE( iTheView->GotoFirstRecord(), KErrNone ); |
|
395 TBuf<KCommsDbSvrMaxFieldLength> value; |
|
396 iTheView->ReadTextL( TPtrC(COMMDB_NAME), value ); |
|
397 if( !value.Compare(_L("Record #9")) ) |
|
398 { |
|
399 CDBLEAVE( iTheView->GotoNextRecord(), KErrNone ); |
|
400 iTheView->ReadTextL( TPtrC(COMMDB_NAME), value); |
|
401 if ( !value.Compare(_L("Record #10")) ) |
|
402 { |
|
403 //There should be no more records |
|
404 CDBLEAVE( iTheView->GotoNextRecord(), KErrNotFound ); |
|
405 ret = KErrNone; |
|
406 } |
|
407 } |
|
408 |
|
409 return ret; |
|
410 } |
|
411 |
|
412 |
|
413 TVerdict CCommDbTest022_06::doTestStepL( ) |
|
414 { |
|
415 Log(_L("Step 022.06 called ")); |
|
416 |
|
417 |
|
418 if ( executeStepL() == KErrNone ) |
|
419 iTestStepResult = EPass; |
|
420 else |
|
421 iTestStepResult = EFail; |
|
422 |
|
423 return iTestStepResult; |
|
424 } |
|
425 |
|
426 |
|
427 // |
|
428 // Test step 022.07 |
|
429 // |
|
430 |
|
431 // constructor |
|
432 CCommDbTest022_07::CCommDbTest022_07() |
|
433 { |
|
434 // store the name of this test case |
|
435 iTestStepName = _L("step_022_07"); |
|
436 } |
|
437 |
|
438 // destructor |
|
439 CCommDbTest022_07::~CCommDbTest022_07() |
|
440 { |
|
441 } |
|
442 |
|
443 |
|
444 TVerdict CCommDbTest022_07::doTestStepPreambleL() |
|
445 { |
|
446 openDbL(); |
|
447 return EPass; |
|
448 } |
|
449 |
|
450 TInt CCommDbTest022_07::executeStepL() |
|
451 { |
|
452 TInt ret=KErrGeneral; |
|
453 |
|
454 //Open a view on the IAP table, then check the records returned |
|
455 iTheView = iTheDb->OpenIAPTableViewMatchingBearerSetLC( KCommDbBearerCSD, ECommDbConnectionDirectionIncoming); |
|
456 CleanupStack::Pop(); |
|
457 |
|
458 CDBLEAVE( iTheView->GotoFirstRecord(), KErrNone ); |
|
459 TBuf<KCommsDbSvrMaxFieldLength> value; |
|
460 iTheView->ReadTextL( TPtrC(COMMDB_NAME), value ); |
|
461 if( !value.Compare(_L("Record #3")) ) |
|
462 { |
|
463 CDBLEAVE( iTheView->GotoNextRecord(), KErrNone ); |
|
464 iTheView->ReadTextL( TPtrC(COMMDB_NAME), value); |
|
465 if ( !value.Compare(_L("Record #4")) ) |
|
466 { |
|
467 CDBLEAVE( iTheView->GotoNextRecord(), KErrNone ); |
|
468 iTheView->ReadTextL( TPtrC(COMMDB_NAME), value); |
|
469 if ( !value.Compare(_L("Record #6")) ) |
|
470 { |
|
471 //There should be no more records |
|
472 CDBLEAVE( iTheView->GotoNextRecord(), KErrNotFound ); |
|
473 ret = KErrNone; |
|
474 } |
|
475 } |
|
476 } |
|
477 |
|
478 return ret; |
|
479 } |
|
480 |
|
481 |
|
482 TVerdict CCommDbTest022_07::doTestStepL( ) |
|
483 { |
|
484 Log(_L("Step 022.07 called ")); |
|
485 |
|
486 |
|
487 if ( executeStepL() == KErrNone ) |
|
488 iTestStepResult = EPass; |
|
489 else |
|
490 iTestStepResult = EFail; |
|
491 |
|
492 return iTestStepResult; |
|
493 } |
|
494 |
|
495 |
|
496 // |
|
497 // Test step 022.08 |
|
498 // |
|
499 |
|
500 // constructor |
|
501 CCommDbTest022_08::CCommDbTest022_08() |
|
502 { |
|
503 // store the name of this test case |
|
504 iTestStepName = _L("step_022_08"); |
|
505 } |
|
506 |
|
507 // destructor |
|
508 CCommDbTest022_08::~CCommDbTest022_08() |
|
509 { |
|
510 } |
|
511 |
|
512 |
|
513 TVerdict CCommDbTest022_08::doTestStepPreambleL() |
|
514 { |
|
515 openDbL(); |
|
516 return EPass; |
|
517 } |
|
518 |
|
519 TInt CCommDbTest022_08::executeStepL() |
|
520 { |
|
521 TInt ret=KErrGeneral; |
|
522 |
|
523 //Open a view on the IAP table, then check the records returned |
|
524 iTheView = iTheDb->OpenIAPTableViewMatchingBearerSetLC( KCommDbBearerLAN, ECommDbConnectionDirectionIncoming); |
|
525 CleanupStack::Pop(); |
|
526 |
|
527 CDBLEAVE( iTheView->GotoFirstRecord(), KErrNone ); |
|
528 TBuf<KCommsDbSvrMaxFieldLength> value; |
|
529 iTheView->ReadTextL( TPtrC(COMMDB_NAME), value ); |
|
530 if( !value.Compare(_L("Record #11")) ) |
|
531 { |
|
532 CDBLEAVE( iTheView->GotoNextRecord(), KErrNone ); |
|
533 iTheView->ReadTextL( TPtrC(COMMDB_NAME), value); |
|
534 if ( !value.Compare(_L("Record #12")) ) |
|
535 { |
|
536 //There should be no more records |
|
537 CDBLEAVE( iTheView->GotoNextRecord(), KErrNotFound ); |
|
538 ret = KErrNone; |
|
539 } |
|
540 } |
|
541 |
|
542 return ret; |
|
543 } |
|
544 |
|
545 |
|
546 TVerdict CCommDbTest022_08::doTestStepL( ) |
|
547 { |
|
548 Log(_L("Step 022.08 called ")); |
|
549 |
|
550 |
|
551 if ( executeStepL() == KErrNone ) |
|
552 iTestStepResult = EPass; |
|
553 else |
|
554 iTestStepResult = EFail; |
|
555 |
|
556 return iTestStepResult; |
|
557 } |
|
558 |
|
559 // |
|
560 // Test step 022.09 |
|
561 // |
|
562 |
|
563 // constructor |
|
564 CCommDbTest022_09::CCommDbTest022_09() |
|
565 { |
|
566 // store the name of this test case |
|
567 iTestStepName = _L("step_022_09"); |
|
568 } |
|
569 |
|
570 // destructor |
|
571 CCommDbTest022_09::~CCommDbTest022_09() |
|
572 { |
|
573 } |
|
574 |
|
575 |
|
576 TVerdict CCommDbTest022_09::doTestStepPreambleL() |
|
577 { |
|
578 openDbL(); |
|
579 return EPass; |
|
580 } |
|
581 |
|
582 TInt CCommDbTest022_09::executeStepL() |
|
583 { |
|
584 TInt ret=KErrGeneral; |
|
585 |
|
586 //Open a view on the IAP table, then check the records returned |
|
587 iTheView = iTheDb->OpenIAPTableViewMatchingBearerSetLC( KCommDbBearerLAN, ECommDbConnectionDirectionOutgoing); |
|
588 CleanupStack::Pop(); |
|
589 |
|
590 CDBLEAVE( iTheView->GotoFirstRecord(), KErrNone ); |
|
591 TBuf<KCommsDbSvrMaxFieldLength> value; |
|
592 iTheView->ReadTextL( TPtrC(COMMDB_NAME), value ); |
|
593 if( !value.Compare(_L("Record #11")) ) |
|
594 { |
|
595 CDBLEAVE( iTheView->GotoNextRecord(), KErrNone ); |
|
596 iTheView->ReadTextL( TPtrC(COMMDB_NAME), value); |
|
597 if ( !value.Compare(_L("Record #12")) ) |
|
598 { |
|
599 //There should be no more records |
|
600 CDBLEAVE( iTheView->GotoNextRecord(), KErrNotFound ); |
|
601 ret = KErrNone; |
|
602 } |
|
603 } |
|
604 |
|
605 return ret; |
|
606 } |
|
607 |
|
608 |
|
609 TVerdict CCommDbTest022_09::doTestStepL( ) |
|
610 { |
|
611 Log(_L("Step 022.09 called ")); |
|
612 |
|
613 |
|
614 if ( executeStepL() == KErrNone ) |
|
615 iTestStepResult = EPass; |
|
616 else |
|
617 iTestStepResult = EFail; |
|
618 |
|
619 return iTestStepResult; |
|
620 } |
|
621 |
|
622 |
|
623 |
|
624 // |
|
625 // Test step 022.10 |
|
626 // |
|
627 |
|
628 // constructor |
|
629 CCommDbTest022_10::CCommDbTest022_10() |
|
630 { |
|
631 // store the name of this test case |
|
632 iTestStepName = _L("step_022_10"); |
|
633 } |
|
634 |
|
635 // destructor |
|
636 CCommDbTest022_10::~CCommDbTest022_10() |
|
637 { |
|
638 } |
|
639 |
|
640 |
|
641 TVerdict CCommDbTest022_10::doTestStepPreambleL() |
|
642 { |
|
643 openDbL(); |
|
644 return EPass; |
|
645 } |
|
646 |
|
647 TInt CCommDbTest022_10::executeStepL() |
|
648 { |
|
649 TInt ret=KErrNone; |
|
650 |
|
651 //Open a view with multiple bearers on the IAP table, then check the records returned |
|
652 iTheView = iTheDb->OpenIAPTableViewMatchingBearerSetLC( KCommDbBearerCSD | KCommDbBearerLAN, ECommDbConnectionDirectionOutgoing); |
|
653 CleanupStack::Pop(); |
|
654 |
|
655 CDBLEAVE( iTheView->GotoFirstRecord(), KErrNone ); |
|
656 TBuf<KCommsDbSvrMaxFieldLength> value; |
|
657 iTheView->ReadTextL( TPtrC(COMMDB_NAME), value ); |
|
658 if( value.Compare(_L("Record #1")) && ret == KErrNone) |
|
659 { |
|
660 ret = KErrGeneral; |
|
661 } |
|
662 else |
|
663 { |
|
664 CDBLEAVE( iTheView->GotoNextRecord(), KErrNone ); |
|
665 iTheView->ReadTextL( TPtrC(COMMDB_NAME), value); |
|
666 } |
|
667 |
|
668 if ( value.Compare(_L("Record #2")) && ret == KErrNone ) |
|
669 { |
|
670 ret = KErrGeneral; |
|
671 } |
|
672 else |
|
673 { |
|
674 CDBLEAVE( iTheView->GotoNextRecord(), KErrNone ); |
|
675 iTheView->ReadTextL( TPtrC(COMMDB_NAME), value); |
|
676 } |
|
677 |
|
678 if ( value.Compare(_L("Record #11")) && ret == KErrNone ) |
|
679 { |
|
680 ret = KErrGeneral; |
|
681 } |
|
682 else |
|
683 { |
|
684 CDBLEAVE( iTheView->GotoNextRecord(), KErrNone ); |
|
685 iTheView->ReadTextL( TPtrC(COMMDB_NAME), value); |
|
686 } |
|
687 |
|
688 if ( value.Compare(_L("Record #12")) && ret == KErrNone ) |
|
689 { |
|
690 ret = KErrGeneral; |
|
691 } |
|
692 else |
|
693 { |
|
694 CDBLEAVE( iTheView->GotoNextRecord(), KErrNotFound ); |
|
695 } |
|
696 |
|
697 |
|
698 return ret; |
|
699 } |
|
700 |
|
701 |
|
702 TVerdict CCommDbTest022_10::doTestStepL( ) |
|
703 { |
|
704 Log(_L("Step 022.10 called ")); |
|
705 |
|
706 |
|
707 if ( executeStepL() == KErrNone ) |
|
708 iTestStepResult = EPass; |
|
709 else |
|
710 iTestStepResult = EFail; |
|
711 |
|
712 return iTestStepResult; |
|
713 } |
|
714 |
|
715 |
|
716 // |
|
717 // Test step 022.11 |
|
718 // |
|
719 |
|
720 // constructor |
|
721 CCommDbTest022_11::CCommDbTest022_11() |
|
722 { |
|
723 // store the name of this test case |
|
724 iTestStepName = _L("step_022_11"); |
|
725 } |
|
726 |
|
727 // destructor |
|
728 CCommDbTest022_11::~CCommDbTest022_11() |
|
729 { |
|
730 } |
|
731 |
|
732 |
|
733 TVerdict CCommDbTest022_11::doTestStepPreambleL() |
|
734 { |
|
735 openDbL(); |
|
736 return EPass; |
|
737 } |
|
738 |
|
739 |
|
740 #define INVALID_BEARER 0x200 |
|
741 |
|
742 TInt CCommDbTest022_11::executeStepL() |
|
743 { |
|
744 TInt ret=KErrGeneral; |
|
745 |
|
746 |
|
747 TRAPD( r, iTheView = iTheDb->OpenIAPTableViewMatchingBearerSetLC( INVALID_BEARER , ECommDbConnectionDirectionOutgoing) ); |
|
748 if ( r!=KErrNone ) |
|
749 { |
|
750 ret = r; |
|
751 } |
|
752 else |
|
753 { |
|
754 //Shouldnt get here, but just in case .... |
|
755 CleanupStack::Pop(); |
|
756 } |
|
757 |
|
758 return ret; |
|
759 } |
|
760 |
|
761 |
|
762 TVerdict CCommDbTest022_11::doTestStepL( ) |
|
763 { |
|
764 Log(_L("Step 022.11 called ")); |
|
765 |
|
766 |
|
767 if ( executeStepL() == KErrArgument ) |
|
768 iTestStepResult = EPass; |
|
769 else |
|
770 iTestStepResult = EFail; |
|
771 |
|
772 return iTestStepResult; |
|
773 } |
|
774 |
|
775 |
|
776 |
|
777 |
|
778 // |
|
779 // Test step 022.12 |
|
780 // |
|
781 |
|
782 // constructor |
|
783 CCommDbTest022_12::CCommDbTest022_12() |
|
784 { |
|
785 // store the name of this test case |
|
786 iTestStepName = _L("step_022_12"); |
|
787 } |
|
788 |
|
789 // destructor |
|
790 CCommDbTest022_12::~CCommDbTest022_12() |
|
791 { |
|
792 } |
|
793 |
|
794 |
|
795 TVerdict CCommDbTest022_12::doTestStepPreambleL() |
|
796 { |
|
797 openDbL(); |
|
798 return EPass; |
|
799 } |
|
800 |
|
801 |
|
802 #define INVALID_DIRECTION 0xF |
|
803 |
|
804 TInt CCommDbTest022_12::executeStepL() |
|
805 { |
|
806 TInt ret=KErrGeneral; |
|
807 |
|
808 //Due to the strong type checking in C++, this test step is not particularly valid |
|
809 TRAPD( r, iTheView = iTheDb->OpenIAPTableViewMatchingBearerSetLC( KCommDbBearerCSD , (TCommDbConnectionDirection)INVALID_DIRECTION ) ); |
|
810 if ( r!=KErrNone ) |
|
811 { |
|
812 ret = r; |
|
813 } |
|
814 else |
|
815 { |
|
816 //Shouldnt get here, but just in case .... |
|
817 CleanupStack::Pop(); |
|
818 } |
|
819 |
|
820 return ret; |
|
821 } |
|
822 |
|
823 |
|
824 TVerdict CCommDbTest022_12::doTestStepL( ) |
|
825 { |
|
826 Log(_L("Step 022.12 called ")); |
|
827 |
|
828 |
|
829 if ( executeStepL() == KErrArgument ) |
|
830 iTestStepResult = EPass; |
|
831 else |
|
832 iTestStepResult = EFail; |
|
833 |
|
834 return iTestStepResult; |
|
835 } |
|
836 |
|
837 |
|
838 |
|
839 // |
|
840 // Test step 022.13 |
|
841 // |
|
842 |
|
843 // constructor |
|
844 CCommDbTest022_13::CCommDbTest022_13() |
|
845 { |
|
846 // store the name of this test case |
|
847 iTestStepName = _L("step_022_13"); |
|
848 } |
|
849 |
|
850 // destructor |
|
851 CCommDbTest022_13::~CCommDbTest022_13() |
|
852 { |
|
853 } |
|
854 |
|
855 |
|
856 TVerdict CCommDbTest022_13::doTestStepPreambleL() |
|
857 { |
|
858 openDbL(); |
|
859 return EPass; |
|
860 } |
|
861 |
|
862 |
|
863 TInt CCommDbTest022_13::executeStepL() |
|
864 { |
|
865 TInt ret=KErrGeneral; |
|
866 |
|
867 //Due to the strong type checking in C++, this test step is not particularly valid |
|
868 TRAPD( r, iTheView = iTheDb->OpenIAPTableViewMatchingBearerSetLC( KCommDbBearerCSD , (TCommDbConnectionDirection)5 ) ); |
|
869 if ( r!=KErrNone ) |
|
870 { |
|
871 ret = r; |
|
872 } |
|
873 else |
|
874 { |
|
875 //Shouldnt get here, but just in case .... |
|
876 CleanupStack::Pop(); |
|
877 } |
|
878 |
|
879 return ret; |
|
880 } |
|
881 |
|
882 |
|
883 TVerdict CCommDbTest022_13::doTestStepL( ) |
|
884 { |
|
885 Log(_L("Step 022.13 called ")); |
|
886 |
|
887 |
|
888 if ( executeStepL() == KErrArgument ) |
|
889 iTestStepResult = EPass; |
|
890 else |
|
891 iTestStepResult = EFail; |
|
892 |
|
893 return iTestStepResult; |
|
894 } |
|
895 |
|
896 |
|
897 // |
|
898 // Test step 022.14 |
|
899 // |
|
900 |
|
901 // constructor |
|
902 CCommDbTest022_14::CCommDbTest022_14() |
|
903 { |
|
904 // store the name of this test case |
|
905 iTestStepName = _L("step_022_14"); |
|
906 } |
|
907 |
|
908 // destructor |
|
909 CCommDbTest022_14::~CCommDbTest022_14() |
|
910 { |
|
911 } |
|
912 |
|
913 |
|
914 TVerdict CCommDbTest022_14::doTestStepPreambleL() |
|
915 { |
|
916 openDbL(); |
|
917 return EPass; |
|
918 } |
|
919 |
|
920 |
|
921 #define INVALID_DIRECTION2 0xffffffff |
|
922 |
|
923 TInt CCommDbTest022_14::executeStepL() |
|
924 { |
|
925 TInt ret=KErrGeneral; |
|
926 |
|
927 //Due to the strong type checking in C++, this test step is not particularly valid |
|
928 TRAPD( r, iTheView = iTheDb->OpenIAPTableViewMatchingBearerSetLC( KCommDbBearerCSD , (TCommDbConnectionDirection)INVALID_DIRECTION2 ) ); |
|
929 if ( r!=KErrNone ) |
|
930 { |
|
931 ret = r; |
|
932 } |
|
933 else |
|
934 { |
|
935 //Shouldnt get here, but just in case .... |
|
936 CleanupStack::Pop(); |
|
937 } |
|
938 |
|
939 return ret; |
|
940 } |
|
941 |
|
942 |
|
943 TVerdict CCommDbTest022_14::doTestStepL( ) |
|
944 { |
|
945 Log(_L("Step 022.14 called ")); |
|
946 |
|
947 |
|
948 if ( executeStepL() == KErrArgument ) |
|
949 iTestStepResult = EPass; |
|
950 else |
|
951 iTestStepResult = EFail; |
|
952 |
|
953 return iTestStepResult; |
|
954 } |
|
955 |
|
956 |
|
957 // |
|
958 // Test step 022.15 |
|
959 // |
|
960 |
|
961 // constructor |
|
962 CCommDbTest022_15::CCommDbTest022_15() |
|
963 { |
|
964 // store the name of this test case |
|
965 iTestStepName = _L("step_022_15"); |
|
966 } |
|
967 |
|
968 // destructor |
|
969 CCommDbTest022_15::~CCommDbTest022_15() |
|
970 { |
|
971 } |
|
972 |
|
973 |
|
974 TVerdict CCommDbTest022_15::doTestStepPreambleL() |
|
975 { |
|
976 openDbL(); |
|
977 return EPass; |
|
978 } |
|
979 |
|
980 |
|
981 #define UNSUPPORTED_BEARER 0x30 |
|
982 |
|
983 TInt CCommDbTest022_15::executeStepL() |
|
984 { |
|
985 TInt ret=KErrGeneral; |
|
986 // Similar to test 022_11, but with direction incoming... |
|
987 |
|
988 TRAPD( r, iTheView = iTheDb->OpenIAPTableViewMatchingBearerSetLC( UNSUPPORTED_BEARER , ECommDbConnectionDirectionIncoming) ); |
|
989 if ( r!=KErrNone ) |
|
990 { |
|
991 ret = r; |
|
992 } |
|
993 else |
|
994 { |
|
995 //Shouldnt get here, but just in case .... |
|
996 CleanupStack::Pop(); |
|
997 } |
|
998 |
|
999 return ret; |
|
1000 } |
|
1001 |
|
1002 |
|
1003 TVerdict CCommDbTest022_15::doTestStepL( ) |
|
1004 { |
|
1005 Log(_L("Step 022.15 called ")); |
|
1006 |
|
1007 |
|
1008 if ( executeStepL() == KErrArgument ) |
|
1009 iTestStepResult = EPass; |
|
1010 else |
|
1011 iTestStepResult = EFail; |
|
1012 |
|
1013 return iTestStepResult; |
|
1014 } |
|
1015 |
|
1016 |
|
1017 // |
|
1018 // Test step 022.16 |
|
1019 // |
|
1020 |
|
1021 // constructor |
|
1022 CCommDbTest022_16::CCommDbTest022_16() |
|
1023 { |
|
1024 // store the name of this test case |
|
1025 iTestStepName = _L("step_022_16"); |
|
1026 } |
|
1027 |
|
1028 // destructor |
|
1029 CCommDbTest022_16::~CCommDbTest022_16() |
|
1030 { |
|
1031 } |
|
1032 |
|
1033 TVerdict CCommDbTest022_16::doTestStepL( ) |
|
1034 { |
|
1035 Log(_L("Step 022.16 called ")); |
|
1036 |
|
1037 iTestStepResult = EPass; |
|
1038 |
|
1039 // Heap test for 022.01 |
|
1040 |
|
1041 CCommDbTest022_01* step022_01 = new(ELeave) CCommDbTest022_01; |
|
1042 CleanupStack::PushL(step022_01); |
|
1043 step022_01->iSuite = iSuite; |
|
1044 if ( doTestStepWithHeapFailureL( *step022_01, KErrNone) == EFail ) |
|
1045 iTestStepResult = EFail; |
|
1046 CleanupStack::PopAndDestroy(step022_01); |
|
1047 |
|
1048 |
|
1049 |
|
1050 return iTestStepResult; |
|
1051 |
|
1052 } |
|
1053 |
|
1054 |
|
1055 // |
|
1056 // Test step 022.17 |
|
1057 // |
|
1058 |
|
1059 // constructor |
|
1060 CCommDbTest022_17::CCommDbTest022_17() |
|
1061 { |
|
1062 // store the name of this test case |
|
1063 iTestStepName = _L("step_022_17"); |
|
1064 } |
|
1065 |
|
1066 // destructor |
|
1067 CCommDbTest022_17::~CCommDbTest022_17() |
|
1068 { |
|
1069 } |
|
1070 |
|
1071 TVerdict CCommDbTest022_17::doTestStepL( ) |
|
1072 { |
|
1073 Log(_L("Step 022.17 called ")); |
|
1074 |
|
1075 iTestStepResult = EPass; |
|
1076 |
|
1077 // Heap test for 022.02 |
|
1078 |
|
1079 CCommDbTest022_02* step022_02 = new CCommDbTest022_02; |
|
1080 CleanupStack::PushL(step022_02); |
|
1081 step022_02->iSuite = iSuite; |
|
1082 if ( doTestStepWithHeapFailureL( *step022_02, KErrNone) == EFail ) |
|
1083 iTestStepResult = EFail; |
|
1084 CleanupStack::PopAndDestroy(step022_02); |
|
1085 |
|
1086 return iTestStepResult; |
|
1087 |
|
1088 } |
|
1089 |
|
1090 // |
|
1091 // Test step 022.18 |
|
1092 // |
|
1093 |
|
1094 // constructor |
|
1095 CCommDbTest022_18::CCommDbTest022_18() |
|
1096 { |
|
1097 // store the name of this test case |
|
1098 iTestStepName = _L("step_022_18"); |
|
1099 } |
|
1100 |
|
1101 // destructor |
|
1102 CCommDbTest022_18::~CCommDbTest022_18() |
|
1103 { |
|
1104 } |
|
1105 |
|
1106 TVerdict CCommDbTest022_18::doTestStepL( ) |
|
1107 { |
|
1108 Log(_L("Step 022.18 called ")); |
|
1109 |
|
1110 iTestStepResult = EPass; |
|
1111 |
|
1112 // Heap test for 022.03 |
|
1113 |
|
1114 CCommDbTest022_03* step022_03 = new CCommDbTest022_03; |
|
1115 CleanupStack::PushL(step022_03); |
|
1116 step022_03->iSuite = iSuite; |
|
1117 if ( doTestStepWithHeapFailureL( *step022_03, KErrNone) == EFail ) |
|
1118 iTestStepResult = EFail; |
|
1119 CleanupStack::PopAndDestroy(step022_03); |
|
1120 |
|
1121 return iTestStepResult; |
|
1122 |
|
1123 } |
|
1124 |
|
1125 // |
|
1126 // Test step 022.19 |
|
1127 // |
|
1128 |
|
1129 // constructor |
|
1130 CCommDbTest022_19::CCommDbTest022_19() |
|
1131 { |
|
1132 // store the name of this test case |
|
1133 iTestStepName = _L("step_022_19"); |
|
1134 } |
|
1135 |
|
1136 // destructor |
|
1137 CCommDbTest022_19::~CCommDbTest022_19() |
|
1138 { |
|
1139 } |
|
1140 |
|
1141 TVerdict CCommDbTest022_19::doTestStepL( ) |
|
1142 { |
|
1143 Log(_L("Step 022.19 called ")); |
|
1144 |
|
1145 iTestStepResult = EPass; |
|
1146 |
|
1147 // Heap test for 022.04 |
|
1148 |
|
1149 CCommDbTest022_04* step022_04 = new CCommDbTest022_04; |
|
1150 CleanupStack::PushL(step022_04); |
|
1151 step022_04->iSuite = iSuite; |
|
1152 if ( doTestStepWithHeapFailureL( *step022_04, KErrNone) == EFail ) |
|
1153 iTestStepResult = EFail; |
|
1154 CleanupStack::PopAndDestroy(step022_04); |
|
1155 |
|
1156 return iTestStepResult; |
|
1157 |
|
1158 } |
|
1159 |
|
1160 // |
|
1161 // Test step 022.20 |
|
1162 // |
|
1163 |
|
1164 // constructor |
|
1165 CCommDbTest022_20::CCommDbTest022_20() |
|
1166 { |
|
1167 // store the name of this test case |
|
1168 iTestStepName = _L("step_022_20"); |
|
1169 } |
|
1170 |
|
1171 // destructor |
|
1172 CCommDbTest022_20::~CCommDbTest022_20() |
|
1173 { |
|
1174 } |
|
1175 |
|
1176 TVerdict CCommDbTest022_20::doTestStepL( ) |
|
1177 { |
|
1178 Log(_L("Step 022.20 called ")); |
|
1179 |
|
1180 iTestStepResult = EPass; |
|
1181 |
|
1182 // Heap test for 022.05 |
|
1183 |
|
1184 CCommDbTest022_05* step022_05 = new CCommDbTest022_05; |
|
1185 CleanupStack::PushL(step022_05); |
|
1186 step022_05->iSuite = iSuite; |
|
1187 if ( doTestStepWithHeapFailureL( *step022_05, KErrNone) == EFail ) |
|
1188 iTestStepResult = EFail; |
|
1189 CleanupStack::PopAndDestroy(step022_05); |
|
1190 |
|
1191 return iTestStepResult; |
|
1192 |
|
1193 } |
|
1194 |
|
1195 // |
|
1196 // Test step 022.21 |
|
1197 // |
|
1198 |
|
1199 // constructor |
|
1200 CCommDbTest022_21::CCommDbTest022_21() |
|
1201 { |
|
1202 // store the name of this test case |
|
1203 iTestStepName = _L("step_022_21"); |
|
1204 } |
|
1205 |
|
1206 // destructor |
|
1207 CCommDbTest022_21::~CCommDbTest022_21() |
|
1208 { |
|
1209 } |
|
1210 |
|
1211 TVerdict CCommDbTest022_21::doTestStepL( ) |
|
1212 { |
|
1213 Log(_L("Step 022.21 called ")); |
|
1214 |
|
1215 iTestStepResult = EPass; |
|
1216 |
|
1217 // Heap test for 022.06 |
|
1218 |
|
1219 CCommDbTest022_06* step022_06 = new CCommDbTest022_06; |
|
1220 CleanupStack::PushL(step022_06); |
|
1221 step022_06->iSuite = iSuite; |
|
1222 if ( doTestStepWithHeapFailureL( *step022_06, KErrNone) == EFail ) |
|
1223 iTestStepResult = EFail; |
|
1224 CleanupStack::PopAndDestroy(step022_06); |
|
1225 |
|
1226 return iTestStepResult; |
|
1227 |
|
1228 } |
|
1229 |
|
1230 // |
|
1231 // Test step 022.22 |
|
1232 // |
|
1233 |
|
1234 // constructor |
|
1235 CCommDbTest022_22::CCommDbTest022_22() |
|
1236 { |
|
1237 // store the name of this test case |
|
1238 iTestStepName = _L("step_022_22"); |
|
1239 } |
|
1240 |
|
1241 // destructor |
|
1242 CCommDbTest022_22::~CCommDbTest022_22() |
|
1243 { |
|
1244 } |
|
1245 |
|
1246 TVerdict CCommDbTest022_22::doTestStepL( ) |
|
1247 { |
|
1248 Log(_L("Step 022.22 called ")); |
|
1249 |
|
1250 iTestStepResult = EPass; |
|
1251 |
|
1252 // Heap test for 022.07 |
|
1253 |
|
1254 CCommDbTest022_07* step022_07 = new CCommDbTest022_07; |
|
1255 CleanupStack::PushL(step022_07); |
|
1256 step022_07->iSuite = iSuite; |
|
1257 if ( doTestStepWithHeapFailureL( *step022_07, KErrNone) == EFail ) |
|
1258 iTestStepResult = EFail; |
|
1259 CleanupStack::PopAndDestroy(step022_07); |
|
1260 |
|
1261 return iTestStepResult; |
|
1262 |
|
1263 } |
|
1264 |
|
1265 // |
|
1266 // Test step 022.23 |
|
1267 // |
|
1268 |
|
1269 // constructor |
|
1270 CCommDbTest022_23::CCommDbTest022_23() |
|
1271 { |
|
1272 // store the name of this test case |
|
1273 iTestStepName = _L("step_022_23"); |
|
1274 } |
|
1275 |
|
1276 // destructor |
|
1277 CCommDbTest022_23::~CCommDbTest022_23() |
|
1278 { |
|
1279 } |
|
1280 |
|
1281 TVerdict CCommDbTest022_23::doTestStepL( ) |
|
1282 { |
|
1283 Log(_L("Step 022.23 called ")); |
|
1284 |
|
1285 iTestStepResult = EPass; |
|
1286 |
|
1287 // Heap test for 022.08 |
|
1288 |
|
1289 CCommDbTest022_08* step022_08 = new CCommDbTest022_08; |
|
1290 CleanupStack::PushL(step022_08); |
|
1291 step022_08->iSuite = iSuite; |
|
1292 if ( doTestStepWithHeapFailureL( *step022_08, KErrNone) == EFail ) |
|
1293 iTestStepResult = EFail; |
|
1294 CleanupStack::PopAndDestroy(step022_08); |
|
1295 |
|
1296 return iTestStepResult; |
|
1297 |
|
1298 } |
|
1299 |
|
1300 // |
|
1301 // Test step 022.24 |
|
1302 // |
|
1303 |
|
1304 // constructor |
|
1305 CCommDbTest022_24::CCommDbTest022_24() |
|
1306 { |
|
1307 // store the name of this test case |
|
1308 iTestStepName = _L("step_022_24"); |
|
1309 } |
|
1310 |
|
1311 // destructor |
|
1312 CCommDbTest022_24::~CCommDbTest022_24() |
|
1313 { |
|
1314 } |
|
1315 |
|
1316 TVerdict CCommDbTest022_24::doTestStepL( ) |
|
1317 { |
|
1318 Log(_L("Step 022.24 called ")); |
|
1319 |
|
1320 iTestStepResult = EPass; |
|
1321 |
|
1322 // Heap test for 022.09 |
|
1323 |
|
1324 CCommDbTest022_09* step022_09 = new CCommDbTest022_09; |
|
1325 CleanupStack::PushL(step022_09); |
|
1326 step022_09->iSuite = iSuite; |
|
1327 if ( doTestStepWithHeapFailureL( *step022_09, KErrNone) == EFail ) |
|
1328 iTestStepResult = EFail; |
|
1329 CleanupStack::PopAndDestroy(step022_09); |
|
1330 |
|
1331 return iTestStepResult; |
|
1332 |
|
1333 } |
|
1334 |
|
1335 // |
|
1336 // Test step 022.25 |
|
1337 // |
|
1338 |
|
1339 // constructor |
|
1340 CCommDbTest022_25::CCommDbTest022_25() |
|
1341 { |
|
1342 // store the name of this test case |
|
1343 iTestStepName = _L("step_022_25"); |
|
1344 } |
|
1345 |
|
1346 // destructor |
|
1347 CCommDbTest022_25::~CCommDbTest022_25() |
|
1348 { |
|
1349 } |
|
1350 |
|
1351 TVerdict CCommDbTest022_25::doTestStepL( ) |
|
1352 { |
|
1353 Log(_L("Step 022.25 called ")); |
|
1354 |
|
1355 iTestStepResult = EPass; |
|
1356 |
|
1357 // Heap test for 022.10 |
|
1358 |
|
1359 CCommDbTest022_10* step022_10 = new CCommDbTest022_10; |
|
1360 CleanupStack::PushL(step022_10); |
|
1361 step022_10->iSuite = iSuite; |
|
1362 if ( doTestStepWithHeapFailureL( *step022_10, KErrNone) == EFail ) |
|
1363 iTestStepResult = EFail; |
|
1364 CleanupStack::PopAndDestroy(step022_10); |
|
1365 |
|
1366 return iTestStepResult; |
|
1367 |
|
1368 } |
|
1369 |
|
1370 // |
|
1371 // Test step 022.26 |
|
1372 // |
|
1373 |
|
1374 // constructor |
|
1375 CCommDbTest022_26::CCommDbTest022_26() |
|
1376 { |
|
1377 // store the name of this test case |
|
1378 iTestStepName = _L("step_022_26"); |
|
1379 } |
|
1380 |
|
1381 // destructor |
|
1382 CCommDbTest022_26::~CCommDbTest022_26() |
|
1383 { |
|
1384 } |
|
1385 |
|
1386 TVerdict CCommDbTest022_26::doTestStepL( ) |
|
1387 { |
|
1388 Log(_L("Step 022.26 called ")); |
|
1389 |
|
1390 iTestStepResult = EPass; |
|
1391 |
|
1392 // Heap test for 022.11 |
|
1393 |
|
1394 CCommDbTest022_11* step022_11 = new CCommDbTest022_11; |
|
1395 CleanupStack::PushL(step022_11); |
|
1396 step022_11->iSuite = iSuite; |
|
1397 if ( doTestStepWithHeapFailureL( *step022_11, KErrArgument) == EFail ) |
|
1398 iTestStepResult = EFail; |
|
1399 CleanupStack::PopAndDestroy(step022_11); |
|
1400 |
|
1401 return iTestStepResult; |
|
1402 |
|
1403 } |
|
1404 |
|
1405 // |
|
1406 // Test step 022.27 |
|
1407 // |
|
1408 |
|
1409 // constructor |
|
1410 CCommDbTest022_27::CCommDbTest022_27() |
|
1411 { |
|
1412 // store the name of this test case |
|
1413 iTestStepName = _L("step_022_27"); |
|
1414 } |
|
1415 |
|
1416 // destructor |
|
1417 CCommDbTest022_27::~CCommDbTest022_27() |
|
1418 { |
|
1419 } |
|
1420 |
|
1421 TVerdict CCommDbTest022_27::doTestStepL( ) |
|
1422 { |
|
1423 Log(_L("Step 022.27 called ")); |
|
1424 |
|
1425 iTestStepResult = EPass; |
|
1426 |
|
1427 // Heap test for 022.12 |
|
1428 |
|
1429 CCommDbTest022_12* step022_12 = new CCommDbTest022_12; |
|
1430 CleanupStack::PushL(step022_12); |
|
1431 step022_12->iSuite = iSuite; |
|
1432 if ( doTestStepWithHeapFailureL( *step022_12, KErrArgument) == EFail ) |
|
1433 iTestStepResult = EFail; |
|
1434 CleanupStack::PopAndDestroy(step022_12); |
|
1435 |
|
1436 return iTestStepResult; |
|
1437 |
|
1438 } |
|
1439 |
|
1440 // |
|
1441 // Test step 022.28 |
|
1442 // |
|
1443 |
|
1444 // constructor |
|
1445 CCommDbTest022_28::CCommDbTest022_28() |
|
1446 { |
|
1447 // store the name of this test case |
|
1448 iTestStepName = _L("step_022_28"); |
|
1449 } |
|
1450 |
|
1451 // destructor |
|
1452 CCommDbTest022_28::~CCommDbTest022_28() |
|
1453 { |
|
1454 } |
|
1455 |
|
1456 TVerdict CCommDbTest022_28::doTestStepL( ) |
|
1457 { |
|
1458 Log(_L("Step 022.28 called ")); |
|
1459 |
|
1460 iTestStepResult = EPass; |
|
1461 |
|
1462 // Heap test for 022.13 |
|
1463 |
|
1464 CCommDbTest022_13* step022_13 = new CCommDbTest022_13; |
|
1465 CleanupStack::PushL(step022_13); |
|
1466 step022_13->iSuite = iSuite; |
|
1467 if ( doTestStepWithHeapFailureL( *step022_13, KErrArgument) == EFail ) |
|
1468 iTestStepResult = EFail; |
|
1469 CleanupStack::PopAndDestroy(step022_13); |
|
1470 |
|
1471 return iTestStepResult; |
|
1472 |
|
1473 } |
|
1474 |
|
1475 // |
|
1476 // Test step 022.29 |
|
1477 // |
|
1478 |
|
1479 // constructor |
|
1480 CCommDbTest022_29::CCommDbTest022_29() |
|
1481 { |
|
1482 // store the name of this test case |
|
1483 iTestStepName = _L("step_022_29"); |
|
1484 } |
|
1485 |
|
1486 // destructor |
|
1487 CCommDbTest022_29::~CCommDbTest022_29() |
|
1488 { |
|
1489 } |
|
1490 |
|
1491 TVerdict CCommDbTest022_29::doTestStepL( ) |
|
1492 { |
|
1493 Log(_L("Step 022.29 called ")); |
|
1494 |
|
1495 iTestStepResult = EPass; |
|
1496 |
|
1497 // Heap test for 022.14 |
|
1498 |
|
1499 CCommDbTest022_14* step022_14 = new CCommDbTest022_14; |
|
1500 CleanupStack::PushL(step022_14); |
|
1501 step022_14->iSuite = iSuite; |
|
1502 if ( doTestStepWithHeapFailureL( *step022_14, KErrArgument) == EFail ) |
|
1503 iTestStepResult = EFail; |
|
1504 CleanupStack::PopAndDestroy(step022_14); |
|
1505 |
|
1506 return iTestStepResult; |
|
1507 |
|
1508 } |
|
1509 |
|
1510 |
|
1511 // |
|
1512 // Test step 022.30 |
|
1513 // |
|
1514 |
|
1515 // constructor |
|
1516 CCommDbTest022_30::CCommDbTest022_30() |
|
1517 { |
|
1518 // store the name of this test case |
|
1519 iTestStepName = _L("step_022_30"); |
|
1520 } |
|
1521 |
|
1522 // destructor |
|
1523 CCommDbTest022_30::~CCommDbTest022_30() |
|
1524 { |
|
1525 } |
|
1526 |
|
1527 TInt CCommDbTest022_30::executeStepL() |
|
1528 { |
|
1529 TInt ret = KErrGeneral; |
|
1530 |
|
1531 CCommsDatabase* db = CCommsDatabase::NewL(); |
|
1532 CleanupStack::PushL(db); |
|
1533 |
|
1534 CCommsDbTableView* view1 = db->OpenTableLC( TPtrC(IAP) ); |
|
1535 TUint32 a = 0; |
|
1536 User::LeaveIfError(view1->InsertRecord(a)); |
|
1537 // expected commdb currently only has 1 IAP, hence 2 here |
|
1538 if (a != 2) |
|
1539 { |
|
1540 User::Leave(KErrGeneral); |
|
1541 } |
|
1542 CleanupStack::Pop(view1); |
|
1543 |
|
1544 CCommsDbTableView* view2 = db->OpenIAPTableViewMatchingBearerSetLC(KCommDbBearerWcdma, ECommDbConnectionDirectionOutgoing); |
|
1545 a = 0; |
|
1546 User::LeaveIfError(view2->InsertRecord(a)); |
|
1547 if (a != 3) |
|
1548 { |
|
1549 User::Leave(KErrGeneral); |
|
1550 } |
|
1551 CleanupStack::Pop(view2); |
|
1552 |
|
1553 CleanupStack::Pop(db); |
|
1554 |
|
1555 ret = KErrNone; |
|
1556 return ret; |
|
1557 } |
|
1558 |
|
1559 |
|
1560 TVerdict CCommDbTest022_30::doTestStepL( ) |
|
1561 { |
|
1562 Log(_L("Step 022.30 called ")); |
|
1563 |
|
1564 |
|
1565 if ( executeStepL() == KErrNone ) |
|
1566 iTestStepResult = EPass; |
|
1567 else |
|
1568 iTestStepResult = EFail; |
|
1569 |
|
1570 return iTestStepResult; |
|
1571 } |
|
1572 |
|
1573 //EOF |