telephonyserverplugins/simatktsy/tests/src/ccsatgetinputfu.cpp
changeset 0 3553901f7fa8
equal deleted inserted replaced
-1:000000000000 0:3553901f7fa8
       
     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 GetInput in the SAT.
       
    20 */
       
    21 
       
    22 #include <cstktsy/bertlv_defs.h>
       
    23 #include <etel.h>
       
    24 #include <etelmm.h>
       
    25 #include <etelsat.h>
       
    26 #include <ctsy/serviceapi/gsmerror.h>
       
    27 #include <ctsy/mmtsy_names.h>
       
    28 #include <satcs.h>
       
    29 
       
    30 #include <ctsy/ltsy/mltsydispatchsatinterface.h>
       
    31 #include <test/tmockltsydata.h>
       
    32 #include <cstktsy/ttlv.h>
       
    33 
       
    34 #include "ccsatgetinputfu.h"
       
    35 
       
    36 
       
    37 CTestSuite* CCSatGetInputFU::CreateSuiteL(const TDesC& aName)
       
    38 	{
       
    39 	SUB_SUITE;
       
    40 	
       
    41 	ADD_TEST_STEP_ISO_CPP(CCSatGetInputFU, TestNotifyGetInputPCmd0001L);
       
    42 	ADD_TEST_STEP_ISO_CPP(CCSatGetInputFU, TestNotifyGetInputPCmd0001bL);
       
    43 	ADD_TEST_STEP_ISO_CPP(CCSatGetInputFU, TestNotifyGetInputPCmd0002L);
       
    44 	ADD_TEST_STEP_ISO_CPP(CCSatGetInputFU, TestNotifyGetInputPCmd0004L);
       
    45 
       
    46 	END_SUITE;
       
    47 	}
       
    48 
       
    49 
       
    50 /**
       
    51 Fills in a Tlv with command details and device identities for GetInput proactive command
       
    52 @param aTlv Tlv to fill in
       
    53 @param aPCmdNumber proactive command number
       
    54 @param aCommandQualifier GetInput proactive command qualifier
       
    55 */
       
    56 void GetInputProactiveCmdTlvBegin( 
       
    57 		TTlv& aTlv, 
       
    58 		TUint8 aPCmdNumber,
       
    59 		TUint8 aCommandQualifier)
       
    60 	{
       
    61 	ProactiveCmdTlvBegin( aTlv, aPCmdNumber, KGetInput, aCommandQualifier, KMe );
       
    62 	}
       
    63 
       
    64 
       
    65 /**
       
    66 Prepares a default GetInput data from the data to compare with lately in binary mode,
       
    67 so that the data coincides in the fields whos default values is not specified by standards
       
    68 (e.g. the rest of buffers)
       
    69 @param aDefGetInpData GetInput structure to fill in the default data
       
    70 @param aGetInpData GetInput structure containing the default values that is not specified by standards
       
    71 */
       
    72 void PrepareDefaultGetInpData(RSat::TGetInputV1& aDefGetInpData, const RSat::TGetInputV1& aGetInpData)
       
    73 	{
       
    74 	Mem::Copy(&aDefGetInpData, &aGetInpData, sizeof(RSat::TGetInputV1));
       
    75 
       
    76 	aDefGetInpData.iText.Zero();
       
    77 	aDefGetInpData.iInputDisplayOption = RSat::EDisplayUserInput;
       
    78 	aDefGetInpData.iRspFormat = RSat::EDigitOnlyUnpacked;
       
    79 	aDefGetInpData.iRspLength.iMinRspLength = 0;
       
    80 	aDefGetInpData.iRspLength.iMaxRspLength = 0;
       
    81 	aDefGetInpData.iDefaultText.Zero();
       
    82 	aDefGetInpData.iIconId.iQualifier = RSat::ENoIconId;
       
    83 	aDefGetInpData.iHelp = RSat::ENoHelpAvailable;
       
    84 	}
       
    85 
       
    86 
       
    87 /**
       
    88 Test support in SATTSY for successful RSat::NotifyGetInputPCmd request without terminal response generation
       
    89 @param aPCmdNumber proactive command number
       
    90 @param aGetInputQualifier GetInput proactive command qualifier
       
    91 @param aGetInputText text for the Terminal to display in conjunction with asking the user to respond
       
    92 @param aMinRspLength minimum length of the user response
       
    93 @param aMaxRspLength maximum length of the user response
       
    94 */
       
    95 void CCSatGetInputFU::TestGetInputSuccessfulWithoutTerminalResponseL(
       
    96 		TUint8 aPCmdNumber,
       
    97 		TUint8 aGetInputQualifier,
       
    98 		const TDesC8& aGetInputText,
       
    99 		TUint8 aMinRspLength,
       
   100 		TUint8 aMaxRspLength)
       
   101 	{
       
   102 	PrepareMockWithExpDataForPCmdNotifyL(KGetInput);
       
   103 
       
   104 	RSat::TGetInputV1 getInpData;
       
   105 	RSat::TGetInputV1Pckg getInpDataPckg(getInpData);
       
   106 	TRequestStatus requestStatus;
       
   107 	iSat.NotifyGetInputPCmd(requestStatus, getInpDataPckg);
       
   108 
       
   109 	TTlv getInpTlv;
       
   110 	GetInputProactiveCmdTlvBegin( getInpTlv, aPCmdNumber, aGetInputQualifier );
       
   111 	
       
   112 	getInpTlv.AddTag(KTlvTextStringTag);
       
   113 	getInpTlv.AddByte(K8BitDCS); //ETLV_DataCodingScheme
       
   114 	getInpTlv.AddData(aGetInputText);
       
   115 	
       
   116 	getInpTlv.AddTag(KTlvResponseLengthTag);
       
   117 	getInpTlv.AddByte(aMinRspLength); //ETLV_MinimumLengthOfResponse
       
   118 	getInpTlv.AddByte(aMaxRspLength); //ETLV_MaximumLengthOfResponse
       
   119 	
       
   120 	PrepareMockWithCompleteDataForPCmdNotifyL(getInpTlv.End(), KErrNone);
       
   121 
       
   122 	User::WaitForRequest(requestStatus);
       
   123 
       
   124 	// check result
       
   125 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
   126 
       
   127 	RSat::TGetInputV1 expGetInpData;
       
   128 	RSat::TGetInputV1Pckg expGetInpDataPckg(expGetInpData);
       
   129 
       
   130 	PrepareDefaultGetInpData(expGetInpData, getInpData);
       
   131 	expGetInpData.iText.Copy(aGetInputText);
       
   132 	expGetInpData.iRspLength.iMinRspLength = aMinRspLength;
       
   133 	expGetInpData.iRspLength.iMaxRspLength = aMaxRspLength;
       
   134 
       
   135 	if ( KUserInputMask & aGetInputQualifier )
       
   136 		{
       
   137 		// User input hidden
       
   138 		expGetInpData.iInputDisplayOption = RSat::EHideUserInput;
       
   139 		}
       
   140 	else
       
   141 		{
       
   142 		// User input shown
       
   143 		expGetInpData.iInputDisplayOption = RSat::EDisplayUserInput;
       
   144 		}
       
   145 
       
   146 	// Character set selected
       
   147 	if ( KUCS2AlphabetMask & aGetInputQualifier )
       
   148 		{
       
   149 		// UCS2 alphabet selected
       
   150 		expGetInpData.iRspFormat = RSat::EUcs2Alphabet;
       
   151 		}
       
   152 	else if ( KAlphabetMask & aGetInputQualifier )
       
   153 		{
       
   154 		if ( KGetInputSmsPackedMask & aGetInputQualifier )
       
   155 			{
       
   156 			// SMS default alphabet
       
   157 			expGetInpData.iRspFormat = RSat::ESmsDefaultAlphabetPacked;
       
   158 			}
       
   159 		else
       
   160 			{
       
   161 			expGetInpData.iRspFormat = RSat::ESmsDefaultAlphabetUnpacked;
       
   162 			}
       
   163 		}
       
   164 	
       
   165 	else
       
   166 		{
       
   167 		if  ( KGetInputSmsPackedMask & aGetInputQualifier )
       
   168 			{
       
   169 			// Digit only
       
   170 			expGetInpData.iRspFormat = RSat::EDigitOnlyPacked;
       
   171 			}
       
   172 		else
       
   173 			{
       
   174 			expGetInpData.iRspFormat = RSat::EDigitOnlyUnpacked;
       
   175 			}
       
   176 		}
       
   177 
       
   178 	// Help information.
       
   179 	if ( KHelpAvailabilityMask & aGetInputQualifier )
       
   180 		{
       
   181 		// Help information available
       
   182 		expGetInpData.iHelp = RSat::EHelpAvailable;
       
   183 		}
       
   184 	else
       
   185 		{
       
   186 		// No help
       
   187 		expGetInpData.iHelp = RSat::ENoHelpAvailable;
       
   188 		}
       
   189 
       
   190 	ASSERT_EQUALS(0, expGetInpDataPckg.Compare(getInpDataPckg));
       
   191 
       
   192 	}
       
   193 
       
   194 
       
   195 /**
       
   196 Test support in SATTSY for successful RSat::NotifyGetInputPCmd request with terminal response about unsuccessful command processing
       
   197 @param aPCmdNumber proactive command number
       
   198 @param aError error code of the proactive command processing
       
   199 @param aMeProblemAddInfo additional information in case of Me problem
       
   200 @param aExpResult expected result of TerminalRsp() execution
       
   201 */
       
   202 void CCSatGetInputFU::TestGetInputWithUnsuccessfulTerminalResponseL(
       
   203 		TUint8 aPCmdNumber,
       
   204 		RSat::TPCmdResult aError,
       
   205 		const TDesC& aMeProblemAddInfo,
       
   206 		const TInt aExpResult)
       
   207 	{
       
   208 
       
   209 	const TUint8 KGetInputQualifier = KAlphabetMask;	// SMS default alphabet, input in unpacked format, 
       
   210 														// Terminal to echo text, no help information available
       
   211 	_LIT8(KGetInputText, "<GET-INPUT-TEXT>"); 
       
   212 	TestGetInputSuccessfulWithoutTerminalResponseL(aPCmdNumber, KGetInputQualifier, KGetInputText, 2, 30);
       
   213 	
       
   214 	//generate the terminal response
       
   215 	RSat::TGetInputRspV1 resp;
       
   216 	RSat::TGetInputRspV1Pckg respPckg(resp);
       
   217 
       
   218 	resp.iGeneralResult = aError;
       
   219 	resp.iAdditionalInfo.Zero();
       
   220 	if ( RSat::KMeUnableToProcessCmd == aError )
       
   221 		{
       
   222 		resp.iInfoType = RSat::KMeProblem;
       
   223 		resp.iAdditionalInfo.Append(aMeProblemAddInfo);
       
   224 		}
       
   225 	else
       
   226 		{
       
   227 		resp.iInfoType = RSat::KNoAdditionalInfo;
       
   228 		}
       
   229 	resp.iRspFormat = RSat::ESmsDefaultAlphabetUnpacked;
       
   230 	resp.SetPCmdNumber(aPCmdNumber);
       
   231 
       
   232 	GenerateTerminalResponseL(KGetInputQualifier, resp, K8BitDCS, aExpResult);
       
   233 	AssertMockLtsyStatusL();
       
   234 
       
   235 	}
       
   236 
       
   237 
       
   238 /**
       
   239 Handles sending a terminal response
       
   240 @param aCommandQualifier get input proactive command qualifier
       
   241 @param aResp terminal response data
       
   242 @param aCodingScheme coding scheme of input data
       
   243 @param aExpResult expected result of TerminalRsp() execution
       
   244 */
       
   245 void CCSatGetInputFU::GenerateTerminalResponseL(
       
   246 		TUint8 aCommandQualifier,
       
   247 		const RSat::TGetInputRspV1& aResp,
       
   248 		TUint8 aCodingScheme,
       
   249 		const TInt aExpResult)
       
   250 	{
       
   251 
       
   252 	TPtrC genResultAddInfo(KNullDesC);
       
   253 	TPtrC8 additionalInfoTlv(KNullDesC8);
       
   254 	if ( RSat::KTextString == aResp.iInfoType ) 
       
   255 		{
       
   256 		TTlv textStringTlv;
       
   257 		textStringTlv.AddTag(KTlvTextStringTag);
       
   258 		textStringTlv.AddByte(aCodingScheme); //ETLV_DataCodingScheme
       
   259 
       
   260 		TBuf8<RSat::KAdditionalInfoMaxSize> addInfo;
       
   261 		addInfo.Zero();
       
   262 		switch (aCodingScheme)
       
   263 			{
       
   264 			case KUCS2DCS:
       
   265 				TSatUtility::Copy16to8LE(aResp.iAdditionalInfo, addInfo);
       
   266 				break;
       
   267 			case K7BitDefaultSmsDCS:
       
   268 				TSatUtility::UCSToPacked7(aResp.iAdditionalInfo, addInfo);
       
   269 				break;
       
   270 			case K8BitDCS:
       
   271 			default:
       
   272 				addInfo.Copy(aResp.iAdditionalInfo);
       
   273 				break;
       
   274 			}
       
   275 		textStringTlv.AddData(addInfo);
       
   276 
       
   277 		additionalInfoTlv.Set( textStringTlv.GetDataWithoutTopLevelTag() );
       
   278 		}
       
   279 	else if ( RSat::KMeProblem == aResp.iInfoType )
       
   280 		{
       
   281 		genResultAddInfo.Set( aResp.iAdditionalInfo );
       
   282 		}
       
   283 
       
   284 	RSat::TGetInputRspV1Pckg respPckg(aResp);
       
   285 	CCSatComponentTestBase::GenerateTerminalResponseL(
       
   286 			aResp.PCmdNumber(),
       
   287 			KGetInput,
       
   288 			aCommandQualifier,
       
   289 			RSat::EGetInput,
       
   290 			respPckg,
       
   291 			genResultAddInfo,
       
   292 			aResp.iGeneralResult,
       
   293 			additionalInfoTlv,
       
   294 			aExpResult);
       
   295 	}
       
   296 
       
   297 
       
   298 //
       
   299 // Actual test cases
       
   300 //
       
   301 
       
   302 
       
   303 /**
       
   304 @SYMTestCaseID BA-CSAT-GUI-TNGIPC-0001
       
   305 @SYMPREQ 1780
       
   306 @SYMComponent  telephony_csat
       
   307 @SYMTestCaseDesc Test support in CSAT for RSat::NotifyGetInputPCmd
       
   308 @SYMTestPriority High
       
   309 @SYMTestActions Invokes RSat::NotifyGetInputPCmd
       
   310 @SYMTestExpectedResults Pass
       
   311 @SYMTestType CT
       
   312 */
       
   313 void CCSatGetInputFU::TestNotifyGetInputPCmd0001L()
       
   314 	{
       
   315 
       
   316 	OpenEtelServerL(EUseExtendedError);
       
   317 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
   318 	OpenPhoneL();
       
   319 	OpenSatL();
       
   320 
       
   321  	//-------------------------------------------------------------------------
       
   322 	// TEST C: Successful completion request of
       
   323 	// RSat::NotifyGetInputPCmd when result is not cached.
       
   324  	//-------------------------------------------------------------------------
       
   325 
       
   326 	//
       
   327 	// (GET INPUT, digits only, SMS default alphabet, Terminal to echo text, Terminal supporting 8 bit data Message)
       
   328 	//
       
   329 
       
   330 	PrepareMockWithExpDataForPCmdNotifyL(KGetInput);
       
   331 
       
   332 	RSat::TGetInputV1 getInpData;
       
   333 	RSat::TGetInputV1Pckg getInpDataPckg(getInpData);
       
   334 	TRequestStatus requestStatus;
       
   335 	iSat.NotifyGetInputPCmd(requestStatus, getInpDataPckg);
       
   336 
       
   337 	TUint8 pcmdNumber = 1;
       
   338 
       
   339 	TTlv getInpTlv;
       
   340 	TUint8 getInputQualifier = 0; // digits (0-9, *, # and +) only, SMS default alphabet, input in unpacked format, Terminal to echo text, no help information available
       
   341 	GetInputProactiveCmdTlvBegin( getInpTlv, pcmdNumber, getInputQualifier );
       
   342 	
       
   343 	getInpTlv.AddTag(KTlvTextStringTag);
       
   344 	getInpTlv.AddByte(K8BitDCS); //ETLV_DataCodingScheme
       
   345 	_LIT8(KGetInputText, "Enter 12345");
       
   346 	getInpTlv.AddData(KGetInputText);
       
   347 	
       
   348 	getInpTlv.AddTag(KTlvResponseLengthTag);
       
   349 	getInpTlv.AddByte(5); //ETLV_MinimumLengthOfResponse
       
   350 	getInpTlv.AddByte(5); //ETLV_MaximumLengthOfResponse
       
   351 	
       
   352 	PrepareMockWithCompleteDataForPCmdNotifyL(getInpTlv.End(), KErrNone);
       
   353 
       
   354 	User::WaitForRequest(requestStatus);
       
   355 
       
   356 	// check results
       
   357 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
   358 
       
   359 	ASSERT_EQUALS(0, Compare16bitDesWith8bitDesL(KGetInputText, getInpData.iText));
       
   360 	ASSERT_EQUALS(RSat::EDisplayUserInput, getInpData.iInputDisplayOption);
       
   361 	ASSERT_EQUALS(RSat::EDigitOnlyUnpacked, getInpData.iRspFormat);
       
   362 	ASSERT_EQUALS(static_cast<TUint8>(5), getInpData.iRspLength.iMinRspLength);
       
   363 	ASSERT_EQUALS(static_cast<TUint8>(5), getInpData.iRspLength.iMaxRspLength);
       
   364 	ASSERT_EQUALS(0, KNullDesC().Compare(getInpData.iDefaultText));
       
   365 	ASSERT_EQUALS(RSat::ENoIconId, getInpData.iIconId.iQualifier);
       
   366 	ASSERT_EQUALS(RSat::ENoHelpAvailable, getInpData.iHelp);
       
   367 
       
   368 	// check result by package
       
   369 	RSat::TGetInputV1 expGetInpData;
       
   370 	RSat::TGetInputV1Pckg expGetInpDataPckg(expGetInpData);
       
   371 
       
   372 	PrepareDefaultGetInpData(expGetInpData, getInpData);
       
   373 	expGetInpData.iText.Copy(KGetInputText);
       
   374 	expGetInpData.iRspLength.iMinRspLength = 5;
       
   375 	expGetInpData.iRspLength.iMaxRspLength = 5;
       
   376 	ASSERT_EQUALS(0, expGetInpDataPckg.Compare(getInpDataPckg));
       
   377 
       
   378 	//generate the terminal response
       
   379 	RSat::TGetInputRspV1 resp;
       
   380 	RSat::TGetInputRspV1Pckg respPckg(resp);
       
   381 	resp.iGeneralResult = RSat::KSuccess;
       
   382 	resp.iInfoType = RSat::KTextString;
       
   383 	_LIT8(KUserInputText, "12345"); 
       
   384 	resp.iAdditionalInfo.Copy(KUserInputText);
       
   385 	resp.iRspFormat = RSat::EDigitOnlyUnpacked;
       
   386 	resp.SetPCmdNumber(pcmdNumber);
       
   387 
       
   388 	GenerateTerminalResponseL(getInputQualifier, resp);
       
   389 	AssertMockLtsyStatusL();
       
   390 
       
   391 	//
       
   392 	// (GET INPUT, digits only, SMS default alphabet, packed, Hide user input)
       
   393 	//
       
   394 
       
   395 	PrepareMockWithExpDataForPCmdNotifyL(KGetInput);
       
   396 	iSat.NotifyGetInputPCmd(requestStatus, getInpDataPckg);
       
   397 
       
   398 	getInputQualifier = KUserInputMask|KHelpAvailabilityMask|KGetInputSmsPackedMask; // digits (0-9, *, # and +) only, SMS default alphabet, input in packed format, Hide user input, help information available
       
   399 	GetInputProactiveCmdTlvBegin( getInpTlv, pcmdNumber, getInputQualifier );
       
   400 	
       
   401 	getInpTlv.AddTag(KTlvTextStringTag);
       
   402 	getInpTlv.AddByte(K8BitDCS); //ETLV_DataCodingScheme
       
   403 	_LIT8(KGetInputText2, "Enter a digit"); 
       
   404 	getInpTlv.AddData(KGetInputText2);
       
   405 	
       
   406 	getInpTlv.AddTag(KTlvResponseLengthTag);
       
   407 	getInpTlv.AddByte(1); //ETLV_MinimumLengthOfResponse
       
   408 	getInpTlv.AddByte(1); //ETLV_MaximumLengthOfResponse
       
   409 	
       
   410 	getInpTlv.AddTag(KTlvDefaultTextTag);
       
   411 	getInpTlv.AddByte(K8BitDCS); //ETLV_DataCodingScheme
       
   412 	_LIT8(KDefaultText, "1"); 
       
   413 	getInpTlv.AddData(KDefaultText);
       
   414 	
       
   415 	PrepareMockWithCompleteDataForPCmdNotifyL(getInpTlv.End(), KErrNone);
       
   416 
       
   417 	User::WaitForRequest(requestStatus);
       
   418 
       
   419 	// check results
       
   420 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
   421 
       
   422 	PrepareDefaultGetInpData(expGetInpData, getInpData);
       
   423 	expGetInpData.iText.Copy(KGetInputText2);
       
   424 	expGetInpData.iRspLength.iMinRspLength = 1;
       
   425 	expGetInpData.iRspLength.iMaxRspLength = 1;
       
   426 	expGetInpData.iDefaultText.Copy(KDefaultText);
       
   427 	expGetInpData.iHelp = RSat::EHelpAvailable;
       
   428 	expGetInpData.iInputDisplayOption = RSat::EHideUserInput;
       
   429 	expGetInpData.iRspFormat = RSat::EDigitOnlyPacked;
       
   430 	ASSERT_EQUALS(0, expGetInpDataPckg.Compare(getInpDataPckg));
       
   431 
       
   432 	//generate the terminal response
       
   433 	resp.iGeneralResult = RSat::KSuccess;
       
   434 	resp.iInfoType = RSat::KTextString;
       
   435 	_LIT(KUserInputText2, "2"); 
       
   436 	resp.iAdditionalInfo.Copy(KUserInputText2);
       
   437 	resp.iRspFormat = RSat::EDigitOnlyPacked;
       
   438 	resp.SetPCmdNumber(pcmdNumber);
       
   439 
       
   440 	GenerateTerminalResponseL(getInputQualifier, resp, K7BitDefaultSmsDCS);
       
   441 	AssertMockLtsyStatusL();
       
   442 
       
   443 	//
       
   444 	// (GET INPUT, SMS default alphabet, Terminal to echo text, Terminal supporting 8 bit data Message)
       
   445 	//
       
   446 	
       
   447 	getInputQualifier = KAlphabetMask; // SMS default alphabet, input in unpacked format, Terminal to echo text, no help information available
       
   448 	_LIT8(KGetInputText3, "Enter your account name"); 
       
   449 	TestGetInputSuccessfulWithoutTerminalResponseL(pcmdNumber, getInputQualifier, KGetInputText3, 2, 30);
       
   450 	
       
   451 	//generate the terminal response
       
   452 	resp.iGeneralResult = RSat::KSuccess;
       
   453 	resp.iInfoType = RSat::KTextString;
       
   454 	_LIT8(KUserInputText3, "Roman"); 
       
   455 	resp.iAdditionalInfo.Copy(KUserInputText3);
       
   456 	resp.iRspFormat = RSat::ESmsDefaultAlphabetUnpacked;
       
   457 	resp.SetPCmdNumber(pcmdNumber);
       
   458 
       
   459 	TTlv getInpRspTlv3;
       
   460 	getInpRspTlv3.AddTag(KTlvTextStringTag);
       
   461 	getInpRspTlv3.AddByte(K8BitDCS); //ETLV_DataCodingScheme
       
   462 	getInpRspTlv3.AddData(KUserInputText3);
       
   463 
       
   464 	GenerateTerminalResponseL(getInputQualifier, resp);
       
   465 	AssertMockLtsyStatusL();
       
   466 
       
   467 	//
       
   468 	// (GET INPUT, SMS default alphabet, packed, Terminal to echo text)
       
   469 	//
       
   470 	
       
   471 	getInputQualifier = KAlphabetMask|KGetInputSmsPackedMask; // SMS default alphabet, input in packed format, Terminal to echo text, no help information available
       
   472 	TestGetInputSuccessfulWithoutTerminalResponseL(pcmdNumber, getInputQualifier, KGetInputText3, 2, 30);
       
   473 	
       
   474 	//generate the terminal response
       
   475 	resp.iGeneralResult = RSat::KSuccess;
       
   476 	resp.iInfoType = RSat::KTextString;
       
   477 	_LIT(KUserInputText4, "Vladimir"); 
       
   478 	resp.iAdditionalInfo.Copy(KUserInputText4);
       
   479 	resp.iRspFormat = RSat::ESmsDefaultAlphabetPacked;
       
   480 	resp.SetPCmdNumber(pcmdNumber);
       
   481 
       
   482 	GenerateTerminalResponseL(getInputQualifier, resp, K7BitDefaultSmsDCS);
       
   483 	AssertMockLtsyStatusL();
       
   484 
       
   485 	//
       
   486 	// (GET INPUT, UCS2 alphabet, Terminal to echo text)
       
   487 	//
       
   488 	
       
   489 	getInputQualifier = KUCS2AlphabetMask; // UCS2 alphabet, Terminal to echo text, no help information available
       
   490 	TestGetInputSuccessfulWithoutTerminalResponseL(pcmdNumber, getInputQualifier, KGetInputText3, 2, 30);
       
   491 	
       
   492 	//generate the terminal response
       
   493 	resp.iGeneralResult = RSat::KSuccess;
       
   494 	resp.iInfoType = RSat::KTextString;
       
   495 	resp.iAdditionalInfo.Copy(KUserInputText4);
       
   496 	resp.iRspFormat = RSat::EUcs2Alphabet;
       
   497 	resp.SetPCmdNumber(pcmdNumber);
       
   498 
       
   499 	GenerateTerminalResponseL(getInputQualifier, resp, KUCS2DCS);
       
   500 	AssertMockLtsyStatusL();
       
   501 
       
   502 	//-------------------------------------------------------------------------
       
   503 	// TEST E: Unsolicited completion of RSat::NotifyGetInputPCmd
       
   504 	// from LTSY.
       
   505  	//-------------------------------------------------------------------------
       
   506 
       
   507 	getInputQualifier = 0; // digits (0-9, *, # and +) only, SMS default alphabet, input in unpacked format, Terminal to echo text, no help information available
       
   508 	GetInputProactiveCmdTlvBegin( getInpTlv, pcmdNumber, getInputQualifier );
       
   509 	
       
   510 	getInpTlv.AddTag(KTlvTextStringTag);
       
   511 	getInpTlv.AddByte(K8BitDCS); //ETLV_DataCodingScheme
       
   512 	getInpTlv.AddData(KGetInputText);
       
   513 	
       
   514 	getInpTlv.AddTag(KTlvResponseLengthTag);
       
   515 	getInpTlv.AddByte(5); //ETLV_MinimumLengthOfResponse
       
   516 	getInpTlv.AddByte(5); //ETLV_MaximumLengthOfResponse
       
   517 
       
   518 	PrepareMockWithCompleteDataForPCmdNotifyL(getInpTlv.End(), KErrNone);
       
   519 
       
   520 	resp.iAdditionalInfo.Zero();
       
   521 	resp.iAdditionalInfo.Append(RSat::KNoSpecificMeProblem);
       
   522 
       
   523 	PrepareTerminalResponseMockDataL(pcmdNumber, KGetInput, getInputQualifier, resp.iAdditionalInfo, RSat::KMeUnableToProcessCmd, KNullDesC8);
       
   524 	WaitForMockLTSYTerminated();
       
   525 	
       
   526 	AssertMockLtsyStatusL();
       
   527 
       
   528 	//-------------------------------------------------------------------------
       
   529 	// TEST B: failure on completion of pending request from LTSY->SATTSY
       
   530  	//-------------------------------------------------------------------------
       
   531 
       
   532 	PrepareMockWithExpDataForPCmdNotifyL(KGetInput);
       
   533 	iSat.NotifyGetInputPCmd(requestStatus, getInpDataPckg);
       
   534 
       
   535 	getInputQualifier = 0; // digits (0-9, *, # and +) only, SMS default alphabet, input in unpacked format, Terminal to echo text, no help information available
       
   536 	GetInputProactiveCmdTlvBegin( getInpTlv, pcmdNumber, getInputQualifier );
       
   537 	
       
   538 	getInpTlv.AddTag(KTlvTextStringTag);
       
   539 	getInpTlv.AddByte(K8BitDCS); //ETLV_DataCodingScheme
       
   540 	getInpTlv.AddData(KGetInputText);
       
   541 	
       
   542 	getInpTlv.AddTag(KTlvResponseLengthTag);
       
   543 	getInpTlv.AddByte(5); //ETLV_MinimumLengthOfResponse
       
   544 	getInpTlv.AddByte(5); //ETLV_MaximumLengthOfResponse
       
   545 
       
   546 	PrepareMockWithCompleteDataForPCmdNotifyL(getInpTlv.End(), KErrGeneral);
       
   547 
       
   548 	User::WaitForRequest(requestStatus);
       
   549 
       
   550 	ASSERT_EQUALS(KErrGeneral, requestStatus.Int());
       
   551 	AssertMockLtsyStatusL();
       
   552 
       
   553 	CleanupStack::PopAndDestroy(this);
       
   554 	
       
   555 	}
       
   556 
       
   557 
       
   558 /**
       
   559 @SYMTestCaseID BA-CSAT-GUI-TNGIPC-0001b
       
   560 @SYMPREQ 1780
       
   561 @SYMComponent  telephony_csat
       
   562 @SYMTestCaseDesc Test support in CSAT for RSat::NotifyGetInputPCmd when problems in processing command
       
   563 @SYMTestPriority High
       
   564 @SYMTestActions Invokes RSat::NotifyGetInputPCmd
       
   565 @SYMTestExpectedResults Pass
       
   566 @SYMTestType CT
       
   567 */
       
   568 void CCSatGetInputFU::TestNotifyGetInputPCmd0001bL()
       
   569 	{
       
   570 	
       
   571 	OpenEtelServerL(EUseExtendedError);
       
   572 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
   573 	OpenPhoneL();
       
   574 	OpenSatL();
       
   575 	
       
   576 	TUint8 pcmdNumber = 1;
       
   577 
       
   578 	//
       
   579 	// (GET INPUT, SMS default alphabet, Terminal to echo text, no text string tag given, required values missing in tlv from sim)
       
   580 	//
       
   581 	
       
   582 	PrepareMockWithExpDataForPCmdNotifyL(KGetInput);
       
   583 
       
   584 	RSat::TGetInputV1 getInpData;
       
   585 	RSat::TGetInputV1Pckg getInpDataPckg(getInpData);
       
   586 	TRequestStatus requestStatus;
       
   587 	iSat.NotifyGetInputPCmd(requestStatus, getInpDataPckg);
       
   588 
       
   589 	TTlv getInpTlv;
       
   590 	TUint8 getInputQualifier = KAlphabetMask; // SMS default alphabet, input in unpacked format, Terminal to echo text, no help information available
       
   591 	GetInputProactiveCmdTlvBegin( getInpTlv, pcmdNumber, getInputQualifier );
       
   592 	
       
   593 	getInpTlv.AddTag(KTlvResponseLengthTag);
       
   594 	getInpTlv.AddByte(2); //ETLV_MinimumLengthOfResponse
       
   595 	getInpTlv.AddByte(30); //ETLV_MaximumLengthOfResponse
       
   596 	
       
   597 	PrepareMockWithCompleteDataForPCmdNotifyL(getInpTlv.End(), KErrNone);
       
   598 
       
   599 	PrepareTerminalResponseMockDataL(pcmdNumber, KGetInput, getInputQualifier, KNullDesC, RSat::KErrorRequiredValuesMissing, KNullDesC8);
       
   600 
       
   601 	User::WaitForRequest(requestStatus);
       
   602 	ASSERT_EQUALS(KErrCorrupt, requestStatus.Int());
       
   603 
       
   604 	AssertMockLtsyStatusL();
       
   605 
       
   606 	//
       
   607 	// (GET INPUT, SMS default alphabet, Terminal to echo text, no response length tag given, required values missing in tlv from sim)
       
   608 	//
       
   609 	
       
   610 	PrepareMockWithExpDataForPCmdNotifyL(KGetInput);
       
   611 	iSat.NotifyGetInputPCmd(requestStatus, getInpDataPckg);
       
   612 
       
   613 	getInputQualifier = KAlphabetMask; // SMS default alphabet, input in unpacked format, Terminal to echo text, no help information available
       
   614 	GetInputProactiveCmdTlvBegin( getInpTlv, pcmdNumber, getInputQualifier );
       
   615 	
       
   616 	getInpTlv.AddTag(KTlvTextStringTag);
       
   617 	getInpTlv.AddByte(K8BitDCS); //ETLV_DataCodingScheme
       
   618 	_LIT8(KGetInputText, "Enter your account name"); 
       
   619 	getInpTlv.AddData(KGetInputText);
       
   620 	
       
   621 	PrepareMockWithCompleteDataForPCmdNotifyL(getInpTlv.End(), KErrNone);
       
   622 
       
   623 	PrepareTerminalResponseMockDataL(pcmdNumber, KGetInput, getInputQualifier, KNullDesC, RSat::KErrorRequiredValuesMissing, KNullDesC8);
       
   624 
       
   625 	User::WaitForRequest(requestStatus);
       
   626 	ASSERT_EQUALS(KErrCorrupt, requestStatus.Int());
       
   627 
       
   628 	AssertMockLtsyStatusL();
       
   629 
       
   630 	//
       
   631 	// (GET INPUT, SMS default alphabet, Terminal to echo text, minimum length of response exceed, command data not understood)
       
   632 	//
       
   633 	
       
   634 	PrepareMockWithExpDataForPCmdNotifyL(KGetInput);
       
   635 	iSat.NotifyGetInputPCmd(requestStatus, getInpDataPckg);
       
   636 
       
   637 	getInputQualifier = KAlphabetMask; // SMS default alphabet, input in unpacked format, Terminal to echo text, no help information available
       
   638 	GetInputProactiveCmdTlvBegin( getInpTlv, pcmdNumber, getInputQualifier );
       
   639 	
       
   640 	getInpTlv.AddTag(KTlvTextStringTag);
       
   641 	getInpTlv.AddByte(K8BitDCS); //ETLV_DataCodingScheme
       
   642 	getInpTlv.AddData(KGetInputText);
       
   643 	
       
   644 	getInpTlv.AddTag(KTlvResponseLengthTag);
       
   645 	getInpTlv.AddByte( RSat::KGetInputTextMaxSize + 1 ); //ETLV_MinimumLengthOfResponse
       
   646 	getInpTlv.AddByte( 30 ); //ETLV_MaximumLengthOfResponse
       
   647 	
       
   648 	PrepareMockWithCompleteDataForPCmdNotifyL(getInpTlv.End(), KErrNone);
       
   649 
       
   650 	PrepareTerminalResponseMockDataL(pcmdNumber, KGetInput, getInputQualifier, KNullDesC, RSat::KCmdDataNotUnderstood, KNullDesC8);
       
   651 
       
   652 	User::WaitForRequest(requestStatus);
       
   653 	ASSERT_EQUALS(KErrCorrupt, requestStatus.Int());
       
   654 
       
   655 	AssertMockLtsyStatusL();
       
   656 
       
   657 	//
       
   658 	// (GET INPUT, SMS default alphabet, Terminal to echo text, user answer is empty string)
       
   659 	//
       
   660 	
       
   661 	getInputQualifier = KAlphabetMask; // SMS default alphabet, input in unpacked format, Terminal to echo text, no help information available
       
   662 	TestGetInputSuccessfulWithoutTerminalResponseL(pcmdNumber, getInputQualifier, KGetInputText, 2, 30);
       
   663 	
       
   664 	//generate the terminal response
       
   665 	RSat::TGetInputRspV1 resp;
       
   666 	RSat::TGetInputRspV1Pckg respPckg(resp);
       
   667 
       
   668 	resp.iGeneralResult = RSat::KSuccess;
       
   669 	resp.iInfoType = RSat::KTextString;
       
   670 	resp.iAdditionalInfo.Zero();
       
   671 	resp.iRspFormat = RSat::EGetInputRspFormatNotSet;
       
   672 	resp.SetPCmdNumber(pcmdNumber);
       
   673 
       
   674 	TTlv getInpRspTlv2;
       
   675 	getInpRspTlv2.AddTag(KTlvTextStringTag);
       
   676 
       
   677 	PrepareTerminalResponseMockDataL(pcmdNumber, KGetInput, getInputQualifier, KNullDesC, resp.iGeneralResult, getInpRspTlv2.GetDataWithoutTopLevelTag());
       
   678 	
       
   679 	TRequestStatus reqStatus;
       
   680 	iSat.TerminalRsp(reqStatus, RSat::EGetInput, respPckg);
       
   681 	User::WaitForRequest(reqStatus);
       
   682 	ASSERT_EQUALS(KErrCorrupt, reqStatus.Int());
       
   683 
       
   684 	AssertMockLtsyStatusL();
       
   685 
       
   686 	//
       
   687 	// (GET INPUT, SMS default alphabet, Terminal to echo text, user answer is empty string and minimal length is 0)
       
   688 	// 
       
   689 	
       
   690 	getInputQualifier = KAlphabetMask; // SMS default alphabet, input in unpacked format, Terminal to echo text, no help information available
       
   691 	TestGetInputSuccessfulWithoutTerminalResponseL(pcmdNumber, getInputQualifier, KGetInputText, 0, 10);
       
   692 	
       
   693 	//generate the terminal response
       
   694 
       
   695 	resp.iGeneralResult = RSat::KSuccess;
       
   696 	resp.iInfoType = RSat::KTextString;
       
   697 	resp.iAdditionalInfo.Zero();
       
   698 	resp.iRspFormat = RSat::ESmsDefaultAlphabetUnpacked;
       
   699 	resp.SetPCmdNumber(pcmdNumber);
       
   700 	
       
   701 	getInpRspTlv2.Begin(KTlvTextStringTag);
       
   702 
       
   703 	PrepareTerminalResponseMockDataL(pcmdNumber, KGetInput, getInputQualifier, KNullDesC, resp.iGeneralResult, getInpRspTlv2.GetDataWithoutTopLevelTag());
       
   704 	
       
   705 	iSat.TerminalRsp(reqStatus, RSat::EGetInput, respPckg);
       
   706 	User::WaitForRequest(reqStatus);
       
   707 	ASSERT_EQUALS(KErrNone, reqStatus.Int());
       
   708 
       
   709 	AssertMockLtsyStatusL();
       
   710 
       
   711 	//
       
   712 	// (GET INPUT, SMS default alphabet, Terminal to echo text, proactive session terminated by user)
       
   713 	//
       
   714 
       
   715 	TestGetInputWithUnsuccessfulTerminalResponseL(pcmdNumber, RSat::KPSessionTerminatedByUser);
       
   716 	
       
   717 	//
       
   718 	// (GET INPUT, SMS default alphabet, Terminal to echo text, backward mode requested by user)
       
   719 	//
       
   720 
       
   721 	TestGetInputWithUnsuccessfulTerminalResponseL(pcmdNumber, RSat::KBackwardModeRequestedByUser);
       
   722 	
       
   723 	//
       
   724 	// (GET INPUT, SMS default alphabet, Terminal to echo text, no response from user)
       
   725 	//
       
   726 
       
   727 	TestGetInputWithUnsuccessfulTerminalResponseL(pcmdNumber, RSat::KNoResponseFromUser);
       
   728 	
       
   729 	//
       
   730 	// (GET INPUT, SMS default alphabet, Terminal to echo text, help requested by user)
       
   731 	//
       
   732 
       
   733 	TestGetInputWithUnsuccessfulTerminalResponseL(pcmdNumber, RSat::KHelpRequestedByUser);
       
   734 	
       
   735 	//
       
   736 	// (GET INPUT, SMS default alphabet, Terminal to echo text, command beyond Me capabilities)
       
   737 	//
       
   738 
       
   739 	TestGetInputWithUnsuccessfulTerminalResponseL(pcmdNumber, RSat::KCmdBeyondMeCapabilities);
       
   740 	
       
   741 	//
       
   742 	// (GET INPUT, SMS default alphabet, Terminal to echo text, screen busy)
       
   743 	//
       
   744 
       
   745 	RSat::TAdditionalInfo additionalInfo;
       
   746 	additionalInfo.Append(RSat::KScreenBusy);
       
   747 	TestGetInputWithUnsuccessfulTerminalResponseL(pcmdNumber, RSat::KMeUnableToProcessCmd, additionalInfo);
       
   748 	
       
   749 	//
       
   750 	// (GET INPUT, SMS default alphabet, Terminal to echo text, me problem without additional info)
       
   751 	//
       
   752 
       
   753 	TestGetInputWithUnsuccessfulTerminalResponseL(pcmdNumber, RSat::KMeUnableToProcessCmd, KNullDesC, KErrCorrupt);
       
   754 	
       
   755 	CleanupStack::PopAndDestroy(this);
       
   756 	
       
   757 	}
       
   758 
       
   759 
       
   760 /**
       
   761 @SYMTestCaseID BA-CSAT-GUI-TNGIPC-0002
       
   762 @SYMPREQ 1780
       
   763 @SYMComponent  telephony_csat
       
   764 @SYMTestCaseDesc Test support in CSAT for cancelling of RSat::NotifyGetInputPCmd
       
   765 @SYMTestPriority High
       
   766 @SYMTestActions Invokes cancelling of RSat::NotifyGetInputPCmd
       
   767 @SYMTestExpectedResults Pass
       
   768 @SYMTestType CT
       
   769 */
       
   770 void CCSatGetInputFU::TestNotifyGetInputPCmd0002L()
       
   771 	{
       
   772 
       
   773 	OpenEtelServerL(EUseExtendedError);
       
   774 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
   775 	OpenPhoneL();
       
   776 	OpenSatL();
       
   777 
       
   778  	//-------------------------------------------------------------------------
       
   779 	// Test cancelling of RSat::NotifyGetInputPCmd
       
   780  	//-------------------------------------------------------------------------
       
   781 	
       
   782 	PrepareMockWithExpDataForPCmdNotifyL(KGetInput);
       
   783 
       
   784 	RSat::TGetInputV1 getInpData;
       
   785 	RSat::TGetInputV1Pckg getInpDataPckg(getInpData);
       
   786 	TRequestStatus requestStatus;
       
   787 	iSat.NotifyGetInputPCmd(requestStatus, getInpDataPckg);
       
   788 
       
   789 	iSat.CancelAsyncRequest(ESatNotifyGetInputPCmd);
       
   790 
       
   791 	User::WaitForRequest(requestStatus);
       
   792 	ASSERT_EQUALS(KErrCancel, requestStatus.Int());
       
   793 
       
   794 	AssertMockLtsyStatusL();
       
   795 	
       
   796 	CleanupStack::PopAndDestroy(this);
       
   797 	
       
   798 	}
       
   799 
       
   800 
       
   801 /**
       
   802 @SYMTestCaseID BA-CSAT-GUI-TNGIPC-0004
       
   803 @SYMPREQ 1780
       
   804 @SYMComponent  telephony_csat
       
   805 @SYMTestCaseDesc Test support in CSAT for multiple client requests to RSat::NotifyGetInputPCmd
       
   806 @SYMTestPriority High
       
   807 @SYMTestActions Invokes multiple client requests to RSat::NotifyGetInputPCmd
       
   808 @SYMTestExpectedResults Pass
       
   809 @SYMTestType CT
       
   810 */
       
   811 void CCSatGetInputFU::TestNotifyGetInputPCmd0004L()
       
   812 	{
       
   813 
       
   814 	OpenEtelServerL(EUseExtendedError);
       
   815 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
   816 	OpenPhoneL();
       
   817 	OpenSatL();
       
   818 
       
   819 	// Open second client
       
   820 	RTelServer telServer2;
       
   821 	TInt ret = telServer2.Connect();
       
   822 	ASSERT_EQUALS(KErrNone, ret);
       
   823 	CleanupClosePushL(telServer2);
       
   824 
       
   825 	RMobilePhone phone2;
       
   826 	ret = phone2.Open(telServer2, KMmTsyPhoneName);
       
   827 	ASSERT_EQUALS(KErrNone, ret);
       
   828 	CleanupClosePushL(phone2);
       
   829 	
       
   830 	RSat sat2;
       
   831 	ret = sat2.Open(phone2);
       
   832 	ASSERT_EQUALS(KErrNone, ret);
       
   833 	CleanupClosePushL(sat2);
       
   834 
       
   835 	//-------------------------------------------------------------------------
       
   836 	// Test A: Test multiple clients requesting RSat::NotifyGetInputPCmd
       
   837 	// when they both pass the same T-class version
       
   838  	//-------------------------------------------------------------------------
       
   839 
       
   840 	// send 1st request
       
   841 	PrepareMockWithExpDataForPCmdNotifyL(KGetInput);
       
   842 
       
   843 	RSat::TGetInputV1 getInpData;
       
   844 	RSat::TGetInputV1Pckg getInpDataPckg(getInpData);
       
   845 	TRequestStatus requestStatus;
       
   846 	iSat.NotifyGetInputPCmd(requestStatus, getInpDataPckg);
       
   847 
       
   848 	// send 2nd request
       
   849 	RSat::TGetInputV1 getInpData2;
       
   850 	RSat::TGetInputV1Pckg getInpDataPckg2(getInpData2);
       
   851 	TRequestStatus requestStatus2;
       
   852 	sat2.NotifyGetInputPCmd(requestStatus2, getInpDataPckg2);
       
   853 	
       
   854 	// generate completion
       
   855 	TUint8 pcmdNumber = 1;
       
   856 
       
   857 	TTlv getInpTlv;
       
   858 	TUint8 getInputQualifier = 0; // digits (0-9, *, # and +) only, SMS default alphabet, input in unpacked format, Terminal to echo text, no help information available
       
   859 	GetInputProactiveCmdTlvBegin( getInpTlv, pcmdNumber, getInputQualifier );
       
   860 	
       
   861 	getInpTlv.AddTag(KTlvTextStringTag);
       
   862 	getInpTlv.AddByte(K8BitDCS); //ETLV_DataCodingScheme
       
   863 	_LIT8(KGetInputText, "Enter 12345"); 
       
   864 	getInpTlv.AddData(KGetInputText);
       
   865 	
       
   866 	getInpTlv.AddTag(KTlvResponseLengthTag);
       
   867 	getInpTlv.AddByte(5); //ETLV_MinimumLengthOfResponse
       
   868 	getInpTlv.AddByte(5); //ETLV_MaximumLengthOfResponse
       
   869 
       
   870 	PrepareMockWithCompleteDataForPCmdNotifyL(getInpTlv.End(), KErrNone);
       
   871 	
       
   872 	// completion of requests
       
   873 	User::WaitForRequest(requestStatus);
       
   874 	User::WaitForRequest(requestStatus2);
       
   875 
       
   876 	// check results
       
   877 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
   878 	ASSERT_EQUALS(KErrNone, requestStatus2.Int());
       
   879 
       
   880 	RSat::TGetInputV1 expGetInpData;
       
   881 	RSat::TGetInputV1Pckg expGetInpDataPckg(expGetInpData);
       
   882 	PrepareDefaultGetInpData(expGetInpData, getInpData);
       
   883 	expGetInpData.iText.Copy(KGetInputText);
       
   884 	expGetInpData.iRspLength.iMinRspLength = 5;
       
   885 	expGetInpData.iRspLength.iMaxRspLength = 5;
       
   886 
       
   887 	ASSERT_EQUALS(0, expGetInpDataPckg.Compare(getInpDataPckg));
       
   888 
       
   889 	PrepareDefaultGetInpData(expGetInpData, getInpData2);
       
   890 	expGetInpData.iText.Copy(KGetInputText);
       
   891 	expGetInpData.iRspLength.iMinRspLength = 5;
       
   892 	expGetInpData.iRspLength.iMaxRspLength = 5;
       
   893 	
       
   894 	ASSERT_EQUALS(0, expGetInpDataPckg.Compare(getInpDataPckg2));
       
   895 
       
   896 	// generate the terminal response
       
   897 	RSat::TGetInputRspV1 resp;
       
   898 	RSat::TGetInputRspV1Pckg respPckg(resp);
       
   899 	resp.iGeneralResult = RSat::KSuccess;
       
   900 	resp.iInfoType = RSat::KTextString;
       
   901 	_LIT(KUserInputText, "12345"); 
       
   902 	resp.iAdditionalInfo.Copy(KUserInputText);
       
   903 	resp.iRspFormat = RSat::EDigitOnlyUnpacked;
       
   904 	resp.SetPCmdNumber(pcmdNumber);
       
   905 
       
   906 	GenerateTerminalResponseL(getInputQualifier, resp);
       
   907 	GenerateTerminalResponseL(getInputQualifier, resp);
       
   908  
       
   909 	AssertMockLtsyStatusL();
       
   910 
       
   911 	//-------------------------------------------------------------------------
       
   912 	// Test B: Test multiple clients requesting RSat::NotifyGetInputPCmd
       
   913 	// when they both pass different T-class versions
       
   914  	//-------------------------------------------------------------------------
       
   915 
       
   916 	// When multiple clients requesting RSat::NotifyGetInputPCmd and they both pass
       
   917 	// different packaged parameter versions only the last request completes, because
       
   918 	// etel reposts request with new parameter size and looses previous requests.
       
   919 	// May be it would be worth to make ESatNotifyGetInputPCmd ipc requests flow controlled
       
   920 	// by CSATTSY instead of multiple completed by ETEL. Similar defects are 51,
       
   921 	// 58, 71, 78, 86 and 90
       
   922 	ERR_PRINTF2(_L("<font color=Orange>$CSATKnownFailure: defect id = %d</font>"), 99);
       
   923 	// Following assert was added to prevent test execution hang
       
   924 	ASSERT_TRUE( EFalse );
       
   925 
       
   926 	// send 1st request
       
   927 	PrepareMockWithExpDataForPCmdNotifyL(KGetInput);
       
   928 	iSat.NotifyGetInputPCmd(requestStatus, getInpDataPckg);
       
   929 
       
   930 	// send 2nd request
       
   931 	RSat::TGetInputV5 getInpDataV5;
       
   932 	RSat::TGetInputV5Pckg getInpDataV5Pckg(getInpDataV5);
       
   933 	sat2.NotifyGetInputPCmd(requestStatus2, getInpDataV5Pckg);
       
   934 	
       
   935 	// generate completion
       
   936 	GetInputProactiveCmdTlvBegin( getInpTlv, pcmdNumber, getInputQualifier );
       
   937 	
       
   938 	getInpTlv.AddTag(KTlvTextStringTag);
       
   939 	getInpTlv.AddByte(K8BitDCS); //ETLV_DataCodingScheme
       
   940 	getInpTlv.AddData(KGetInputText);
       
   941 	
       
   942 	getInpTlv.AddTag(KTlvResponseLengthTag);
       
   943 	getInpTlv.AddByte(5); //ETLV_MinimumLengthOfResponse
       
   944 	getInpTlv.AddByte(5); //ETLV_MaximumLengthOfResponse
       
   945 
       
   946 	PrepareMockWithCompleteDataForPCmdNotifyL(getInpTlv.End(), KErrNone);
       
   947 	
       
   948 	// completion of requests
       
   949 	User::WaitForRequest(requestStatus2);
       
   950 	User::WaitForRequest(requestStatus);
       
   951 
       
   952 	// check results
       
   953 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
   954 	ASSERT_EQUALS(KErrNone, requestStatus2.Int());
       
   955 
       
   956 	PrepareDefaultGetInpData(expGetInpData, getInpData);
       
   957 	expGetInpData.iText.Copy(KGetInputText);
       
   958 	expGetInpData.iRspLength.iMinRspLength = 5;
       
   959 	expGetInpData.iRspLength.iMaxRspLength = 5;
       
   960 
       
   961 	ASSERT_EQUALS(0, expGetInpDataPckg.Compare(getInpDataPckg));
       
   962 
       
   963 	PrepareDefaultGetInpData(expGetInpData, getInpDataV5);
       
   964 	expGetInpData.iText.Copy(KGetInputText);
       
   965 	expGetInpData.iRspLength.iMinRspLength = 5;
       
   966 	expGetInpData.iRspLength.iMaxRspLength = 5;
       
   967 	
       
   968 	ASSERT_EQUALS( 0, expGetInpDataPckg.Compare( getInpDataV5Pckg.Left(sizeof(RSat::TGetInputV1)) ) );
       
   969 	ASSERT_TRUE( RSat::ETextAttributeProvided != getInpDataV5.iTextAttribute.iStatus );
       
   970 
       
   971 	// generate the terminal response
       
   972 	GenerateTerminalResponseL(getInputQualifier, resp);
       
   973 	GenerateTerminalResponseL(getInputQualifier, resp);
       
   974  
       
   975 	AssertMockLtsyStatusL();
       
   976 
       
   977 	CleanupStack::PopAndDestroy(4, this); // sat2, phone2, telServer2, this
       
   978 
       
   979 	}
       
   980