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