|
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 027.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_027_xx.h" |
|
28 |
|
29 |
|
30 CCommDbTest027_01::CCommDbTest027_01() |
|
31 { |
|
32 // store the name of this test case |
|
33 SetTestStepName(_L("step_027_01")); |
|
34 } |
|
35 |
|
36 CCommDbTest027_01::~CCommDbTest027_01() |
|
37 {} |
|
38 |
|
39 TVerdict CCommDbTest027_01::doTestStepL( void ) |
|
40 { |
|
41 executeStepL(); |
|
42 SetTestStepResult(EPass); return TestStepResult(); |
|
43 } |
|
44 |
|
45 TVerdict CCommDbTest027_01::doTestStepPreambleL() |
|
46 { |
|
47 iTheDb=CCommsDatabase::NewL(); |
|
48 |
|
49 iPrefView = iTheDb->OpenConnectionPrefTableLC(); |
|
50 CleanupStack::Pop(); |
|
51 |
|
52 SetTestStepResult(EPass); return TestStepResult(); |
|
53 } |
|
54 |
|
55 TInt CCommDbTest027_01::executeStepL() |
|
56 { |
|
57 CCommsDbConnectionPrefTableView::TCommDbIapConnectionPref pref; |
|
58 User::LeaveIfError(iPrefView->GotoFirstRecord()); |
|
59 iPrefView->ReadConnectionPreferenceL(pref); |
|
60 return KErrNone; |
|
61 } |
|
62 |
|
63 TVerdict CCommDbTest027_01::doTestStepPostambleL() |
|
64 { |
|
65 delete iPrefView; |
|
66 iPrefView = NULL; |
|
67 delete iTheDb; |
|
68 iTheDb=NULL; |
|
69 SetTestStepResult(EPass); return TestStepResult(); |
|
70 } |
|
71 |
|
72 ////////////////////////////////////////////////////////////////////////// |
|
73 |
|
74 CCommDbTest027_02::CCommDbTest027_02() |
|
75 { |
|
76 // store the name of this test case |
|
77 SetTestStepName(_L("step_027_02")); |
|
78 } |
|
79 |
|
80 CCommDbTest027_02::~CCommDbTest027_02() |
|
81 {} |
|
82 |
|
83 TVerdict CCommDbTest027_02::doTestStepL( void ) |
|
84 { |
|
85 INFO_PRINTF1(_L("Step 027.02 called ")); |
|
86 |
|
87 SetTestStepResult(EPass); |
|
88 CCommDbTest027_01* step027_01 = new(ELeave) CCommDbTest027_01; |
|
89 CleanupStack::PushL(step027_01); |
|
90 doTestStepWithHeapFailureL( *step027_01, KErrNone); |
|
91 CleanupStack::PopAndDestroy(step027_01); |
|
92 |
|
93 return TestStepResult(); |
|
94 } |
|
95 |