24
|
1 |
// Copyright (c) 2007-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 |
// The TEFUnit test suite for CallCost in the Common TSY.
|
|
15 |
//
|
|
16 |
//
|
|
17 |
|
|
18 |
/**
|
|
19 |
@file
|
|
20 |
*/
|
|
21 |
|
|
22 |
#include "cctsycallcostfu.h"
|
|
23 |
#include <etel.h>
|
|
24 |
#include <etelmm.h>
|
|
25 |
#include <et_clsvr.h>
|
|
26 |
#include <ctsy/mmtsy_names.h>
|
|
27 |
#include <ctsy/serviceapi/mmtsy_ipcdefs.h>
|
|
28 |
#include "tmockltsydata.h"
|
|
29 |
#include <ctsy/serviceapi/gsmerror.h>
|
|
30 |
|
|
31 |
CTestSuite* CCTsyCallCostFU::CreateSuiteL(const TDesC& aName)
|
|
32 |
{
|
|
33 |
SUB_SUITE;
|
|
34 |
|
|
35 |
ADD_TEST_STEP_ISO_CPP(CCTsyCallCostFU, TestGetCostCaps0001L);
|
|
36 |
ADD_TEST_STEP_ISO_CPP(CCTsyCallCostFU, TestGetCostInfo0001L);
|
|
37 |
ADD_TEST_STEP_ISO_CPP(CCTsyCallCostFU, TestClearCostMeter0001L);
|
|
38 |
ADD_TEST_STEP_ISO_CPP(CCTsyCallCostFU, TestSetMaxCostMeter0001L);
|
|
39 |
ADD_TEST_STEP_ISO_CPP(CCTsyCallCostFU, TestNotifyCostCapsChange0001L);
|
|
40 |
ADD_TEST_STEP_ISO_CPP(CCTsyCallCostFU, TestNotifyCostInfoChange0001L);
|
|
41 |
ADD_TEST_STEP_ISO_CPP(CCTsyCallCostFU, TestSetPuct0001L);
|
|
42 |
|
|
43 |
END_SUITE;
|
|
44 |
}
|
|
45 |
|
|
46 |
|
|
47 |
//
|
|
48 |
// Actual test cases
|
|
49 |
//
|
|
50 |
|
|
51 |
|
|
52 |
/**
|
|
53 |
@SYMTestCaseID BA-CTSY-CCOS-MGCC-0001
|
|
54 |
@SYMComponent telephony_ctsy
|
|
55 |
@SYMTestCaseDesc Test support in CTSY for RMobilePhone::GetCostCaps
|
|
56 |
@SYMTestPriority High
|
|
57 |
@SYMTestActions Invokes RMobilePhone::GetCostCaps
|
|
58 |
@SYMTestExpectedResults Pass
|
|
59 |
@SYMTestType CT
|
|
60 |
*/
|
|
61 |
void CCTsyCallCostFU::TestGetCostCaps0001L()
|
|
62 |
{
|
|
63 |
|
|
64 |
OpenEtelServerL(EUseExtendedError);
|
|
65 |
CleanupStack::PushL(TCleanupItem(Cleanup,this));
|
|
66 |
OpenPhoneL();
|
|
67 |
|
|
68 |
TUint32 caps(0);
|
|
69 |
TInt err = iPhone.GetCostCaps(caps);
|
|
70 |
ASSERT_EQUALS(KErrNotSupported, err);
|
|
71 |
|
|
72 |
AssertMockLtsyStatusL();
|
|
73 |
CleanupStack::PopAndDestroy(this);
|
|
74 |
|
|
75 |
}
|
|
76 |
|
|
77 |
|
|
78 |
/**
|
|
79 |
@SYMTestCaseID BA-CTSY-CCOS-MGCI-0001
|
|
80 |
@SYMComponent telephony_ctsy
|
|
81 |
@SYMTestCaseDesc Test support in CTSY for RMobilePhone::GetCostInfo
|
|
82 |
@SYMTestPriority High
|
|
83 |
@SYMTestActions Invokes RMobilePhone::GetCostInfo
|
|
84 |
@SYMTestExpectedResults Pass
|
|
85 |
@SYMTestType CT
|
|
86 |
*/
|
|
87 |
void CCTsyCallCostFU::TestGetCostInfo0001L()
|
|
88 |
{
|
|
89 |
|
|
90 |
OpenEtelServerL(EUseExtendedError);
|
|
91 |
CleanupStack::PushL(TCleanupItem(Cleanup,this));
|
|
92 |
OpenPhoneL();
|
|
93 |
|
|
94 |
RMobilePhone::TMobilePhoneCostInfoV1 costInfo;
|
|
95 |
RMobilePhone::TMobilePhoneCostInfoV1Pckg infoPckg(costInfo);
|
|
96 |
TRequestStatus reqStatus;
|
|
97 |
iPhone.GetCostInfo(reqStatus, infoPckg);
|
|
98 |
User::WaitForRequest(reqStatus);
|
|
99 |
ASSERT_EQUALS(KErrNotSupported, reqStatus.Int());
|
|
100 |
|
|
101 |
AssertMockLtsyStatusL();
|
|
102 |
CleanupStack::PopAndDestroy(this);
|
|
103 |
|
|
104 |
}
|
|
105 |
|
|
106 |
|
|
107 |
/**
|
|
108 |
@SYMTestCaseID BA-CTSY-CCOS-MCCM-0001
|
|
109 |
@SYMComponent telephony_ctsy
|
|
110 |
@SYMTestCaseDesc Test support in CTSY for RMobilePhone::ClearCostMeter
|
|
111 |
@SYMTestPriority High
|
|
112 |
@SYMTestActions Invokes RMobilePhone::ClearCostMeter
|
|
113 |
@SYMTestExpectedResults Pass
|
|
114 |
@SYMTestType CT
|
|
115 |
*/
|
|
116 |
void CCTsyCallCostFU::TestClearCostMeter0001L()
|
|
117 |
{
|
|
118 |
|
|
119 |
OpenEtelServerL(EUseExtendedError);
|
|
120 |
CleanupStack::PushL(TCleanupItem(Cleanup,this));
|
|
121 |
OpenPhoneL();
|
|
122 |
|
|
123 |
RMobilePhone::TMobilePhoneCostMeters meter(RMobilePhone::EClearCCM);
|
|
124 |
TRequestStatus reqStatus;
|
|
125 |
iPhone.ClearCostMeter(reqStatus, meter);
|
|
126 |
User::WaitForRequest(reqStatus);
|
|
127 |
ASSERT_EQUALS(KErrNotSupported, reqStatus.Int());
|
|
128 |
|
|
129 |
AssertMockLtsyStatusL();
|
|
130 |
CleanupStack::PopAndDestroy(this);
|
|
131 |
|
|
132 |
}
|
|
133 |
|
|
134 |
|
|
135 |
/**
|
|
136 |
@SYMTestCaseID BA-CTSY-CCOS-MSMCM-0001
|
|
137 |
@SYMComponent telephony_ctsy
|
|
138 |
@SYMTestCaseDesc Test support in CTSY for RMobilePhone::SetMaxCostMeter
|
|
139 |
@SYMTestPriority High
|
|
140 |
@SYMTestActions Invokes RMobilePhone::SetMaxCostMeter
|
|
141 |
@SYMTestExpectedResults Pass
|
|
142 |
@SYMTestType CT
|
|
143 |
*/
|
|
144 |
void CCTsyCallCostFU::TestSetMaxCostMeter0001L()
|
|
145 |
{
|
|
146 |
|
|
147 |
OpenEtelServerL(EUseExtendedError);
|
|
148 |
CleanupStack::PushL(TCleanupItem(Cleanup,this));
|
|
149 |
OpenPhoneL();
|
|
150 |
|
|
151 |
TUint units(10);
|
|
152 |
TRequestStatus reqStatus;
|
|
153 |
iPhone.SetMaxCostMeter(reqStatus, units);
|
|
154 |
User::WaitForRequest(reqStatus);
|
|
155 |
ASSERT_EQUALS(KErrNotSupported, reqStatus.Int());
|
|
156 |
|
|
157 |
AssertMockLtsyStatusL();
|
|
158 |
CleanupStack::PopAndDestroy(this);
|
|
159 |
|
|
160 |
}
|
|
161 |
|
|
162 |
|
|
163 |
/**
|
|
164 |
@SYMTestCaseID BA-CTSY-CCOS-MNCCC-0001
|
|
165 |
@SYMComponent telephony_ctsy
|
|
166 |
@SYMTestCaseDesc Test support in CTSY for RMobilePhone::NotifyCostCapsChange
|
|
167 |
@SYMTestPriority High
|
|
168 |
@SYMTestActions Invokes RMobilePhone::NotifyCostCapsChange
|
|
169 |
@SYMTestExpectedResults Pass
|
|
170 |
@SYMTestType CT
|
|
171 |
*/
|
|
172 |
void CCTsyCallCostFU::TestNotifyCostCapsChange0001L()
|
|
173 |
{
|
|
174 |
|
|
175 |
OpenEtelServerL(EUseExtendedError);
|
|
176 |
CleanupStack::PushL(TCleanupItem(Cleanup,this));
|
|
177 |
OpenPhoneL();
|
|
178 |
|
|
179 |
TUint32 caps(0);
|
|
180 |
TRequestStatus reqStatus;
|
|
181 |
iPhone.NotifyCostCapsChange(reqStatus, caps);
|
|
182 |
User::WaitForRequest(reqStatus);
|
|
183 |
ASSERT_EQUALS(KErrNotSupported, reqStatus.Int());
|
|
184 |
|
|
185 |
AssertMockLtsyStatusL();
|
|
186 |
CleanupStack::PopAndDestroy(this);
|
|
187 |
|
|
188 |
}
|
|
189 |
|
|
190 |
|
|
191 |
/**
|
|
192 |
@SYMTestCaseID BA-CTSY-CCOS-MNCIC-0001
|
|
193 |
@SYMComponent telephony_ctsy
|
|
194 |
@SYMTestCaseDesc Test support in CTSY for RMobilePhone::NotifyCostInfoChange
|
|
195 |
@SYMTestPriority High
|
|
196 |
@SYMTestActions Invokes RMobilePhone::NotifyCostInfoChange
|
|
197 |
@SYMTestExpectedResults Pass
|
|
198 |
@SYMTestType CT
|
|
199 |
*/
|
|
200 |
void CCTsyCallCostFU::TestNotifyCostInfoChange0001L()
|
|
201 |
{
|
|
202 |
|
|
203 |
OpenEtelServerL(EUseExtendedError);
|
|
204 |
CleanupStack::PushL(TCleanupItem(Cleanup,this));
|
|
205 |
OpenPhoneL();
|
|
206 |
|
|
207 |
RMobilePhone::TMobilePhoneCostInfoV1 costInfo;
|
|
208 |
RMobilePhone::TMobilePhoneCostInfoV1Pckg infoPckg(costInfo);
|
|
209 |
TRequestStatus reqStatus;
|
|
210 |
iPhone.NotifyCostInfoChange(reqStatus, infoPckg);
|
|
211 |
User::WaitForRequest(reqStatus);
|
|
212 |
ASSERT_EQUALS(KErrNotSupported, reqStatus.Int());
|
|
213 |
|
|
214 |
AssertMockLtsyStatusL();
|
|
215 |
CleanupStack::PopAndDestroy(this);
|
|
216 |
|
|
217 |
}
|
|
218 |
|
|
219 |
|
|
220 |
/**
|
|
221 |
@SYMTestCaseID BA-CTSY-CCOS-MSP-0001
|
|
222 |
@SYMComponent telephony_ctsy
|
|
223 |
@SYMTestCaseDesc Test support in CTSY for RMobilePhone::SetPuct
|
|
224 |
@SYMTestPriority High
|
|
225 |
@SYMTestActions Invokes RMobilePhone::SetPuct
|
|
226 |
@SYMTestExpectedResults Pass
|
|
227 |
@SYMTestType CT
|
|
228 |
*/
|
|
229 |
void CCTsyCallCostFU::TestSetPuct0001L()
|
|
230 |
{
|
|
231 |
|
|
232 |
OpenEtelServerL(EUseExtendedError);
|
|
233 |
CleanupStack::PushL(TCleanupItem(Cleanup,this));
|
|
234 |
OpenPhoneL();
|
|
235 |
|
|
236 |
RMobilePhone::TMobilePhonePuctV1 puct;
|
|
237 |
RMobilePhone::TMobilePhonePuctV1Pckg puctPckg(puct);
|
|
238 |
TRequestStatus reqStatus;
|
|
239 |
iPhone.SetPuct(reqStatus, puctPckg);
|
|
240 |
User::WaitForRequest(reqStatus);
|
|
241 |
ASSERT_EQUALS(KErrNotSupported, reqStatus.Int());
|
|
242 |
|
|
243 |
AssertMockLtsyStatusL();
|
|
244 |
CleanupStack::PopAndDestroy(this);
|
|
245 |
|
|
246 |
}
|
|
247 |
|
|
248 |
|
|
249 |
|