24
|
1 |
// Copyright (c) 2002-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 |
#include "Te_EtelSatTestStepBase.h"
|
|
17 |
#include "TE_EtelSatcontrol.h"
|
|
18 |
|
|
19 |
CTestSatControl::CTestSatControl()
|
|
20 |
/** Each test step initialises it's own name
|
|
21 |
*/
|
|
22 |
{
|
|
23 |
// store the name of this test case
|
|
24 |
// this is the name that is used by the script file
|
|
25 |
SetTestStepName(_L("TestSatControl"));
|
|
26 |
}
|
|
27 |
|
|
28 |
enum TVerdict CTestSatControl::doTestStepL()
|
|
29 |
{
|
|
30 |
INFO_PRINTF1(_L("**************************************"));
|
|
31 |
INFO_PRINTF1(_L("Test RSat Control Functionality"));
|
|
32 |
INFO_PRINTF1(_L("**************************************"));
|
|
33 |
|
|
34 |
RPhone phone;
|
|
35 |
TInt ret=phone.Open(iTelServer,DSATTSY_PHONE_NAME);
|
|
36 |
TEST(ret==KErrNone);
|
|
37 |
|
|
38 |
RSat sat;
|
|
39 |
ret=sat.Open(phone);
|
|
40 |
TEST(ret==KErrNone);
|
|
41 |
|
|
42 |
// local variables used throughout the gprs tests
|
|
43 |
TRequestStatus reqStatus;
|
|
44 |
iTestCount=1;
|
|
45 |
|
|
46 |
// Call Control - Address
|
|
47 |
RSat::TCallControlV1* callControl = new (ELeave) RSat::TCallControlV1;
|
|
48 |
CleanupStack::PushL(callControl);
|
|
49 |
RSat::TCallControlV1Pckg* callControlPckg = new (ELeave) RSat::TCallControlV1Pckg(*callControl);
|
|
50 |
CleanupStack::PushL(callControlPckg);
|
|
51 |
|
|
52 |
sat.NotifyCallControlRequest(reqStatus,*callControlPckg);
|
|
53 |
User::WaitForRequest(reqStatus);
|
|
54 |
TEST(reqStatus.Int()==KErrNone);
|
|
55 |
|
|
56 |
RSat::TControlResult* result = new (ELeave) RSat::TControlResult;
|
|
57 |
CleanupStack::PushL(result);
|
|
58 |
|
|
59 |
callControl->GetCcGeneralResult(*result);
|
|
60 |
TEST(*result==DSATTSY_CC_RESULT);
|
|
61 |
|
|
62 |
RSat::TCallControlType* ccType = new (ELeave) RSat::TCallControlType;
|
|
63 |
CleanupStack::PushL(ccType);
|
|
64 |
callControl->GetCallControlType(*ccType);
|
|
65 |
TEST(*ccType==RSat::ECcAddress);
|
|
66 |
|
|
67 |
RSat::TCallSetUpParams* address = new (ELeave) RSat::TCallSetUpParams;
|
|
68 |
CleanupStack::PushL(address);
|
|
69 |
|
|
70 |
TEST(callControl->GetCallSetUpDetails(*address)==KErrNone);
|
|
71 |
TEST(address->iCcp1==DSATTSY_CCP1);
|
|
72 |
TEST(address->iSubAddress==DSATTSY_SUBADDRESS);
|
|
73 |
TEST(address->iCcp2==DSATTSY_CCP2);
|
|
74 |
TEST(address->iAddress.iTypeOfNumber==DSATTSY_TON);
|
|
75 |
TEST(address->iAddress.iNumberPlan==DSATTSY_NPI);
|
|
76 |
TEST(address->iAddress.iTelNumber==DSATTSY_TEL_NUMBER);
|
|
77 |
|
|
78 |
RSat::TAlphaIdValidity* validity = new (ELeave) RSat::TAlphaIdValidity;
|
|
79 |
CleanupStack::PushL(validity);
|
|
80 |
RSat::TAlphaId* alphaId = new (ELeave) RSat::TAlphaId;
|
|
81 |
CleanupStack::PushL(alphaId);
|
|
82 |
|
|
83 |
callControl->GetAlphaId(*validity, *alphaId);
|
|
84 |
TEST(*validity==DSATTSY_NO_ALPHAID);
|
|
85 |
TEST(alphaId->iStatus==DSATTSY_ALPHAID_STATUS);
|
|
86 |
TEST(alphaId->iAlphaId==DSATTSY_NULL_BUF);
|
|
87 |
RSat::TBCRepeatIndicator bcRepeatIndicator;
|
|
88 |
callControl->GetBCRepeatIndicator(bcRepeatIndicator);
|
|
89 |
|
|
90 |
TEST(bcRepeatIndicator==DSATTSY_BC_REPEAT_INDICATOR_SEQUENTIAL);
|
|
91 |
|
|
92 |
// Call Control Cancel
|
|
93 |
sat.NotifyCallControlRequest(reqStatus, *callControlPckg);
|
|
94 |
sat.CancelAsyncRequest(ESatNotifyCallControlRequest);
|
|
95 |
User::WaitForRequest(reqStatus);
|
|
96 |
TEST(reqStatus.Int()==KErrCancel);
|
|
97 |
INFO_PRINTF2(_L("Test %d - RSat::CallControlCancel passed"),iTestCount++);
|
|
98 |
|
|
99 |
|
|
100 |
// Call Control - SS String
|
|
101 |
RSat::TSsString* ssString = new (ELeave) RSat::TSsString;
|
|
102 |
CleanupStack::PushL(ssString);
|
|
103 |
|
|
104 |
sat.NotifyCallControlRequest(reqStatus,*callControlPckg);
|
|
105 |
User::WaitForRequest(reqStatus);
|
|
106 |
TEST(reqStatus.Int()==KErrNone);
|
|
107 |
|
|
108 |
callControl->GetCallControlType(*ccType);
|
|
109 |
TEST(*ccType==RSat::ECcSsString);
|
|
110 |
|
|
111 |
RSat::TUssdString ussdString;
|
|
112 |
TEST(callControl->GetSendUssdDetails(ussdString)==KErrNotSupported);
|
|
113 |
TEST(callControl->GetCallSetUpDetails(*address)==KErrNotSupported);
|
|
114 |
|
|
115 |
TEST(callControl->GetSendSsDetails(*ssString)==KErrNone);
|
|
116 |
TEST(ssString->iTypeOfNumber==DSATTSY_TON);
|
|
117 |
TEST(ssString->iNumberPlan==DSATTSY_NPI);
|
|
118 |
TEST(ssString->iSsString==DSATTSY_SS_STRING);
|
|
119 |
|
|
120 |
// Call Control Cancel
|
|
121 |
sat.NotifyCallControlRequest(reqStatus,*callControlPckg);
|
|
122 |
sat.CancelAsyncRequest(ESatNotifyCallControlRequest);
|
|
123 |
User::WaitForRequest(reqStatus);
|
|
124 |
TEST(reqStatus.Int()==KErrCancel);
|
|
125 |
INFO_PRINTF2(_L("Test %d - RSat::CallControlCancel passed"),iTestCount++);
|
|
126 |
|
|
127 |
// Call Control - USSD String & Call originator
|
|
128 |
RSat::TCallControlV2* callControlV2 = new (ELeave) RSat::TCallControlV2;
|
|
129 |
CleanupStack::PushL(callControlV2);
|
|
130 |
RSat::TCallControlV2Pckg* callControlV2Pckg = new (ELeave) RSat::TCallControlV2Pckg(*callControlV2);
|
|
131 |
CleanupStack::PushL(callControlV2Pckg);
|
|
132 |
|
|
133 |
sat.NotifyCallControlRequest(reqStatus,*callControlV2Pckg);
|
|
134 |
User::WaitForRequest(reqStatus);
|
|
135 |
TEST(reqStatus.Int()==KErrNone);
|
|
136 |
|
|
137 |
callControlV2->GetCallControlType(*ccType);
|
|
138 |
TEST(*ccType==RSat::ECcUssdString);
|
|
139 |
|
|
140 |
TEST(callControlV2->GetCallSetUpDetails(*address)==KErrNotSupported);
|
|
141 |
TEST(callControlV2->GetSendSsDetails(*ssString)==KErrNotSupported);
|
|
142 |
|
|
143 |
TEST(callControlV2->GetSendUssdDetails(ussdString)==KErrNone);
|
|
144 |
TEST(ussdString.iDcs==DSATTSY_DCS);
|
|
145 |
TEST(ussdString.iUssdString==DSATTSY_USSD_STRING);
|
|
146 |
INFO_PRINTF2(_L("Test %d - RSat::NotifyCallControlRequest - USSD String - passed"),iTestCount++);
|
|
147 |
|
|
148 |
TName callNameV2;
|
|
149 |
callControlV2->GetCallName(callNameV2);
|
|
150 |
TEST(callNameV2 == DSATTSY_CALL_NAME);
|
|
151 |
|
|
152 |
RSat::TActionOriginator* callOriginatorV2 = new (ELeave) RSat::TActionOriginator;
|
|
153 |
CleanupStack::PushL(callOriginatorV2);
|
|
154 |
callControlV2->GetActionOriginator(*callOriginatorV2);
|
|
155 |
TEST(*callOriginatorV2 == DSATTSY_ACTION_ORIGINATOR);
|
|
156 |
|
|
157 |
INFO_PRINTF2(_L("Test %d - RSat::NotifyCallControlRequest - V2 passed"), iTestCount++);
|
|
158 |
|
|
159 |
// Call Control Cancel
|
|
160 |
sat.NotifyCallControlRequest(reqStatus,*callControlV2Pckg);
|
|
161 |
sat.CancelAsyncRequest(ESatNotifyCallControlRequest);
|
|
162 |
User::WaitForRequest(reqStatus);
|
|
163 |
TEST(reqStatus.Int()==KErrCancel);
|
|
164 |
INFO_PRINTF2(_L("Test %d - RSat::CallControlCancel passed"),iTestCount++);
|
|
165 |
|
|
166 |
// Call Control - PDP Context Activation Parameters and BC Repeat Indicator Fallback Mode
|
|
167 |
|
|
168 |
RSat::TCallControlV5* callControlV5 = new (ELeave) RSat::TCallControlV5;
|
|
169 |
CleanupStack::PushL(callControlV5);
|
|
170 |
RSat::TCallControlV5Pckg* callControlPckgV5 = new (ELeave) RSat::TCallControlV5Pckg(*callControlV5);
|
|
171 |
CleanupStack::PushL(callControlPckgV5);
|
|
172 |
|
|
173 |
sat.NotifyCallControlRequest(reqStatus,*callControlPckgV5);
|
|
174 |
User::WaitForRequest(reqStatus);
|
|
175 |
TEST(reqStatus.Int()==KErrNone);
|
|
176 |
|
|
177 |
callControlV5->GetCallControlType(*ccType);
|
|
178 |
TEST(*ccType==RSat::ECcPDPParameters);
|
|
179 |
|
|
180 |
callControlV5->GetBCRepeatIndicator(bcRepeatIndicator);
|
|
181 |
TEST(bcRepeatIndicator==DSATTSY_BC_REPEAT_INDICATOR_FALLBACK);
|
|
182 |
|
|
183 |
TPdpParameters pdpParams;
|
|
184 |
callControlV5->GetPdpParameters(pdpParams);
|
|
185 |
TEST(pdpParams==DSATTSY_PDP_PARAMETERS);
|
|
186 |
|
|
187 |
INFO_PRINTF2(_L("Test %d - RSat::NotifyCallControlRequest PDP Context Activation Parameters and BC Repeat Indicator Fallback Mode - passed"),iTestCount++);
|
|
188 |
|
|
189 |
// Call Control Cancel
|
|
190 |
sat.NotifyCallControlRequest(reqStatus,*callControlPckgV5);
|
|
191 |
sat.CancelAsyncRequest(ESatNotifyCallControlRequest);
|
|
192 |
User::WaitForRequest(reqStatus);
|
|
193 |
TEST(reqStatus.Int()==KErrCancel);
|
|
194 |
INFO_PRINTF2(_L("Test %d - RSat::CallControlCancel passed"),iTestCount++);
|
|
195 |
|
|
196 |
// Call Control - PDP Context Activation Parameters and BC Repeat Indicator Service Change and Fallback Mode
|
|
197 |
|
|
198 |
sat.NotifyCallControlRequest(reqStatus,*callControlPckgV5);
|
|
199 |
User::WaitForRequest(reqStatus);
|
|
200 |
TEST(reqStatus.Int()==KErrNone);
|
|
201 |
|
|
202 |
callControlV5->GetCallControlType(*ccType);
|
|
203 |
TEST(*ccType==RSat::ECcPDPParameters);
|
|
204 |
|
|
205 |
callControlV5->GetBCRepeatIndicator(bcRepeatIndicator);
|
|
206 |
TEST(bcRepeatIndicator==DSATTSY_BC_REPEAT_INDICATOR_SERVICECHANGEANDFALLBACK);
|
|
207 |
|
|
208 |
callControlV5->GetPdpParameters(pdpParams);
|
|
209 |
TEST(pdpParams==DSATTSY_PDP_PARAMETERS2);
|
|
210 |
|
|
211 |
|
|
212 |
INFO_PRINTF2(_L("Test %d - RSat::NotifyCallControlRequest - PDP Context Activation Parameters and BC Repeat Indicator Service Change and Fallback Mode - passed"),iTestCount++);
|
|
213 |
|
|
214 |
// Call Control Cancel
|
|
215 |
sat.NotifyCallControlRequest(reqStatus,*callControlPckgV5);
|
|
216 |
sat.CancelAsyncRequest(ESatNotifyCallControlRequest);
|
|
217 |
User::WaitForRequest(reqStatus);
|
|
218 |
TEST(reqStatus.Int()==KErrCancel);
|
|
219 |
INFO_PRINTF2(_L("Test %d - RSat::CallControlCancel passed"),iTestCount++);
|
|
220 |
CleanupStack::PopAndDestroy(2);
|
|
221 |
|
|
222 |
// Call Control with V6 Parameters
|
|
223 |
RSat::TCallControlV6* callControlV6 = new (ELeave) RSat::TCallControlV6;
|
|
224 |
CleanupStack::PushL(callControlV6);
|
|
225 |
TEST(callControlV6->ExtensionId() == RSat::KSatV6);
|
|
226 |
RSat::TCallControlV6Pckg* callControlPckgV6 = new (ELeave) RSat::TCallControlV6Pckg(*callControlV6);
|
|
227 |
CleanupStack::PushL(callControlPckgV6);
|
|
228 |
|
|
229 |
sat.NotifyCallControlRequest(reqStatus,*callControlPckgV6);
|
|
230 |
User::WaitForRequest(reqStatus);
|
|
231 |
TEST(reqStatus.Int()==KErrNone);
|
|
232 |
|
|
233 |
callControlV6->GetCallControlType(*ccType);
|
|
234 |
TEST(*ccType==RSat::ECcPDPParameters);
|
|
235 |
|
|
236 |
callControlV6->GetBCRepeatIndicator(bcRepeatIndicator);
|
|
237 |
TEST(bcRepeatIndicator==DSATTSY_BC_REPEAT_INDICATOR_SERVICECHANGEANDFALLBACK);
|
|
238 |
|
|
239 |
callControlV6->GetPdpParameters(pdpParams);
|
|
240 |
TEST(pdpParams==DSATTSY_PDP_PARAMETERS2);
|
|
241 |
|
|
242 |
RSat::TCallParamOrigin callParamOrigin;
|
|
243 |
callControlV6->GetCallParamOrigin(callParamOrigin);
|
|
244 |
TEST(callParamOrigin == DSATTSY_CC_CALL_PARAM_ORIGIN);
|
|
245 |
|
|
246 |
INFO_PRINTF2(_L("Test %d - RSat::NotifyCallControlRequest Call originator - passed"),iTestCount++);
|
|
247 |
|
|
248 |
// Call Control Cancel
|
|
249 |
sat.NotifyCallControlRequest(reqStatus,*callControlPckgV6);
|
|
250 |
sat.CancelAsyncRequest(ESatNotifyCallControlRequest);
|
|
251 |
User::WaitForRequest(reqStatus);
|
|
252 |
TEST(reqStatus.Int()==KErrCancel);
|
|
253 |
INFO_PRINTF2(_L("Test %d - RSat::CallControlCancel passed"),iTestCount++);
|
|
254 |
CleanupStack::PopAndDestroy(2);
|
|
255 |
|
|
256 |
// MO SM Control
|
|
257 |
RSat::TMoSmControlV1* moSmControl = new (ELeave) RSat::TMoSmControlV1;
|
|
258 |
CleanupStack::PushL(moSmControl);
|
|
259 |
RSat::TMoSmControlV1Pckg* moSmControlPckg = new (ELeave) RSat::TMoSmControlV1Pckg(*moSmControl);
|
|
260 |
CleanupStack::PushL(moSmControlPckg);
|
|
261 |
|
|
262 |
sat.NotifyMoSmControlRequest(reqStatus,*moSmControlPckg);
|
|
263 |
User::WaitForRequest(reqStatus);
|
|
264 |
TEST(reqStatus.Int()==KErrNone);
|
|
265 |
|
|
266 |
TEST(moSmControl->iRpAddress.iTypeOfNumber==DSATTSY_TON);
|
|
267 |
TEST(moSmControl->iRpAddress.iNumberPlan==DSATTSY_NPI);
|
|
268 |
TEST(moSmControl->iRpAddress.iTelNumber==DSATTSY_TEL_NUMBER);
|
|
269 |
TEST(moSmControl->iTpAddress.iTypeOfNumber==DSATTSY_TON);
|
|
270 |
TEST(moSmControl->iTpAddress.iNumberPlan==DSATTSY_NPI);
|
|
271 |
TEST(moSmControl->iTpAddress.iTelNumber==DSATTSY_TEL_NUMBER);
|
|
272 |
TEST(moSmControl->iResult==DSATTSY_CONTROL_RESULT);
|
|
273 |
TEST(moSmControl->iAlphaId.iStatus==DSATTSY_ALPHA_ID1_STATUS);
|
|
274 |
TEST(moSmControl->iAlphaId.iAlphaId==DSATTSY_ALPHA_ID1);
|
|
275 |
INFO_PRINTF2(_L("Test %d - RSat::NotifyMoSmControlRequest passed"),iTestCount++);
|
|
276 |
|
|
277 |
// MO SM Control Cancel
|
|
278 |
sat.NotifyMoSmControlRequest(reqStatus,*moSmControlPckg);
|
|
279 |
sat.CancelAsyncRequest(ESatNotifyMoSmControlRequest);
|
|
280 |
|
|
281 |
User::WaitForRequest(reqStatus);
|
|
282 |
TEST(reqStatus.Int()==KErrCancel);
|
|
283 |
INFO_PRINTF2(_L("Test %d - RSat::MoSmControlCancel passed"),iTestCount++);
|
|
284 |
|
|
285 |
|
|
286 |
CleanupStack::PopAndDestroy(13);
|
|
287 |
|
|
288 |
sat.Close();
|
|
289 |
phone.Close();
|
|
290 |
|
|
291 |
return TestStepResult();
|
|
292 |
}
|
|
293 |
|
|
294 |
|