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 |
// This contains CommDb Unit Test Cases 042.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_042_xx.h"
|
|
28 |
|
|
29 |
|
|
30 |
CCommDbTest042_01::CCommDbTest042_01()
|
|
31 |
{
|
|
32 |
// store the name of this test case
|
|
33 |
SetTestStepName(_L("step_042_01"));
|
|
34 |
}
|
|
35 |
|
|
36 |
CCommDbTest042_01::~CCommDbTest042_01()
|
|
37 |
{}
|
|
38 |
|
|
39 |
TVerdict CCommDbTest042_01::doTestStepL( void )
|
|
40 |
{
|
|
41 |
if(executeStepL()!=KErrNone)
|
|
42 |
SetTestStepResult(EFail); SetTestStepResult(EPass); return TestStepResult();
|
|
43 |
}
|
|
44 |
|
|
45 |
TVerdict CCommDbTest042_01::doTestStepPreambleL()
|
|
46 |
{
|
|
47 |
SetTestStepResult(EPass); return TestStepResult();
|
|
48 |
}
|
|
49 |
|
|
50 |
TInt CCommDbTest042_01::executeStepL()
|
|
51 |
{
|
|
52 |
TInt err(KErrNone);
|
|
53 |
|
|
54 |
CCommDbOverrideSettings* overSet1=CCommDbOverrideSettings::NewL(CCommDbOverrideSettings::EParamListPartial);
|
|
55 |
CleanupStack::PushL(overSet1);
|
|
56 |
TUint32 temp1 = 5000;
|
|
57 |
User::LeaveIfError(overSet1->SetIntOverride(TPtrC(DIAL_OUT_ISP), TPtrC(ISP_IWF_TO_MS), temp1));
|
|
58 |
|
|
59 |
CCommDbOverrideSettings* overSet2=CCommDbOverrideSettings::NewL(CCommDbOverrideSettings::EParamListPartial);
|
|
60 |
CleanupStack::PushL(overSet2);
|
|
61 |
TUint32 temp2=5000;
|
|
62 |
User::LeaveIfError(overSet2->SetIntOverride(TPtrC(DIAL_OUT_ISP), TPtrC(ISP_IF_AUTH_RETRIES), temp2));
|
|
63 |
|
|
64 |
if(overSet1->Compare(overSet2))
|
|
65 |
err = KErrGeneral;
|
|
66 |
|
|
67 |
CleanupStack::PopAndDestroy(overSet2);
|
|
68 |
CleanupStack::PopAndDestroy(overSet1);
|
|
69 |
|
|
70 |
return err;
|
|
71 |
}
|
|
72 |
|
|
73 |
TVerdict CCommDbTest042_01::doTestStepPostambleL()
|
|
74 |
{
|
|
75 |
SetTestStepResult(EPass); return TestStepResult();
|
|
76 |
}
|
|
77 |
|
|
78 |
///////////////////////////////////////////////////////////////////////////////////////
|
|
79 |
|
|
80 |
CCommDbTest042_02::CCommDbTest042_02()
|
|
81 |
{
|
|
82 |
// store the name of this test case
|
|
83 |
SetTestStepName(_L("step_042_02"));
|
|
84 |
}
|
|
85 |
|
|
86 |
CCommDbTest042_02::~CCommDbTest042_02()
|
|
87 |
{}
|
|
88 |
|
|
89 |
TVerdict CCommDbTest042_02::doTestStepL( void )
|
|
90 |
{
|
|
91 |
if(executeStepL()!=KErrNone)
|
|
92 |
SetTestStepResult(EFail); SetTestStepResult(EPass); return TestStepResult();
|
|
93 |
}
|
|
94 |
|
|
95 |
TVerdict CCommDbTest042_02::doTestStepPreambleL()
|
|
96 |
{
|
|
97 |
SetTestStepResult(EPass); return TestStepResult();
|
|
98 |
}
|
|
99 |
|
|
100 |
TInt CCommDbTest042_02::executeStepL()
|
|
101 |
{
|
|
102 |
TInt err(KErrNone);
|
|
103 |
|
|
104 |
CCommDbOverrideSettings* overSet1=CCommDbOverrideSettings::NewL(CCommDbOverrideSettings::EParamListPartial);
|
|
105 |
CleanupStack::PushL(overSet1);
|
|
106 |
TUint32 temp1 = 5000;
|
|
107 |
User::LeaveIfError(overSet1->SetIntOverride(TPtrC(DIAL_OUT_ISP), TPtrC(ISP_IWF_TO_MS), temp1));
|
|
108 |
|
|
109 |
CCommDbOverrideSettings* overSet2=CCommDbOverrideSettings::NewL(CCommDbOverrideSettings::EParamListPartial);
|
|
110 |
CleanupStack::PushL(overSet2);
|
|
111 |
TUint32 temp2=5000;
|
|
112 |
User::LeaveIfError(overSet2->SetIntOverride(TPtrC(DIAL_OUT_ISP), TPtrC(ISP_IWF_TO_MS), temp2));
|
|
113 |
|
|
114 |
if(!overSet1->Compare(overSet2))
|
|
115 |
err = KErrGeneral;
|
|
116 |
|
|
117 |
CleanupStack::PopAndDestroy(overSet2);
|
|
118 |
CleanupStack::PopAndDestroy(overSet1);
|
|
119 |
|
|
120 |
return err;
|
|
121 |
}
|
|
122 |
|
|
123 |
TVerdict CCommDbTest042_02::doTestStepPostambleL()
|
|
124 |
{
|
|
125 |
SetTestStepResult(EPass); return TestStepResult();
|
|
126 |
}
|
|
127 |
|
|
128 |
//////////////////////////////////////////////////////////////////////////
|
|
129 |
|
|
130 |
CCommDbTest042_03::CCommDbTest042_03()
|
|
131 |
{
|
|
132 |
// store the name of this test case
|
|
133 |
SetTestStepName(_L("step_042_03"));
|
|
134 |
}
|
|
135 |
|
|
136 |
CCommDbTest042_03::~CCommDbTest042_03()
|
|
137 |
{}
|
|
138 |
|
|
139 |
TVerdict CCommDbTest042_03::doTestStepL( void )
|
|
140 |
{
|
|
141 |
INFO_PRINTF1(_L("Step 042.03 called "));
|
|
142 |
|
|
143 |
SetTestStepResult(EPass);
|
|
144 |
CCommDbTest042_01* step042_01 = new(ELeave) CCommDbTest042_01;
|
|
145 |
CleanupStack::PushL(step042_01);
|
|
146 |
doTestStepWithHeapFailureL( *step042_01, KErrNone);
|
|
147 |
CleanupStack::PopAndDestroy(step042_01);
|
|
148 |
|
|
149 |
CCommDbTest042_02* step042_02 = new(ELeave) CCommDbTest042_02;
|
|
150 |
CleanupStack::PushL(step042_02);
|
|
151 |
doTestStepWithHeapFailureL( *step042_02, KErrNone);
|
|
152 |
CleanupStack::PopAndDestroy(step042_02);
|
|
153 |
|
|
154 |
return TestStepResult();
|
|
155 |
}
|