24
|
1 |
// Copyright (c) 2008-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 |
|
|
17 |
|
|
18 |
/**
|
|
19 |
@file The TEFUnit test suite for SendReceiveData in the SAT.
|
|
20 |
*/
|
|
21 |
|
|
22 |
#include "ccsatsendreceivedatafu.h"
|
|
23 |
#include <etel.h>
|
|
24 |
#include <etelmm.h>
|
|
25 |
#include <satcs.h>
|
|
26 |
#include <test/tmockltsydata.h>
|
|
27 |
|
|
28 |
// define used constants
|
|
29 |
const TUint8 KSendDataStoreMode = 0x00; // constant for store mode
|
|
30 |
const TUint8 KReceiveDataQualifier = 0x00; // RFU
|
|
31 |
const TUint8 KIconOne = 1; // record 1 in EFIMG file on sim
|
|
32 |
const TUint8 KChannelDataLength = 200; // should be non zero
|
|
33 |
|
|
34 |
// additional information for RSat::KNetworkUnableToProcessCmd error
|
|
35 |
// in processing proactive command
|
|
36 |
// please see documentation for RSat::KNetworkUnableToProcessCmd
|
|
37 |
const TUint8 KRequestedFacilityNotImplemented = 69/*see 3GPP TS 24.008*/ | 0x80;
|
|
38 |
|
|
39 |
// define some channel data
|
|
40 |
_LIT8(KChannelData, "\x00\x01\x02\x03\x04\x05\x06\x07");
|
|
41 |
|
|
42 |
_LIT8(KBasicIconAlpha, "Basic Icon");
|
|
43 |
|
|
44 |
//"Hello" in Russian, first byte "\x80" is 0x80 UCS2 coding type for Tlv data
|
|
45 |
_LIT8(KRussianHello, "\x80\x04\x17\x04\x14\x04\x20\x04\x10\x04\x12\x04\x21\
|
|
46 |
\x04\x22\x04\x12\x04\x23\x04\x19\x04\x22\x04\x15");
|
|
47 |
//"Hello" in Russian in unicode for checking results
|
|
48 |
_LIT16(KRussianHelloU, "\x0417\x0414\x0420\x0410\x0412\x0421\x0422\x0412\
|
|
49 |
\x0423\x0419\x0422\x0415");
|
|
50 |
|
|
51 |
//"Hello" in Chinese, first byte "\x80" is 0x80 UCS2 coding type for Tlv data
|
|
52 |
_LIT8(KChineseHello, "\x80\x4F\x60\x59\x7D");
|
|
53 |
//"Hello" in Chinese in unicode for checking results
|
|
54 |
_LIT16(KChineseHelloU, "\x4F60\x597D");
|
|
55 |
|
|
56 |
//Characters in Katakana, first byte "\x80" is 0x80 UCS2 coding type for Tlv data
|
|
57 |
_LIT8(KKatakanaChars, "\x80\x30\xEB");
|
|
58 |
//Characters in Katakana in unicode for checking results
|
|
59 |
_LIT16(KKatakanaCharsU, "\x30EB");
|
|
60 |
|
|
61 |
CTestSuite* CCSatSendReceiveDataFU::CreateSuiteL(const TDesC& aName)
|
|
62 |
{
|
|
63 |
SUB_SUITE;
|
|
64 |
|
|
65 |
ADD_TEST_STEP_ISO_CPP(CCSatSendReceiveDataFU, TestNotifyReceiveDataPCmd0001L);
|
|
66 |
ADD_TEST_STEP_ISO_CPP(CCSatSendReceiveDataFU, TestNotifyReceiveDataPCmd0001bL);
|
|
67 |
ADD_TEST_STEP_ISO_CPP(CCSatSendReceiveDataFU, TestNotifyReceiveDataPCmd0002L);
|
|
68 |
ADD_TEST_STEP_ISO_CPP(CCSatSendReceiveDataFU, TestNotifyReceiveDataPCmd0004L);
|
|
69 |
ADD_TEST_STEP_ISO_CPP(CCSatSendReceiveDataFU, TestNotifySendDataPCmd0001L);
|
|
70 |
ADD_TEST_STEP_ISO_CPP(CCSatSendReceiveDataFU, TestNotifySendDataPCmd0001bL);
|
|
71 |
ADD_TEST_STEP_ISO_CPP(CCSatSendReceiveDataFU, TestNotifySendDataPCmd0002L);
|
|
72 |
ADD_TEST_STEP_ISO_CPP(CCSatSendReceiveDataFU, TestNotifySendDataPCmd0004L);
|
|
73 |
|
|
74 |
END_SUITE;
|
|
75 |
}
|
|
76 |
|
|
77 |
|
|
78 |
/**
|
|
79 |
Fills in channel data descriptor
|
|
80 |
@param aData TDes8 or TDes16 descriptor data to be prepared
|
|
81 |
*/
|
|
82 |
template <class T>
|
|
83 |
LOCAL_C void PrepareChannelData(T& aData)
|
|
84 |
{
|
|
85 |
for (TUint8 i = 0; i < KChannelDataLength; i++)
|
|
86 |
{
|
|
87 |
aData.Append(i);
|
|
88 |
}
|
|
89 |
}
|
|
90 |
|
|
91 |
|
|
92 |
/**
|
|
93 |
Resets RSat::SendDataV2 data fields
|
|
94 |
@param aSendData data to be reset
|
|
95 |
*/
|
|
96 |
LOCAL_C void ResetSendData(RSat::TSendDataV2& aData)
|
|
97 |
{
|
|
98 |
// reset public members
|
|
99 |
aData.iDestination = RSat::KDeviceIdNotSet;
|
|
100 |
aData.iMode = RSat::ESendDataModeNotSet;
|
|
101 |
aData.iAlphaId.iStatus = RSat::EAlphaIdNotSet;
|
|
102 |
aData.iAlphaId.iAlphaId.Zero();
|
|
103 |
aData.iIconId.iQualifier = RSat::EIconQualifierNotSet;
|
|
104 |
aData.iIconId.iIdentifier = 0;
|
|
105 |
aData.iChannelData.Zero();
|
|
106 |
|
|
107 |
// reset protected members;
|
|
108 |
aData.SetPCmdNumber(0);
|
|
109 |
}
|
|
110 |
|
|
111 |
|
|
112 |
/**
|
|
113 |
Resets RSat::ReceiveDataV2 data fields
|
|
114 |
@param aReceiveData data to be reset
|
|
115 |
*/
|
|
116 |
LOCAL_C void ResetReceiveData(RSat::TReceiveDataV2& aData)
|
|
117 |
{
|
|
118 |
// reset public members
|
|
119 |
aData.iDestination = RSat::KDeviceIdNotSet;
|
|
120 |
aData.iAlphaId.iStatus = RSat::EAlphaIdNotSet;
|
|
121 |
aData.iAlphaId.iAlphaId.Zero();
|
|
122 |
aData.iIconId.iQualifier = RSat::EIconQualifierNotSet;
|
|
123 |
aData.iIconId.iIdentifier = 0;
|
|
124 |
aData.iChannelDataLength = 0;
|
|
125 |
|
|
126 |
// reset protected members;
|
|
127 |
aData.SetPCmdNumber(0);
|
|
128 |
}
|
|
129 |
|
|
130 |
|
|
131 |
/**
|
|
132 |
Prepares SendData proactive command complete data for MockLtsy
|
|
133 |
@param aChannelData Channel data
|
|
134 |
@param aDelay Delay value for MockLtsy completion
|
|
135 |
*/
|
|
136 |
void CCSatSendReceiveDataFU::PrepareSendDataCompleteDataL(
|
|
137 |
const TDesC8* aChannelData,
|
|
138 |
TInt aDelay)
|
|
139 |
{
|
|
140 |
PrepareSendDataCompleteDataL(
|
|
141 |
aChannelData, KPCmdNumberOne, KBipSendDataImmediately, RSat::KChannel1,
|
|
142 |
NULL, RSat::EIconQualifierNotSet, KErrNone, aDelay);
|
|
143 |
}
|
|
144 |
|
|
145 |
/**
|
|
146 |
Prepares SendData proactive command complete data for MockLtsy
|
|
147 |
@param aChannelData Channel data
|
|
148 |
@param aPCmdNumber Proactive command number.
|
|
149 |
@param aCmdQual Command qualifier
|
|
150 |
@param aDestDeviceId Command destination device Id
|
|
151 |
@param aAlphaId Alpha identifier
|
|
152 |
@param aIconQual Type of icon
|
|
153 |
@param aResult Proactive command notify result
|
|
154 |
@param aDelay Delay value for MockLtsy completion
|
|
155 |
*/
|
|
156 |
void CCSatSendReceiveDataFU::PrepareSendDataCompleteDataL(
|
|
157 |
const TDesC8* aChannelData,
|
|
158 |
TUint8 aPCmdNumber,
|
|
159 |
TUint8 aCmdQual,
|
|
160 |
TUint8 aDestDeviceId,
|
|
161 |
const TDesC8* aAlphaId,
|
|
162 |
RSat::TIconQualifier aIconQual,
|
|
163 |
TInt aResult,
|
|
164 |
TInt aDelay)
|
|
165 |
{
|
|
166 |
TTlv tlv;
|
|
167 |
ProactiveCmdTlvBegin(tlv, aPCmdNumber, KSendData, aCmdQual, aDestDeviceId);
|
|
168 |
|
|
169 |
if ( aChannelData )
|
|
170 |
{
|
|
171 |
tlv.AddTag(KTlvChannelDataTag);
|
|
172 |
tlv.AddData(*aChannelData);//ETLV_ChannelDataString
|
|
173 |
}
|
|
174 |
|
|
175 |
if ( aAlphaId )
|
|
176 |
{
|
|
177 |
tlv.AddTag(KTlvAlphaIdentifierTag);
|
|
178 |
tlv.AddData(*aAlphaId);//ETLV_AlphaIdentifier
|
|
179 |
}
|
|
180 |
|
|
181 |
if ( ( RSat::ESelfExplanatory == aIconQual ) ||
|
|
182 |
( RSat::ENotSelfExplanatory == aIconQual ) )
|
|
183 |
{
|
|
184 |
tlv.AddTag(KTlvIconIdentifierTag);
|
|
185 |
tlv.AddByte((RSat::ESelfExplanatory == aIconQual)?0:1);//ETLV_IconQualifier
|
|
186 |
tlv.AddByte(KIconOne);//ETLV_IconIdentifier
|
|
187 |
}
|
|
188 |
|
|
189 |
PrepareMockWithCompleteDataForPCmdNotifyL(tlv.End(), aResult, aDelay);
|
|
190 |
}
|
|
191 |
|
|
192 |
|
|
193 |
/**
|
|
194 |
Tests for successful completion of RSat::NotifySendDataPCmd request
|
|
195 |
@param aChannelData Channel data
|
|
196 |
@param aCmdQual Command qualifier
|
|
197 |
*/
|
|
198 |
void CCSatSendReceiveDataFU::TestNotifySendDataPCmdL(
|
|
199 |
const TDesC8* aChannelData,
|
|
200 |
TUint8 aCmdQual)
|
|
201 |
{
|
|
202 |
TestNotifySendDataPCmdL(
|
|
203 |
aChannelData, KPCmdNumberOne, aCmdQual, RSat::KChannel1,
|
|
204 |
NULL, RSat::EIconQualifierNotSet, KErrNone, NULL);
|
|
205 |
}
|
|
206 |
|
|
207 |
|
|
208 |
/**
|
|
209 |
Tests for completion of RSat::NotifySendDataPCmd request
|
|
210 |
@param aChannelData Channel data
|
|
211 |
@param aError Proactive command notify error code for mock data
|
|
212 |
*/
|
|
213 |
void CCSatSendReceiveDataFU::TestNotifySendDataPCmdErrorL(
|
|
214 |
const TDesC8* aChannelData,
|
|
215 |
TInt aError)
|
|
216 |
{
|
|
217 |
TestNotifySendDataPCmdL(
|
|
218 |
aChannelData, KPCmdNumberOne, KBipSendDataImmediately, RSat::KChannel1,
|
|
219 |
NULL, RSat::EIconQualifierNotSet, aError, NULL);
|
|
220 |
}
|
|
221 |
|
|
222 |
|
|
223 |
/**
|
|
224 |
Tests for successful completion of RSat::NotifySendDataPCmd request
|
|
225 |
@param aChannelData Channel data
|
|
226 |
@param aDestDeviceId Command destination device Id
|
|
227 |
*/
|
|
228 |
void CCSatSendReceiveDataFU::TestNotifySendDataPCmdL(
|
|
229 |
const TDesC8* aChannelData,
|
|
230 |
RSat::TDeviceId aDestDeviceId)
|
|
231 |
{
|
|
232 |
TestNotifySendDataPCmdL(
|
|
233 |
aChannelData, KPCmdNumberOne, KBipSendDataImmediately, aDestDeviceId,
|
|
234 |
NULL, RSat::EIconQualifierNotSet, KErrNone, NULL);
|
|
235 |
}
|
|
236 |
|
|
237 |
|
|
238 |
/**
|
|
239 |
Tests for successful completion of RSat::NotifySendDataPCmd request
|
|
240 |
@param aChannelData Channel data
|
|
241 |
@param aAlphaId Alpha identifier
|
|
242 |
@param aAlphaIdCheck Alpha identifier value to ckeck with returned value
|
|
243 |
@param aIconQual Type of icon
|
|
244 |
*/
|
|
245 |
void CCSatSendReceiveDataFU::TestNotifySendDataPCmdL(
|
|
246 |
const TDesC8* aChannelData,
|
|
247 |
const TDesC8* aAlphaId,
|
|
248 |
const TDesC16* aAlphaIdCheck,
|
|
249 |
RSat::TIconQualifier aIconQual)
|
|
250 |
{
|
|
251 |
TestNotifySendDataPCmdL(
|
|
252 |
aChannelData, KPCmdNumberOne, KBipSendDataImmediately, RSat::KChannel1,
|
|
253 |
aAlphaId, aIconQual, KErrNone, aAlphaIdCheck);
|
|
254 |
}
|
|
255 |
|
|
256 |
|
|
257 |
/**
|
|
258 |
Tests for completion of RSat::NotifySendDataPCmd request
|
|
259 |
@param aChannelData Channel data
|
|
260 |
@param aPCmdNumber Proactive command number
|
|
261 |
@param aCmdQual Command qualifier
|
|
262 |
@param aDestDeviceId Command destination device Id
|
|
263 |
@param aAlphaId Alpha identifier
|
|
264 |
@param aIconQual Type of icon
|
|
265 |
@param aResult Proactive command notify result
|
|
266 |
@param aAlphaIdCheck Alpha identifier value to ckeck with returned value
|
|
267 |
*/
|
|
268 |
void CCSatSendReceiveDataFU::TestNotifySendDataPCmdL(
|
|
269 |
const TDesC8* aChannelData,
|
|
270 |
TUint8 aPCmdNumber,
|
|
271 |
TUint8 aCmdQual,
|
|
272 |
RSat::TDeviceId aDestDeviceId,
|
|
273 |
const TDesC8* aAlphaId,
|
|
274 |
RSat::TIconQualifier aIconQual,
|
|
275 |
TInt aResult,
|
|
276 |
const TDesC16* aAlphaIdCheck)
|
|
277 |
{
|
|
278 |
// write expected notify request in mockLtsy
|
|
279 |
PrepareMockWithExpDataForPCmdNotifyL(KSendData);
|
|
280 |
|
|
281 |
// write completion data in mockLtsy to complete notify request
|
|
282 |
TUint8 destDeviceId = ( RSat::KDeviceIdNotSet==aDestDeviceId )?KDeviceIdNotSet:aDestDeviceId;
|
|
283 |
PrepareSendDataCompleteDataL(
|
|
284 |
aChannelData, aPCmdNumber, aCmdQual, destDeviceId,
|
|
285 |
aAlphaId, aIconQual, aResult);
|
|
286 |
|
|
287 |
// send notify request to CSAT
|
|
288 |
RSat::TSendDataV2 sendData;
|
|
289 |
RSat::TSendDataV2Pckg sendDataPckg(sendData);
|
|
290 |
TRequestStatus requestStatus;
|
|
291 |
iSat.NotifySendDataPCmd(requestStatus, sendDataPckg);
|
|
292 |
|
|
293 |
// wait for the request completion
|
|
294 |
User::WaitForRequest(requestStatus);
|
|
295 |
|
|
296 |
// check expected results with recieved data
|
|
297 |
ASSERT_EQUALS(aResult, requestStatus.Int());
|
|
298 |
|
|
299 |
if ( KErrNone == aResult )
|
|
300 |
{
|
|
301 |
// proactive command number
|
|
302 |
ASSERT_EQUALS(aPCmdNumber, sendData.PCmdNumber());
|
|
303 |
|
|
304 |
ASSERT_EQUALS(aDestDeviceId, sendData.iDestination);
|
|
305 |
|
|
306 |
if ( KBipSendDataImmediately & aCmdQual )
|
|
307 |
{
|
|
308 |
ASSERT_EQUALS(RSat::ESendDataImmediately, sendData.iMode);
|
|
309 |
}
|
|
310 |
else
|
|
311 |
{
|
|
312 |
ASSERT_EQUALS(RSat::EStoreDataInTxBuffer, sendData.iMode);
|
|
313 |
}
|
|
314 |
|
|
315 |
if ( aChannelData )
|
|
316 |
{
|
|
317 |
ASSERT_EQUALS( 0, aChannelData->Compare(sendData.iChannelData) );
|
|
318 |
}
|
|
319 |
else
|
|
320 |
{
|
|
321 |
ASSERT_EQUALS( 0, KNullDesC8().Compare(sendData.iChannelData) );
|
|
322 |
}
|
|
323 |
|
|
324 |
if ( aAlphaId && ( 0 < aAlphaId->Length() ) )
|
|
325 |
{
|
|
326 |
ASSERT_EQUALS(RSat::EAlphaIdProvided, sendData.iAlphaId.iStatus);
|
|
327 |
if ( aAlphaIdCheck )
|
|
328 |
{
|
|
329 |
ASSERT_EQUALS( 0, aAlphaIdCheck->Compare(
|
|
330 |
sendData.iAlphaId.iAlphaId));
|
|
331 |
}
|
|
332 |
else
|
|
333 |
{
|
|
334 |
ASSERT_EQUALS(0, Compare16bitDesWith8bitDesL(
|
|
335 |
*aAlphaId,
|
|
336 |
sendData.iAlphaId.iAlphaId));
|
|
337 |
}
|
|
338 |
}
|
|
339 |
else if ( aAlphaId && ( 0 == aAlphaId->Length() ) )
|
|
340 |
{
|
|
341 |
ASSERT_EQUALS( RSat::EAlphaIdNull, sendData.iAlphaId.iStatus );
|
|
342 |
}
|
|
343 |
else
|
|
344 |
{
|
|
345 |
ASSERT_TRUE( (RSat::EAlphaIdNotPresent == sendData.iAlphaId.iStatus) ||
|
|
346 |
(RSat::EAlphaIdNotSet == sendData.iAlphaId.iStatus) );
|
|
347 |
}
|
|
348 |
|
|
349 |
if (RSat::EIconQualifierNotSet != aIconQual)
|
|
350 |
{
|
|
351 |
ASSERT_EQUALS(aIconQual, sendData.iIconId.iQualifier);
|
|
352 |
ASSERT_EQUALS(KIconOne, sendData.iIconId.iIdentifier);
|
|
353 |
}
|
|
354 |
else
|
|
355 |
{
|
|
356 |
ASSERT_EQUALS(RSat::ENoIconId, sendData.iIconId.iQualifier);
|
|
357 |
}
|
|
358 |
}
|
|
359 |
|
|
360 |
AssertMockLtsyStatusL();
|
|
361 |
}
|
|
362 |
|
|
363 |
|
|
364 |
/**
|
|
365 |
Handles sending a terminal response
|
|
366 |
@param aResp terminal response data
|
|
367 |
*/
|
|
368 |
void CCSatSendReceiveDataFU::GenerateSendDataTerminalResponseL(
|
|
369 |
const RSat::TSendDataRspV2& aResp)
|
|
370 |
{
|
|
371 |
GenerateSendDataTerminalResponseL(aResp, KBipSendDataImmediately);
|
|
372 |
}
|
|
373 |
|
|
374 |
|
|
375 |
/**
|
|
376 |
Handles sending a terminal response
|
|
377 |
@param aResp terminal response data
|
|
378 |
@param aCmdQual Command qualifier
|
|
379 |
@param aExpResult Expected result of TerminalRsp() request
|
|
380 |
*/
|
|
381 |
void CCSatSendReceiveDataFU::GenerateSendDataTerminalResponseL(
|
|
382 |
const RSat::TSendDataRspV2& aResp,
|
|
383 |
TUint8 aCmdQual,
|
|
384 |
TInt aExpResult)
|
|
385 |
{
|
|
386 |
TTlv additionalInfoTlv;
|
|
387 |
TPtrC8 additionalInfoTlvData(KNullDesC8);
|
|
388 |
|
|
389 |
TPtrC genResultAddInfo(KNullDesC);
|
|
390 |
if ( RSat::KMeProblem == aResp.iInfoType )
|
|
391 |
{
|
|
392 |
// prepare additional info for general result for expected data in mockLtsy
|
|
393 |
genResultAddInfo.Set( aResp.iAdditionalInfo );
|
|
394 |
}
|
|
395 |
else if ( CommandPerformedSuccessfully(aResp.iGeneralResult) )
|
|
396 |
{
|
|
397 |
// prepare additional info Tlv data for expected data in mockLtsy
|
|
398 |
additionalInfoTlv.AddTag(KTlvChannelDataLengthTag);
|
|
399 |
additionalInfoTlv.AddByte(aResp.iChannelDataLength);//ETLV_ChannelDataLength
|
|
400 |
|
|
401 |
additionalInfoTlvData.Set( additionalInfoTlv.GetDataWithoutTopLevelTag() );
|
|
402 |
}
|
|
403 |
|
|
404 |
RSat::RSat::TSendDataRspV2Pckg respPckg(aResp);
|
|
405 |
GenerateTerminalResponseL(
|
|
406 |
aResp.PCmdNumber(),
|
|
407 |
KSendData,
|
|
408 |
aCmdQual,
|
|
409 |
RSat::ESendData,
|
|
410 |
respPckg,
|
|
411 |
genResultAddInfo,
|
|
412 |
aResp.iGeneralResult,
|
|
413 |
additionalInfoTlvData,
|
|
414 |
aExpResult);
|
|
415 |
|
|
416 |
AssertMockLtsyStatusL();
|
|
417 |
}
|
|
418 |
|
|
419 |
|
|
420 |
/**
|
|
421 |
Prepares ReceiveData proactive command complete data for MockLtsy
|
|
422 |
@param aChannelDataLength Channel data length
|
|
423 |
@param aDelay Delay value for MockLtsy completion
|
|
424 |
*/
|
|
425 |
void CCSatSendReceiveDataFU::PrepareReceiveDataCompleteDataL(
|
|
426 |
const TUint8* aChannelDataLength,
|
|
427 |
TInt aDelay)
|
|
428 |
{
|
|
429 |
PrepareReceiveDataCompleteDataL(
|
|
430 |
KPCmdNumberOne, aChannelDataLength, NULL, RSat::EIconQualifierNotSet,
|
|
431 |
KErrNone, aDelay, RSat::KChannel1);
|
|
432 |
}
|
|
433 |
|
|
434 |
|
|
435 |
/**
|
|
436 |
Prepares ReceiveData proactive command complete data for MockLtsy
|
|
437 |
@param aPCmdNumber Proactive command number.
|
|
438 |
@param aChannelDataLength Channel data length
|
|
439 |
@param aAlphaId Alpha identifier
|
|
440 |
@param aIconQual Type of icon
|
|
441 |
@param aResult Proactive command notify result
|
|
442 |
@param aDelay Delay value for MockLtsy completion
|
|
443 |
@param aDestDeviceId Command destination device Id
|
|
444 |
*/
|
|
445 |
void CCSatSendReceiveDataFU::PrepareReceiveDataCompleteDataL(
|
|
446 |
TUint8 aPCmdNumber,
|
|
447 |
const TUint8* aChannelDataLength,
|
|
448 |
const TDesC8* aAlphaId,
|
|
449 |
RSat::TIconQualifier aIconQual,
|
|
450 |
TInt aResult,
|
|
451 |
TInt aDelay,
|
|
452 |
TUint8 aDestDeviceId)
|
|
453 |
{
|
|
454 |
TTlv tlv;
|
|
455 |
ProactiveCmdTlvBegin(tlv, aPCmdNumber, KReceiveData, KReceiveDataQualifier, aDestDeviceId);
|
|
456 |
|
|
457 |
if ( aChannelDataLength )
|
|
458 |
{
|
|
459 |
tlv.AddTag(KTlvChannelDataLengthTag);
|
|
460 |
tlv.AddByte(*aChannelDataLength);//ETLV_ChannelDataLength
|
|
461 |
}
|
|
462 |
|
|
463 |
if ( aAlphaId )
|
|
464 |
{
|
|
465 |
tlv.AddTag(KTlvAlphaIdentifierTag);
|
|
466 |
tlv.AddData(*aAlphaId);//ETLV_AlphaIdentifier
|
|
467 |
}
|
|
468 |
|
|
469 |
if ( ( RSat::ESelfExplanatory == aIconQual ) ||
|
|
470 |
( RSat::ENotSelfExplanatory == aIconQual ) )
|
|
471 |
{
|
|
472 |
tlv.AddTag(KTlvIconIdentifierTag);
|
|
473 |
tlv.AddByte((RSat::ESelfExplanatory == aIconQual)?0:1);//ETLV_IconQualifier
|
|
474 |
tlv.AddByte(KIconOne);//ETLV_IconIdentifier
|
|
475 |
}
|
|
476 |
|
|
477 |
PrepareMockWithCompleteDataForPCmdNotifyL(tlv.End(), aResult, aDelay);
|
|
478 |
}
|
|
479 |
|
|
480 |
|
|
481 |
/**
|
|
482 |
Tests for completion of RSat::NotifyReceiveDataPCmd request with specified
|
|
483 |
channel data length and RSat::KChannel1 as the destination device to process
|
|
484 |
the command
|
|
485 |
@param aChannelDataLength Channel data length
|
|
486 |
@param aResult Proactive command notify result
|
|
487 |
*/
|
|
488 |
void CCSatSendReceiveDataFU::TestNotifyReceiveDataPCmdL(
|
|
489 |
const TUint8* aChannelDataLength,
|
|
490 |
TInt aResult)
|
|
491 |
{
|
|
492 |
TestNotifyReceiveDataPCmdL(
|
|
493 |
KPCmdNumberOne, aChannelDataLength, NULL, RSat::EIconQualifierNotSet,
|
|
494 |
aResult, NULL, RSat::KChannel1);
|
|
495 |
}
|
|
496 |
|
|
497 |
|
|
498 |
/**
|
|
499 |
Tests for successful completion of RSat::NotifyReceiveDataPCmd request with
|
|
500 |
specified channel data length and destination device to process the command
|
|
501 |
@param aChannelDataLength Channel data length
|
|
502 |
@param aDestDeviceId Command destination device Id
|
|
503 |
*/
|
|
504 |
void CCSatSendReceiveDataFU::TestNotifyReceiveDataPCmdL(
|
|
505 |
const TUint8* aChannelDataLength,
|
|
506 |
RSat::TDeviceId aDestDeviceId)
|
|
507 |
{
|
|
508 |
TestNotifyReceiveDataPCmdL(
|
|
509 |
KPCmdNumberOne, aChannelDataLength, NULL, RSat::EIconQualifierNotSet,
|
|
510 |
KErrNone, NULL, aDestDeviceId);
|
|
511 |
}
|
|
512 |
|
|
513 |
|
|
514 |
/**
|
|
515 |
Tests for successful completion of RSat::NotifyReceiveDataPCmd request
|
|
516 |
@param aChannelDataLength Channel data length
|
|
517 |
@param aAlphaId Alpha identifier
|
|
518 |
@param aAlphaIdCheck Alpha identifier value to ckeck with returned value
|
|
519 |
@param aIconQual Type of icon
|
|
520 |
*/
|
|
521 |
void CCSatSendReceiveDataFU::TestNotifyReceiveDataPCmdL(
|
|
522 |
const TUint8* aChannelDataLength,
|
|
523 |
const TDesC8* aAlphaId,
|
|
524 |
const TDesC16* aAlphaIdCheck,
|
|
525 |
RSat::TIconQualifier aIconQual)
|
|
526 |
{
|
|
527 |
TestNotifyReceiveDataPCmdL(
|
|
528 |
KPCmdNumberOne, aChannelDataLength, aAlphaId, aIconQual,
|
|
529 |
KErrNone, aAlphaIdCheck, RSat::KChannel1);
|
|
530 |
}
|
|
531 |
|
|
532 |
|
|
533 |
/**
|
|
534 |
Tests for completion of RSat::NotifyReceiveDataPCmd request
|
|
535 |
@param aPCmdNumber Proactive command number
|
|
536 |
@param aChannelDataLength Channel data length
|
|
537 |
@param aAlphaId Alpha identifier
|
|
538 |
@param aIconQual Type of icon
|
|
539 |
@param aResult Proactive command notify result
|
|
540 |
@param aAlphaIdCheck Alpha identifier value to ckeck with returned value
|
|
541 |
@param aDestDeviceId Command destination device Id
|
|
542 |
*/
|
|
543 |
void CCSatSendReceiveDataFU::TestNotifyReceiveDataPCmdL(
|
|
544 |
TUint8 aPCmdNumber,
|
|
545 |
const TUint8* aChannelDataLength,
|
|
546 |
const TDesC8* aAlphaId,
|
|
547 |
RSat::TIconQualifier aIconQual,
|
|
548 |
TInt aResult,
|
|
549 |
const TDesC16* aAlphaIdCheck,
|
|
550 |
RSat::TDeviceId aDestDeviceId)
|
|
551 |
{
|
|
552 |
// write expected request data in mockLtsy
|
|
553 |
PrepareMockWithExpDataForPCmdNotifyL(KReceiveData);
|
|
554 |
|
|
555 |
// write completion data in mockLtsy to complete notify request
|
|
556 |
TUint8 destDeviceId = ( RSat::KDeviceIdNotSet==aDestDeviceId )?KDeviceIdNotSet:aDestDeviceId;
|
|
557 |
PrepareReceiveDataCompleteDataL(
|
|
558 |
aPCmdNumber, aChannelDataLength, aAlphaId,
|
|
559 |
aIconQual, aResult, KDefaultNoDelay, destDeviceId);
|
|
560 |
|
|
561 |
// send notify request to CSAT
|
|
562 |
RSat::TReceiveDataV2 receiveData;
|
|
563 |
RSat::TReceiveDataV2Pckg receiveDataPckg(receiveData);
|
|
564 |
TRequestStatus requestStatus;
|
|
565 |
iSat.NotifyReceiveDataPCmd(requestStatus, receiveDataPckg);
|
|
566 |
|
|
567 |
// wait for notify request completion
|
|
568 |
User::WaitForRequest(requestStatus);
|
|
569 |
|
|
570 |
// check expected results with recieved data
|
|
571 |
ASSERT_EQUALS(aResult, requestStatus.Int());
|
|
572 |
|
|
573 |
if ( KErrNone == aResult )
|
|
574 |
{
|
|
575 |
ASSERT_EQUALS(aPCmdNumber, receiveData.PCmdNumber());
|
|
576 |
|
|
577 |
ASSERT_EQUALS(aDestDeviceId, receiveData.iDestination);
|
|
578 |
|
|
579 |
if ( aChannelDataLength )
|
|
580 |
{
|
|
581 |
ASSERT_EQUALS(*aChannelDataLength, receiveData.iChannelDataLength);
|
|
582 |
}
|
|
583 |
else
|
|
584 |
{
|
|
585 |
ASSERT_EQUALS(static_cast<TUint8>(0), receiveData.iChannelDataLength);
|
|
586 |
}
|
|
587 |
|
|
588 |
if ( aAlphaId && ( 0 < aAlphaId->Length() ) )
|
|
589 |
{
|
|
590 |
ASSERT_EQUALS(RSat::EAlphaIdProvided, receiveData.iAlphaId.iStatus);
|
|
591 |
if ( aAlphaIdCheck )
|
|
592 |
{
|
|
593 |
ASSERT_EQUALS( 0, aAlphaIdCheck->Compare(
|
|
594 |
receiveData.iAlphaId.iAlphaId));
|
|
595 |
}
|
|
596 |
else
|
|
597 |
{
|
|
598 |
ASSERT_EQUALS(0, Compare16bitDesWith8bitDesL(
|
|
599 |
*aAlphaId,
|
|
600 |
receiveData.iAlphaId.iAlphaId));
|
|
601 |
}
|
|
602 |
}
|
|
603 |
else if ( aAlphaId && ( 0 == aAlphaId->Length() ) )
|
|
604 |
{
|
|
605 |
ASSERT_EQUALS( RSat::EAlphaIdNull, receiveData.iAlphaId.iStatus );
|
|
606 |
}
|
|
607 |
else
|
|
608 |
{
|
|
609 |
ASSERT_TRUE( (RSat::EAlphaIdNotPresent == receiveData.iAlphaId.iStatus) ||
|
|
610 |
(RSat::EAlphaIdNotSet == receiveData.iAlphaId.iStatus) );
|
|
611 |
}
|
|
612 |
|
|
613 |
if (RSat::EIconQualifierNotSet != aIconQual)
|
|
614 |
{
|
|
615 |
ASSERT_EQUALS(aIconQual, receiveData.iIconId.iQualifier);
|
|
616 |
ASSERT_EQUALS(KIconOne, receiveData.iIconId.iIdentifier);
|
|
617 |
}
|
|
618 |
else
|
|
619 |
{
|
|
620 |
ASSERT_EQUALS(RSat::ENoIconId, receiveData.iIconId.iQualifier);
|
|
621 |
}
|
|
622 |
}
|
|
623 |
|
|
624 |
AssertMockLtsyStatusL();
|
|
625 |
}
|
|
626 |
|
|
627 |
|
|
628 |
/**
|
|
629 |
Handles sending a terminal response
|
|
630 |
@param aResp terminal response data
|
|
631 |
@param aExpResult Expected result of TerminalRsp() request
|
|
632 |
*/
|
|
633 |
void CCSatSendReceiveDataFU::GenerateReceiveDataTerminalResponseL(
|
|
634 |
const RSat::TReceiveDataRspV2& aResp,
|
|
635 |
TInt aExpResult)
|
|
636 |
{
|
|
637 |
TTlv additionalInfoTlv;
|
|
638 |
TPtrC8 additionalInfoTlvData(KNullDesC8);
|
|
639 |
|
|
640 |
TPtrC genResultAddInfo(KNullDesC);
|
|
641 |
if ( RSat::KMeProblem == aResp.iInfoType )
|
|
642 |
{
|
|
643 |
// prepare additional info for general result for expected data in mockLtsy
|
|
644 |
genResultAddInfo.Set( aResp.iAdditionalInfo );
|
|
645 |
}
|
|
646 |
else if ( CommandPerformedSuccessfully(aResp.iGeneralResult) )
|
|
647 |
{
|
|
648 |
// prepare additional info Tlv data for expected data in mockLtsy
|
|
649 |
additionalInfoTlv.AddTag(KTlvChannelDataTag);
|
|
650 |
TBuf8<RSat::KAdditionalInfoMaxSize> channelData;
|
|
651 |
channelData.Copy(aResp.iAdditionalInfo);
|
|
652 |
additionalInfoTlv.AddData(channelData);//ETLV_ChannelDataString
|
|
653 |
|
|
654 |
additionalInfoTlv.AddTag(KTlvChannelDataLengthTag);
|
|
655 |
additionalInfoTlv.AddByte(aResp.iChannelDataLength);//ETLV_ChannelDataLength
|
|
656 |
|
|
657 |
additionalInfoTlvData.Set( additionalInfoTlv.GetDataWithoutTopLevelTag() );
|
|
658 |
}
|
|
659 |
|
|
660 |
RSat::RSat::TReceiveDataRspV2Pckg respPckg(aResp);
|
|
661 |
GenerateTerminalResponseL(
|
|
662 |
aResp.PCmdNumber(),
|
|
663 |
KReceiveData,
|
|
664 |
KReceiveDataQualifier,
|
|
665 |
RSat::EReceiveData,
|
|
666 |
respPckg,
|
|
667 |
genResultAddInfo,
|
|
668 |
aResp.iGeneralResult,
|
|
669 |
additionalInfoTlvData,
|
|
670 |
aExpResult);
|
|
671 |
|
|
672 |
AssertMockLtsyStatusL();
|
|
673 |
}
|
|
674 |
|
|
675 |
|
|
676 |
//
|
|
677 |
// Actual test cases
|
|
678 |
//
|
|
679 |
|
|
680 |
|
|
681 |
/**
|
|
682 |
@SYMTestCaseID BA-CSAT-SRD-SRDPC-0001
|
|
683 |
@SYMPREQ 1780
|
|
684 |
@SYMComponent telephony_csat
|
|
685 |
@SYMTestCaseDesc Test support in CSAT for RSat::NotifyReceiveDataPCmd
|
|
686 |
@SYMTestPriority High
|
|
687 |
@SYMTestActions Invokes RSat::NotifyReceiveDataPCmd
|
|
688 |
@SYMTestExpectedResults Pass
|
|
689 |
@SYMTestType CT
|
|
690 |
*/
|
|
691 |
void CCSatSendReceiveDataFU::TestNotifyReceiveDataPCmd0001L()
|
|
692 |
{
|
|
693 |
|
|
694 |
OpenEtelServerL(EUseExtendedError);
|
|
695 |
CleanupStack::PushL(TCleanupItem(Cleanup,this));
|
|
696 |
OpenPhoneL();
|
|
697 |
OpenSatL();
|
|
698 |
|
|
699 |
//-------------------------------------------------------------------------
|
|
700 |
// TEST C: Successful completion request of
|
|
701 |
// RSat::NotifyReceiveDataPCmd
|
|
702 |
//-------------------------------------------------------------------------
|
|
703 |
|
|
704 |
// test for successful completion of RSat::NotifyReceiveDataPCmd request
|
|
705 |
TestNotifyReceiveDataPCmdL(&KChannelDataLength);
|
|
706 |
|
|
707 |
// generate terminal response to RECEIVE DATA proactive command
|
|
708 |
RSat::TReceiveDataRspV2 resp;
|
|
709 |
resp.SetPCmdNumber(KPCmdNumberOne);
|
|
710 |
resp.iGeneralResult = RSat::KSuccess;
|
|
711 |
resp.iInfoType = RSat::KChannelData;
|
|
712 |
// fills in recieved data
|
|
713 |
PrepareChannelData(resp.iAdditionalInfo);
|
|
714 |
// fills in the size of available data to recieve
|
|
715 |
resp.iChannelDataLength = 0xFF; // more than 255 bytes still available
|
|
716 |
|
|
717 |
GenerateReceiveDataTerminalResponseL( resp );
|
|
718 |
|
|
719 |
//-------------------------------------------------------------------------
|
|
720 |
// TEST F: Coverage test(s) for RSat::NotifyReceiveDataPCmd
|
|
721 |
//-------------------------------------------------------------------------
|
|
722 |
// containing text to display to the user
|
|
723 |
//-------------------------------------------------------------------------
|
|
724 |
|
|
725 |
// test for successful completion of RSat::NotifyReceiveDataPCmd request
|
|
726 |
_LIT8(KAlphaId, "Receive Data");
|
|
727 |
TestNotifyReceiveDataPCmdL(&KChannelDataLength, &KAlphaId);
|
|
728 |
|
|
729 |
// generate terminal response to RECEIVE DATA proactive command
|
|
730 |
GenerateReceiveDataTerminalResponseL( resp );
|
|
731 |
|
|
732 |
//-------------------------------------------------------------------------
|
|
733 |
// containing text with null data object
|
|
734 |
//-------------------------------------------------------------------------
|
|
735 |
|
|
736 |
TestNotifyReceiveDataPCmdL(&KChannelDataLength, &KNullDesC8);
|
|
737 |
|
|
738 |
GenerateReceiveDataTerminalResponseL( resp );
|
|
739 |
|
|
740 |
//-------------------------------------------------------------------------
|
|
741 |
// containing a self explanatory icon to display to the user, successful
|
|
742 |
//-------------------------------------------------------------------------
|
|
743 |
|
|
744 |
RSat::TIconQualifier iconQual = RSat::ESelfExplanatory;
|
|
745 |
TestNotifyReceiveDataPCmdL(
|
|
746 |
&KChannelDataLength, &KBasicIconAlpha, NULL, iconQual);
|
|
747 |
|
|
748 |
GenerateReceiveDataTerminalResponseL( resp );
|
|
749 |
|
|
750 |
//-------------------------------------------------------------------------
|
|
751 |
// containing text & not self-explanatory icon, successful
|
|
752 |
//-------------------------------------------------------------------------
|
|
753 |
|
|
754 |
iconQual = RSat::ENotSelfExplanatory;
|
|
755 |
TestNotifyReceiveDataPCmdL(
|
|
756 |
&KChannelDataLength, &KBasicIconAlpha, NULL, iconQual);
|
|
757 |
|
|
758 |
GenerateReceiveDataTerminalResponseL( resp );
|
|
759 |
|
|
760 |
//-------------------------------------------------------------------------
|
|
761 |
// successful, UCS2 text in Cyrillic
|
|
762 |
//-------------------------------------------------------------------------
|
|
763 |
|
|
764 |
TestNotifyReceiveDataPCmdL(
|
|
765 |
&KChannelDataLength, &KRussianHello, &KRussianHelloU);
|
|
766 |
|
|
767 |
GenerateReceiveDataTerminalResponseL( resp );
|
|
768 |
|
|
769 |
//-------------------------------------------------------------------------
|
|
770 |
// successful, UCS2 text in Chinese
|
|
771 |
//-------------------------------------------------------------------------
|
|
772 |
|
|
773 |
TestNotifyReceiveDataPCmdL(
|
|
774 |
&KChannelDataLength, &KChineseHello, &KChineseHelloU);
|
|
775 |
|
|
776 |
GenerateReceiveDataTerminalResponseL( resp );
|
|
777 |
|
|
778 |
//-------------------------------------------------------------------------
|
|
779 |
// successful, UCS2 text in Katakana
|
|
780 |
//-------------------------------------------------------------------------
|
|
781 |
|
|
782 |
TestNotifyReceiveDataPCmdL(
|
|
783 |
&KChannelDataLength, &KKatakanaChars, &KKatakanaCharsU);
|
|
784 |
|
|
785 |
GenerateReceiveDataTerminalResponseL( resp );
|
|
786 |
|
|
787 |
//-------------------------------------------------------------------------
|
|
788 |
// TEST E: Unsolicited completion of RSat::NotifyReceiveDataPCmd
|
|
789 |
// from LTSY.
|
|
790 |
//-------------------------------------------------------------------------
|
|
791 |
|
|
792 |
// write completion data in mockLtsy to complete notify
|
|
793 |
// receive data proactive command request
|
|
794 |
PrepareReceiveDataCompleteDataL(&KChannelDataLength);
|
|
795 |
|
|
796 |
// write expected request data in mockLtsy
|
|
797 |
// for terminal response sent by CSAT
|
|
798 |
RSat::TAdditionalInfo addInfo;
|
|
799 |
addInfo.Append(RSat::KNoSpecificMeProblem);
|
|
800 |
PrepareTerminalResponseMockDataL(
|
|
801 |
KPCmdNumberOne, KReceiveData, KReceiveDataQualifier,
|
|
802 |
addInfo, RSat::KMeUnableToProcessCmd);
|
|
803 |
|
|
804 |
// wait for completion of requests processing by mockLtsy
|
|
805 |
WaitForMockLTSYTerminated();
|
|
806 |
AssertMockLtsyStatusL();
|
|
807 |
|
|
808 |
//-------------------------------------------------------------------------
|
|
809 |
// TEST B: failure on completion of pending request from LTSY->CTSY
|
|
810 |
//-------------------------------------------------------------------------
|
|
811 |
|
|
812 |
// test for unsuccessful completion of notify
|
|
813 |
// receive data proactive command request
|
|
814 |
TestNotifyReceiveDataPCmdL(&KChannelDataLength, KErrUnknown);
|
|
815 |
|
|
816 |
CleanupStack::PopAndDestroy(this);
|
|
817 |
|
|
818 |
}
|
|
819 |
|
|
820 |
|
|
821 |
/**
|
|
822 |
@SYMTestCaseID BA-CSAT-SRD-SRDPC-0001b
|
|
823 |
@SYMPREQ 1780
|
|
824 |
@SYMComponent telephony_csat
|
|
825 |
@SYMTestCaseDesc Test support in CSAT for RSat::NotifyReceiveDataPCmd when problems in processing command
|
|
826 |
@SYMTestPriority High
|
|
827 |
@SYMTestActions Invokes RSat::NotifyReceiveDataPCmd
|
|
828 |
@SYMTestExpectedResults Pass
|
|
829 |
@SYMTestType CT
|
|
830 |
*/
|
|
831 |
void CCSatSendReceiveDataFU::TestNotifyReceiveDataPCmd0001bL()
|
|
832 |
{
|
|
833 |
|
|
834 |
OpenEtelServerL(EUseExtendedError);
|
|
835 |
CleanupStack::PushL(TCleanupItem(Cleanup,this));
|
|
836 |
OpenPhoneL();
|
|
837 |
OpenSatL();
|
|
838 |
|
|
839 |
//-------------------------------------------------------------------------
|
|
840 |
// TEST F: Coverage test(s) for RSat::NotifyReceiveDataPCmd
|
|
841 |
//-------------------------------------------------------------------------
|
|
842 |
// containing a self explanatory icon to display to the user, but
|
|
843 |
// requested icon could not be displayed
|
|
844 |
//-------------------------------------------------------------------------
|
|
845 |
|
|
846 |
RSat::TIconQualifier iconQual = RSat::ESelfExplanatory;
|
|
847 |
TestNotifyReceiveDataPCmdL(
|
|
848 |
&KChannelDataLength, &KBasicIconAlpha, NULL, iconQual);
|
|
849 |
|
|
850 |
// generate terminal response to RECEIVE DATA proactive command
|
|
851 |
RSat::TReceiveDataRspV2 resp;
|
|
852 |
resp.SetPCmdNumber(KPCmdNumberOne);
|
|
853 |
resp.iGeneralResult = RSat::KSuccessRequestedIconNotDisplayed;
|
|
854 |
resp.iInfoType = RSat::KChannelData;
|
|
855 |
// fills in recieved data
|
|
856 |
PrepareChannelData(resp.iAdditionalInfo);
|
|
857 |
// fills in the size of available data to recieve
|
|
858 |
resp.iChannelDataLength = 0xFF; // more than 255 bytes still available
|
|
859 |
|
|
860 |
GenerateReceiveDataTerminalResponseL( resp );
|
|
861 |
|
|
862 |
//-------------------------------------------------------------------------
|
|
863 |
// with text & not self-explanatory icon,
|
|
864 |
// requested icon could not be displayed
|
|
865 |
//-------------------------------------------------------------------------
|
|
866 |
|
|
867 |
iconQual = RSat::ENotSelfExplanatory;
|
|
868 |
TestNotifyReceiveDataPCmdL(
|
|
869 |
&KChannelDataLength, &KBasicIconAlpha, NULL, iconQual);
|
|
870 |
|
|
871 |
GenerateReceiveDataTerminalResponseL( resp );
|
|
872 |
|
|
873 |
//-------------------------------------------------------------------------
|
|
874 |
// missing channel data length
|
|
875 |
//-------------------------------------------------------------------------
|
|
876 |
|
|
877 |
// write expected request data in mockLtsy
|
|
878 |
PrepareMockWithExpDataForPCmdNotifyL(KReceiveData);
|
|
879 |
|
|
880 |
// write completion data in mockLtsy to complete notify request
|
|
881 |
// with data missing channel data length
|
|
882 |
PrepareReceiveDataCompleteDataL(NULL);
|
|
883 |
|
|
884 |
// write expected request data in mockLtsy
|
|
885 |
// for terminal response sent by CSAT
|
|
886 |
PrepareTerminalResponseMockDataL(
|
|
887 |
KPCmdNumberOne, KReceiveData, KReceiveDataQualifier,
|
|
888 |
KNullDesC, RSat::KErrorRequiredValuesMissing);
|
|
889 |
|
|
890 |
// send notify recieve data proactive command to CSAT
|
|
891 |
RSat::TReceiveDataV2 receiveData;
|
|
892 |
RSat::TReceiveDataV2Pckg receiveDataPckg(receiveData);
|
|
893 |
|
|
894 |
TRequestStatus requestStatus;
|
|
895 |
iSat.NotifyReceiveDataPCmd(requestStatus, receiveDataPckg);
|
|
896 |
|
|
897 |
// wait for unsuccessful request completion
|
|
898 |
User::WaitForRequest(requestStatus);
|
|
899 |
ASSERT_EQUALS(KErrCorrupt, requestStatus.Int());
|
|
900 |
|
|
901 |
AssertMockLtsyStatusL();
|
|
902 |
|
|
903 |
//-------------------------------------------------------------------------
|
|
904 |
// network unable to process command
|
|
905 |
//-------------------------------------------------------------------------
|
|
906 |
|
|
907 |
// test for successful notify request completion
|
|
908 |
TestNotifyReceiveDataPCmdL(&KChannelDataLength);
|
|
909 |
|
|
910 |
// sent terminal response on the command about
|
|
911 |
// unsupported error due to procesing the command
|
|
912 |
resp.iGeneralResult = RSat::KNetworkUnableToProcessCmd; // invalid for this command
|
|
913 |
resp.iInfoType = RSat::KSatNetworkErrorInfo;
|
|
914 |
resp.iAdditionalInfo.Zero();
|
|
915 |
resp.iAdditionalInfo.Append(KRequestedFacilityNotImplemented);
|
|
916 |
resp.iChannelDataLength = 0;
|
|
917 |
GenerateReceiveDataTerminalResponseL( resp, KErrCorrupt );
|
|
918 |
|
|
919 |
//-------------------------------------------------------------------------
|
|
920 |
// Me unable to process command
|
|
921 |
//-------------------------------------------------------------------------
|
|
922 |
|
|
923 |
// test for successful notify request completion
|
|
924 |
TestNotifyReceiveDataPCmdL(&KChannelDataLength);
|
|
925 |
|
|
926 |
// sent terminal response on the command about
|
|
927 |
// an error due to procesing the command
|
|
928 |
resp.iGeneralResult = RSat::KMeUnableToProcessCmd;
|
|
929 |
resp.iInfoType = RSat::KMeProblem;
|
|
930 |
resp.iAdditionalInfo.Zero();
|
|
931 |
resp.iAdditionalInfo.Append(RSat::KNoSpecificMeProblem);
|
|
932 |
GenerateReceiveDataTerminalResponseL( resp );
|
|
933 |
|
|
934 |
//-------------------------------------------------------------------------
|
|
935 |
// command type not understood
|
|
936 |
//-------------------------------------------------------------------------
|
|
937 |
|
|
938 |
// test for successful notify request completion
|
|
939 |
TestNotifyReceiveDataPCmdL(&KChannelDataLength);
|
|
940 |
|
|
941 |
// sent terminal response on the command about
|
|
942 |
// an error due to procesing the command
|
|
943 |
resp.iGeneralResult = RSat::KCmdTypeNotUnderstood;
|
|
944 |
resp.iInfoType = RSat::KNoAdditionalInfo;
|
|
945 |
resp.iAdditionalInfo.Zero();
|
|
946 |
GenerateReceiveDataTerminalResponseL( resp );
|
|
947 |
|
|
948 |
//-------------------------------------------------------------------------
|
|
949 |
// command data not understood
|
|
950 |
//-------------------------------------------------------------------------
|
|
951 |
|
|
952 |
TestNotifyReceiveDataPCmdL(&KChannelDataLength);
|
|
953 |
|
|
954 |
// sent terminal response on the command about
|
|
955 |
// an error due to procesing the command
|
|
956 |
resp.iGeneralResult = RSat::KCmdDataNotUnderstood;
|
|
957 |
GenerateReceiveDataTerminalResponseL( resp );
|
|
958 |
|
|
959 |
//-------------------------------------------------------------------------
|
|
960 |
// bearer indep protocol error
|
|
961 |
//-------------------------------------------------------------------------
|
|
962 |
|
|
963 |
TestNotifyReceiveDataPCmdL(&KChannelDataLength);
|
|
964 |
|
|
965 |
// sent terminal response on the command about
|
|
966 |
// an error due to procesing the command
|
|
967 |
resp.iGeneralResult = RSat::KBearerIndepProtocolError;
|
|
968 |
resp.iInfoType = RSat::KMeProblem;
|
|
969 |
resp.iAdditionalInfo.Append(RSat::KChannelIdNotValid);
|
|
970 |
GenerateReceiveDataTerminalResponseL( resp );
|
|
971 |
|
|
972 |
//-------------------------------------------------------------------------
|
|
973 |
// command number not known
|
|
974 |
//-------------------------------------------------------------------------
|
|
975 |
|
|
976 |
TestNotifyReceiveDataPCmdL(&KChannelDataLength);
|
|
977 |
|
|
978 |
// sent terminal response on the command about
|
|
979 |
// an error due to procesing the command
|
|
980 |
resp.iGeneralResult = RSat::KCmdNumberNotKnown;
|
|
981 |
resp.iInfoType = RSat::KNoAdditionalInfo;
|
|
982 |
resp.iAdditionalInfo.Zero();
|
|
983 |
GenerateReceiveDataTerminalResponseL( resp );
|
|
984 |
|
|
985 |
//-------------------------------------------------------------------------
|
|
986 |
// command beyond me capabilities
|
|
987 |
//-------------------------------------------------------------------------
|
|
988 |
|
|
989 |
TestNotifyReceiveDataPCmdL(&KChannelDataLength);
|
|
990 |
|
|
991 |
// sent terminal response on the command about
|
|
992 |
// an error due to procesing the command
|
|
993 |
resp.iGeneralResult = RSat::KCmdBeyondMeCapabilities;
|
|
994 |
GenerateReceiveDataTerminalResponseL( resp );
|
|
995 |
|
|
996 |
//-------------------------------------------------------------------------
|
|
997 |
// proactive session terminated by user
|
|
998 |
//-------------------------------------------------------------------------
|
|
999 |
|
|
1000 |
TestNotifyReceiveDataPCmdL(&KChannelDataLength);
|
|
1001 |
|
|
1002 |
// sent terminal response on the command about
|
|
1003 |
// an error due to procesing the command
|
|
1004 |
resp.iGeneralResult = RSat::KPSessionTerminatedByUser;
|
|
1005 |
GenerateReceiveDataTerminalResponseL( resp );
|
|
1006 |
|
|
1007 |
//-------------------------------------------------------------------------
|
|
1008 |
// missing device identities
|
|
1009 |
//-------------------------------------------------------------------------
|
|
1010 |
|
|
1011 |
// write expected notify request data in mockLtsy
|
|
1012 |
PrepareMockWithExpDataForPCmdNotifyL(KReceiveData);
|
|
1013 |
|
|
1014 |
// write completion data in mockLtsy to complete notify request
|
|
1015 |
PrepareReceiveDataCompleteDataL(
|
|
1016 |
KPCmdNumberOne, &KChannelDataLength, NULL, RSat::EIconQualifierNotSet,
|
|
1017 |
KErrNone, KDefaultNoDelay, KDeviceIdNotSet);
|
|
1018 |
|
|
1019 |
// write expected request data in mockLtsy
|
|
1020 |
// for unsuccessful terminal response sent by CSAT
|
|
1021 |
PrepareTerminalResponseMockDataL(
|
|
1022 |
KPCmdNumberOne, KReceiveData, KReceiveDataQualifier,
|
|
1023 |
KNullDesC, RSat::KErrorRequiredValuesMissing);
|
|
1024 |
|
|
1025 |
// send notify request to CSAT
|
|
1026 |
iSat.NotifyReceiveDataPCmd(requestStatus, receiveDataPckg);
|
|
1027 |
|
|
1028 |
// wait for notify request completion
|
|
1029 |
User::WaitForRequest(requestStatus);
|
|
1030 |
ASSERT_EQUALS(KErrCorrupt, requestStatus.Int());
|
|
1031 |
AssertMockLtsyStatusL();
|
|
1032 |
|
|
1033 |
//-------------------------------------------------------------------------
|
|
1034 |
// missing information, successful
|
|
1035 |
//-------------------------------------------------------------------------
|
|
1036 |
|
|
1037 |
TestNotifyReceiveDataPCmdL(&KChannelDataLength);
|
|
1038 |
|
|
1039 |
// sent terminal response on the command about
|
|
1040 |
// an error due to procesing the command
|
|
1041 |
resp.iGeneralResult = RSat::KMissingInformation;
|
|
1042 |
resp.iInfoType = RSat::KChannelData;
|
|
1043 |
// fills in recieved data
|
|
1044 |
PrepareChannelData(resp.iAdditionalInfo);
|
|
1045 |
// fills in the size of available data to recieve
|
|
1046 |
resp.iChannelDataLength = 0xFF; // more than 255 bytes still available
|
|
1047 |
GenerateReceiveDataTerminalResponseL( resp );
|
|
1048 |
|
|
1049 |
//-------------------------------------------------------------------------
|
|
1050 |
// partial comprehension, successful
|
|
1051 |
//-------------------------------------------------------------------------
|
|
1052 |
|
|
1053 |
TestNotifyReceiveDataPCmdL(&KChannelDataLength);
|
|
1054 |
|
|
1055 |
resp.iGeneralResult = RSat::KPartialComprehension;
|
|
1056 |
GenerateReceiveDataTerminalResponseL( resp );
|
|
1057 |
|
|
1058 |
//-------------------------------------------------------------------------
|
|
1059 |
// interaction with CC permanent error
|
|
1060 |
//-------------------------------------------------------------------------
|
|
1061 |
|
|
1062 |
TestNotifyReceiveDataPCmdL(&KChannelDataLength);
|
|
1063 |
|
|
1064 |
// sent terminal response on the command about
|
|
1065 |
// unsupported error due to procesing the command
|
|
1066 |
resp.iGeneralResult = RSat::KInteractionWithCCPermanentError; // invalid for this command
|
|
1067 |
resp.iInfoType = RSat::KMeProblem;
|
|
1068 |
resp.iAdditionalInfo.Zero();
|
|
1069 |
resp.iAdditionalInfo.Append(RSat::KNoSpecificInteractionError);
|
|
1070 |
resp.iChannelDataLength = 0;
|
|
1071 |
GenerateReceiveDataTerminalResponseL( resp, KErrCorrupt );
|
|
1072 |
|
|
1073 |
//-------------------------------------------------------------------------
|
|
1074 |
// Me unable to process command, empty additional info
|
|
1075 |
//-------------------------------------------------------------------------
|
|
1076 |
|
|
1077 |
TestNotifyReceiveDataPCmdL(&KChannelDataLength);
|
|
1078 |
|
|
1079 |
// sent terminal response on the command about
|
|
1080 |
// ME problem due to procesing the command
|
|
1081 |
// without addition info on the problem
|
|
1082 |
resp.iGeneralResult = RSat::KMeUnableToProcessCmd;
|
|
1083 |
resp.iAdditionalInfo.Zero(); // invalid for this command
|
|
1084 |
GenerateReceiveDataTerminalResponseL( resp, KErrCorrupt );
|
|
1085 |
|
|
1086 |
CleanupStack::PopAndDestroy(this);
|
|
1087 |
|
|
1088 |
}
|
|
1089 |
|
|
1090 |
|
|
1091 |
/**
|
|
1092 |
@SYMTestCaseID BA-CSAT-SRD-SRDPC-0002
|
|
1093 |
@SYMPREQ 1780
|
|
1094 |
@SYMComponent telephony_csat
|
|
1095 |
@SYMTestCaseDesc Test support in CSAT for cancelling of RSat::NotifyReceiveDataPCmd
|
|
1096 |
@SYMTestPriority High
|
|
1097 |
@SYMTestActions Invokes cancelling of RSat::NotifyReceiveDataPCmd
|
|
1098 |
@SYMTestExpectedResults Pass
|
|
1099 |
@SYMTestType CT
|
|
1100 |
*/
|
|
1101 |
void CCSatSendReceiveDataFU::TestNotifyReceiveDataPCmd0002L()
|
|
1102 |
{
|
|
1103 |
|
|
1104 |
OpenEtelServerL(EUseExtendedError);
|
|
1105 |
CleanupStack::PushL(TCleanupItem(Cleanup,this));
|
|
1106 |
OpenPhoneL();
|
|
1107 |
OpenSatL();
|
|
1108 |
|
|
1109 |
TRequestStatus mockLtsyStatus;
|
|
1110 |
iMockLTSY.NotifyTerminated(mockLtsyStatus);
|
|
1111 |
|
|
1112 |
//-------------------------------------------------------------------------
|
|
1113 |
// Test cancelling of RSat::NotifyReceiveDataPCmd
|
|
1114 |
//-------------------------------------------------------------------------
|
|
1115 |
|
|
1116 |
// write expected notify request data in mockLtsy
|
|
1117 |
PrepareMockWithExpDataForPCmdNotifyL(KReceiveData);
|
|
1118 |
|
|
1119 |
// write completion data in mockLtsy to complete notify request
|
|
1120 |
|
|
1121 |
// delay for completion is used for make cancel before
|
|
1122 |
// the completion arrives to CSATTSY
|
|
1123 |
PrepareReceiveDataCompleteDataL(&KChannelDataLength, KDefaultDelay);
|
|
1124 |
|
|
1125 |
RSat::TAdditionalInfo addInfo;
|
|
1126 |
addInfo.Append(RSat::KNoSpecificMeProblem);
|
|
1127 |
|
|
1128 |
// write expected request data in mockLtsy
|
|
1129 |
// for unsuccessful terminal response sent by CSAT
|
|
1130 |
// on unsolicited notify request completion
|
|
1131 |
PrepareTerminalResponseMockDataL(
|
|
1132 |
KPCmdNumberOne, KReceiveData, KReceiveDataQualifier,
|
|
1133 |
addInfo, RSat::KMeUnableToProcessCmd);
|
|
1134 |
|
|
1135 |
// send notify request to CSAT
|
|
1136 |
RSat::TReceiveDataV2 receiveData;
|
|
1137 |
RSat::TReceiveDataV2Pckg receiveDataPckg(receiveData);
|
|
1138 |
TRequestStatus requestStatus;
|
|
1139 |
iSat.NotifyReceiveDataPCmd(requestStatus, receiveDataPckg);
|
|
1140 |
|
|
1141 |
// cancel notify request
|
|
1142 |
iSat.CancelAsyncRequest(ESatNotifyReceiveDataPCmd);
|
|
1143 |
|
|
1144 |
// wait for completion of cancelling
|
|
1145 |
User::WaitForRequest(requestStatus);
|
|
1146 |
ASSERT_EQUALS(KErrCancel, requestStatus.Int());
|
|
1147 |
|
|
1148 |
// Wait for completion of request processing by mockLtsy
|
|
1149 |
User::WaitForRequest(mockLtsyStatus);
|
|
1150 |
ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
|
|
1151 |
AssertMockLtsyStatusL();
|
|
1152 |
|
|
1153 |
CleanupStack::PopAndDestroy(this);
|
|
1154 |
|
|
1155 |
}
|
|
1156 |
|
|
1157 |
|
|
1158 |
/**
|
|
1159 |
@SYMTestCaseID BA-CSAT-SRD-SRDPC-0004
|
|
1160 |
@SYMPREQ 1780
|
|
1161 |
@SYMComponent telephony_csat
|
|
1162 |
@SYMTestCaseDesc Test support in CSAT for multiple client requests to RSat::NotifyReceiveDataPCmd
|
|
1163 |
@SYMTestPriority High
|
|
1164 |
@SYMTestActions Invokes multiple client requests to RSat::NotifyReceiveDataPCmd
|
|
1165 |
@SYMTestExpectedResults Pass
|
|
1166 |
@SYMTestType CT
|
|
1167 |
*/
|
|
1168 |
void CCSatSendReceiveDataFU::TestNotifyReceiveDataPCmd0004L()
|
|
1169 |
{
|
|
1170 |
|
|
1171 |
OpenEtelServerL(EUseExtendedError);
|
|
1172 |
CleanupStack::PushL(TCleanupItem(Cleanup,this));
|
|
1173 |
OpenPhoneL();
|
|
1174 |
OpenSatL();
|
|
1175 |
|
|
1176 |
// Open second client
|
|
1177 |
RTelServer telServer2;
|
|
1178 |
TInt ret = telServer2.Connect();
|
|
1179 |
ASSERT_EQUALS(KErrNone, ret);
|
|
1180 |
CleanupClosePushL(telServer2);
|
|
1181 |
|
|
1182 |
RMobilePhone phone2;
|
|
1183 |
ret = phone2.Open(telServer2, KMmTsyPhoneName);
|
|
1184 |
ASSERT_EQUALS(KErrNone, ret);
|
|
1185 |
CleanupClosePushL(phone2);
|
|
1186 |
|
|
1187 |
RSat sat2;
|
|
1188 |
ret = sat2.Open(phone2);
|
|
1189 |
ASSERT_EQUALS(KErrNone, ret);
|
|
1190 |
CleanupClosePushL(sat2);
|
|
1191 |
|
|
1192 |
//-------------------------------------------------------------------------
|
|
1193 |
// Test A: Test multiple clients requesting RSat::NotifyReceiveDataPCmd
|
|
1194 |
// when they both pass the same T-class version
|
|
1195 |
//-------------------------------------------------------------------------
|
|
1196 |
|
|
1197 |
// write expected notify request data in mockLtsy
|
|
1198 |
PrepareMockWithExpDataForPCmdNotifyL(KReceiveData);
|
|
1199 |
|
|
1200 |
// write completion data in mockLtsy to complete notify request
|
|
1201 |
|
|
1202 |
// delay for completion is used for make the 2nd request before
|
|
1203 |
// the completion arrives to CSATTSY
|
|
1204 |
PrepareReceiveDataCompleteDataL(&KChannelDataLength, KDefaultDelay);
|
|
1205 |
|
|
1206 |
// send notify requests to CSAT
|
|
1207 |
RSat::TReceiveDataV2 receiveData;
|
|
1208 |
RSat::TReceiveDataV2 receiveData2;
|
|
1209 |
RSat::TReceiveDataV2Pckg receiveDataPckg(receiveData);
|
|
1210 |
RSat::TReceiveDataV2Pckg receiveData2Pckg(receiveData2);
|
|
1211 |
TRequestStatus requestStatus;
|
|
1212 |
TRequestStatus requestStatus2;
|
|
1213 |
iSat.NotifyReceiveDataPCmd(requestStatus, receiveDataPckg);
|
|
1214 |
sat2.NotifyReceiveDataPCmd(requestStatus2, receiveData2Pckg);
|
|
1215 |
|
|
1216 |
// wait for completion of notify requests
|
|
1217 |
User::WaitForRequest(requestStatus);
|
|
1218 |
User::WaitForRequest(requestStatus2);
|
|
1219 |
|
|
1220 |
// check results
|
|
1221 |
ASSERT_EQUALS(KErrNone, requestStatus.Int());
|
|
1222 |
ASSERT_EQUALS(KPCmdNumberOne, receiveData.PCmdNumber());
|
|
1223 |
ASSERT_EQUALS(RSat::KChannel1, receiveData.iDestination);
|
|
1224 |
ASSERT_EQUALS(KChannelDataLength, receiveData.iChannelDataLength);
|
|
1225 |
ASSERT_TRUE( (RSat::EAlphaIdNotPresent == receiveData.iAlphaId.iStatus) ||
|
|
1226 |
(RSat::EAlphaIdNotSet == receiveData.iAlphaId.iStatus) );
|
|
1227 |
ASSERT_EQUALS(RSat::ENoIconId, receiveData.iIconId.iQualifier);
|
|
1228 |
|
|
1229 |
ASSERT_EQUALS(KErrNone, requestStatus2.Int());
|
|
1230 |
ASSERT_EQUALS(KPCmdNumberOne, receiveData2.PCmdNumber());
|
|
1231 |
ASSERT_EQUALS(RSat::KChannel1, receiveData2.iDestination);
|
|
1232 |
ASSERT_EQUALS(KChannelDataLength, receiveData2.iChannelDataLength);
|
|
1233 |
ASSERT_TRUE( (RSat::EAlphaIdNotPresent == receiveData2.iAlphaId.iStatus) ||
|
|
1234 |
(RSat::EAlphaIdNotSet == receiveData2.iAlphaId.iStatus) );
|
|
1235 |
ASSERT_EQUALS(RSat::ENoIconId, receiveData2.iIconId.iQualifier);
|
|
1236 |
|
|
1237 |
AssertMockLtsyStatusL();
|
|
1238 |
|
|
1239 |
// send terminal response on the proactive command
|
|
1240 |
RSat::TReceiveDataRspV2 resp;
|
|
1241 |
resp.SetPCmdNumber(KPCmdNumberOne);
|
|
1242 |
resp.iGeneralResult = RSat::KSuccess;
|
|
1243 |
resp.iInfoType = RSat::KChannelData;
|
|
1244 |
// fills in recieved data
|
|
1245 |
PrepareChannelData(resp.iAdditionalInfo);
|
|
1246 |
// fills in the size of available data to recieve
|
|
1247 |
resp.iChannelDataLength = 0xFF; // more than 255 bytes are available
|
|
1248 |
|
|
1249 |
// both clients send the terminal response
|
|
1250 |
GenerateReceiveDataTerminalResponseL( resp );
|
|
1251 |
GenerateReceiveDataTerminalResponseL( resp );
|
|
1252 |
|
|
1253 |
//-------------------------------------------------------------------------
|
|
1254 |
// Test B: Test multiple clients requesting RSat::NotifyReceiveDataPCmd
|
|
1255 |
// when they both pass different T-class versions
|
|
1256 |
//-------------------------------------------------------------------------
|
|
1257 |
|
|
1258 |
// When multiple clients requesting RSat::NotifyReceiveDataPCmd and they both pass
|
|
1259 |
// different packaged parameter versions only the last request completes, because
|
|
1260 |
// etel reposts request with new parameter size and looses previous requests.
|
|
1261 |
// May be it would be worth to make ESatNotifyReceiveDataPCmd ipc requests flow controlled
|
|
1262 |
// by CSATTSY instead of multiple completed by ETEL. Similar defects are 51, 58, 71 and 78
|
|
1263 |
ERR_PRINTF2(_L("<font color=Orange>$CSATKnownFailure: defect id = %d</font>"), 86);
|
|
1264 |
ASSERT_TRUE( EFalse );
|
|
1265 |
|
|
1266 |
// write expected notify request data in mockLtsy
|
|
1267 |
PrepareMockWithExpDataForPCmdNotifyL(KReceiveData);
|
|
1268 |
|
|
1269 |
// write completion data in mockLtsy to complete notify request
|
|
1270 |
|
|
1271 |
// delay for completion is used for make the 2nd request before
|
|
1272 |
// the completion arrives to CSATTSY
|
|
1273 |
PrepareReceiveDataCompleteDataL(&KChannelDataLength, KDefaultDelay);
|
|
1274 |
|
|
1275 |
// send notify requests to CSAT
|
|
1276 |
RSat::TReceiveDataV5 receiveDataV5;
|
|
1277 |
RSat::TReceiveDataV5Pckg receiveDataV5Pckg(receiveDataV5);
|
|
1278 |
ResetReceiveData(receiveData);
|
|
1279 |
iSat.NotifyReceiveDataPCmd(requestStatus, receiveDataPckg);
|
|
1280 |
sat2.NotifyReceiveDataPCmd(requestStatus2, receiveDataV5Pckg);
|
|
1281 |
|
|
1282 |
// wait for completion of notify requests
|
|
1283 |
User::WaitForRequest(requestStatus2);
|
|
1284 |
User::WaitForRequest(requestStatus);
|
|
1285 |
|
|
1286 |
// check results
|
|
1287 |
ASSERT_EQUALS(KErrNone, requestStatus.Int());
|
|
1288 |
ASSERT_EQUALS(KPCmdNumberOne, receiveData.PCmdNumber());
|
|
1289 |
ASSERT_EQUALS(RSat::KChannel1, receiveData.iDestination);
|
|
1290 |
ASSERT_EQUALS(KChannelDataLength, receiveData.iChannelDataLength);
|
|
1291 |
ASSERT_TRUE( (RSat::EAlphaIdNotPresent == receiveData.iAlphaId.iStatus) ||
|
|
1292 |
(RSat::EAlphaIdNotSet == receiveData.iAlphaId.iStatus) );
|
|
1293 |
ASSERT_EQUALS(RSat::ENoIconId, receiveData.iIconId.iQualifier);
|
|
1294 |
|
|
1295 |
ASSERT_EQUALS(KErrNone, requestStatus2.Int());
|
|
1296 |
ASSERT_EQUALS(KPCmdNumberOne, receiveDataV5.PCmdNumber());
|
|
1297 |
ASSERT_EQUALS(RSat::KChannel1, receiveDataV5.iDestination);
|
|
1298 |
ASSERT_EQUALS(KChannelDataLength, receiveDataV5.iChannelDataLength);
|
|
1299 |
ASSERT_TRUE( (RSat::EAlphaIdNotPresent == receiveDataV5.iAlphaId.iStatus) ||
|
|
1300 |
(RSat::EAlphaIdNotSet == receiveDataV5.iAlphaId.iStatus) );
|
|
1301 |
ASSERT_EQUALS(RSat::ENoIconId, receiveDataV5.iIconId.iQualifier);
|
|
1302 |
ASSERT_TRUE( RSat::ETextAttributeProvided !=
|
|
1303 |
receiveDataV5.iTextAttribute.iStatus );
|
|
1304 |
|
|
1305 |
AssertMockLtsyStatusL();
|
|
1306 |
|
|
1307 |
// send terminal response on the proactive command
|
|
1308 |
// both clients send the terminal response
|
|
1309 |
GenerateReceiveDataTerminalResponseL( resp );
|
|
1310 |
GenerateReceiveDataTerminalResponseL( resp );
|
|
1311 |
|
|
1312 |
CleanupStack::PopAndDestroy(4, this); // sat2, phone2, telServer2, this
|
|
1313 |
|
|
1314 |
}
|
|
1315 |
|
|
1316 |
|
|
1317 |
/**
|
|
1318 |
@SYMTestCaseID BA-CSAT-SRD-SSDPC-0001
|
|
1319 |
@SYMPREQ 1780
|
|
1320 |
@SYMComponent telephony_csat
|
|
1321 |
@SYMTestCaseDesc Test support in CSAT for RSat::NotifySendDataPCmd
|
|
1322 |
@SYMTestPriority High
|
|
1323 |
@SYMTestActions Invokes RSat::NotifySendDataPCmd
|
|
1324 |
@SYMTestExpectedResults Pass
|
|
1325 |
@SYMTestType CT
|
|
1326 |
*/
|
|
1327 |
void CCSatSendReceiveDataFU::TestNotifySendDataPCmd0001L()
|
|
1328 |
{
|
|
1329 |
|
|
1330 |
OpenEtelServerL(EUseExtendedError);
|
|
1331 |
CleanupStack::PushL(TCleanupItem(Cleanup,this));
|
|
1332 |
OpenPhoneL();
|
|
1333 |
OpenSatL();
|
|
1334 |
|
|
1335 |
//-------------------------------------------------------------------------
|
|
1336 |
// TEST C: Successful completion request of
|
|
1337 |
// RSat::NotifySendDataPCmd
|
|
1338 |
//-------------------------------------------------------------------------
|
|
1339 |
// SEND DATA, immediate mode
|
|
1340 |
//-------------------------------------------------------------------------
|
|
1341 |
|
|
1342 |
// test for successful completion of RSat::NotifySendDataPCmd request
|
|
1343 |
TestNotifySendDataPCmdL( &KChannelData );
|
|
1344 |
|
|
1345 |
// generate terminal response to SEND DATA proactive command
|
|
1346 |
RSat::TSendDataRspV2 resp;
|
|
1347 |
resp.SetPCmdNumber(KPCmdNumberOne);
|
|
1348 |
resp.iGeneralResult = RSat::KSuccess;
|
|
1349 |
resp.iInfoType = RSat::KNoAdditionalInfo;
|
|
1350 |
// fills in available space in the Tx buffer
|
|
1351 |
resp.iChannelDataLength = 0xFF; // more than 255 bytes
|
|
1352 |
GenerateSendDataTerminalResponseL( resp );
|
|
1353 |
|
|
1354 |
//-------------------------------------------------------------------------
|
|
1355 |
// TEST F: Coverage test(s) for RSat::NotifySendDataPCmd
|
|
1356 |
//-------------------------------------------------------------------------
|
|
1357 |
// SEND DATA, Store mode
|
|
1358 |
//-------------------------------------------------------------------------
|
|
1359 |
|
|
1360 |
// test for successful completion of RSat::NotifySendDataPCmd request
|
|
1361 |
TBuf8<KChannelDataLength> channelData;
|
|
1362 |
PrepareChannelData(channelData);
|
|
1363 |
TestNotifySendDataPCmdL( &channelData, KSendDataStoreMode );
|
|
1364 |
|
|
1365 |
// generate terminal response to SEND DATA proactive command
|
|
1366 |
GenerateSendDataTerminalResponseL( resp, KSendDataStoreMode );
|
|
1367 |
|
|
1368 |
//-------------------------------------------------------------------------
|
|
1369 |
// containing text to display to user
|
|
1370 |
//-------------------------------------------------------------------------
|
|
1371 |
|
|
1372 |
_LIT8(KAlphaId, "Send Data");
|
|
1373 |
TestNotifySendDataPCmdL(&KChannelData, &KAlphaId);
|
|
1374 |
|
|
1375 |
GenerateSendDataTerminalResponseL( resp );
|
|
1376 |
|
|
1377 |
//-------------------------------------------------------------------------
|
|
1378 |
// containing text of zero length
|
|
1379 |
//-------------------------------------------------------------------------
|
|
1380 |
|
|
1381 |
TestNotifySendDataPCmdL(&KChannelData, &KNullDesC8);
|
|
1382 |
|
|
1383 |
GenerateSendDataTerminalResponseL( resp );
|
|
1384 |
|
|
1385 |
//-------------------------------------------------------------------------
|
|
1386 |
// containing self explanatory icon to display to user, successful
|
|
1387 |
//-------------------------------------------------------------------------
|
|
1388 |
|
|
1389 |
RSat::TIconQualifier iconQual = RSat::ESelfExplanatory;
|
|
1390 |
TestNotifySendDataPCmdL(&KChannelData, &KBasicIconAlpha, NULL, iconQual);
|
|
1391 |
|
|
1392 |
GenerateSendDataTerminalResponseL( resp );
|
|
1393 |
|
|
1394 |
//-------------------------------------------------------------------------
|
|
1395 |
// containing text & not self-explanatory icon, successful
|
|
1396 |
//-------------------------------------------------------------------------
|
|
1397 |
|
|
1398 |
iconQual = RSat::ENotSelfExplanatory;
|
|
1399 |
TestNotifySendDataPCmdL(&KChannelData, &KBasicIconAlpha, NULL, iconQual);
|
|
1400 |
|
|
1401 |
GenerateSendDataTerminalResponseL( resp );
|
|
1402 |
|
|
1403 |
//-------------------------------------------------------------------------
|
|
1404 |
// successful, UCS2 text in Cyrillic
|
|
1405 |
//-------------------------------------------------------------------------
|
|
1406 |
|
|
1407 |
TestNotifySendDataPCmdL(&KChannelData, &KRussianHello, &KRussianHelloU);
|
|
1408 |
|
|
1409 |
GenerateSendDataTerminalResponseL( resp );
|
|
1410 |
|
|
1411 |
//-------------------------------------------------------------------------
|
|
1412 |
// successful, UCS2 text in Chinese
|
|
1413 |
//-------------------------------------------------------------------------
|
|
1414 |
|
|
1415 |
TestNotifySendDataPCmdL(&KChannelData, &KChineseHello, &KChineseHelloU);
|
|
1416 |
|
|
1417 |
GenerateSendDataTerminalResponseL( resp );
|
|
1418 |
|
|
1419 |
//-------------------------------------------------------------------------
|
|
1420 |
// successful, UCS2 text in Katakana
|
|
1421 |
//-------------------------------------------------------------------------
|
|
1422 |
|
|
1423 |
TestNotifySendDataPCmdL(&KChannelData, &KKatakanaChars, &KKatakanaCharsU);
|
|
1424 |
|
|
1425 |
GenerateSendDataTerminalResponseL( resp );
|
|
1426 |
|
|
1427 |
//-------------------------------------------------------------------------
|
|
1428 |
// TEST E: Unsolicited completion of RSat::NotifySendDataPCmd
|
|
1429 |
// from LTSY.
|
|
1430 |
//-------------------------------------------------------------------------
|
|
1431 |
|
|
1432 |
// write completion data in mockLtsy to complete notify
|
|
1433 |
// send data proactive command request
|
|
1434 |
PrepareSendDataCompleteDataL( &KChannelData );
|
|
1435 |
|
|
1436 |
// write expected request data in mockLtsy
|
|
1437 |
// for terminal response sent by CSAT
|
|
1438 |
RSat::TAdditionalInfo addInfo;
|
|
1439 |
addInfo.Append(RSat::KNoSpecificMeProblem);
|
|
1440 |
PrepareTerminalResponseMockDataL(
|
|
1441 |
KPCmdNumberOne, KSendData, KBipSendDataImmediately,
|
|
1442 |
addInfo, RSat::KMeUnableToProcessCmd);
|
|
1443 |
|
|
1444 |
// wait for completion of requests processing by mockLtsy
|
|
1445 |
WaitForMockLTSYTerminated();
|
|
1446 |
AssertMockLtsyStatusL();
|
|
1447 |
|
|
1448 |
//-------------------------------------------------------------------------
|
|
1449 |
// TEST B: failure on completion of pending request from LTSY->CTSY
|
|
1450 |
//-------------------------------------------------------------------------
|
|
1451 |
|
|
1452 |
// test for unsuccessful completion of notify
|
|
1453 |
// send data proactive command request
|
|
1454 |
TestNotifySendDataPCmdErrorL(&KChannelData, KErrUnknown);
|
|
1455 |
|
|
1456 |
CleanupStack::PopAndDestroy(this);
|
|
1457 |
|
|
1458 |
}
|
|
1459 |
|
|
1460 |
|
|
1461 |
/**
|
|
1462 |
@SYMTestCaseID BA-CSAT-SRD-SSDPC-0001b
|
|
1463 |
@SYMPREQ 1780
|
|
1464 |
@SYMComponent telephony_csat
|
|
1465 |
@SYMTestCaseDesc Test support in CSAT for RSat::NotifySendDataPCmd when problems in processing command
|
|
1466 |
@SYMTestPriority High
|
|
1467 |
@SYMTestActions Invokes RSat::NotifySendDataPCmd
|
|
1468 |
@SYMTestExpectedResults Pass
|
|
1469 |
@SYMTestType CT
|
|
1470 |
*/
|
|
1471 |
void CCSatSendReceiveDataFU::TestNotifySendDataPCmd0001bL()
|
|
1472 |
{
|
|
1473 |
|
|
1474 |
OpenEtelServerL(EUseExtendedError);
|
|
1475 |
CleanupStack::PushL(TCleanupItem(Cleanup,this));
|
|
1476 |
OpenPhoneL();
|
|
1477 |
OpenSatL();
|
|
1478 |
|
|
1479 |
//-------------------------------------------------------------------------
|
|
1480 |
// TEST F: Coverage test(s) for RSat::NotifySendDataPCmd
|
|
1481 |
//-------------------------------------------------------------------------
|
|
1482 |
// Expected Sequence 1.5(ETSI TS 131 124), SEND DATA,
|
|
1483 |
// immediate mode with a bad channel identifier
|
|
1484 |
//-------------------------------------------------------------------------
|
|
1485 |
|
|
1486 |
// test for successful completion of notify request
|
|
1487 |
TestNotifySendDataPCmdL(&KChannelData, RSat::KChannel2);
|
|
1488 |
|
|
1489 |
// send unsuccessful terminal response on the proactive command
|
|
1490 |
RSat::TSendDataRspV2 resp;
|
|
1491 |
resp.SetPCmdNumber(KPCmdNumberOne);
|
|
1492 |
resp.iGeneralResult = RSat::KBearerIndepProtocolError;
|
|
1493 |
resp.iInfoType = RSat::KMeProblem;
|
|
1494 |
resp.iAdditionalInfo.Append(RSat::KChannelIdNotValid);
|
|
1495 |
GenerateSendDataTerminalResponseL( resp );
|
|
1496 |
|
|
1497 |
//-------------------------------------------------------------------------
|
|
1498 |
// self explanatory icon, requested icon could not be displayed, successful
|
|
1499 |
//-------------------------------------------------------------------------
|
|
1500 |
|
|
1501 |
// test for successful completion of notify request
|
|
1502 |
RSat::TIconQualifier iconQual = RSat::ESelfExplanatory;
|
|
1503 |
TestNotifySendDataPCmdL(&KChannelData, &KBasicIconAlpha, NULL, iconQual);
|
|
1504 |
|
|
1505 |
// send terminal response
|
|
1506 |
resp.iGeneralResult = RSat::KSuccessRequestedIconNotDisplayed;
|
|
1507 |
resp.iInfoType = RSat::KNoAdditionalInfo;
|
|
1508 |
resp.iAdditionalInfo.Zero();
|
|
1509 |
// fills in available space in the Tx buffer
|
|
1510 |
resp.iChannelDataLength = 0xFF; // more than 255 bytes
|
|
1511 |
GenerateSendDataTerminalResponseL( resp );
|
|
1512 |
|
|
1513 |
//-------------------------------------------------------------------------
|
|
1514 |
// Alpha identifier & BASIC-ICON, not self-explanatory,
|
|
1515 |
// requested icon could not be displayed
|
|
1516 |
//-------------------------------------------------------------------------
|
|
1517 |
|
|
1518 |
iconQual = RSat::ENotSelfExplanatory;
|
|
1519 |
TestNotifySendDataPCmdL(&KChannelData, &KBasicIconAlpha, NULL, iconQual);
|
|
1520 |
|
|
1521 |
GenerateSendDataTerminalResponseL( resp );
|
|
1522 |
|
|
1523 |
//-------------------------------------------------------------------------
|
|
1524 |
// missing channel data
|
|
1525 |
//-------------------------------------------------------------------------
|
|
1526 |
|
|
1527 |
// write expected notify request data in mockLtsy
|
|
1528 |
PrepareMockWithExpDataForPCmdNotifyL(KSendData);
|
|
1529 |
|
|
1530 |
// write completion data in mockLtsy to complete notify
|
|
1531 |
// send data proactive command request
|
|
1532 |
// with missing channel data
|
|
1533 |
PrepareSendDataCompleteDataL( NULL );
|
|
1534 |
|
|
1535 |
// write expected request data in mockLtsy
|
|
1536 |
// for terminal response sent by CSAT
|
|
1537 |
PrepareTerminalResponseMockDataL(
|
|
1538 |
KPCmdNumberOne, KSendData, KBipSendDataImmediately,
|
|
1539 |
KNullDesC, RSat::KErrorRequiredValuesMissing);
|
|
1540 |
|
|
1541 |
// send notify request
|
|
1542 |
RSat::TSendDataV2 sendData;
|
|
1543 |
RSat::TSendDataV2Pckg sendDataPckg(sendData);
|
|
1544 |
TRequestStatus requestStatus;
|
|
1545 |
iSat.NotifySendDataPCmd(requestStatus, sendDataPckg);
|
|
1546 |
|
|
1547 |
// wait for notify request completion
|
|
1548 |
User::WaitForRequest(requestStatus);
|
|
1549 |
ASSERT_EQUALS(KErrCorrupt, requestStatus.Int());
|
|
1550 |
AssertMockLtsyStatusL();
|
|
1551 |
|
|
1552 |
//-------------------------------------------------------------------------
|
|
1553 |
// network unable to process cmd
|
|
1554 |
//-------------------------------------------------------------------------
|
|
1555 |
|
|
1556 |
TestNotifySendDataPCmdL( &KChannelData );
|
|
1557 |
|
|
1558 |
// sent terminal response on the command about
|
|
1559 |
// an error due to procesing the command
|
|
1560 |
resp.iGeneralResult = RSat::KNetworkUnableToProcessCmd;
|
|
1561 |
resp.iInfoType = RSat::KSatNetworkErrorInfo;
|
|
1562 |
resp.iAdditionalInfo.Append(KRequestedFacilityNotImplemented);
|
|
1563 |
resp.iChannelDataLength = 0;
|
|
1564 |
GenerateSendDataTerminalResponseL( resp );
|
|
1565 |
|
|
1566 |
//-------------------------------------------------------------------------
|
|
1567 |
// command type not understood
|
|
1568 |
//-------------------------------------------------------------------------
|
|
1569 |
|
|
1570 |
TestNotifySendDataPCmdL( &KChannelData );
|
|
1571 |
|
|
1572 |
// sent terminal response on the command about
|
|
1573 |
// an error due to procesing the command
|
|
1574 |
resp.iGeneralResult = RSat::KCmdTypeNotUnderstood;
|
|
1575 |
resp.iInfoType = RSat::KNoAdditionalInfo;
|
|
1576 |
resp.iAdditionalInfo.Zero();
|
|
1577 |
GenerateSendDataTerminalResponseL( resp );
|
|
1578 |
|
|
1579 |
//-------------------------------------------------------------------------
|
|
1580 |
// command data not understood
|
|
1581 |
//-------------------------------------------------------------------------
|
|
1582 |
|
|
1583 |
TestNotifySendDataPCmdL( &KChannelData );
|
|
1584 |
|
|
1585 |
// sent terminal response on the command about
|
|
1586 |
// an error due to procesing the command
|
|
1587 |
resp.iGeneralResult = RSat::KCmdDataNotUnderstood;
|
|
1588 |
GenerateSendDataTerminalResponseL( resp );
|
|
1589 |
|
|
1590 |
//-------------------------------------------------------------------------
|
|
1591 |
// bearer indep protocol error
|
|
1592 |
//-------------------------------------------------------------------------
|
|
1593 |
|
|
1594 |
TestNotifySendDataPCmdL( &KChannelData );
|
|
1595 |
|
|
1596 |
// sent terminal response on the command about
|
|
1597 |
// an error due to procesing the command
|
|
1598 |
resp.iGeneralResult = RSat::KBearerIndepProtocolError;
|
|
1599 |
resp.iInfoType = RSat::KMeProblem;
|
|
1600 |
resp.iAdditionalInfo.Append(RSat::KChannelIdNotValid);
|
|
1601 |
GenerateSendDataTerminalResponseL( resp );
|
|
1602 |
|
|
1603 |
//-------------------------------------------------------------------------
|
|
1604 |
// command number not known
|
|
1605 |
//-------------------------------------------------------------------------
|
|
1606 |
|
|
1607 |
TestNotifySendDataPCmdL( &KChannelData );
|
|
1608 |
|
|
1609 |
// sent terminal response on the command about
|
|
1610 |
// an error due to procesing the command
|
|
1611 |
resp.iGeneralResult = RSat::KCmdNumberNotKnown;
|
|
1612 |
resp.iInfoType = RSat::KNoAdditionalInfo;
|
|
1613 |
resp.iAdditionalInfo.Zero();
|
|
1614 |
GenerateSendDataTerminalResponseL( resp );
|
|
1615 |
|
|
1616 |
//-------------------------------------------------------------------------
|
|
1617 |
// command beyond me capabilities
|
|
1618 |
//-------------------------------------------------------------------------
|
|
1619 |
|
|
1620 |
TestNotifySendDataPCmdL( &KChannelData );
|
|
1621 |
|
|
1622 |
// sent terminal response on the command about
|
|
1623 |
// an error due to procesing the command
|
|
1624 |
resp.iGeneralResult = RSat::KCmdBeyondMeCapabilities;
|
|
1625 |
GenerateSendDataTerminalResponseL( resp );
|
|
1626 |
|
|
1627 |
//-------------------------------------------------------------------------
|
|
1628 |
// proactive session terminated by user
|
|
1629 |
//-------------------------------------------------------------------------
|
|
1630 |
|
|
1631 |
TestNotifySendDataPCmdL( &KChannelData );
|
|
1632 |
|
|
1633 |
// sent terminal response on the command about
|
|
1634 |
// an error due to procesing the command
|
|
1635 |
resp.iGeneralResult = RSat::KPSessionTerminatedByUser;
|
|
1636 |
GenerateSendDataTerminalResponseL( resp );
|
|
1637 |
|
|
1638 |
//-------------------------------------------------------------------------
|
|
1639 |
// missing device identities
|
|
1640 |
//-------------------------------------------------------------------------
|
|
1641 |
|
|
1642 |
// write expected notify request data in mockLtsy
|
|
1643 |
PrepareMockWithExpDataForPCmdNotifyL(KSendData);
|
|
1644 |
|
|
1645 |
// write completion data in mockLtsy to complete notify request
|
|
1646 |
PrepareSendDataCompleteDataL(
|
|
1647 |
&KChannelData, KPCmdNumberOne, KBipSendDataImmediately, KDeviceIdNotSet,
|
|
1648 |
NULL, RSat::EIconQualifierNotSet, KErrNone, KDefaultNoDelay);
|
|
1649 |
|
|
1650 |
// write expected request data in mockLtsy
|
|
1651 |
// for unsuccessful terminal response sent by CSAT
|
|
1652 |
PrepareTerminalResponseMockDataL(
|
|
1653 |
KPCmdNumberOne, KSendData, KBipSendDataImmediately,
|
|
1654 |
KNullDesC, RSat::KErrorRequiredValuesMissing);
|
|
1655 |
|
|
1656 |
// send notify request to CSAT
|
|
1657 |
iSat.NotifySendDataPCmd(requestStatus, sendDataPckg);
|
|
1658 |
|
|
1659 |
// wait for notify request completion
|
|
1660 |
User::WaitForRequest(requestStatus);
|
|
1661 |
ASSERT_EQUALS(KErrCorrupt, requestStatus.Int());
|
|
1662 |
AssertMockLtsyStatusL();
|
|
1663 |
|
|
1664 |
//-------------------------------------------------------------------------
|
|
1665 |
// Me unable to process command, empty additional info
|
|
1666 |
//-------------------------------------------------------------------------
|
|
1667 |
|
|
1668 |
TestNotifySendDataPCmdL( &KChannelData );
|
|
1669 |
|
|
1670 |
// sent terminal response on the command about
|
|
1671 |
// ME problem due to procesing the command
|
|
1672 |
// without addition info on the problem
|
|
1673 |
resp.iGeneralResult = RSat::KMeUnableToProcessCmd;
|
|
1674 |
resp.iInfoType = RSat::KMeProblem;
|
|
1675 |
GenerateSendDataTerminalResponseL( resp, KBipSendDataImmediately, KErrCorrupt );
|
|
1676 |
|
|
1677 |
//-------------------------------------------------------------------------
|
|
1678 |
// interaction with CC permanent error
|
|
1679 |
//-------------------------------------------------------------------------
|
|
1680 |
|
|
1681 |
TestNotifySendDataPCmdL( &KChannelData );
|
|
1682 |
|
|
1683 |
// sent terminal response on the command about
|
|
1684 |
// unsupported error due to procesing the command
|
|
1685 |
resp.iGeneralResult = RSat::KInteractionWithCCPermanentError; // invalid for this command
|
|
1686 |
resp.iAdditionalInfo.Zero();
|
|
1687 |
resp.iAdditionalInfo.Append(RSat::KNoSpecificInteractionError);
|
|
1688 |
GenerateSendDataTerminalResponseL( resp, KBipSendDataImmediately, KErrCorrupt );
|
|
1689 |
|
|
1690 |
//-------------------------------------------------------------------------
|
|
1691 |
// missing information ( successful )
|
|
1692 |
//-------------------------------------------------------------------------
|
|
1693 |
|
|
1694 |
TestNotifySendDataPCmdL( &KChannelData );
|
|
1695 |
|
|
1696 |
// sent terminal response on the command about
|
|
1697 |
// an error due to procesing the command
|
|
1698 |
resp.iGeneralResult = RSat::KMissingInformation;
|
|
1699 |
resp.iInfoType = RSat::KNoAdditionalInfo;
|
|
1700 |
resp.iAdditionalInfo.Zero();
|
|
1701 |
resp.iChannelDataLength = 0xFF;
|
|
1702 |
|
|
1703 |
GenerateSendDataTerminalResponseL( resp );
|
|
1704 |
|
|
1705 |
//-------------------------------------------------------------------------
|
|
1706 |
// partial comprehension ( successful )
|
|
1707 |
//-------------------------------------------------------------------------
|
|
1708 |
|
|
1709 |
TestNotifySendDataPCmdL( &KChannelData );
|
|
1710 |
|
|
1711 |
// sent terminal response on the command about
|
|
1712 |
// an error due to procesing the command
|
|
1713 |
resp.iGeneralResult = RSat::KPartialComprehension;
|
|
1714 |
GenerateSendDataTerminalResponseL( resp );
|
|
1715 |
|
|
1716 |
CleanupStack::PopAndDestroy(this);
|
|
1717 |
|
|
1718 |
}
|
|
1719 |
|
|
1720 |
|
|
1721 |
/**
|
|
1722 |
@SYMTestCaseID BA-CSAT-SRD-SSDPC-0002
|
|
1723 |
@SYMPREQ 1780
|
|
1724 |
@SYMComponent telephony_csat
|
|
1725 |
@SYMTestCaseDesc Test support in CSAT for cancelling of RSat::NotifySendDataPCmd
|
|
1726 |
@SYMTestPriority High
|
|
1727 |
@SYMTestActions Invokes cancelling of RSat::NotifySendDataPCmd
|
|
1728 |
@SYMTestExpectedResults Pass
|
|
1729 |
@SYMTestType CT
|
|
1730 |
*/
|
|
1731 |
void CCSatSendReceiveDataFU::TestNotifySendDataPCmd0002L()
|
|
1732 |
{
|
|
1733 |
|
|
1734 |
OpenEtelServerL(EUseExtendedError);
|
|
1735 |
CleanupStack::PushL(TCleanupItem(Cleanup,this));
|
|
1736 |
OpenPhoneL();
|
|
1737 |
OpenSatL();
|
|
1738 |
|
|
1739 |
TRequestStatus mockLtsyStatus;
|
|
1740 |
iMockLTSY.NotifyTerminated(mockLtsyStatus);
|
|
1741 |
|
|
1742 |
//-------------------------------------------------------------------------
|
|
1743 |
// Test cancelling of RSat::NotifySendDataPCmd
|
|
1744 |
//-------------------------------------------------------------------------
|
|
1745 |
|
|
1746 |
// write expected notify request data in mockLtsy
|
|
1747 |
PrepareMockWithExpDataForPCmdNotifyL(KSendData);
|
|
1748 |
|
|
1749 |
// write completion data in mockLtsy to complete notify request
|
|
1750 |
|
|
1751 |
// delay for completion is used for make cancel before
|
|
1752 |
// the completion arrives to CSATTSY
|
|
1753 |
PrepareSendDataCompleteDataL(&KChannelData, KDefaultDelay);
|
|
1754 |
|
|
1755 |
// write expected request data in mockLtsy
|
|
1756 |
// for unsuccessful terminal response sent by CSAT
|
|
1757 |
// on unsolicited notify request completion
|
|
1758 |
RSat::TAdditionalInfo addInfo;
|
|
1759 |
addInfo.Append(RSat::KNoSpecificMeProblem);
|
|
1760 |
PrepareTerminalResponseMockDataL(
|
|
1761 |
KPCmdNumberOne, KSendData, KBipSendDataImmediately,
|
|
1762 |
addInfo, RSat::KMeUnableToProcessCmd);
|
|
1763 |
|
|
1764 |
// send notify request to CSAT
|
|
1765 |
RSat::TSendDataV2 sendData;
|
|
1766 |
RSat::TSendDataV2Pckg sendDataPckg(sendData);
|
|
1767 |
TRequestStatus requestStatus;
|
|
1768 |
iSat.NotifySendDataPCmd(requestStatus, sendDataPckg);
|
|
1769 |
|
|
1770 |
// cancel notify request
|
|
1771 |
iSat.CancelAsyncRequest(ESatNotifySendDataPCmd);
|
|
1772 |
|
|
1773 |
// wait for completion of cancelling
|
|
1774 |
User::WaitForRequest(requestStatus);
|
|
1775 |
ASSERT_EQUALS(KErrCancel, requestStatus.Int());
|
|
1776 |
|
|
1777 |
// Wait for completion of request processing by mockLtsy
|
|
1778 |
User::WaitForRequest(mockLtsyStatus);
|
|
1779 |
ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
|
|
1780 |
AssertMockLtsyStatusL();
|
|
1781 |
|
|
1782 |
CleanupStack::PopAndDestroy(this);
|
|
1783 |
|
|
1784 |
}
|
|
1785 |
|
|
1786 |
|
|
1787 |
/**
|
|
1788 |
@SYMTestCaseID BA-CSAT-SRD-SSDPC-0004
|
|
1789 |
@SYMPREQ 1780
|
|
1790 |
@SYMComponent telephony_csat
|
|
1791 |
@SYMTestCaseDesc Test support in CSAT for multiple client requests to RSat::NotifySendDataPCmd
|
|
1792 |
@SYMTestPriority High
|
|
1793 |
@SYMTestActions Invokes multiple client requests to RSat::NotifySendDataPCmd
|
|
1794 |
@SYMTestExpectedResults Pass
|
|
1795 |
@SYMTestType CT
|
|
1796 |
*/
|
|
1797 |
void CCSatSendReceiveDataFU::TestNotifySendDataPCmd0004L()
|
|
1798 |
{
|
|
1799 |
|
|
1800 |
OpenEtelServerL(EUseExtendedError);
|
|
1801 |
CleanupStack::PushL(TCleanupItem(Cleanup,this));
|
|
1802 |
OpenPhoneL();
|
|
1803 |
OpenSatL();
|
|
1804 |
|
|
1805 |
// Open second client
|
|
1806 |
RTelServer telServer2;
|
|
1807 |
TInt ret = telServer2.Connect();
|
|
1808 |
ASSERT_EQUALS(KErrNone, ret);
|
|
1809 |
CleanupClosePushL(telServer2);
|
|
1810 |
|
|
1811 |
RMobilePhone phone2;
|
|
1812 |
ret = phone2.Open(telServer2, KMmTsyPhoneName);
|
|
1813 |
ASSERT_EQUALS(KErrNone, ret);
|
|
1814 |
CleanupClosePushL(phone2);
|
|
1815 |
|
|
1816 |
RSat sat2;
|
|
1817 |
ret = sat2.Open(phone2);
|
|
1818 |
ASSERT_EQUALS(KErrNone, ret);
|
|
1819 |
CleanupClosePushL(sat2);
|
|
1820 |
|
|
1821 |
//-------------------------------------------------------------------------
|
|
1822 |
// Test A: Test multiple clients requesting RSat::NotifySendDataPCmd
|
|
1823 |
// when they both pass the same T-class version
|
|
1824 |
//-------------------------------------------------------------------------
|
|
1825 |
|
|
1826 |
// write expected notify request data in mockLtsy
|
|
1827 |
PrepareMockWithExpDataForPCmdNotifyL(KSendData);
|
|
1828 |
|
|
1829 |
// write completion data in mockLtsy to complete notify request
|
|
1830 |
|
|
1831 |
// delay for completion is used for make the 2nd request before
|
|
1832 |
// the completion arrives to CSATTSY
|
|
1833 |
PrepareSendDataCompleteDataL(&KChannelData, KDefaultDelay);
|
|
1834 |
|
|
1835 |
// send notify requests to CSAT
|
|
1836 |
RSat::TSendDataV2 sendData;
|
|
1837 |
RSat::TSendDataV2 sendData2;
|
|
1838 |
RSat::TSendDataV2Pckg sendDataPckg(sendData);
|
|
1839 |
RSat::TSendDataV2Pckg sendDataPckg2(sendData2);
|
|
1840 |
TRequestStatus requestStatus;
|
|
1841 |
TRequestStatus requestStatus2;
|
|
1842 |
iSat.NotifySendDataPCmd(requestStatus, sendDataPckg);
|
|
1843 |
sat2.NotifySendDataPCmd(requestStatus2, sendDataPckg2);
|
|
1844 |
|
|
1845 |
// wait for completion of notify requests
|
|
1846 |
User::WaitForRequest(requestStatus);
|
|
1847 |
User::WaitForRequest(requestStatus2);
|
|
1848 |
|
|
1849 |
// check results
|
|
1850 |
ASSERT_EQUALS(KErrNone, requestStatus.Int());
|
|
1851 |
ASSERT_EQUALS(KPCmdNumberOne, sendData.PCmdNumber());
|
|
1852 |
ASSERT_EQUALS(RSat::KChannel1, sendData.iDestination);
|
|
1853 |
ASSERT_EQUALS(RSat::ESendDataImmediately, sendData.iMode);
|
|
1854 |
ASSERT_EQUALS( 0, KChannelData().Compare(sendData.iChannelData) );
|
|
1855 |
ASSERT_TRUE( (RSat::EAlphaIdNotPresent == sendData.iAlphaId.iStatus) ||
|
|
1856 |
(RSat::EAlphaIdNotSet == sendData.iAlphaId.iStatus) );
|
|
1857 |
ASSERT_EQUALS(RSat::ENoIconId, sendData.iIconId.iQualifier);
|
|
1858 |
|
|
1859 |
ASSERT_EQUALS(KErrNone, requestStatus2.Int());
|
|
1860 |
ASSERT_EQUALS(KPCmdNumberOne, sendData2.PCmdNumber());
|
|
1861 |
ASSERT_EQUALS(RSat::KChannel1, sendData2.iDestination);
|
|
1862 |
ASSERT_EQUALS(RSat::ESendDataImmediately, sendData2.iMode);
|
|
1863 |
ASSERT_EQUALS( 0, KChannelData().Compare(sendData2.iChannelData) );
|
|
1864 |
ASSERT_TRUE( (RSat::EAlphaIdNotPresent == sendData2.iAlphaId.iStatus) ||
|
|
1865 |
(RSat::EAlphaIdNotSet == sendData2.iAlphaId.iStatus) );
|
|
1866 |
ASSERT_EQUALS(RSat::ENoIconId, sendData2.iIconId.iQualifier);
|
|
1867 |
|
|
1868 |
AssertMockLtsyStatusL();
|
|
1869 |
|
|
1870 |
// send terminal response on the proactive command
|
|
1871 |
RSat::TSendDataRspV2 resp;
|
|
1872 |
resp.SetPCmdNumber(KPCmdNumberOne);
|
|
1873 |
resp.iGeneralResult = RSat::KSuccess;
|
|
1874 |
resp.iInfoType = RSat::KNoAdditionalInfo;
|
|
1875 |
// more than 255 bytes of space available in the Tx buffer
|
|
1876 |
resp.iChannelDataLength = 0xFF;
|
|
1877 |
|
|
1878 |
// both clients send the terminal response
|
|
1879 |
GenerateSendDataTerminalResponseL( resp );
|
|
1880 |
GenerateSendDataTerminalResponseL( resp );
|
|
1881 |
|
|
1882 |
//-------------------------------------------------------------------------
|
|
1883 |
// Test B: Test multiple clients requesting RSat::NotifySendDataPCmd
|
|
1884 |
// when they both pass different T-class versions
|
|
1885 |
//-------------------------------------------------------------------------
|
|
1886 |
|
|
1887 |
// When multiple clients requesting RSat::NotifySendDataPCmd and they both
|
|
1888 |
// pass different packaged parameter versions only the last request completes,
|
|
1889 |
// because etel reposts request with new parameter size and looses previous
|
|
1890 |
// requests. May be it would be worth to make ESatNotifySendDataPCmd ipc
|
|
1891 |
// requests flow controlled by CSATTSY instead of multiple completed by ETEL.
|
|
1892 |
// Similar defects are 51, 58, 71, 78 and 86
|
|
1893 |
ERR_PRINTF2(_L("<font color=Orange>$CSATKnownFailure: defect id = %d</font>"), 90);
|
|
1894 |
ASSERT_TRUE( EFalse );
|
|
1895 |
|
|
1896 |
// write expected notify request data in mockLtsy
|
|
1897 |
PrepareMockWithExpDataForPCmdNotifyL(KSendData);
|
|
1898 |
|
|
1899 |
// write completion data in mockLtsy to complete notify request
|
|
1900 |
|
|
1901 |
// delay for completion is used for make the 2nd request before
|
|
1902 |
// the completion arrives to CSATTSY
|
|
1903 |
PrepareSendDataCompleteDataL(&KChannelData, KDefaultDelay);
|
|
1904 |
|
|
1905 |
// send notify requests to CSAT
|
|
1906 |
RSat::TSendDataV5 sendDataV5;
|
|
1907 |
RSat::TSendDataV5Pckg sendDataV5Pckg(sendDataV5);
|
|
1908 |
ResetSendData(sendData);
|
|
1909 |
iSat.NotifySendDataPCmd(requestStatus, sendDataPckg);
|
|
1910 |
sat2.NotifySendDataPCmd(requestStatus2, sendDataV5Pckg);
|
|
1911 |
|
|
1912 |
// wait for completion of notify requests
|
|
1913 |
User::WaitForRequest(requestStatus2);
|
|
1914 |
User::WaitForRequest(requestStatus);
|
|
1915 |
|
|
1916 |
// check results
|
|
1917 |
ASSERT_EQUALS(KErrNone, requestStatus.Int());
|
|
1918 |
ASSERT_EQUALS(KPCmdNumberOne, sendData.PCmdNumber());
|
|
1919 |
ASSERT_EQUALS(RSat::KChannel1, sendData.iDestination);
|
|
1920 |
ASSERT_EQUALS(RSat::ESendDataImmediately, sendData.iMode);
|
|
1921 |
ASSERT_EQUALS( 0, KChannelData().Compare(sendData.iChannelData) );
|
|
1922 |
ASSERT_TRUE( (RSat::EAlphaIdNotPresent == sendData.iAlphaId.iStatus) ||
|
|
1923 |
(RSat::EAlphaIdNotSet == sendData.iAlphaId.iStatus) );
|
|
1924 |
ASSERT_EQUALS(RSat::ENoIconId, sendData.iIconId.iQualifier);
|
|
1925 |
|
|
1926 |
ASSERT_EQUALS(KErrNone, requestStatus2.Int());
|
|
1927 |
ASSERT_EQUALS(KPCmdNumberOne, sendDataV5.PCmdNumber());
|
|
1928 |
ASSERT_EQUALS(RSat::KChannel1, sendDataV5.iDestination);
|
|
1929 |
ASSERT_EQUALS(RSat::ESendDataImmediately, sendDataV5.iMode);
|
|
1930 |
ASSERT_EQUALS( 0, KChannelData().Compare(sendDataV5.iChannelData) );
|
|
1931 |
ASSERT_TRUE( (RSat::EAlphaIdNotPresent == sendDataV5.iAlphaId.iStatus) ||
|
|
1932 |
(RSat::EAlphaIdNotSet == sendDataV5.iAlphaId.iStatus) );
|
|
1933 |
ASSERT_EQUALS(RSat::ENoIconId, sendDataV5.iIconId.iQualifier);
|
|
1934 |
ASSERT_TRUE( RSat::ETextAttributeProvided !=
|
|
1935 |
sendDataV5.iTextAttribute.iStatus );
|
|
1936 |
|
|
1937 |
AssertMockLtsyStatusL();
|
|
1938 |
|
|
1939 |
// send terminal response on the proactive command
|
|
1940 |
// both clients send the terminal response
|
|
1941 |
GenerateSendDataTerminalResponseL( resp );
|
|
1942 |
GenerateSendDataTerminalResponseL( resp );
|
|
1943 |
|
|
1944 |
CleanupStack::PopAndDestroy(4, this); // sat2, phone2, telServer2, this
|
|
1945 |
|
|
1946 |
}
|
|
1947 |
|
|
1948 |
|