|
1 // Copyright (c) 2003-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 // |
|
15 |
|
16 // EPOC includes |
|
17 #include <e32base.h> |
|
18 #include <commdb.h> |
|
19 #include <d32comm.h> |
|
20 #include <cdbstore.h> |
|
21 |
|
22 // Test system includes |
|
23 #include <networking/log.h> |
|
24 #include <networking/teststep.h> |
|
25 #include "Teststepcommdb.h" |
|
26 #include "TestSuiteCommdb.h" |
|
27 |
|
28 #ifdef SYMBIAN_OLD_EXPORT_LOCATION |
|
29 #include <comms-infras/commdb/protection/protectdb.h> |
|
30 #include <comms-infras/commdb/protection/protectcpdb.h> |
|
31 #else |
|
32 //these headers are user includes in the new env. |
|
33 #include "protectdb.h" |
|
34 #include "protectcpdb.h" |
|
35 #endif |
|
36 |
|
37 |
|
38 #include <cdbpreftable.h> |
|
39 |
|
40 #include "step_053_xx.h" |
|
41 |
|
42 // |
|
43 // Test step 053.01 |
|
44 // |
|
45 |
|
46 CCommDbTest053_01::CCommDbTest053_01() |
|
47 { |
|
48 // store the name of this test case |
|
49 iTestStepName = _L("step_053_01"); |
|
50 } |
|
51 |
|
52 CCommDbTest053_01::~CCommDbTest053_01() |
|
53 { |
|
54 delete iTheDb; |
|
55 } |
|
56 |
|
57 TVerdict CCommDbTest053_01::doTestStepPreambleL() |
|
58 { |
|
59 iTheDb = CCommsDatabase::NewL(EDatabaseTypeIAP); |
|
60 return EPass; |
|
61 } |
|
62 |
|
63 //Protect Connection Preference Table |
|
64 enum TVerdict CCommDbTest053_01::doTestStepL( void ) |
|
65 { |
|
66 |
|
67 Log(_L("Connection Preference Table : Protection ..")); |
|
68 iTestStepResult = EPass; |
|
69 |
|
70 CCommsDbProtectConnectPrefTableView* table = (CCommsDbProtectConnectPrefTableView *)iTheDb->OpenConnectionPrefTableLC(); |
|
71 |
|
72 if(table->GotoFirstRecord()==KErrNone) |
|
73 { |
|
74 TESTL(table->ProtectTable()==0); |
|
75 iTestStepResult = EPass; |
|
76 Log(_L("\t\tSUCCESS")); |
|
77 } |
|
78 else |
|
79 { |
|
80 iTestStepResult = EFail; |
|
81 Log(_L("\t\tFAIL")); |
|
82 } |
|
83 CleanupStack::PopAndDestroy(); |
|
84 return iTestStepResult; |
|
85 } |
|
86 |
|
87 |
|
88 // |
|
89 // Test step 053.02 |
|
90 // |
|
91 |
|
92 CCommDbTest053_02::CCommDbTest053_02() |
|
93 { |
|
94 // store the name of this test case |
|
95 iTestStepName = _L("step_053_02"); |
|
96 } |
|
97 |
|
98 CCommDbTest053_02::~CCommDbTest053_02() |
|
99 { |
|
100 delete iTheDb; |
|
101 } |
|
102 |
|
103 TVerdict CCommDbTest053_02::doTestStepPreambleL() |
|
104 { |
|
105 iTheDb = CCommsDatabase::NewL(EDatabaseTypeIAP); |
|
106 return EPass; |
|
107 } |
|
108 |
|
109 //UnProtect Connection pref Record |
|
110 enum TVerdict CCommDbTest053_02::doTestStepL( void ) |
|
111 { |
|
112 |
|
113 Log(_L("Connection Preference Table : Unprotection ..")); |
|
114 iTestStepResult = EPass; |
|
115 |
|
116 CCommsDbProtectConnectPrefTableView* table = (CCommsDbProtectConnectPrefTableView *)iTheDb->OpenConnectionPrefTableLC(); |
|
117 |
|
118 if(table->GotoFirstRecord()==KErrNone) |
|
119 { |
|
120 TESTL(table->UnprotectTable()==KErrNone); |
|
121 iTestStepResult = EPass; |
|
122 Log(_L("\t\tSUCCESS")); |
|
123 } |
|
124 else |
|
125 { |
|
126 iTestStepResult = EFail; |
|
127 Log(_L("\t\tFAIL")); |
|
128 } |
|
129 CleanupStack::PopAndDestroy(); |
|
130 return iTestStepResult; |
|
131 } |
|
132 |