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_EtelSatpcmds1d.h"
|
|
18 |
|
|
19 |
CTestSatPCmds1d::CTestSatPCmds1d()
|
|
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("TestSatPCmds1d"));
|
|
26 |
}
|
|
27 |
|
|
28 |
enum TVerdict CTestSatPCmds1d::doTestStepL()
|
|
29 |
{
|
|
30 |
INFO_PRINTF1(_L("***********************************************"));
|
|
31 |
INFO_PRINTF1(_L("RSat Proactive Commands Functionality suite - 2"));
|
|
32 |
INFO_PRINTF1(_L("***********************************************"));
|
|
33 |
|
|
34 |
TInt ret=phone.Open(iTelServer,DSATTSY_PHONE_NAME);
|
|
35 |
TEST(ret==KErrNone);
|
|
36 |
|
|
37 |
ret=sat.Open(phone);
|
|
38 |
TEST(ret==KErrNone);
|
|
39 |
|
|
40 |
// Open Channel Cs with V2
|
|
41 |
RSat::TOpenCsChannelV2Pckg openCsChannelPckg(iOpenCsChannel);
|
|
42 |
|
|
43 |
iOpenCsChannel.iPCmdType = DSATTSY_CS_BEARER;
|
|
44 |
|
|
45 |
sat.NotifyOpenChannelPCmd(reqStatus, openCsChannelPckg);
|
|
46 |
User::WaitForRequest(reqStatus);
|
|
47 |
TEST(reqStatus.Int()==KErrNone);
|
|
48 |
|
|
49 |
TEST(iOpenCsChannel.PCmdNumber()==DSATTSY_OPEN_CHANNEL_NUMBER);
|
|
50 |
TEST(iOpenCsChannel.iPCmdType==DSATTSY_CS_BEARER);
|
|
51 |
TEST(iOpenCsChannel.iLinkEst==DSATTSY_ON_DEMAND_ESTABLISHMENT);
|
|
52 |
TEST(iOpenCsChannel.iReconnectionMode==DSATTSY_AUTO_RECONNECTION);
|
|
53 |
TEST(iOpenCsChannel.iAlphaId.iStatus==DSATTSY_ALPHA_ID1_STATUS);
|
|
54 |
TEST(iOpenCsChannel.iAlphaId.iAlphaId==DSATTSY_ALPHA_ID1);
|
|
55 |
TEST(iOpenCsChannel.iIconId.iIdentifier==DSATTSY_ICON_ID1);
|
|
56 |
TEST(iOpenCsChannel.iIconId.iQualifier==DSATTSY_ICON_QUALIFIER1);
|
|
57 |
TEST(iOpenCsChannel.iBearer.iType==DSATTSY_CSD_BEARER_TYPE);
|
|
58 |
TEST(iOpenCsChannel.iBearer.iParams==DSATTSY_BEARER_PARAMS);
|
|
59 |
TEST(iOpenCsChannel.iBufferSize==DSATTSY_BUFFER_SIZE);
|
|
60 |
TEST(iOpenCsChannel.iSimMeInterface.iPrtNumber==DSATTSY_PORT_1);
|
|
61 |
TEST(iOpenCsChannel.iSimMeInterface.iTransportProto==DSATTSY_TCP_PROTO);
|
|
62 |
TEST(iOpenCsChannel.iDestinationAddress.iType==DSATTSY_IPV4_TYPE);
|
|
63 |
TEST(iOpenCsChannel.iDestinationAddress.iAddress==DSATTSY_ADDRESS);
|
|
64 |
TEST(iOpenCsChannel.iAddress.iTypeOfNumber==DSATTSY_TON);
|
|
65 |
TEST(iOpenCsChannel.iAddress.iNumberPlan==DSATTSY_NPI);
|
|
66 |
TEST(iOpenCsChannel.iAddress.iTelNumber==DSATTSY_TEL_NUMBER);
|
|
67 |
TEST(iOpenCsChannel.iSubAddress==DSATTSY_SUBADDRESS);
|
|
68 |
TEST(iOpenCsChannel.iDuration1.iTimeUnit==DSATTSY_TIME_UNIT);
|
|
69 |
TEST(iOpenCsChannel.iDuration1.iNumOfUnits==DSATTSY_NUM_OF_UNITS);
|
|
70 |
TEST(iOpenCsChannel.iDuration2.iTimeUnit==DSATTSY_TIME_UNIT);
|
|
71 |
TEST(iOpenCsChannel.iDuration2.iNumOfUnits==DSATTSY_TIME_UNIT);
|
|
72 |
TEST(iOpenCsChannel.iLocalAddress.iType==DSATTSY_IPV4_TYPE);
|
|
73 |
TEST(iOpenCsChannel.iLocalAddress.iAddress==DSATTSY_ADDRESS);
|
|
74 |
TEST(iOpenCsChannel.iUserLogin==DSATTSY_LOGIN);
|
|
75 |
TEST(iOpenCsChannel.iUserPassword==DSATTSY_PASSWORD);
|
|
76 |
|
|
77 |
INFO_PRINTF2(_L("Test %d - RSat::NotifyOpenChannelPCmd - CS channel (RSat::TOpenCsChannelV2) - passed"),iTestCount++);
|
|
78 |
|
|
79 |
// Open Channel Cancel
|
|
80 |
sat.NotifyOpenChannelPCmd(reqStatus,openCsChannelPckg);
|
|
81 |
sat.CancelAsyncRequest(ESatNotifyOpenChannelPCmd);
|
|
82 |
|
|
83 |
User::WaitForRequest(reqStatus);
|
|
84 |
TEST(reqStatus.Int()==KErrCancel);
|
|
85 |
INFO_PRINTF2(_L("Test %d - RSat::NotifyOpenChannelPCmd Cancel (RSat::TOpenCsChannelV2) passed"),iTestCount++);
|
|
86 |
|
|
87 |
// Open Channel Gprs with V4
|
|
88 |
RSat::TOpenGprsChannelV4Pckg openGprsChannelPckg(iOpenGprsChannel);
|
|
89 |
|
|
90 |
iOpenGprsChannel.iPCmdType=DSATTSY_GPRS_BEARER;
|
|
91 |
|
|
92 |
sat.NotifyOpenChannelPCmd(reqStatus,openGprsChannelPckg);
|
|
93 |
User::WaitForRequest(reqStatus);
|
|
94 |
TEST(reqStatus.Int()==KErrNone);
|
|
95 |
|
|
96 |
TEST(iOpenGprsChannel.PCmdNumber()==DSATTSY_OPEN_CHANNEL_NUMBER);
|
|
97 |
TEST(iOpenGprsChannel.iPCmdType==DSATTSY_GPRS_BEARER);
|
|
98 |
TEST(iOpenGprsChannel.iLinkEst==DSATTSY_ON_DEMAND_ESTABLISHMENT);
|
|
99 |
TEST(iOpenGprsChannel.iReconnectionMode==DSATTSY_AUTO_RECONNECTION);
|
|
100 |
TEST(iOpenGprsChannel.iAlphaId.iStatus==DSATTSY_ALPHA_ID1_STATUS);
|
|
101 |
TEST(iOpenGprsChannel.iAlphaId.iAlphaId==DSATTSY_ALPHA_ID1);
|
|
102 |
TEST(iOpenGprsChannel.iIconId.iIdentifier==DSATTSY_ICON_ID1);
|
|
103 |
TEST(iOpenGprsChannel.iIconId.iQualifier==DSATTSY_ICON_QUALIFIER1);
|
|
104 |
TEST(iOpenGprsChannel.iBearer.iType==DSATTSY_CSD_BEARER_TYPE);
|
|
105 |
TEST(iOpenGprsChannel.iBearer.iParams==DSATTSY_BEARER_PARAMS);
|
|
106 |
TEST(iOpenGprsChannel.iBufferSize==DSATTSY_BUFFER_SIZE);
|
|
107 |
TEST(iOpenGprsChannel.iSimMeInterface.iPrtNumber==DSATTSY_PORT_1);
|
|
108 |
TEST(iOpenGprsChannel.iSimMeInterface.iTransportProto==DSATTSY_TCP_PROTO);
|
|
109 |
TEST(iOpenGprsChannel.iDestinationAddress.iType==DSATTSY_IPV4_TYPE);
|
|
110 |
TEST(iOpenGprsChannel.iDestinationAddress.iAddress==DSATTSY_ADDRESS);
|
|
111 |
TEST(iOpenGprsChannel.iAccessName==DSATTSY_ACCESS_NAME);
|
|
112 |
TEST(iOpenGprsChannel.iLocalAddress.iType==DSATTSY_IPV4_TYPE);
|
|
113 |
TEST(iOpenGprsChannel.iLocalAddress.iAddress==DSATTSY_ADDRESS);
|
|
114 |
TEST(iOpenGprsChannel.iUserLogin==DSATTSY_LOGIN);
|
|
115 |
TEST(iOpenGprsChannel.iUserPassword==DSATTSY_PASSWORD);
|
|
116 |
|
|
117 |
INFO_PRINTF2(_L("Test %d - RSat::NotifyOpenChannelPCmd - GPRS Channel (RSat::TOpenGprsChannelV4) - passed"),iTestCount++);
|
|
118 |
|
|
119 |
// Open Channel Cancel with V4
|
|
120 |
sat.NotifyOpenChannelPCmd(reqStatus,openGprsChannelPckg);
|
|
121 |
sat.CancelAsyncRequest(ESatNotifyOpenChannelPCmd);
|
|
122 |
|
|
123 |
User::WaitForRequest(reqStatus);
|
|
124 |
TEST(reqStatus.Int()==KErrCancel);
|
|
125 |
INFO_PRINTF2(_L("Test %d - RSat::NotifyOpenChannelPCmd Cancel (RSat::TOpenGprsChannelV4) passed"),iTestCount++);
|
|
126 |
|
|
127 |
// Further tests, seperated to prevent stack overflow
|
|
128 |
ExtendedTest1L(reqStatus, openCsChannelPckg, openGprsChannelPckg);
|
|
129 |
|
|
130 |
sat.Close();
|
|
131 |
phone.Close();
|
|
132 |
|
|
133 |
return TestStepResult();
|
|
134 |
}
|
|
135 |
|
|
136 |
// Further tests, seperated to prevent stack overflow
|
|
137 |
void CTestSatPCmds1d::ExtendedTest1L(TRequestStatus& reqStatus,
|
|
138 |
RSat::TOpenCsChannelV2Pckg& aOpenCsChannelPckg,
|
|
139 |
RSat::TOpenGprsChannelV4Pckg& aOpenGprsChannelPckg)
|
|
140 |
{
|
|
141 |
|
|
142 |
// Open Channel Local with version 2
|
|
143 |
|
|
144 |
RSat::TOpenLocalLinksChannelV2* openLocalChannel = new(ELeave) RSat::TOpenLocalLinksChannelV2;
|
|
145 |
CleanupStack::PushL(openLocalChannel);
|
|
146 |
|
|
147 |
RSat::TOpenLocalLinksChannelV2Pckg* openLocalChannelPckg = new(ELeave) RSat::TOpenLocalLinksChannelV2Pckg(*openLocalChannel);
|
|
148 |
CleanupStack::PushL(openLocalChannelPckg);
|
|
149 |
|
|
150 |
openLocalChannel->iPCmdType=DSATTSY_LOCAL_BEARER;
|
|
151 |
|
|
152 |
sat.NotifyOpenChannelPCmd(reqStatus,*openLocalChannelPckg);
|
|
153 |
User::WaitForRequest(reqStatus);
|
|
154 |
TEST(reqStatus.Int()==KErrNone);
|
|
155 |
|
|
156 |
TEST(openLocalChannel->PCmdNumber()==DSATTSY_OPEN_CHANNEL_NUMBER);
|
|
157 |
TEST(openLocalChannel->iPCmdType==DSATTSY_LOCAL_BEARER);
|
|
158 |
TEST(openLocalChannel->iLinkEst==DSATTSY_ON_DEMAND_ESTABLISHMENT);
|
|
159 |
TEST(openLocalChannel->iReconnectionMode==DSATTSY_AUTO_RECONNECTION);
|
|
160 |
TEST(openLocalChannel->iAlphaId.iStatus==DSATTSY_ALPHA_ID1_STATUS);
|
|
161 |
TEST(openLocalChannel->iAlphaId.iAlphaId==DSATTSY_ALPHA_ID1);
|
|
162 |
TEST(openLocalChannel->iIconId.iIdentifier==DSATTSY_ICON_ID1);
|
|
163 |
TEST(openLocalChannel->iIconId.iQualifier==DSATTSY_ICON_QUALIFIER1);
|
|
164 |
TEST(openLocalChannel->iBearer.iType==DSATTSY_CSD_BEARER_TYPE);
|
|
165 |
TEST(openLocalChannel->iBearer.iParams==DSATTSY_BEARER_PARAMS);
|
|
166 |
TEST(openLocalChannel->iBufferSize==DSATTSY_BUFFER_SIZE);
|
|
167 |
TEST(openLocalChannel->iSimMeInterface.iPrtNumber==DSATTSY_PORT_1);
|
|
168 |
TEST(openLocalChannel->iSimMeInterface.iTransportProto==DSATTSY_TCP_PROTO);
|
|
169 |
TEST(openLocalChannel->iDestinationAddress.iType==DSATTSY_IPV4_TYPE);
|
|
170 |
TEST(openLocalChannel->iDestinationAddress.iAddress==DSATTSY_ADDRESS);
|
|
171 |
TEST(openLocalChannel->iDuration1.iTimeUnit==DSATTSY_TIME_UNIT);
|
|
172 |
TEST(openLocalChannel->iDuration1.iNumOfUnits==DSATTSY_TIME_UNIT);
|
|
173 |
TEST(openLocalChannel->iDuration2.iTimeUnit==DSATTSY_TIME_UNIT);
|
|
174 |
TEST(openLocalChannel->iDuration2.iNumOfUnits==DSATTSY_TIME_UNIT);
|
|
175 |
TEST(openLocalChannel->iRemoteAddress.iCoding==DSATTSY_CODING);
|
|
176 |
TEST(openLocalChannel->iRemoteAddress.iAddress==DSATTSY_ADDRESS);
|
|
177 |
TEST(openLocalChannel->iUserPassword==DSATTSY_PASSWORD);
|
|
178 |
|
|
179 |
INFO_PRINTF2(_L("Test %d - RSat::NotifyOpenChannelPCmd - Local Channel (RSat::TOpenLocalLinksChannelV2) - passed"),iTestCount++);
|
|
180 |
|
|
181 |
// Open Channel Cancel with version 2
|
|
182 |
sat.NotifyOpenChannelPCmd(reqStatus,*openLocalChannelPckg);
|
|
183 |
sat.CancelAsyncRequest(ESatNotifyOpenChannelPCmd);
|
|
184 |
|
|
185 |
User::WaitForRequest(reqStatus);
|
|
186 |
TEST(reqStatus.Int()==KErrCancel);
|
|
187 |
INFO_PRINTF2(_L("Test %d - RSat::NotifyOpenChannelPCmd Cancel (RSat::TOpenLocalLinksChannelV2) passed"),iTestCount++);
|
|
188 |
|
|
189 |
// START Open channel "AnyBearer" tests
|
|
190 |
// 1. expect CS returned
|
|
191 |
// 2. expect GPRS returned
|
|
192 |
// 3. expect LocalLink returned
|
|
193 |
// 4. expect error
|
|
194 |
|
|
195 |
// [1] Test for CS returned
|
|
196 |
|
|
197 |
iOpenCsChannel.iPCmdType = DSATTSY_ANY_BEARER;
|
|
198 |
|
|
199 |
sat.NotifyOpenChannelPCmd(reqStatus, aOpenCsChannelPckg);
|
|
200 |
User::WaitForRequest(reqStatus);
|
|
201 |
TEST(reqStatus.Int()==KErrNone);
|
|
202 |
|
|
203 |
TEST(iOpenCsChannel.PCmdNumber()==DSATTSY_OPEN_CHANNEL_NUMBER);
|
|
204 |
TEST(iOpenCsChannel.iPCmdType==DSATTSY_CS_BEARER);
|
|
205 |
|
|
206 |
sat.GetOpenChannelPCmd(reqStatus, aOpenCsChannelPckg);
|
|
207 |
User::WaitForRequest(reqStatus);
|
|
208 |
TEST(reqStatus.Int()==KErrNone);
|
|
209 |
|
|
210 |
TEST(iOpenCsChannel.iLinkEst==DSATTSY_ON_DEMAND_ESTABLISHMENT);
|
|
211 |
TEST(iOpenCsChannel.iReconnectionMode==DSATTSY_AUTO_RECONNECTION);
|
|
212 |
TEST(iOpenCsChannel.iAlphaId.iStatus==DSATTSY_ALPHA_ID1_STATUS);
|
|
213 |
TEST(iOpenCsChannel.iAlphaId.iAlphaId==DSATTSY_ALPHA_ID1);
|
|
214 |
TEST(iOpenCsChannel.iIconId.iIdentifier==DSATTSY_ICON_ID1);
|
|
215 |
TEST(iOpenCsChannel.iIconId.iQualifier==DSATTSY_ICON_QUALIFIER1);
|
|
216 |
TEST(iOpenCsChannel.iBearer.iType==DSATTSY_CSD_BEARER_TYPE);
|
|
217 |
TEST(iOpenCsChannel.iBearer.iParams==DSATTSY_BEARER_PARAMS);
|
|
218 |
TEST(iOpenCsChannel.iBufferSize==DSATTSY_BUFFER_SIZE);
|
|
219 |
TEST(iOpenCsChannel.iSimMeInterface.iPrtNumber==DSATTSY_PORT_1);
|
|
220 |
TEST(iOpenCsChannel.iSimMeInterface.iTransportProto==DSATTSY_TCP_PROTO);
|
|
221 |
TEST(iOpenCsChannel.iDestinationAddress.iType==DSATTSY_IPV4_TYPE);
|
|
222 |
TEST(iOpenCsChannel.iDestinationAddress.iAddress==DSATTSY_ADDRESS);
|
|
223 |
TEST(iOpenCsChannel.iAddress.iTypeOfNumber==DSATTSY_TON);
|
|
224 |
TEST(iOpenCsChannel.iAddress.iNumberPlan==DSATTSY_NPI);
|
|
225 |
TEST(iOpenCsChannel.iAddress.iTelNumber==DSATTSY_TEL_NUMBER);
|
|
226 |
TEST(iOpenCsChannel.iSubAddress==DSATTSY_SUBADDRESS);
|
|
227 |
TEST(iOpenCsChannel.iDuration1.iTimeUnit==DSATTSY_TIME_UNIT);
|
|
228 |
TEST(iOpenCsChannel.iDuration1.iNumOfUnits==DSATTSY_NUM_OF_UNITS);
|
|
229 |
TEST(iOpenCsChannel.iDuration2.iTimeUnit==DSATTSY_TIME_UNIT);
|
|
230 |
TEST(iOpenCsChannel.iDuration2.iNumOfUnits==DSATTSY_TIME_UNIT);
|
|
231 |
TEST(iOpenCsChannel.iLocalAddress.iType==DSATTSY_IPV4_TYPE);
|
|
232 |
TEST(iOpenCsChannel.iLocalAddress.iAddress==DSATTSY_ADDRESS);
|
|
233 |
TEST(iOpenCsChannel.iUserLogin==DSATTSY_LOGIN);
|
|
234 |
TEST(iOpenCsChannel.iUserPassword==DSATTSY_PASSWORD);
|
|
235 |
|
|
236 |
INFO_PRINTF2(_L("Test %d - RSat::NotifyOpenChannelPCmd - AnyBearer, expect CS channel - passed"),iTestCount++);
|
|
237 |
|
|
238 |
// Open Channel Cancel
|
|
239 |
sat.NotifyOpenChannelPCmd(reqStatus,aOpenCsChannelPckg);
|
|
240 |
sat.CancelAsyncRequest(ESatNotifyOpenChannelPCmd);
|
|
241 |
|
|
242 |
User::WaitForRequest(reqStatus);
|
|
243 |
TEST(reqStatus.Int()==KErrCancel);
|
|
244 |
INFO_PRINTF2(_L("Test %d - RSat::NotifyOpenChannelPCmd Cancel passed"),iTestCount++);
|
|
245 |
|
|
246 |
// [2] Open Channel Gprs
|
|
247 |
|
|
248 |
iOpenGprsChannel.iPCmdType = DSATTSY_ANY_BEARER;
|
|
249 |
|
|
250 |
sat.NotifyOpenChannelPCmd(reqStatus,aOpenGprsChannelPckg);
|
|
251 |
User::WaitForRequest(reqStatus);
|
|
252 |
TEST(reqStatus.Int()==KErrNone);
|
|
253 |
|
|
254 |
TEST(iOpenGprsChannel.PCmdNumber()==DSATTSY_OPEN_CHANNEL_NUMBER);
|
|
255 |
TEST(iOpenGprsChannel.iPCmdType==DSATTSY_GPRS_BEARER);
|
|
256 |
|
|
257 |
sat.GetOpenChannelPCmd(reqStatus, aOpenGprsChannelPckg);
|
|
258 |
User::WaitForRequest(reqStatus);
|
|
259 |
TEST(reqStatus.Int()==KErrNone);
|
|
260 |
|
|
261 |
TEST(iOpenGprsChannel.iLinkEst==DSATTSY_ON_DEMAND_ESTABLISHMENT);
|
|
262 |
TEST(iOpenGprsChannel.iReconnectionMode==DSATTSY_AUTO_RECONNECTION);
|
|
263 |
TEST(iOpenGprsChannel.iAlphaId.iStatus==DSATTSY_ALPHA_ID1_STATUS);
|
|
264 |
TEST(iOpenGprsChannel.iAlphaId.iAlphaId==DSATTSY_ALPHA_ID1);
|
|
265 |
TEST(iOpenGprsChannel.iIconId.iIdentifier==DSATTSY_ICON_ID1);
|
|
266 |
TEST(iOpenGprsChannel.iIconId.iQualifier==DSATTSY_ICON_QUALIFIER1);
|
|
267 |
TEST(iOpenGprsChannel.iBearer.iType==DSATTSY_CSD_BEARER_TYPE);
|
|
268 |
TEST(iOpenGprsChannel.iBearer.iParams==DSATTSY_BEARER_PARAMS);
|
|
269 |
TEST(iOpenGprsChannel.iBufferSize==DSATTSY_BUFFER_SIZE);
|
|
270 |
TEST(iOpenGprsChannel.iSimMeInterface.iPrtNumber==DSATTSY_PORT_1);
|
|
271 |
TEST(iOpenGprsChannel.iSimMeInterface.iTransportProto==DSATTSY_TCP_PROTO);
|
|
272 |
TEST(iOpenGprsChannel.iDestinationAddress.iType==DSATTSY_IPV4_TYPE);
|
|
273 |
TEST(iOpenGprsChannel.iDestinationAddress.iAddress==DSATTSY_ADDRESS);
|
|
274 |
TEST(iOpenGprsChannel.iAccessName==DSATTSY_ACCESS_NAME);
|
|
275 |
TEST(iOpenGprsChannel.iLocalAddress.iType==DSATTSY_IPV4_TYPE);
|
|
276 |
TEST(iOpenGprsChannel.iLocalAddress.iAddress==DSATTSY_ADDRESS);
|
|
277 |
TEST(iOpenGprsChannel.iUserLogin==DSATTSY_LOGIN);
|
|
278 |
TEST(iOpenGprsChannel.iUserPassword==DSATTSY_PASSWORD);
|
|
279 |
|
|
280 |
INFO_PRINTF2(_L("Test %d - RSat::NotifyOpenChannelPCmd - AnyBearer, expect GPRS channel - passed"),iTestCount++);
|
|
281 |
|
|
282 |
// Open Channel Cancel
|
|
283 |
|
|
284 |
sat.NotifyOpenChannelPCmd(reqStatus,aOpenGprsChannelPckg);
|
|
285 |
sat.CancelAsyncRequest(ESatNotifyOpenChannelPCmd);
|
|
286 |
|
|
287 |
User::WaitForRequest(reqStatus);
|
|
288 |
TEST(reqStatus.Int()==KErrCancel);
|
|
289 |
INFO_PRINTF2(_L("Test %d - RSat::NotifyOpenChannelPCmd Cancel passed"),iTestCount++);
|
|
290 |
|
|
291 |
// [3] Open Channel Local
|
|
292 |
|
|
293 |
openLocalChannel->iPCmdType = DSATTSY_ANY_BEARER;
|
|
294 |
|
|
295 |
sat.NotifyOpenChannelPCmd(reqStatus,*openLocalChannelPckg);
|
|
296 |
User::WaitForRequest(reqStatus);
|
|
297 |
TEST(reqStatus.Int()==KErrNone);
|
|
298 |
|
|
299 |
TEST(openLocalChannel->PCmdNumber()==DSATTSY_OPEN_CHANNEL_NUMBER);
|
|
300 |
TEST(openLocalChannel->iPCmdType==DSATTSY_LOCAL_BEARER);
|
|
301 |
|
|
302 |
sat.GetOpenChannelPCmd(reqStatus, *openLocalChannelPckg);
|
|
303 |
User::WaitForRequest(reqStatus);
|
|
304 |
TEST(reqStatus.Int()==KErrNone);
|
|
305 |
|
|
306 |
TEST(openLocalChannel->iLinkEst==DSATTSY_ON_DEMAND_ESTABLISHMENT);
|
|
307 |
TEST(openLocalChannel->iReconnectionMode==DSATTSY_AUTO_RECONNECTION);
|
|
308 |
TEST(openLocalChannel->iAlphaId.iStatus==DSATTSY_ALPHA_ID1_STATUS);
|
|
309 |
TEST(openLocalChannel->iAlphaId.iAlphaId==DSATTSY_ALPHA_ID1);
|
|
310 |
TEST(openLocalChannel->iIconId.iIdentifier==DSATTSY_ICON_ID1);
|
|
311 |
TEST(openLocalChannel->iIconId.iQualifier==DSATTSY_ICON_QUALIFIER1);
|
|
312 |
TEST(openLocalChannel->iBearer.iType==DSATTSY_CSD_BEARER_TYPE);
|
|
313 |
TEST(openLocalChannel->iBearer.iParams==DSATTSY_BEARER_PARAMS);
|
|
314 |
TEST(openLocalChannel->iBufferSize==DSATTSY_BUFFER_SIZE);
|
|
315 |
TEST(openLocalChannel->iSimMeInterface.iPrtNumber==DSATTSY_PORT_1);
|
|
316 |
TEST(openLocalChannel->iSimMeInterface.iTransportProto==DSATTSY_TCP_PROTO);
|
|
317 |
TEST(openLocalChannel->iDestinationAddress.iType==DSATTSY_IPV4_TYPE);
|
|
318 |
TEST(openLocalChannel->iDestinationAddress.iAddress==DSATTSY_ADDRESS);
|
|
319 |
TEST(openLocalChannel->iDuration1.iTimeUnit==DSATTSY_TIME_UNIT);
|
|
320 |
TEST(openLocalChannel->iDuration1.iNumOfUnits==DSATTSY_TIME_UNIT);
|
|
321 |
TEST(openLocalChannel->iDuration2.iTimeUnit==DSATTSY_TIME_UNIT);
|
|
322 |
TEST(openLocalChannel->iDuration2.iNumOfUnits==DSATTSY_TIME_UNIT);
|
|
323 |
TEST(openLocalChannel->iRemoteAddress.iCoding==DSATTSY_CODING);
|
|
324 |
TEST(openLocalChannel->iRemoteAddress.iAddress==DSATTSY_ADDRESS);
|
|
325 |
TEST(openLocalChannel->iUserPassword==DSATTSY_PASSWORD);
|
|
326 |
|
|
327 |
INFO_PRINTF2(_L("Test %d - RSat::NotifyOpenChannelPCmd - AnyBearer, expect Local channel - passed"),iTestCount++);
|
|
328 |
|
|
329 |
// Open Channel Cancel
|
|
330 |
sat.NotifyOpenChannelPCmd(reqStatus,*openLocalChannelPckg);
|
|
331 |
sat.CancelAsyncRequest(ESatNotifyOpenChannelPCmd);
|
|
332 |
|
|
333 |
User::WaitForRequest(reqStatus);
|
|
334 |
TEST(reqStatus.Int()==KErrCancel);
|
|
335 |
INFO_PRINTF2(_L("Test %d - RSat::NotifyOpenChannelPCmd Cancel passed"),iTestCount++);
|
|
336 |
|
|
337 |
// [4] Test for CS returned - actually expect error (just using CS for convenience)
|
|
338 |
|
|
339 |
// Open Base channel
|
|
340 |
|
|
341 |
RSat::TOpenChannelBaseV2Pckg openBaseChannelPckg(iOpenBaseChannel);
|
|
342 |
|
|
343 |
iOpenBaseChannel.iPCmdType = DSATTSY_ANY_BEARER;
|
|
344 |
|
|
345 |
sat.NotifyOpenChannelPCmd(reqStatus, openBaseChannelPckg);
|
|
346 |
User::WaitForRequest(reqStatus);
|
|
347 |
TEST(reqStatus.Int()==KErrNone);
|
|
348 |
|
|
349 |
sat.NotifyOpenChannelPCmd(reqStatus, openBaseChannelPckg);
|
|
350 |
sat.CancelAsyncRequest(ESatNotifyOpenChannelPCmd);
|
|
351 |
User::WaitForRequest(reqStatus);
|
|
352 |
TEST(reqStatus.Int()==KErrCancel);
|
|
353 |
|
|
354 |
TEST(iOpenBaseChannel.PCmdNumber() == DSATTSY_OPEN_CHANNEL_NUMBER);
|
|
355 |
TEST(iOpenBaseChannel.iPCmdType == RSat::EPCmdTypeNotSet);
|
|
356 |
|
|
357 |
INFO_PRINTF2(_L("Test %d - RSat::NotifyOpenChannelPCmd - AnyBearer, expect error - passed"),iTestCount++);
|
|
358 |
|
|
359 |
// END Open channel "AnyBearer" tests
|
|
360 |
|
|
361 |
// Open Channel Terminal Rsp
|
|
362 |
RSat::TOpenChannelRspV2Pckg openChannelRspPckg(iOpenChannelRsp);
|
|
363 |
|
|
364 |
iOpenChannelRsp.SetPCmdNumber(DSATTSY_OPEN_CHANNEL_NUMBER);
|
|
365 |
iOpenChannelRsp.iGeneralResult=DSATTSY_PCMD_RESULT_SUCCESS;
|
|
366 |
iOpenChannelRsp.iInfoType=DSATTSY_PCMD_RSP_NO_INFO;
|
|
367 |
iOpenChannelRsp.iAdditionalInfo=DSATTSY_NULL_BUF;
|
|
368 |
iOpenChannelRsp.iBearer.iType=DSATTSY_CSD_BEARER_TYPE;
|
|
369 |
iOpenChannelRsp.iBearer.iParams=DSATTSY_BEARER_PARAMS;
|
|
370 |
iOpenChannelRsp.iBufferSize=DSATTSY_BUFFER_SIZE;
|
|
371 |
|
|
372 |
sat.TerminalRsp(reqStatus,RSat::EOpenChannelLocal,openChannelRspPckg);
|
|
373 |
User::WaitForRequest(reqStatus);
|
|
374 |
TEST(reqStatus.Int()==KErrNone);
|
|
375 |
INFO_PRINTF2(_L("Test %d - RSat::TerminalRsp - Open Channel - passed"),iTestCount++);
|
|
376 |
|
|
377 |
// continue the tests
|
|
378 |
ExtendedTest2L(reqStatus);
|
|
379 |
|
|
380 |
CleanupStack::PopAndDestroy(openLocalChannelPckg);
|
|
381 |
CleanupStack::PopAndDestroy(openLocalChannel);
|
|
382 |
|
|
383 |
}
|
|
384 |
|
|
385 |
void CTestSatPCmds1d::ExtendedTest2L(TRequestStatus& reqStatus)
|
|
386 |
{
|
|
387 |
// Now test Open Channel with version 5 of classes
|
|
388 |
|
|
389 |
// Open Channel Cs with V5
|
|
390 |
RSat::TOpenCsChannelV5Pckg openCsChannelV5Pckg(iOpenCsChannelV5);
|
|
391 |
|
|
392 |
iOpenCsChannelV5.iPCmdType = DSATTSY_CS_BEARER;
|
|
393 |
|
|
394 |
sat.NotifyOpenChannelPCmd(reqStatus, openCsChannelV5Pckg);
|
|
395 |
User::WaitForRequest(reqStatus);
|
|
396 |
TEST(reqStatus.Int()==KErrNone);
|
|
397 |
|
|
398 |
TEST(iOpenCsChannelV5.PCmdNumber()==DSATTSY_OPEN_CHANNEL_NUMBER);
|
|
399 |
TEST(iOpenCsChannelV5.iPCmdType==DSATTSY_CS_BEARER);
|
|
400 |
TEST(iOpenCsChannelV5.iLinkEst==DSATTSY_ON_DEMAND_ESTABLISHMENT);
|
|
401 |
TEST(iOpenCsChannelV5.iReconnectionMode==DSATTSY_AUTO_RECONNECTION);
|
|
402 |
TEST(iOpenCsChannelV5.iAlphaId.iStatus==DSATTSY_ALPHA_ID1_STATUS);
|
|
403 |
TEST(iOpenCsChannelV5.iAlphaId.iAlphaId==DSATTSY_ALPHA_ID1);
|
|
404 |
TEST(iOpenCsChannelV5.iIconId.iIdentifier==DSATTSY_ICON_ID1);
|
|
405 |
TEST(iOpenCsChannelV5.iIconId.iQualifier==DSATTSY_ICON_QUALIFIER1);
|
|
406 |
TEST(iOpenCsChannelV5.iBearer.iType==DSATTSY_CSD_BEARER_TYPE);
|
|
407 |
TEST(iOpenCsChannelV5.iBearer.iParams==DSATTSY_BEARER_PARAMS);
|
|
408 |
TEST(iOpenCsChannelV5.iBufferSize==DSATTSY_BUFFER_SIZE);
|
|
409 |
TEST(iOpenCsChannelV5.iSimMeInterface.iPrtNumber==DSATTSY_PORT_1);
|
|
410 |
TEST(iOpenCsChannelV5.iSimMeInterface.iTransportProto==DSATTSY_TCP_PROTO);
|
|
411 |
TEST(iOpenCsChannelV5.iDestinationAddress.iType==DSATTSY_IPV4_TYPE);
|
|
412 |
TEST(iOpenCsChannelV5.iDestinationAddress.iAddress==DSATTSY_ADDRESS);
|
|
413 |
TEST(iOpenCsChannelV5.iAddress.iTypeOfNumber==DSATTSY_TON);
|
|
414 |
TEST(iOpenCsChannelV5.iAddress.iNumberPlan==DSATTSY_NPI);
|
|
415 |
TEST(iOpenCsChannelV5.iAddress.iTelNumber==DSATTSY_TEL_NUMBER);
|
|
416 |
TEST(iOpenCsChannelV5.iSubAddress==DSATTSY_SUBADDRESS);
|
|
417 |
TEST(iOpenCsChannelV5.iDuration1.iTimeUnit==DSATTSY_TIME_UNIT);
|
|
418 |
TEST(iOpenCsChannelV5.iDuration1.iNumOfUnits==DSATTSY_NUM_OF_UNITS);
|
|
419 |
TEST(iOpenCsChannelV5.iDuration2.iTimeUnit==DSATTSY_TIME_UNIT);
|
|
420 |
TEST(iOpenCsChannelV5.iDuration2.iNumOfUnits==DSATTSY_TIME_UNIT);
|
|
421 |
TEST(iOpenCsChannelV5.iLocalAddress.iType==DSATTSY_IPV4_TYPE);
|
|
422 |
TEST(iOpenCsChannelV5.iLocalAddress.iAddress==DSATTSY_ADDRESS);
|
|
423 |
TEST(iOpenCsChannelV5.iUserLogin==DSATTSY_LOGIN);
|
|
424 |
TEST(iOpenCsChannelV5.iUserPassword==DSATTSY_PASSWORD);
|
|
425 |
|
|
426 |
RSat::TTextAttribute textAttribute;
|
|
427 |
textAttribute.iStatus = DSATTSY_TEXT_ATTRIBUTE_STATUS;
|
|
428 |
const TUint8 textAttributeData[DSATTSY_TEXT_ATTRIBUTE_DATA_LENGTH] = DSATTSY_TEXT_ATTRIBUTE_DATA;
|
|
429 |
textAttribute.iTextAttributeData.Append(textAttributeData, DSATTSY_TEXT_ATTRIBUTE_DATA_LENGTH);
|
|
430 |
|
|
431 |
TEST(iOpenCsChannelV5.iTextAttribute.iStatus == textAttribute.iStatus);
|
|
432 |
TEST(iOpenCsChannelV5.iTextAttribute.iTextAttributeData == textAttribute.iTextAttributeData);
|
|
433 |
|
|
434 |
INFO_PRINTF2(_L("Test %d - RSat::NotifyOpenChannelPCmd - CS channel (RSat::TOpenCsChannelV5) - passed"),iTestCount++);
|
|
435 |
|
|
436 |
// Open Channel Cancel
|
|
437 |
sat.NotifyOpenChannelPCmd(reqStatus,openCsChannelV5Pckg);
|
|
438 |
sat.CancelAsyncRequest(ESatNotifyOpenChannelPCmd);
|
|
439 |
|
|
440 |
User::WaitForRequest(reqStatus);
|
|
441 |
TEST(reqStatus.Int()==KErrCancel);
|
|
442 |
INFO_PRINTF2(_L("Test %d - RSat::NotifyOpenChannelPCmd Cancel (RSat::TOpenCsChannelV5) passed"),iTestCount++);
|
|
443 |
|
|
444 |
// Open Channel Gprs with V5
|
|
445 |
RSat::TOpenGprsChannelV5Pckg openGprsChannelV5Pckg(iOpenGprsChannelV5);
|
|
446 |
|
|
447 |
iOpenGprsChannelV5.iPCmdType=DSATTSY_GPRS_BEARER;
|
|
448 |
|
|
449 |
sat.NotifyOpenChannelPCmd(reqStatus,openGprsChannelV5Pckg);
|
|
450 |
User::WaitForRequest(reqStatus);
|
|
451 |
TEST(reqStatus.Int()==KErrNone);
|
|
452 |
|
|
453 |
TEST(iOpenGprsChannelV5.PCmdNumber()==DSATTSY_OPEN_CHANNEL_NUMBER);
|
|
454 |
TEST(iOpenGprsChannelV5.iPCmdType==DSATTSY_GPRS_BEARER);
|
|
455 |
TEST(iOpenGprsChannelV5.iLinkEst==DSATTSY_ON_DEMAND_ESTABLISHMENT);
|
|
456 |
TEST(iOpenGprsChannelV5.iReconnectionMode==DSATTSY_AUTO_RECONNECTION);
|
|
457 |
TEST(iOpenGprsChannelV5.iAlphaId.iStatus==DSATTSY_ALPHA_ID1_STATUS);
|
|
458 |
TEST(iOpenGprsChannelV5.iAlphaId.iAlphaId==DSATTSY_ALPHA_ID1);
|
|
459 |
TEST(iOpenGprsChannelV5.iIconId.iIdentifier==DSATTSY_ICON_ID1);
|
|
460 |
TEST(iOpenGprsChannelV5.iIconId.iQualifier==DSATTSY_ICON_QUALIFIER1);
|
|
461 |
TEST(iOpenGprsChannelV5.iBearer.iType==DSATTSY_CSD_BEARER_TYPE);
|
|
462 |
TEST(iOpenGprsChannelV5.iBearer.iParams==DSATTSY_BEARER_PARAMS);
|
|
463 |
TEST(iOpenGprsChannelV5.iBufferSize==DSATTSY_BUFFER_SIZE);
|
|
464 |
TEST(iOpenGprsChannelV5.iSimMeInterface.iPrtNumber==DSATTSY_PORT_1);
|
|
465 |
TEST(iOpenGprsChannelV5.iSimMeInterface.iTransportProto==DSATTSY_TCP_PROTO);
|
|
466 |
TEST(iOpenGprsChannelV5.iDestinationAddress.iType==DSATTSY_IPV4_TYPE);
|
|
467 |
TEST(iOpenGprsChannelV5.iDestinationAddress.iAddress==DSATTSY_ADDRESS);
|
|
468 |
TEST(iOpenGprsChannelV5.iAccessName==DSATTSY_ACCESS_NAME);
|
|
469 |
TEST(iOpenGprsChannelV5.iLocalAddress.iType==DSATTSY_IPV4_TYPE);
|
|
470 |
TEST(iOpenGprsChannelV5.iLocalAddress.iAddress==DSATTSY_ADDRESS);
|
|
471 |
TEST(iOpenGprsChannelV5.iUserLogin==DSATTSY_LOGIN);
|
|
472 |
TEST(iOpenGprsChannelV5.iUserPassword==DSATTSY_PASSWORD);
|
|
473 |
|
|
474 |
TEST(iOpenGprsChannelV5.iTextAttribute.iStatus == textAttribute.iStatus);
|
|
475 |
TEST(iOpenGprsChannelV5.iTextAttribute.iTextAttributeData == textAttribute.iTextAttributeData);
|
|
476 |
|
|
477 |
INFO_PRINTF2(_L("Test %d - RSat::NotifyOpenChannelPCmd - GPRS Channel (RSat::TOpenGprsChannelV5) - passed"),iTestCount++);
|
|
478 |
|
|
479 |
// Open Channel Cancel with V5
|
|
480 |
sat.NotifyOpenChannelPCmd(reqStatus,openGprsChannelV5Pckg);
|
|
481 |
sat.CancelAsyncRequest(ESatNotifyOpenChannelPCmd);
|
|
482 |
|
|
483 |
User::WaitForRequest(reqStatus);
|
|
484 |
TEST(reqStatus.Int()==KErrCancel);
|
|
485 |
INFO_PRINTF2(_L("Test %d - RSat::NotifyOpenChannelPCmd Cancel (RSat::TOpenGprsChannelV5) passed"),iTestCount++);
|
|
486 |
|
|
487 |
// continue the tests
|
|
488 |
ExtendedTest3L(reqStatus);
|
|
489 |
}
|
|
490 |
|
|
491 |
void CTestSatPCmds1d::ExtendedTest3L(TRequestStatus& reqStatus)
|
|
492 |
{
|
|
493 |
// Open Channel Local with version 5
|
|
494 |
RSat::TOpenLocalLinksChannelV5* openLocalChannelV5 = new(ELeave) RSat::TOpenLocalLinksChannelV5;
|
|
495 |
CleanupStack::PushL(openLocalChannelV5);
|
|
496 |
|
|
497 |
RSat::TOpenLocalLinksChannelV5Pckg* openLocalChannelV5Pckg = new(ELeave) RSat::TOpenLocalLinksChannelV5Pckg(*openLocalChannelV5);
|
|
498 |
CleanupStack::PushL(openLocalChannelV5Pckg);
|
|
499 |
|
|
500 |
TEST(openLocalChannelV5->ExtensionId() == RSat::KSatV5);
|
|
501 |
TEST(openLocalChannelV5->iTextAttribute.iStatus == RSat::ETextAttributeNotSet);
|
|
502 |
|
|
503 |
openLocalChannelV5->iPCmdType=DSATTSY_LOCAL_BEARER;
|
|
504 |
|
|
505 |
sat.NotifyOpenChannelPCmd(reqStatus,*openLocalChannelV5Pckg);
|
|
506 |
User::WaitForRequest(reqStatus);
|
|
507 |
TEST(reqStatus.Int()==KErrNone);
|
|
508 |
|
|
509 |
TEST(openLocalChannelV5->PCmdNumber()==DSATTSY_OPEN_CHANNEL_NUMBER);
|
|
510 |
TEST(openLocalChannelV5->iPCmdType==DSATTSY_LOCAL_BEARER);
|
|
511 |
TEST(openLocalChannelV5->iLinkEst==DSATTSY_ON_DEMAND_ESTABLISHMENT);
|
|
512 |
TEST(openLocalChannelV5->iReconnectionMode==DSATTSY_AUTO_RECONNECTION);
|
|
513 |
TEST(openLocalChannelV5->iAlphaId.iStatus==DSATTSY_ALPHA_ID1_STATUS);
|
|
514 |
TEST(openLocalChannelV5->iAlphaId.iAlphaId==DSATTSY_ALPHA_ID1);
|
|
515 |
TEST(openLocalChannelV5->iIconId.iIdentifier==DSATTSY_ICON_ID1);
|
|
516 |
TEST(openLocalChannelV5->iIconId.iQualifier==DSATTSY_ICON_QUALIFIER1);
|
|
517 |
TEST(openLocalChannelV5->iBearer.iType==DSATTSY_CSD_BEARER_TYPE);
|
|
518 |
TEST(openLocalChannelV5->iBearer.iParams==DSATTSY_BEARER_PARAMS);
|
|
519 |
TEST(openLocalChannelV5->iBufferSize==DSATTSY_BUFFER_SIZE);
|
|
520 |
TEST(openLocalChannelV5->iSimMeInterface.iPrtNumber==DSATTSY_PORT_1);
|
|
521 |
TEST(openLocalChannelV5->iSimMeInterface.iTransportProto==DSATTSY_TCP_PROTO);
|
|
522 |
TEST(openLocalChannelV5->iDestinationAddress.iType==DSATTSY_IPV4_TYPE);
|
|
523 |
TEST(openLocalChannelV5->iDestinationAddress.iAddress==DSATTSY_ADDRESS);
|
|
524 |
TEST(openLocalChannelV5->iDuration1.iTimeUnit==DSATTSY_TIME_UNIT);
|
|
525 |
TEST(openLocalChannelV5->iDuration1.iNumOfUnits==DSATTSY_TIME_UNIT);
|
|
526 |
TEST(openLocalChannelV5->iDuration2.iTimeUnit==DSATTSY_TIME_UNIT);
|
|
527 |
TEST(openLocalChannelV5->iDuration2.iNumOfUnits==DSATTSY_TIME_UNIT);
|
|
528 |
TEST(openLocalChannelV5->iRemoteAddress.iCoding==DSATTSY_CODING);
|
|
529 |
TEST(openLocalChannelV5->iRemoteAddress.iAddress==DSATTSY_ADDRESS);
|
|
530 |
TEST(openLocalChannelV5->iUserPassword==DSATTSY_PASSWORD);
|
|
531 |
|
|
532 |
RSat::TTextAttribute textAttribute;
|
|
533 |
textAttribute.iStatus = DSATTSY_TEXT_ATTRIBUTE_STATUS;
|
|
534 |
const TUint8 textAttributeData[DSATTSY_TEXT_ATTRIBUTE_DATA_LENGTH] = DSATTSY_TEXT_ATTRIBUTE_DATA;
|
|
535 |
textAttribute.iTextAttributeData.Append(textAttributeData, DSATTSY_TEXT_ATTRIBUTE_DATA_LENGTH);
|
|
536 |
|
|
537 |
TEST(openLocalChannelV5->iTextAttribute.iStatus == textAttribute.iStatus);
|
|
538 |
TEST(openLocalChannelV5->iTextAttribute.iTextAttributeData == textAttribute.iTextAttributeData);
|
|
539 |
|
|
540 |
INFO_PRINTF2(_L("Test %d - RSat::NotifyOpenChannelPCmd - Local Channel (RSat::TOpenLocalLinksChannelV5) - passed"),iTestCount++);
|
|
541 |
|
|
542 |
// Open Channel Cancel with version 5
|
|
543 |
sat.NotifyOpenChannelPCmd(reqStatus,*openLocalChannelV5Pckg);
|
|
544 |
sat.CancelAsyncRequest(ESatNotifyOpenChannelPCmd);
|
|
545 |
|
|
546 |
User::WaitForRequest(reqStatus);
|
|
547 |
TEST(reqStatus.Int()==KErrCancel);
|
|
548 |
INFO_PRINTF2(_L("Test %d - RSat::NotifyOpenChannelPCmd Cancel (RSat::TOpenLocalLinksChannelV5) passed"),iTestCount++);
|
|
549 |
|
|
550 |
CleanupStack::PopAndDestroy(openLocalChannelV5Pckg);
|
|
551 |
CleanupStack::PopAndDestroy(openLocalChannelV5);
|
|
552 |
|
|
553 |
|
|
554 |
|
|
555 |
// Continue the tests
|
|
556 |
ExtendedTest4L(reqStatus);
|
|
557 |
}
|
|
558 |
|
|
559 |
// Further tests, seperated to prevent stack overflow
|
|
560 |
void CTestSatPCmds1d::ExtendedTest4L(TRequestStatus& reqStatus)
|
|
561 |
{
|
|
562 |
// Close Channel with V2
|
|
563 |
RSat::TCloseChannelV2Pckg closeChannelPckg(iCloseChannel);
|
|
564 |
|
|
565 |
sat.NotifyCloseChannelPCmd(reqStatus,closeChannelPckg);
|
|
566 |
User::WaitForRequest(reqStatus);
|
|
567 |
TEST(reqStatus.Int()==KErrNone);
|
|
568 |
|
|
569 |
TEST(iCloseChannel.PCmdNumber()==DSATTSY_CLOSE_CHANNEL_NUMBER);
|
|
570 |
TEST(iCloseChannel.iDestination==DSATTSY_CARD_READER_1);
|
|
571 |
TEST(iCloseChannel.iAlphaId.iStatus==DSATTSY_ALPHA_ID1_STATUS);
|
|
572 |
TEST(iCloseChannel.iAlphaId.iAlphaId==DSATTSY_ALPHA_ID1);
|
|
573 |
TEST(iCloseChannel.iIconId.iIdentifier==DSATTSY_ICON_ID1);
|
|
574 |
TEST(iCloseChannel.iIconId.iQualifier==DSATTSY_ICON_QUALIFIER1);
|
|
575 |
|
|
576 |
INFO_PRINTF2(_L("Test %d - RSat::NotifyCloseChannelPCmd with RSat::TCloseChannelV2 passed"),iTestCount++);
|
|
577 |
|
|
578 |
// Close Channel Cancel with V2
|
|
579 |
sat.NotifyCloseChannelPCmd(reqStatus,closeChannelPckg);
|
|
580 |
sat.CancelAsyncRequest(ESatNotifyCloseChannelPCmd);
|
|
581 |
|
|
582 |
User::WaitForRequest(reqStatus);
|
|
583 |
TEST(reqStatus.Int()==KErrCancel);
|
|
584 |
INFO_PRINTF2(_L("Test %d - RSat::NotifyCloseChannelPCmd Cancel with RSat::TCloseChannelV2 passed"),iTestCount++);
|
|
585 |
|
|
586 |
// Close Channel with V5
|
|
587 |
RSat::TCloseChannelV5Pckg closeChannelV5Pckg(iCloseChannelV5);
|
|
588 |
|
|
589 |
TEST(iCloseChannelV5.ExtensionId() == RSat::KSatV5);
|
|
590 |
TEST(iCloseChannelV5.iTextAttribute.iStatus == RSat::ETextAttributeNotSet);
|
|
591 |
|
|
592 |
sat.NotifyCloseChannelPCmd(reqStatus,closeChannelV5Pckg);
|
|
593 |
User::WaitForRequest(reqStatus);
|
|
594 |
TEST(reqStatus.Int()==KErrNone);
|
|
595 |
|
|
596 |
TEST(iCloseChannelV5.PCmdNumber()==DSATTSY_CLOSE_CHANNEL_NUMBER);
|
|
597 |
TEST(iCloseChannelV5.iDestination==DSATTSY_CARD_READER_1);
|
|
598 |
TEST(iCloseChannelV5.iAlphaId.iStatus==DSATTSY_ALPHA_ID1_STATUS);
|
|
599 |
TEST(iCloseChannelV5.iAlphaId.iAlphaId==DSATTSY_ALPHA_ID1);
|
|
600 |
TEST(iCloseChannelV5.iIconId.iIdentifier==DSATTSY_ICON_ID1);
|
|
601 |
TEST(iCloseChannelV5.iIconId.iQualifier==DSATTSY_ICON_QUALIFIER1);
|
|
602 |
// V5 parameters
|
|
603 |
RSat::TTextAttribute textAttribute;
|
|
604 |
textAttribute.iStatus = DSATTSY_TEXT_ATTRIBUTE_STATUS;
|
|
605 |
const TUint8 textAttributeData[DSATTSY_TEXT_ATTRIBUTE_DATA_LENGTH] = DSATTSY_TEXT_ATTRIBUTE_DATA;
|
|
606 |
textAttribute.iTextAttributeData.Append(textAttributeData, DSATTSY_TEXT_ATTRIBUTE_DATA_LENGTH);
|
|
607 |
|
|
608 |
TEST(iCloseChannelV5.iTextAttribute.iStatus == textAttribute.iStatus);
|
|
609 |
TEST(iCloseChannelV5.iTextAttribute.iTextAttributeData == textAttribute.iTextAttributeData);
|
|
610 |
|
|
611 |
INFO_PRINTF2(_L("Test %d - RSat::NotifyCloseChannelPCmd with RSat::TCloseChannelV5 passed"),iTestCount++);
|
|
612 |
|
|
613 |
// Close Channel Cancel with V5
|
|
614 |
sat.NotifyCloseChannelPCmd(reqStatus,closeChannelV5Pckg);
|
|
615 |
sat.CancelAsyncRequest(ESatNotifyCloseChannelPCmd);
|
|
616 |
|
|
617 |
User::WaitForRequest(reqStatus);
|
|
618 |
TEST(reqStatus.Int()==KErrCancel);
|
|
619 |
INFO_PRINTF2(_L("Test %d - RSat::NotifyCloseChannelPCmd Cancel with RSat::TCloseChannelV5 passed"),iTestCount++);
|
|
620 |
|
|
621 |
// Close Channel Terminal Rsp
|
|
622 |
sat.NotifyCloseChannelPCmd(reqStatus,closeChannelPckg);
|
|
623 |
User::WaitForRequest(reqStatus);
|
|
624 |
TEST(reqStatus.Int()==KErrNone);
|
|
625 |
|
|
626 |
RSat::TCloseChannelRspV2* closeChannelRsp = new(ELeave) RSat::TCloseChannelRspV2;
|
|
627 |
CleanupStack::PushL(closeChannelRsp);
|
|
628 |
|
|
629 |
RSat::TCloseChannelRspV2Pckg* closeChannelRspPckg = new(ELeave) RSat::TCloseChannelRspV2Pckg(*closeChannelRsp);
|
|
630 |
CleanupStack::PushL(closeChannelRspPckg);
|
|
631 |
|
|
632 |
closeChannelRsp->SetPCmdNumber(iCloseChannel.PCmdNumber());
|
|
633 |
closeChannelRsp->iGeneralResult=DSATTSY_PCMD_RESULT_SUCCESS;
|
|
634 |
closeChannelRsp->iInfoType=DSATTSY_PCMD_RSP_NO_INFO;
|
|
635 |
closeChannelRsp->iAdditionalInfo=DSATTSY_NULL_BUF;
|
|
636 |
|
|
637 |
sat.TerminalRsp(reqStatus,RSat::ECloseChannel,*closeChannelRspPckg);
|
|
638 |
User::WaitForRequest(reqStatus);
|
|
639 |
TEST(reqStatus.Int()==KErrNone);
|
|
640 |
INFO_PRINTF2(_L("Test %d - RSat::TerminalRsp - Close Channel - passed"),iTestCount++);
|
|
641 |
|
|
642 |
CleanupStack::PopAndDestroy(closeChannelRspPckg);
|
|
643 |
CleanupStack::PopAndDestroy(closeChannelRsp);
|
|
644 |
|
|
645 |
// Continue the tests
|
|
646 |
ExtendedTest5L(reqStatus);
|
|
647 |
}
|
|
648 |
|
|
649 |
void CTestSatPCmds1d::ExtendedTest5L(TRequestStatus& reqStatus)
|
|
650 |
{
|
|
651 |
// Receive Data with V2
|
|
652 |
RSat::TReceiveDataV2Pckg receiveDataPckg(iReceiveData);
|
|
653 |
|
|
654 |
sat.NotifyReceiveDataPCmd(reqStatus,receiveDataPckg);
|
|
655 |
User::WaitForRequest(reqStatus);
|
|
656 |
TEST(reqStatus.Int()==KErrNone);
|
|
657 |
|
|
658 |
TEST(iReceiveData.PCmdNumber()==DSATTSY_RECEIVE_DATA_NUMBER);
|
|
659 |
TEST(iReceiveData.iDestination==DSATTSY_CARD_READER_1);
|
|
660 |
TEST(iReceiveData.iAlphaId.iStatus==DSATTSY_ALPHA_ID1_STATUS);
|
|
661 |
TEST(iReceiveData.iAlphaId.iAlphaId==DSATTSY_ALPHA_ID1);
|
|
662 |
TEST(iReceiveData.iIconId.iIdentifier==DSATTSY_ICON_ID1);
|
|
663 |
TEST(iReceiveData.iIconId.iQualifier==DSATTSY_ICON_QUALIFIER1);
|
|
664 |
TEST(iReceiveData.iChannelDataLength==DSATTSY_DATA_LENGTH);
|
|
665 |
|
|
666 |
INFO_PRINTF2(_L("Test %d - RSat::NotifyReceiveDataPCmd with RSat::TReceiveDataV2 passed"),iTestCount++);
|
|
667 |
|
|
668 |
// Receive Data Cancel with V2
|
|
669 |
sat.NotifyReceiveDataPCmd(reqStatus,receiveDataPckg);
|
|
670 |
sat.CancelAsyncRequest(ESatNotifyReceiveDataPCmd);
|
|
671 |
|
|
672 |
User::WaitForRequest(reqStatus);
|
|
673 |
TEST(reqStatus.Int()==KErrCancel);
|
|
674 |
INFO_PRINTF2(_L("Test %d - RSat::NotifyReceiveDataPCmdCancel with RSat::TReceiveDataV2 passed"),iTestCount++);
|
|
675 |
|
|
676 |
// Receive Data with V5
|
|
677 |
RSat::TReceiveDataV5Pckg receiveDataV5Pckg(iReceiveDataV5);
|
|
678 |
|
|
679 |
TEST(iReceiveDataV5.ExtensionId() == RSat::KSatV5);
|
|
680 |
TEST(iReceiveDataV5.iTextAttribute.iStatus == RSat::ETextAttributeNotSet);
|
|
681 |
|
|
682 |
sat.NotifyReceiveDataPCmd(reqStatus,receiveDataV5Pckg);
|
|
683 |
User::WaitForRequest(reqStatus);
|
|
684 |
TEST(reqStatus.Int()==KErrNone);
|
|
685 |
|
|
686 |
TEST(iReceiveDataV5.PCmdNumber()==DSATTSY_RECEIVE_DATA_NUMBER);
|
|
687 |
TEST(iReceiveDataV5.iDestination==DSATTSY_CARD_READER_1);
|
|
688 |
TEST(iReceiveDataV5.iAlphaId.iStatus==DSATTSY_ALPHA_ID1_STATUS);
|
|
689 |
TEST(iReceiveDataV5.iAlphaId.iAlphaId==DSATTSY_ALPHA_ID1);
|
|
690 |
TEST(iReceiveDataV5.iIconId.iIdentifier==DSATTSY_ICON_ID1);
|
|
691 |
TEST(iReceiveDataV5.iIconId.iQualifier==DSATTSY_ICON_QUALIFIER1);
|
|
692 |
TEST(iReceiveDataV5.iChannelDataLength==DSATTSY_DATA_LENGTH);
|
|
693 |
|
|
694 |
INFO_PRINTF2(_L("Test %d - RSat::NotifyReceiveDataPCmd with RSat::TReceiveDataV5 passed"),iTestCount++);
|
|
695 |
|
|
696 |
// Receive Data Cancel with V5
|
|
697 |
sat.NotifyReceiveDataPCmd(reqStatus,receiveDataV5Pckg);
|
|
698 |
sat.CancelAsyncRequest(ESatNotifyReceiveDataPCmd);
|
|
699 |
|
|
700 |
User::WaitForRequest(reqStatus);
|
|
701 |
TEST(reqStatus.Int()==KErrCancel);
|
|
702 |
INFO_PRINTF2(_L("Test %d - RSat::NotifyReceiveDataPCmdCancel with RSat::TReceiveDataV5 passed"),iTestCount++);
|
|
703 |
|
|
704 |
// Receive Data Terminal Rsp
|
|
705 |
sat.NotifyReceiveDataPCmd(reqStatus,receiveDataPckg);
|
|
706 |
User::WaitForRequest(reqStatus);
|
|
707 |
TEST(reqStatus.Int()==KErrNone);
|
|
708 |
|
|
709 |
RSat::TReceiveDataRspV2Pckg receiveDataRspPckg(iReceiveDataRsp);
|
|
710 |
|
|
711 |
iReceiveDataRsp.SetPCmdNumber(iReceiveData.PCmdNumber());
|
|
712 |
iReceiveDataRsp.iGeneralResult=DSATTSY_PCMD_RESULT_SUCCESS;
|
|
713 |
iReceiveDataRsp.iInfoType=DSATTSY_PCMD_RSP_NO_INFO;
|
|
714 |
iReceiveDataRsp.iAdditionalInfo=DSATTSY_NULL_BUF;
|
|
715 |
iReceiveDataRsp.iChannelDataLength=DSATTSY_DATA_LENGTH;
|
|
716 |
|
|
717 |
sat.TerminalRsp(reqStatus,RSat::EReceiveData,receiveDataRspPckg);
|
|
718 |
User::WaitForRequest(reqStatus);
|
|
719 |
TEST(reqStatus.Int()==KErrNone);
|
|
720 |
INFO_PRINTF2(_L("Test %d - RSat::TerminalRsp - Receive Data - passed"),iTestCount++);
|
|
721 |
|
|
722 |
// continue the tests
|
|
723 |
ExtendedTest6L(reqStatus);
|
|
724 |
}
|
|
725 |
|
|
726 |
// Further tests, seperated to prevent stack overflow
|
|
727 |
void CTestSatPCmds1d::ExtendedTest6L(TRequestStatus& reqStatus)
|
|
728 |
{
|
|
729 |
// Send Data with V2
|
|
730 |
RSat::TSendDataV2Pckg sendDataPckg(iSendData);
|
|
731 |
|
|
732 |
sat.NotifySendDataPCmd(reqStatus,sendDataPckg);
|
|
733 |
User::WaitForRequest(reqStatus);
|
|
734 |
TEST(reqStatus.Int()==KErrNone);
|
|
735 |
|
|
736 |
TEST(iSendData.PCmdNumber()==DSATTSY_SEND_DATA_NUMBER);
|
|
737 |
TEST(iSendData.iDestination==DSATTSY_CARD_READER_1);
|
|
738 |
TEST(iSendData.iMode==DSATTSY_SEND_DATA_MODE);
|
|
739 |
TEST(iSendData.iAlphaId.iStatus==DSATTSY_ALPHA_ID1_STATUS);
|
|
740 |
TEST(iSendData.iAlphaId.iAlphaId==DSATTSY_ALPHA_ID1);
|
|
741 |
TEST(iSendData.iIconId.iIdentifier==DSATTSY_ICON_ID1);
|
|
742 |
TEST(iSendData.iIconId.iQualifier==DSATTSY_ICON_QUALIFIER1);
|
|
743 |
TEST(iSendData.iChannelData==DSATTSY_CHANNEL_DATA);
|
|
744 |
|
|
745 |
INFO_PRINTF2(_L("Test %d - RSat::NotifySendDataPCmd with RSat::TSendDataV2 passed"),iTestCount++);
|
|
746 |
|
|
747 |
// Send Data Cancel with V2
|
|
748 |
sat.NotifySendDataPCmd(reqStatus,sendDataPckg);
|
|
749 |
sat.CancelAsyncRequest(ESatNotifySendDataPCmd);
|
|
750 |
|
|
751 |
User::WaitForRequest(reqStatus);
|
|
752 |
TEST(reqStatus.Int()==KErrCancel);
|
|
753 |
INFO_PRINTF2(_L("Test %d - RSat::NotifySendDataCancel with RSat::TSendDataV2 passed"),iTestCount++);
|
|
754 |
|
|
755 |
// Send Data with V5
|
|
756 |
RSat::TSendDataV5Pckg sendDataV5Pckg(iSendDataV5);
|
|
757 |
|
|
758 |
TEST(iSendDataV5.ExtensionId() == RSat::KSatV5);
|
|
759 |
TEST(iSendDataV5.iTextAttribute.iStatus == RSat::ETextAttributeNotSet);
|
|
760 |
|
|
761 |
sat.NotifySendDataPCmd(reqStatus,sendDataV5Pckg);
|
|
762 |
User::WaitForRequest(reqStatus);
|
|
763 |
TEST(reqStatus.Int()==KErrNone);
|
|
764 |
|
|
765 |
TEST(iSendDataV5.PCmdNumber()==DSATTSY_SEND_DATA_NUMBER);
|
|
766 |
TEST(iSendDataV5.iDestination==DSATTSY_CARD_READER_1);
|
|
767 |
TEST(iSendDataV5.iMode==DSATTSY_SEND_DATA_MODE);
|
|
768 |
TEST(iSendDataV5.iAlphaId.iStatus==DSATTSY_ALPHA_ID1_STATUS);
|
|
769 |
TEST(iSendDataV5.iAlphaId.iAlphaId==DSATTSY_ALPHA_ID1);
|
|
770 |
TEST(iSendDataV5.iIconId.iIdentifier==DSATTSY_ICON_ID1);
|
|
771 |
TEST(iSendDataV5.iIconId.iQualifier==DSATTSY_ICON_QUALIFIER1);
|
|
772 |
TEST(iSendDataV5.iChannelData==DSATTSY_CHANNEL_DATA);
|
|
773 |
|
|
774 |
INFO_PRINTF2(_L("Test %d - RSat::NotifySendDataPCmd with RSat::TSendDataV5 passed"),iTestCount++);
|
|
775 |
|
|
776 |
// Send Data Cancel with V5
|
|
777 |
sat.NotifySendDataPCmd(reqStatus,sendDataV5Pckg);
|
|
778 |
sat.CancelAsyncRequest(ESatNotifySendDataPCmd);
|
|
779 |
|
|
780 |
User::WaitForRequest(reqStatus);
|
|
781 |
TEST(reqStatus.Int()==KErrCancel);
|
|
782 |
INFO_PRINTF2(_L("Test %d - RSat::NotifySendDataCancel with RSat::TSendDataV5passed"),iTestCount++);
|
|
783 |
|
|
784 |
// Send Data Terminal Rsp
|
|
785 |
sat.NotifySendDataPCmd(reqStatus,sendDataPckg);
|
|
786 |
User::WaitForRequest(reqStatus);
|
|
787 |
TEST(reqStatus.Int()==KErrNone);
|
|
788 |
|
|
789 |
RSat::TSendDataRspV2Pckg sendDataRspPckg(iSendDataRsp);
|
|
790 |
|
|
791 |
iSendDataRsp.SetPCmdNumber(iSendData.PCmdNumber());
|
|
792 |
iSendDataRsp.iGeneralResult=DSATTSY_PCMD_RESULT_SUCCESS;
|
|
793 |
iSendDataRsp.iInfoType=DSATTSY_PCMD_RSP_NO_INFO;
|
|
794 |
iSendDataRsp.iAdditionalInfo=DSATTSY_NULL_BUF;
|
|
795 |
iSendDataRsp.iChannelDataLength=DSATTSY_DATA_LENGTH;
|
|
796 |
|
|
797 |
sat.TerminalRsp(reqStatus,RSat::ESendData,sendDataRspPckg);
|
|
798 |
User::WaitForRequest(reqStatus);
|
|
799 |
TEST(reqStatus.Int()==KErrNone);
|
|
800 |
INFO_PRINTF2(_L("Test %d - RSat::TerminalRsp - Send Data - passed"),iTestCount++);
|
|
801 |
|
|
802 |
// Get Channel Status
|
|
803 |
RSat::TGetChannelStatusV2Pckg getChannelStatusPckg(iGetChannelStatus);
|
|
804 |
|
|
805 |
sat.NotifyGetChannelStatusPCmd(reqStatus,getChannelStatusPckg);
|
|
806 |
User::WaitForRequest(reqStatus);
|
|
807 |
TEST(reqStatus.Int()==KErrNone);
|
|
808 |
|
|
809 |
TEST(iGetChannelStatus.PCmdNumber()==DSATTSY_GET_CHANNEL_STATUS_NUMBER);
|
|
810 |
|
|
811 |
INFO_PRINTF2(_L("Test %d - RSat::NotifyGetChannelStatusPCmd passed"),iTestCount++);
|
|
812 |
|
|
813 |
// Get Channel Status Cancel
|
|
814 |
sat.NotifyGetChannelStatusPCmd(reqStatus,getChannelStatusPckg);
|
|
815 |
sat.CancelAsyncRequest(ESatNotifyGetChannelStatusPCmd);
|
|
816 |
|
|
817 |
User::WaitForRequest(reqStatus);
|
|
818 |
TEST(reqStatus.Int()==KErrCancel);
|
|
819 |
INFO_PRINTF2(_L("Test %d - RSat::NotifyGetChannelStatusPCmd Cancel passed"),iTestCount++);
|
|
820 |
|
|
821 |
// Get Channel Status Terminal Rsp
|
|
822 |
sat.NotifyGetChannelStatusPCmd(reqStatus,getChannelStatusPckg);
|
|
823 |
User::WaitForRequest(reqStatus);
|
|
824 |
TEST(reqStatus.Int()==KErrNone);
|
|
825 |
|
|
826 |
RSat::TGetChannelStatusRspV2Pckg getChannelStatusRspPckg(iGetChannelStatusRsp);
|
|
827 |
|
|
828 |
iGetChannelStatusRsp.SetPCmdNumber(iGetChannelStatus.PCmdNumber());
|
|
829 |
iGetChannelStatusRsp.iGeneralResult=DSATTSY_PCMD_RESULT_SUCCESS;
|
|
830 |
iGetChannelStatusRsp.iInfoType=DSATTSY_PCMD_RSP_NO_INFO;
|
|
831 |
iGetChannelStatusRsp.iAdditionalInfo=DSATTSY_NULL_BUF;
|
|
832 |
|
|
833 |
sat.TerminalRsp(reqStatus,RSat::EGetChannelStatus,getChannelStatusRspPckg);
|
|
834 |
User::WaitForRequest(reqStatus);
|
|
835 |
TEST(reqStatus.Int()==KErrNone);
|
|
836 |
INFO_PRINTF2(_L("Test %d - RSat::TerminalRsp - GetChannelStatus - passed"),iTestCount++);
|
|
837 |
|
|
838 |
// Declare Service
|
|
839 |
RSat::TDeclareServiceV2Pckg declareServicePckg(iDeclareService);
|
|
840 |
|
|
841 |
sat.NotifyDeclareServicePCmd(reqStatus,declareServicePckg);
|
|
842 |
User::WaitForRequest(reqStatus);
|
|
843 |
TEST(reqStatus.Int()==KErrNone);
|
|
844 |
|
|
845 |
TEST(iDeclareService.PCmdNumber()==DSATTSY_DECLARE_SERVICE_NUMBER);
|
|
846 |
TEST(iDeclareService.iType==DSATTSY_DECLARE_SERVICE_TYPE);
|
|
847 |
TEST(iDeclareService.iServiceRecord.iBearerId==DSATTSY_BEARER_NOT_PRESENT);
|
|
848 |
TEST(iDeclareService.iServiceRecord.iServiceId==DSATTSY_NULL_BEARER_ID);
|
|
849 |
TEST(iDeclareService.iServiceRecord.iRecord==DSATTSY_NULL_NARROW_BUF);
|
|
850 |
TEST(iDeclareService.iInterface.iPrtNumber==DSATTSY_PORT_1);
|
|
851 |
TEST(iDeclareService.iInterface.iTransportProto==DSATTSY_TCP_PROTO);
|
|
852 |
|
|
853 |
INFO_PRINTF2(_L("Test %d - RSat::NotifyDeclareServicePCmd passed"),iTestCount++);
|
|
854 |
|
|
855 |
// Declare Service Cancel
|
|
856 |
sat.NotifyDeclareServicePCmd(reqStatus,declareServicePckg);
|
|
857 |
sat.CancelAsyncRequest(ESatNotifyDeclareServicePCmd);
|
|
858 |
|
|
859 |
User::WaitForRequest(reqStatus);
|
|
860 |
TEST(reqStatus.Int()==KErrCancel);
|
|
861 |
INFO_PRINTF2(_L("Test %d - RSat::NotifyDeclareServicePCmd Cancel passed"),iTestCount++);
|
|
862 |
|
|
863 |
// Declare Service Terminal Rsp
|
|
864 |
sat.NotifyDeclareServicePCmd(reqStatus,declareServicePckg);
|
|
865 |
User::WaitForRequest(reqStatus);
|
|
866 |
TEST(reqStatus.Int()==KErrNone);
|
|
867 |
|
|
868 |
ExtendedTest7L(reqStatus);
|
|
869 |
}
|
|
870 |
|
|
871 |
// Further tests, seperated to prevent stack overflow
|
|
872 |
void CTestSatPCmds1d::ExtendedTest7L(TRequestStatus& reqStatus)
|
|
873 |
{
|
|
874 |
RSat::TDeclareServiceRspV2* declareServiceRsp = new(ELeave) RSat::TDeclareServiceRspV2;
|
|
875 |
CleanupStack::PushL(declareServiceRsp);
|
|
876 |
|
|
877 |
RSat::TDeclareServiceRspV2Pckg* declareServiceRspPckg = new(ELeave) RSat::TDeclareServiceRspV2Pckg(*declareServiceRsp);
|
|
878 |
CleanupStack::PushL(declareServiceRspPckg);
|
|
879 |
|
|
880 |
declareServiceRsp->SetPCmdNumber(iDeclareService.PCmdNumber());
|
|
881 |
declareServiceRsp->iGeneralResult=DSATTSY_PCMD_RESULT_SUCCESS;
|
|
882 |
declareServiceRsp->iInfoType=DSATTSY_PCMD_RSP_NO_INFO;
|
|
883 |
declareServiceRsp->iAdditionalInfo=DSATTSY_NULL_BUF;
|
|
884 |
|
|
885 |
sat.TerminalRsp(reqStatus,RSat::EDeclareService,*declareServiceRspPckg);
|
|
886 |
User::WaitForRequest(reqStatus);
|
|
887 |
TEST(reqStatus.Int()==KErrNone);
|
|
888 |
INFO_PRINTF2(_L("Test %d - RSat::TerminalRsp - Declare Service - passed"),iTestCount++);
|
|
889 |
|
|
890 |
CleanupStack::PopAndDestroy(declareServiceRspPckg);
|
|
891 |
CleanupStack::PopAndDestroy(declareServiceRsp);
|
|
892 |
|
|
893 |
// Service Search with V2
|
|
894 |
RSat::TServiceSearchV2Pckg serviceSearchPckg(iServiceSearch);
|
|
895 |
|
|
896 |
sat.NotifyServiceSearchPCmd(reqStatus,serviceSearchPckg);
|
|
897 |
User::WaitForRequest(reqStatus);
|
|
898 |
TEST(reqStatus.Int()==KErrNone);
|
|
899 |
|
|
900 |
TEST(iServiceSearch.PCmdNumber()==DSATTSY_SERVICE_SEARCH_NUMBER);
|
|
901 |
TEST(iServiceSearch.iAlphaId.iStatus==DSATTSY_ALPHA_ID1_STATUS);
|
|
902 |
TEST(iServiceSearch.iAlphaId.iAlphaId==DSATTSY_ALPHA_ID1);
|
|
903 |
TEST(iServiceSearch.iIconId.iIdentifier==DSATTSY_ICON_ID1);
|
|
904 |
TEST(iServiceSearch.iIconId.iQualifier==DSATTSY_ICON_QUALIFIER1);
|
|
905 |
TEST(iServiceSearch.iSearch.iBearerId==DSATTSY_BEARER_TECH_INDEPENDENT);
|
|
906 |
TEST(iServiceSearch.iSearch.iSearchParam==DSATTSY_SERVICE_SEARCH_PARAMS);
|
|
907 |
TEST(iServiceSearch.iFilter.iBearerId==DSATTSY_BEARER_TECH_INDEPENDENT);
|
|
908 |
TEST(iServiceSearch.iFilter.iDeviceFilter==DSATTSY_FILTER_INFO);
|
|
909 |
|
|
910 |
INFO_PRINTF2(_L("Test %d - RSat::NotifyServiceSearchPCmd with RSat::TServiceSearchV2 passed"),iTestCount++);
|
|
911 |
|
|
912 |
// Service Search Cancel with V2
|
|
913 |
sat.NotifyServiceSearchPCmd(reqStatus,serviceSearchPckg);
|
|
914 |
sat.CancelAsyncRequest(ESatNotifyServiceSearchPCmd);
|
|
915 |
|
|
916 |
User::WaitForRequest(reqStatus);
|
|
917 |
TEST(reqStatus.Int()==KErrCancel);
|
|
918 |
INFO_PRINTF2(_L("Test %d - RSat::NotifyServiceSearchPCmd Cancel with RSat::TServiceSearchV2 passed"),iTestCount++);
|
|
919 |
|
|
920 |
// Service Search with V5
|
|
921 |
RSat::TServiceSearchV5Pckg serviceSearchV5Pckg(iServiceSearchV5);
|
|
922 |
|
|
923 |
TEST(iServiceSearchV5.ExtensionId() == RSat::KSatV5);
|
|
924 |
TEST(iServiceSearchV5.iTextAttribute.iStatus == RSat::ETextAttributeNotSet);
|
|
925 |
|
|
926 |
sat.NotifyServiceSearchPCmd(reqStatus,serviceSearchV5Pckg);
|
|
927 |
User::WaitForRequest(reqStatus);
|
|
928 |
TEST(reqStatus.Int()==KErrNone);
|
|
929 |
|
|
930 |
TEST(iServiceSearchV5.PCmdNumber()==DSATTSY_SERVICE_SEARCH_NUMBER);
|
|
931 |
TEST(iServiceSearchV5.iAlphaId.iStatus==DSATTSY_ALPHA_ID1_STATUS);
|
|
932 |
TEST(iServiceSearchV5.iAlphaId.iAlphaId==DSATTSY_ALPHA_ID1);
|
|
933 |
TEST(iServiceSearchV5.iIconId.iIdentifier==DSATTSY_ICON_ID1);
|
|
934 |
TEST(iServiceSearchV5.iIconId.iQualifier==DSATTSY_ICON_QUALIFIER1);
|
|
935 |
TEST(iServiceSearchV5.iSearch.iBearerId==DSATTSY_BEARER_TECH_INDEPENDENT);
|
|
936 |
TEST(iServiceSearchV5.iSearch.iSearchParam==DSATTSY_SERVICE_SEARCH_PARAMS);
|
|
937 |
TEST(iServiceSearchV5.iFilter.iBearerId==DSATTSY_BEARER_TECH_INDEPENDENT);
|
|
938 |
TEST(iServiceSearchV5.iFilter.iDeviceFilter==DSATTSY_FILTER_INFO);
|
|
939 |
// V5 parameters
|
|
940 |
RSat::TTextAttribute textAttribute;
|
|
941 |
textAttribute.iStatus = DSATTSY_TEXT_ATTRIBUTE_STATUS;
|
|
942 |
const TUint8 textAttributeData[DSATTSY_TEXT_ATTRIBUTE_DATA_LENGTH] = DSATTSY_TEXT_ATTRIBUTE_DATA;
|
|
943 |
textAttribute.iTextAttributeData.Append(textAttributeData, DSATTSY_TEXT_ATTRIBUTE_DATA_LENGTH);
|
|
944 |
|
|
945 |
TEST(iServiceSearchV5.iTextAttribute.iStatus == textAttribute.iStatus);
|
|
946 |
TEST(iServiceSearchV5.iTextAttribute.iTextAttributeData == textAttribute.iTextAttributeData);
|
|
947 |
|
|
948 |
INFO_PRINTF2(_L("Test %d - RSat::NotifyServiceSearchPCmd with RSat::TServiceSearchV5 passed"),iTestCount++);
|
|
949 |
|
|
950 |
// Service Search Cancel with V5
|
|
951 |
sat.NotifyServiceSearchPCmd(reqStatus,serviceSearchV5Pckg);
|
|
952 |
sat.CancelAsyncRequest(ESatNotifyServiceSearchPCmd);
|
|
953 |
|
|
954 |
User::WaitForRequest(reqStatus);
|
|
955 |
TEST(reqStatus.Int()==KErrCancel);
|
|
956 |
INFO_PRINTF2(_L("Test %d - RSat::NotifyServiceSearchPCmd Cancel with RSat::TServiceSearchV5 passed"),iTestCount++);
|
|
957 |
|
|
958 |
// Service Search Terminal Rsp
|
|
959 |
sat.NotifyServiceSearchPCmd(reqStatus,serviceSearchPckg);
|
|
960 |
User::WaitForRequest(reqStatus);
|
|
961 |
TEST(reqStatus.Int()==KErrNone);
|
|
962 |
|
|
963 |
RSat::TServiceSearchRspV2Pckg serviceSearchRspPckg(iServiceSearchRsp);
|
|
964 |
|
|
965 |
iServiceSearchRsp.SetPCmdNumber(iServiceSearch.PCmdNumber());
|
|
966 |
iServiceSearchRsp.iGeneralResult=DSATTSY_PCMD_RESULT_SUCCESS;
|
|
967 |
iServiceSearchRsp.iInfoType=DSATTSY_PCMD_RSP_NO_INFO;
|
|
968 |
iServiceSearchRsp.iAdditionalInfo=DSATTSY_NULL_BUF;
|
|
969 |
|
|
970 |
sat.TerminalRsp(reqStatus,RSat::EServiceSearch,serviceSearchRspPckg);
|
|
971 |
User::WaitForRequest(reqStatus);
|
|
972 |
TEST(reqStatus.Int()==KErrNone);
|
|
973 |
INFO_PRINTF2(_L("Test %d - RSat::TerminalRsp - Service Search - passed"),iTestCount++);
|
|
974 |
|
|
975 |
ExtendedTest8L(reqStatus);
|
|
976 |
}
|
|
977 |
|
|
978 |
// Further tests, seperated to prevent stack overflow
|
|
979 |
void CTestSatPCmds1d::ExtendedTest8L(TRequestStatus& reqStatus)
|
|
980 |
{
|
|
981 |
// Get Service Information with V2
|
|
982 |
RSat::TGetServiceInfoV2Pckg getServiceInfoPckg(iGetServiceInfo);
|
|
983 |
|
|
984 |
sat.NotifyGetServiceInfoPCmd(reqStatus,getServiceInfoPckg);
|
|
985 |
User::WaitForRequest(reqStatus);
|
|
986 |
TEST(reqStatus.Int()==KErrNone);
|
|
987 |
|
|
988 |
TEST(iGetServiceInfo.PCmdNumber()==DSATTSY_GET_SERVICE_INFO_NUMBER);
|
|
989 |
TEST(iGetServiceInfo.iAlphaId.iStatus==DSATTSY_ALPHA_ID1_STATUS);
|
|
990 |
TEST(iGetServiceInfo.iAlphaId.iAlphaId==DSATTSY_ALPHA_ID1);
|
|
991 |
TEST(iGetServiceInfo.iIconId.iIdentifier==DSATTSY_ICON_ID1);
|
|
992 |
TEST(iGetServiceInfo.iIconId.iQualifier==DSATTSY_ICON_QUALIFIER1);
|
|
993 |
TEST(iGetServiceInfo.iAttributeInfo.iBearerId==DSATTSY_BEARER_TECH_INDEPENDENT);
|
|
994 |
TEST(iGetServiceInfo.iAttributeInfo.iAttributeInfo==DSATTSY_ATTRIBUTE_INFO);
|
|
995 |
|
|
996 |
INFO_PRINTF2(_L("Test %d - RSat::NotifyGetServiceInfoPCmd with RSat::TGetServiceInfoV2 passed"),iTestCount++);
|
|
997 |
|
|
998 |
// Get Service Information Cancel with V2
|
|
999 |
sat.NotifyGetServiceInfoPCmd(reqStatus,getServiceInfoPckg);
|
|
1000 |
sat.CancelAsyncRequest(ESatNotifyGetServiceInfoPCmd);
|
|
1001 |
|
|
1002 |
User::WaitForRequest(reqStatus);
|
|
1003 |
TEST(reqStatus.Int()==KErrCancel);
|
|
1004 |
INFO_PRINTF2(_L("Test %d - RSat::NotifyGetServiceInfoPCmd Cancel with RSat::TGetServiceInfoV2 passed"),iTestCount++);
|
|
1005 |
|
|
1006 |
// Get Service Information with V5
|
|
1007 |
RSat::TGetServiceInfoV5Pckg getServiceInfoV5Pckg(iGetServiceInfoV5);
|
|
1008 |
|
|
1009 |
TEST(iGetServiceInfoV5.ExtensionId() == RSat::KSatV5);
|
|
1010 |
TEST(iGetServiceInfoV5.iTextAttribute.iStatus == RSat::ETextAttributeNotSet);
|
|
1011 |
|
|
1012 |
sat.NotifyGetServiceInfoPCmd(reqStatus,getServiceInfoV5Pckg);
|
|
1013 |
User::WaitForRequest(reqStatus);
|
|
1014 |
TEST(reqStatus.Int()==KErrNone);
|
|
1015 |
|
|
1016 |
TEST(iGetServiceInfoV5.PCmdNumber()==DSATTSY_GET_SERVICE_INFO_NUMBER);
|
|
1017 |
TEST(iGetServiceInfoV5.iAlphaId.iStatus==DSATTSY_ALPHA_ID1_STATUS);
|
|
1018 |
TEST(iGetServiceInfoV5.iAlphaId.iAlphaId==DSATTSY_ALPHA_ID1);
|
|
1019 |
TEST(iGetServiceInfoV5.iIconId.iIdentifier==DSATTSY_ICON_ID1);
|
|
1020 |
TEST(iGetServiceInfoV5.iIconId.iQualifier==DSATTSY_ICON_QUALIFIER1);
|
|
1021 |
TEST(iGetServiceInfoV5.iAttributeInfo.iBearerId==DSATTSY_BEARER_TECH_INDEPENDENT);
|
|
1022 |
TEST(iGetServiceInfoV5.iAttributeInfo.iAttributeInfo==DSATTSY_ATTRIBUTE_INFO);
|
|
1023 |
|
|
1024 |
// V5 parameters
|
|
1025 |
RSat::TTextAttribute textAttribute;
|
|
1026 |
textAttribute.iStatus = DSATTSY_TEXT_ATTRIBUTE_STATUS;
|
|
1027 |
const TUint8 textAttributeData[DSATTSY_TEXT_ATTRIBUTE_DATA_LENGTH] = DSATTSY_TEXT_ATTRIBUTE_DATA;
|
|
1028 |
textAttribute.iTextAttributeData.Append(textAttributeData, DSATTSY_TEXT_ATTRIBUTE_DATA_LENGTH);
|
|
1029 |
|
|
1030 |
TEST(iGetServiceInfoV5.iTextAttribute.iStatus == textAttribute.iStatus);
|
|
1031 |
TEST(iGetServiceInfoV5.iTextAttribute.iTextAttributeData == textAttribute.iTextAttributeData);
|
|
1032 |
|
|
1033 |
INFO_PRINTF2(_L("Test %d - RSat::NotifyGetServiceInfoPCmd with RSat::TGetServiceInfoV5 passed"),iTestCount++);
|
|
1034 |
|
|
1035 |
// Get Service Information Cancel with V5
|
|
1036 |
sat.NotifyGetServiceInfoPCmd(reqStatus,getServiceInfoV5Pckg);
|
|
1037 |
sat.CancelAsyncRequest(ESatNotifyGetServiceInfoPCmd);
|
|
1038 |
|
|
1039 |
User::WaitForRequest(reqStatus);
|
|
1040 |
TEST(reqStatus.Int()==KErrCancel);
|
|
1041 |
INFO_PRINTF2(_L("Test %d - RSat::NotifyGetServiceInfoPCmd Cancel with RSat::TGetServiceInfoV5 passed"),iTestCount++);
|
|
1042 |
|
|
1043 |
// Get Service Information Terminal Rsp
|
|
1044 |
sat.NotifyGetServiceInfoPCmd(reqStatus,getServiceInfoPckg);
|
|
1045 |
User::WaitForRequest(reqStatus);
|
|
1046 |
TEST(reqStatus.Int()==KErrNone);
|
|
1047 |
|
|
1048 |
RSat::TGetServiceInfoRspV2Pckg getServiceInfoRspPckg(iGetServiceInfoRsp);
|
|
1049 |
|
|
1050 |
iGetServiceInfoRsp.SetPCmdNumber(iGetServiceInfo.PCmdNumber());
|
|
1051 |
iGetServiceInfoRsp.iGeneralResult=DSATTSY_PCMD_RESULT_SUCCESS;
|
|
1052 |
iGetServiceInfoRsp.iInfoType=DSATTSY_PCMD_RSP_NO_INFO;
|
|
1053 |
iGetServiceInfoRsp.iAdditionalInfo=DSATTSY_NULL_BUF;
|
|
1054 |
iGetServiceInfoRsp.iRecordInfo.iBearerId=DSATTSY_BEARER_NOT_PRESENT;
|
|
1055 |
iGetServiceInfoRsp.iRecordInfo.iServiceId=DSATTSY_NULL_BEARER_ID;
|
|
1056 |
iGetServiceInfoRsp.iRecordInfo.iRecord=DSATTSY_NULL_NARROW_BUF;
|
|
1057 |
|
|
1058 |
sat.TerminalRsp(reqStatus,RSat::EGetServiceInformation,getServiceInfoRspPckg);
|
|
1059 |
User::WaitForRequest(reqStatus);
|
|
1060 |
TEST(reqStatus.Int()==KErrNone);
|
|
1061 |
INFO_PRINTF2(_L("Test %d - RSat::TerminalRsp - Get Service Info - passed"),iTestCount++);
|
|
1062 |
}
|