telephonyserverplugins/simatktsy/tests/src/ccsatsetupcallfu.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 SetUpCall in the SAT.
       
    20 */
       
    21 
       
    22 #include <cstktsy/bertlv_defs.h>
       
    23 #include <etel.h>
       
    24 #include <etelmm.h>
       
    25 #include <satcs.h>
       
    26 #include <ctsy/ltsy/sat_defs.h>
       
    27 
       
    28 #include <ctsy/ltsy/mltsydispatchsatinterface.h>
       
    29 #include <test/mockltsyindicatorids.h>
       
    30 #include <test/tmockltsydata.h>
       
    31 
       
    32 #include "ccsatsetupcallfu.h"
       
    33 
       
    34 const TInt KDelay = 10;
       
    35 
       
    36 CTestSuite* CCSatSetUpCallFU::CreateSuiteL(const TDesC& aName)
       
    37 	{
       
    38 	SUB_SUITE;
       
    39 
       
    40 	ADD_TEST_STEP_ISO_CPP(CCSatSetUpCallFU, TestNotifySetUpCallPCmd0001L);
       
    41 	ADD_TEST_STEP_ISO_CPP(CCSatSetUpCallFU, TestNotifySetUpCallPCmd0002L);
       
    42 	ADD_TEST_STEP_ISO_CPP(CCSatSetUpCallFU, TestNotifySetUpCallPCmd0004L);
       
    43 
       
    44 	ADD_TEST_STEP_ISO_CPP(CCSatSetUpCallFU, TestNotifySetUpCallPCmd0001bL);
       
    45 	ADD_TEST_STEP_ISO_CPP(CCSatSetUpCallFU, TestNotifySetUpCallPCmd0001cL);
       
    46 	ADD_TEST_STEP_ISO_CPP(CCSatSetUpCallFU, TestNotifySetUpCallPCmd0001dL);
       
    47 	ADD_TEST_STEP_ISO_CPP(CCSatSetUpCallFU, TestNotifySetUpCallPCmd0001eL);
       
    48 
       
    49 	END_SUITE;
       
    50 	}
       
    51 
       
    52 void CCSatSetUpCallFU::PrepareTlvData ( TTlv& aTlvData,
       
    53 		                                const TData& aData,
       
    54 		                                const TDesC8& aAlphaIdentifier,
       
    55 		                                const TDesC8& aSecondAlphaIdentifier )
       
    56 	{
       
    57 	aTlvData.Begin(KBerTlvProactiveSimCommandTag);
       
    58 	
       
    59 	aTlvData.AddTag(KTlvCommandDetailsTag);         // Command details
       
    60 	aTlvData.AddByte(aData.iCommandNumber);               // Command number     
       
    61 	aTlvData.AddByte(aData.iCommandType);                   // Command type     
       
    62 	aTlvData.AddByte(aData.iCommandQualifier);            // Command qualifier  
       
    63 	
       
    64 	aTlvData.AddTag(KTlvDeviceIdentityTag);         // Device identities          
       
    65 	aTlvData.AddByte(aData.iSourceDevice);                // Source device     
       
    66 	aTlvData.AddByte(aData.iDestinationDevice);           // Destination device     
       
    67 
       
    68 	if (aAlphaIdentifier.Length() > 0)
       
    69 		{
       
    70 		aTlvData.AddTag(KTlvAlphaIdentifierTag);        // Alpha identifier
       
    71 		aTlvData.AddData(aAlphaIdentifier);
       
    72 		}
       
    73 	
       
    74 	aTlvData.AddTag(KTlvAddressTag);                // Address
       
    75 	aTlvData.AddByte(aData.iAddress);                // International, ISDN / telephone numbering plan
       
    76 	
       
    77 	TInt callNumberSize = aData.iCallNumber.Length();
       
    78 	if (callNumberSize > 0)
       
    79 		{
       
    80 		for (TInt i = 0; i < callNumberSize; i++)
       
    81 			{
       
    82 			aTlvData.AddByte(aData.iCallNumber[i]);           
       
    83 			}
       
    84 		}
       
    85 
       
    86 	TInt infoTransferCapSize = aData.iInfoTransferCap.Length();
       
    87 	if (infoTransferCapSize > 0)
       
    88 		{
       
    89 		// Capability configuration parameters
       
    90 		aTlvData.AddTag(KTlvCapabilityConfigurationParametersTag);
       
    91 		
       
    92 		for (TInt i = 0; i < infoTransferCapSize; i++)
       
    93 			{
       
    94 			aTlvData.AddByte(aData.iInfoTransferCap[i]);
       
    95 			}
       
    96 		}
       
    97 	
       
    98 	TInt subaddresSize = aData.iSubAddress.Length();
       
    99 	if (subaddresSize > 0)
       
   100 		{
       
   101 		aTlvData.AddTag(KTlvSubaddressTag);
       
   102 		
       
   103 		for (TInt i = 0; i < subaddresSize; i++)
       
   104 			{
       
   105 			aTlvData.AddByte(aData.iSubAddress[i]);
       
   106 			}
       
   107 		}
       
   108 	
       
   109 	if ( aData.iDuration.iIfUse )
       
   110 		{
       
   111 		aTlvData.AddTag(KTlvDurationTag);
       
   112 		aTlvData.AddByte(aData.iDuration.iUnit);
       
   113 		aTlvData.AddByte(aData.iDuration.iInterval);
       
   114 		}
       
   115 
       
   116 	if ( aData.iIcon1.iIfUse )
       
   117 		{
       
   118 		aTlvData.AddTag(KTlvIconIdentifierTag);
       
   119 		aTlvData.AddByte(aData.iIcon1.iQualifier);
       
   120 		aTlvData.AddByte(aData.iIcon1.iIdentifier);
       
   121 		}
       
   122 
       
   123 	// This blocks are always called last.
       
   124 	if (aSecondAlphaIdentifier.Length() > 0)
       
   125 		{
       
   126 		aTlvData.AddTag(KTlvAlphaIdentifierTag);
       
   127 		aTlvData.AddData(aSecondAlphaIdentifier);
       
   128 		}
       
   129 
       
   130 	if ( aData.iIcon2.iIfUse )
       
   131 		{
       
   132 		aTlvData.AddTag(KTlvIconIdentifierTag);
       
   133 		aTlvData.AddByte(aData.iIcon2.iQualifier);
       
   134 		aTlvData.AddByte(aData.iIcon2.iIdentifier);
       
   135 		}
       
   136 
       
   137 	if ( aData.iTextAttribute1.iIfUse )
       
   138 		{
       
   139 		aTlvData.AddTag(KBerTlvProactiveSimCommandTag);
       
   140 		aTlvData.AddByte(aData.iTextAttribute1.iFormattingPosition);
       
   141 		aTlvData.AddByte(aData.iTextAttribute1.iFormattingLength);
       
   142 		aTlvData.AddByte(aData.iTextAttribute1.iFormattingMode);
       
   143 		aTlvData.AddByte(aData.iTextAttribute1.iColour);
       
   144 		}
       
   145 
       
   146 	if ( aData.iTextAttribute2.iIfUse )
       
   147 		{
       
   148 		aTlvData.AddTag(KBerTlvProactiveSimCommandTag);
       
   149 		aTlvData.AddByte(aData.iTextAttribute2.iFormattingPosition);
       
   150 		aTlvData.AddByte(aData.iTextAttribute2.iFormattingLength);
       
   151 		aTlvData.AddByte(aData.iTextAttribute2.iFormattingMode);
       
   152 		aTlvData.AddByte(aData.iTextAttribute2.iColour);
       
   153 		}
       
   154 
       
   155 	}
       
   156 
       
   157 void CCSatSetUpCallFU::PrepareExpectDataL ( TUint8 aCommandType )
       
   158 	{
       
   159 	RBuf8 data;
       
   160 	CleanupClosePushL(data);	
       
   161 	
       
   162 	TMockLtsyData1<TUint8> expLtsyData(aCommandType);
       
   163 	expLtsyData.SerialiseL(data);
       
   164 	iMockLTSY.ExpectL(MLtsyDispatchSatPCmdNotification::KLtsyDispatchSatPCmdNotificationApiId, data);
       
   165 
       
   166 	CleanupStack::PopAndDestroy(1); // data
       
   167 	}
       
   168 
       
   169 void CCSatSetUpCallFU::PrepareCompleteDataL ( const TData& aData,
       
   170 		                                     const TDesC8& aAlphaIdentifier,
       
   171 		                                     TInt aResultCode,
       
   172 		                                     const TDesC8& aSecondAlphaIdentifier )
       
   173 	{
       
   174 	RBuf8 data;
       
   175 	CleanupClosePushL(data);	
       
   176 	
       
   177 	TTlv tlv;
       
   178 	PrepareTlvData( tlv, aData, aAlphaIdentifier, aSecondAlphaIdentifier );
       
   179 	
       
   180 	TPtrC8 tlvDsc = tlv.End();
       
   181 	TDesC8* tlvDscPtr = &tlvDsc;
       
   182 	TMockLtsyData1<TDesC8*> tlvDscPack(tlvDscPtr);
       
   183 	tlvDscPack.SerialiseL(data);
       
   184 	iMockLTSY.CompleteL(KMockLtsyDispatchSatPcmdIndId, aResultCode, data, KDelay);
       
   185 
       
   186 	CleanupStack::PopAndDestroy(1); // data
       
   187 	}
       
   188 
       
   189 void CCSatSetUpCallFU::ProactiveCommandCallL( RSat::TSetUpCallV6& aSetupCallData, 
       
   190 		                                     const TData& aData,
       
   191 		                                     const TDesC8& aAlphaIdentifier,
       
   192 		                                     TInt aResultCode,
       
   193 		                                     const TDesC8& aSecondAlphaIdentifier )
       
   194 	{
       
   195 	TRequestStatus requestStatus;
       
   196 	
       
   197 	PrepareExpectDataL ( aData.iCommandType );
       
   198 	
       
   199 	RSat::TSetUpCallV6Pckg setpPck(aSetupCallData);
       
   200 	iSat.NotifySetUpCallPCmd(requestStatus, setpPck);
       
   201 		
       
   202 	PrepareCompleteDataL ( aData, aAlphaIdentifier, aResultCode, aSecondAlphaIdentifier );
       
   203 	
       
   204 	User::WaitForRequest(requestStatus);
       
   205 	ASSERT_EQUALS(aResultCode, requestStatus.Int());
       
   206 	}
       
   207 
       
   208 void CCSatSetUpCallFU::DataCompareL(const RSat::TSetUpCallV6& aSetupCallData,
       
   209 		                           const TUint8 aCommandQualifier,
       
   210 		                           const TDesC& aAlphaId,
       
   211 		                           const RSat::TTypeOfNumber aTypeOfNumber,
       
   212 		                           const RSat::TNumberingPlan aNumberPlan)
       
   213 	{
       
   214 	RSat::TSetUpCallType type;
       
   215 	
       
   216     switch ( aCommandQualifier )
       
   217         {
       
   218         case KOnlyIfNotBusy:
       
   219             {
       
   220             // Set up call, if not busy on another call
       
   221             type = RSat::EOnlyIfNotBusy;
       
   222             break;
       
   223             }
       
   224         case KOnlyIfNotBusyWithRedial:
       
   225             {
       
   226             // Set up call, if not busy on another call, with redial
       
   227             type = RSat::EOnlyIfNotBusyWithRedial;
       
   228             break;
       
   229             }
       
   230         case KHoldOtherCalls:
       
   231             {
       
   232             // Set up call, put other calls (if any) on hold
       
   233             type = RSat::EHoldOtherCalls;
       
   234             break;
       
   235             }
       
   236         case KHoldOtherCallsWithRedial:
       
   237             {
       
   238             // Set up call, put other calls (if any) on hold, with 
       
   239             // redial
       
   240             type = RSat::EHoldOtherCallsWithRedial;
       
   241             break;
       
   242             }
       
   243         case KDisconnectOtherCalls:
       
   244             {
       
   245             // Set up call, disconnect other calls (if any)
       
   246             type = RSat::EDisconnectOtherCalls;
       
   247             break;
       
   248             }
       
   249         case KDisconnectOtherCallsWithRedial:
       
   250             {
       
   251             // Set up call, disconn. other calls (if any), with redial
       
   252             type = RSat::EDisconnectOtherCallsWithRedial;
       
   253             break;
       
   254             }
       
   255         default:
       
   256             {
       
   257             // Call type not set
       
   258             type = RSat::ESetUpCallTypeNotSet;
       
   259             break;
       
   260             }
       
   261         }
       
   262     
       
   263 	ASSERT_EQUALS(type, aSetupCallData.iType);
       
   264 	ASSERT_TRUE(0 == aSetupCallData.iAlphaIdConfirmationPhase.iAlphaId.Compare(aAlphaId));
       
   265 	ASSERT_EQUALS(aTypeOfNumber, aSetupCallData.iAddress.iTypeOfNumber);
       
   266 	ASSERT_EQUALS(aNumberPlan, aSetupCallData.iAddress.iNumberPlan);
       
   267 	}
       
   268 
       
   269 //
       
   270 // Actual test cases
       
   271 //
       
   272 
       
   273 
       
   274 /**
       
   275 @SYMTestCaseID BA-CSAT-SUC-SNSUCPC-0001
       
   276 @SYMPREQ 1780
       
   277 @SYMComponent  telephony_csat
       
   278 @SYMTestCaseDesc Test support in CSAT for RSat::NotifySetUpCallPCmd
       
   279 @SYMTestPriority High
       
   280 @SYMTestActions Invokes RSat::NotifySetUpCallPCmd
       
   281 @SYMTestExpectedResults Pass
       
   282 @SYMTestType CT
       
   283 */
       
   284 void CCSatSetUpCallFU::TestNotifySetUpCallPCmd0001L()
       
   285 	{
       
   286 
       
   287 	OpenEtelServerL(EUseExtendedError);
       
   288 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
   289 	OpenPhoneL();
       
   290 	OpenSatL();
       
   291 	
       
   292 	TRequestStatus requestStatus;
       
   293 	
       
   294 	const TUint8 KAddress = 0x91; //10010001
       
   295 	RSat::TSetUpCallV6 setupCallData;
       
   296 	TData data;
       
   297 	data.iCommandNumber = 1;
       
   298 	data.iCommandQualifier = KSetUpCallIfNotCurrentlyBusy;
       
   299 	data.iSourceDevice = KSim;
       
   300 	data.iDestinationDevice = KNetwork;
       
   301 	data.iAddress = KAddress;
       
   302 	data.iCommandType = KSetUpCall;
       
   303 
       
   304 	_LIT8(KAlphaIdentifier1, "Not busy");
       
   305 	_LIT16(KAlphaIdentifier1_16, "Not busy");
       
   306 	
       
   307 	data.iCallNumber.Append(0x10);
       
   308 	data.iCallNumber.Append(0x32);
       
   309 	data.iCallNumber.Append(0x04);
       
   310 	data.iCallNumber.Append(0x21);
       
   311 	data.iCallNumber.Append(0x43);
       
   312 	data.iCallNumber.Append(0x65);
       
   313 	data.iCallNumber.Append(0x1C);
       
   314 	data.iCallNumber.Append(0x2C);
       
   315 	
       
   316  	//-------------------------------------------------------------------------
       
   317 	// TEST C: Successful completion request of
       
   318 	// RSat::NotifySetUpCallPCmd 
       
   319  	//-------------------------------------------------------------------------
       
   320 
       
   321 	// test C - implemented in 0001b-0001d functions
       
   322 
       
   323  	//-------------------------------------------------------------------------
       
   324 	// TEST E: Coverage test(s) for RSat::NotifySetUpCallPCmd
       
   325  	//-------------------------------------------------------------------------
       
   326 
       
   327 	iMockLTSY.NotifyTerminated(requestStatus);
       
   328 	
       
   329 	PrepareCompleteDataL ( data, KAlphaIdentifier1 );
       
   330 
       
   331 	RSat::TAdditionalInfo additionalInfo;
       
   332 	additionalInfo.Append(KNoCause);
       
   333 
       
   334 	PrepareTerminalResponseMockDataL( data.iCommandNumber, data.iCommandType, 
       
   335 			data.iCommandQualifier, additionalInfo, RSat::KMeUnableToProcessCmd, KNullDesC8 );
       
   336 
       
   337 	User::WaitForRequest(requestStatus);
       
   338 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
   339 	AssertMockLtsyStatusL();
       
   340 
       
   341 	//-------------------------------------------------------------------------
       
   342 	// to increase CSatNotifySetUpCall::CompleteNotifyL coverage 
       
   343  	//-------------------------------------------------------------------------
       
   344 	
       
   345 	PrepareExpectDataL ( data.iCommandType );
       
   346 	
       
   347 	RSat::TSetUpCallV6Pckg setpPck(setupCallData);
       
   348 	iSat.NotifySetUpCallPCmd(requestStatus, setpPck);
       
   349 	
       
   350 	RBuf8 bufData;
       
   351 	CleanupClosePushL(bufData);	
       
   352 	
       
   353 	TTlv tlv;
       
   354 	tlv.Begin(KBerTlvProactiveSimCommandTag);
       
   355 	
       
   356 	tlv.AddTag(KTlvCommandDetailsTag);         // Command details
       
   357 	tlv.AddByte(data.iCommandNumber);               // Command number     
       
   358 	tlv.AddByte(data.iCommandType);                   // Command type     
       
   359 	tlv.AddByte(data.iCommandQualifier);            // Command qualifier  
       
   360 	
       
   361 	tlv.AddTag(KTlvDeviceIdentityTag);         // Device identities          
       
   362 	tlv.AddByte(data.iSourceDevice);                // Source device     
       
   363 	tlv.AddByte(data.iDestinationDevice);           // Destination device     
       
   364 
       
   365 	tlv.AddTag(KTlvAlphaIdentifierTag);
       
   366 	tlv.AddTag(KTlvAlphaIdentifierTag);
       
   367 	tlv.AddTag(KTlvAddressTag);
       
   368 	tlv.AddTag(KTlvSubaddressTag);
       
   369 
       
   370 	TPtrC8 tlvDsc = tlv.End();
       
   371 	TDesC8* tlvDscPtr = &tlvDsc;
       
   372 	TMockLtsyData1<TDesC8*> tlvDscPack(tlvDscPtr);
       
   373 	tlvDscPack.SerialiseL(bufData);
       
   374 	iMockLTSY.CompleteL(KMockLtsyDispatchSatPcmdIndId, KErrNone, bufData, KDelay);
       
   375 
       
   376 	PrepareTerminalResponseMockDataL( data.iCommandNumber, data.iCommandType, 
       
   377 			data.iCommandQualifier, KNullDesC16, RSat::KCmdDataNotUnderstood, KNullDesC8 );
       
   378 
       
   379 	User::WaitForRequest(requestStatus);
       
   380 	ASSERT_EQUALS(KErrCorrupt, requestStatus.Int());
       
   381 	AssertMockLtsyStatusL();
       
   382 
       
   383 	//-------------------------------------------------------------------------
       
   384 	// to increase CSatNotifySetUpCall::CompleteNotifyL coverage 
       
   385 	// in case of  "command qualifier"
       
   386  	//-------------------------------------------------------------------------
       
   387 
       
   388 	const TUint8 KDefualtCommand = 0x7F;
       
   389 	const TUint8 qualifierArray[] = { KHoldOtherCallsWithRedial, KDisconnectOtherCallsWithRedial, 
       
   390 			                          KDefualtCommand };
       
   391 	TUint8 sizeArray = sizeof(qualifierArray)/sizeof(qualifierArray[0]);
       
   392 	RSat::TSetUpCallRspV2 resp;
       
   393 	RSat::TSetUpCallRspV2Pckg respPck(resp);
       
   394 
       
   395 	for ( TUint8 i = 0; i < sizeArray; i++ )
       
   396 		{
       
   397 		data.iCommandQualifier = qualifierArray[i];
       
   398 		ProactiveCommandCallL( setupCallData, data, KAlphaIdentifier1 );
       
   399 
       
   400 		DataCompareL(setupCallData, 
       
   401 				     data.iCommandQualifier, 
       
   402 				     KAlphaIdentifier1_16,
       
   403 				     RSat::EInternationalNumber,
       
   404 				     RSat::EIsdnNumberPlan);
       
   405 
       
   406 		resp.iInfoType = RSat::KNoAdditionalInfo;
       
   407 		resp.iGeneralResult = RSat::KSuccess;
       
   408 		CCSatComponentTestBase::GenerateTerminalResponseL( data.iCommandNumber, data.iCommandType, 
       
   409 				data.iCommandQualifier, RSat::ESetUpCall, respPck, resp.iAdditionalInfo, resp.iGeneralResult );
       
   410 		AssertMockLtsyStatusL();
       
   411 		}
       
   412 
       
   413 	//-------------------------------------------------------------------------
       
   414 	// TEST B: failure on completion of pending request from LTSY->CTSY
       
   415  	//-------------------------------------------------------------------------
       
   416 
       
   417 	ProactiveCommandCallL( setupCallData, data, KAlphaIdentifier1, KErrGeneral);
       
   418 
       
   419 	CleanupStack::PopAndDestroy(2, this); // this, bufData
       
   420 
       
   421 	}
       
   422 
       
   423 
       
   424 /**
       
   425 @SYMTestCaseID BA-CSAT-SUC-SNSUCPC-0002
       
   426 @SYMPREQ 1780
       
   427 @SYMComponent  telephony_csat
       
   428 @SYMTestCaseDesc Test support in CSAT for cancelling of RSat::NotifySetUpCallPCmd
       
   429 @SYMTestPriority High
       
   430 @SYMTestActions Invokes cancelling of RSat::NotifySetUpCallPCmd
       
   431 @SYMTestExpectedResults Pass
       
   432 @SYMTestType CT
       
   433 */
       
   434 void CCSatSetUpCallFU::TestNotifySetUpCallPCmd0002L()
       
   435 	{
       
   436 
       
   437 	OpenEtelServerL(EUseExtendedError);
       
   438 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
   439 	OpenPhoneL();
       
   440 	OpenSatL();
       
   441 
       
   442 	TUint8 commandType = KSetUpCall;
       
   443 	
       
   444 	TRequestStatus requestStatus;
       
   445 
       
   446  	//-------------------------------------------------------------------------
       
   447 	// Test cancelling of RSat::NotifySetUpCallPCmd
       
   448  	//-------------------------------------------------------------------------
       
   449 
       
   450 	PrepareExpectDataL ( commandType );
       
   451 
       
   452 	RSat::TSetUpCallV6 setupCallData;
       
   453 	RSat::TSetUpCallV6Pckg setupCallDataPck(setupCallData);
       
   454 	iSat.NotifySetUpCallPCmd(requestStatus, setupCallDataPck);
       
   455 
       
   456 	iSat.CancelAsyncRequest(ESatNotifySetUpCallPCmd);
       
   457 
       
   458 	User::WaitForRequest(requestStatus);
       
   459 	ASSERT_EQUALS(KErrCancel, requestStatus.Int());
       
   460 
       
   461 	AssertMockLtsyStatusL();
       
   462 
       
   463 	CleanupStack::PopAndDestroy(1, this); // this	
       
   464 
       
   465 	}
       
   466 
       
   467 
       
   468 /**
       
   469 @SYMTestCaseID BA-CSAT-SUC-SNSUCPC-0004
       
   470 @SYMPREQ 1780
       
   471 @SYMComponent  telephony_csat
       
   472 @SYMTestCaseDesc Test support in CSAT for multiple client requests to RSat::NotifySetUpCallPCmd
       
   473 @SYMTestPriority High
       
   474 @SYMTestActions Invokes multiple client requests to RSat::NotifySetUpCallPCmd
       
   475 @SYMTestExpectedResults Pass
       
   476 @SYMTestType CT
       
   477 */
       
   478 void CCSatSetUpCallFU::TestNotifySetUpCallPCmd0004L()
       
   479 	{
       
   480 
       
   481 	OpenEtelServerL(EUseExtendedError);
       
   482 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
   483 	OpenPhoneL();
       
   484 	OpenSatL();
       
   485 
       
   486 	// Open second client
       
   487 	RTelServer telServer2;
       
   488 	TInt ret = telServer2.Connect();
       
   489 	ASSERT_EQUALS(KErrNone, ret);
       
   490 	CleanupClosePushL(telServer2);
       
   491 
       
   492 	RMobilePhone phone2;
       
   493 	ret = phone2.Open(telServer2, KMmTsyPhoneName);
       
   494 	ASSERT_EQUALS(KErrNone, ret);
       
   495 	CleanupClosePushL(phone2);
       
   496 	
       
   497 	RSat sat2;
       
   498 	ret = sat2.Open(phone2);
       
   499 	ASSERT_EQUALS(KErrNone, ret);
       
   500 	CleanupClosePushL(sat2);
       
   501 
       
   502 	TRequestStatus requestStatus1;
       
   503 	TRequestStatus requestStatus2;
       
   504 
       
   505 	const TUint8 KAddress = 0x91; //10010001
       
   506 
       
   507 	TData data;
       
   508 	data.iCommandNumber = 1;
       
   509 	data.iCommandQualifier = KSetUpCallIfNotCurrentlyBusy;
       
   510 	data.iSourceDevice = KSim;
       
   511 	data.iDestinationDevice = KNetwork;
       
   512 	data.iAddress = KAddress;
       
   513 	data.iCommandType = KSetUpCall;
       
   514 
       
   515 	_LIT8(KAlphaIdentifier1, "Not busy");
       
   516 	_LIT16(KAlphaIdentifier2, "Not busy");
       
   517 	
       
   518 	data.iCallNumber.Append(0x10);
       
   519 	data.iCallNumber.Append(0x32);
       
   520 	data.iCallNumber.Append(0x04);
       
   521 	data.iCallNumber.Append(0x21);
       
   522 	data.iCallNumber.Append(0x43);
       
   523 	data.iCallNumber.Append(0x65);
       
   524 	data.iCallNumber.Append(0x1C);
       
   525 	data.iCallNumber.Append(0x2C);
       
   526 
       
   527 	//-------------------------------------------------------------------------
       
   528 	// Test A: Test multiple clients requesting RSat::NotifySetUpCallPCmd
       
   529 	// when they both pass the same T-class version
       
   530  	//-------------------------------------------------------------------------
       
   531 
       
   532 	PrepareExpectDataL ( data.iCommandType );
       
   533 	
       
   534 	RSat::TSetUpCallV6 setupCallData1;
       
   535 	RSat::TSetUpCallV6Pckg setpPck1(setupCallData1);
       
   536 	iSat.NotifySetUpCallPCmd(requestStatus1, setpPck1);
       
   537 
       
   538 	RSat::TSetUpCallV6 setupCallData2;
       
   539 	RSat::TSetUpCallV6Pckg setpPck2(setupCallData2);
       
   540 	sat2.NotifySetUpCallPCmd(requestStatus2, setpPck2);
       
   541 
       
   542 	PrepareCompleteDataL ( data, KAlphaIdentifier1 );
       
   543 
       
   544 	User::WaitForRequest(requestStatus1);
       
   545 	User::WaitForRequest(requestStatus2);
       
   546 
       
   547 	ASSERT_EQUALS(KErrNone, requestStatus1.Int());
       
   548 	ASSERT_EQUALS(KErrNone, requestStatus2.Int());
       
   549 
       
   550 	DataCompareL(setupCallData1, 
       
   551 			     data.iCommandQualifier, 
       
   552 			     KAlphaIdentifier2,
       
   553 			     RSat::EInternationalNumber,
       
   554 			     RSat::EIsdnNumberPlan);
       
   555 
       
   556 	DataCompareL(setupCallData2, 
       
   557 			     data.iCommandQualifier, 
       
   558 			     KAlphaIdentifier2,
       
   559 			     RSat::EInternationalNumber,
       
   560 			     RSat::EIsdnNumberPlan);
       
   561 
       
   562 	AssertMockLtsyStatusL();
       
   563 
       
   564 	CleanupStack::PopAndDestroy(4, this); // sat2, phone2, telServer2, this
       
   565 
       
   566 	}
       
   567 
       
   568 /**
       
   569 @SYMTestCaseID BA-CSAT-SUC-SNSUCPC-0001b
       
   570 @SYMPREQ 1780
       
   571 @SYMComponent telephony_ctsy
       
   572 @SYMTestCaseDesc Test support in CTSY for set up call ipc ( Expected Sequence 2 See 3GPP TS 31.124 ) 
       
   573 @SYMTestPriority High
       
   574 @SYMTestActions Invokes RSat.NotifySetUpCallPCmd
       
   575 @SYMTestExpectedResults Pass
       
   576 @SYMTestType CT
       
   577  */
       
   578 
       
   579 void CCSatSetUpCallFU::TestNotifySetUpCallPCmd0001bL()
       
   580 	{
       
   581 	OpenEtelServerL(EUseExtendedError);
       
   582 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
   583 	OpenPhoneL();
       
   584 	OpenSatL();
       
   585 	
       
   586 	RSat::TSetUpCallRspV2 resp;
       
   587 	RSat::TSetUpCallRspV2Pckg respPck(resp);
       
   588 	RSat::TSetUpCallV6 setupCallData;
       
   589 
       
   590 	const TUint8 KAddress = 0x91; //10010001
       
   591 
       
   592 	TData data;
       
   593 	data.iCommandNumber = 1;
       
   594 	data.iCommandQualifier = KSetUpCallIfNotCurrentlyBusy;
       
   595 	data.iSourceDevice = KSim;
       
   596 	data.iDestinationDevice = KNetwork;
       
   597 	data.iAddress = KAddress;
       
   598 	data.iCommandType = KSetUpCall;
       
   599 
       
   600 	//
       
   601 	// Expected Sequence 2.1 (SET UP CALL, two alpha identifiers)
       
   602 	//
       
   603 
       
   604 	data.iCallNumber.Append(0x10);
       
   605 	data.iCallNumber.Append(0x32);
       
   606 	data.iCallNumber.Append(0x04);
       
   607 	data.iCallNumber.Append(0x21);
       
   608 	data.iCallNumber.Append(0x43);
       
   609 	data.iCallNumber.Append(0x65);
       
   610 	data.iCallNumber.Append(0x1C);
       
   611 	data.iCallNumber.Append(0x2C);
       
   612 
       
   613 	_LIT8(KAlphaIdentifier8_1, "CONFIRMATION");
       
   614 	_LIT16(KAlphaIdentifier16, "CONFIRMATION");
       
   615 
       
   616 	_LIT8(KAlphaIdentifier8_2, "CALL");
       
   617 
       
   618 	data.iDuration.iIfUse = EFalse;
       
   619 	data.iCommandQualifier = KSetUpCallIfNotCurrentlyBusy;
       
   620 	ProactiveCommandCallL( setupCallData, data, KAlphaIdentifier8_1, KErrNone, KAlphaIdentifier8_2 );
       
   621 
       
   622 	DataCompareL(setupCallData, 
       
   623 			     data.iCommandQualifier,
       
   624 			     KAlphaIdentifier16, 
       
   625 			     RSat::EInternationalNumber, 
       
   626 			     RSat::EIsdnNumberPlan);
       
   627 
       
   628 	resp.iInfoType = RSat::KNoAdditionalInfo;
       
   629 	resp.iAdditionalInfo.Zero();
       
   630 	resp.iGeneralResult = RSat::KSuccess;
       
   631 	CCSatComponentTestBase::GenerateTerminalResponseL( data.iCommandNumber, data.iCommandType, 
       
   632 			data.iCommandQualifier, RSat::ESetUpCall, respPck, KNullDesC16, resp.iGeneralResult );
       
   633 	AssertMockLtsyStatusL();
       
   634 
       
   635 	CleanupStack::PopAndDestroy(1, this); // this
       
   636 	}
       
   637 
       
   638 /**
       
   639 @SYMTestCaseID BA-CSAT-SUC-SNSUCPC-0001c
       
   640 @SYMPREQ 1780
       
   641 @SYMComponent telephony_ctsy
       
   642 @SYMTestCaseDesc Test support in CTSY for set up call ipc ( Expected Sequence 3 See 3GPP TS 31.124 ) 
       
   643 @SYMTestPriority High
       
   644 @SYMTestActions Invokes RSat.NotifySetUpCallPCmd
       
   645 @SYMTestExpectedResults Pass
       
   646 @SYMTestType CT
       
   647  */
       
   648 
       
   649 void CCSatSetUpCallFU::TestNotifySetUpCallPCmd0001cL()
       
   650 	{
       
   651 	OpenEtelServerL(EUseExtendedError);
       
   652 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
   653 	OpenPhoneL();
       
   654 	OpenSatL();
       
   655 	
       
   656 	RSat::TSetUpCallRspV2 resp;
       
   657 	RSat::TSetUpCallRspV2Pckg respPck(resp);
       
   658 	RSat::TSetUpCallV6 setupCallData;
       
   659 
       
   660 	const TUint8 KAddress = 0x91; //10010001
       
   661 
       
   662 	TData data;
       
   663 	data.iCommandNumber = 1;
       
   664 	data.iCommandQualifier = KSetUpCallIfNotCurrentlyBusy;
       
   665 	data.iSourceDevice = KSim;
       
   666 	data.iDestinationDevice = KNetwork;
       
   667 	data.iAddress = KAddress;
       
   668 	data.iCommandType = KSetUpCall;
       
   669 	
       
   670 	//
       
   671 	// Expected Sequence 3.1A (SET UP CALL, display of basic icon during confirmation phase, 
       
   672 	// not selfexplanatory, successful)
       
   673 	//
       
   674 
       
   675 	data.iCallNumber.Append(0x10);
       
   676 	data.iCallNumber.Append(0x32);
       
   677 	data.iCallNumber.Append(0x04);
       
   678 	data.iCallNumber.Append(0x21);
       
   679 	data.iCallNumber.Append(0x43);
       
   680 	data.iCallNumber.Append(0x65);
       
   681 	data.iCallNumber.Append(0x1C);
       
   682 	data.iCallNumber.Append(0x2C);
       
   683 
       
   684 	const TUint8 KIconNotSelfExplanatory = 0x01;
       
   685 
       
   686 	_LIT8(KAlphaIdentifier8_9, "Set up call Icon 3.1.1");
       
   687 	_LIT16(KAlphaIdentifier16_9, "Set up call Icon 3.1.1");
       
   688 	data.iIcon1.iIfUse = ETrue;
       
   689 	data.iIcon1.iIdentifier = 0x01;
       
   690 	data.iIcon1.iQualifier = KIconNotSelfExplanatory;
       
   691 
       
   692 	ProactiveCommandCallL( setupCallData, data, KAlphaIdentifier8_9 );
       
   693 
       
   694 	DataCompareL(setupCallData, 
       
   695 			     data.iCommandQualifier,
       
   696 			     KAlphaIdentifier16_9, 
       
   697 			     RSat::EInternationalNumber, 
       
   698 			     RSat::EIsdnNumberPlan);
       
   699 
       
   700 	resp.iInfoType = RSat::KNoAdditionalInfo;
       
   701 	resp.iAdditionalInfo.Zero();
       
   702 	resp.iGeneralResult = RSat::KSuccess;
       
   703 
       
   704 	CCSatComponentTestBase::GenerateTerminalResponseL( data.iCommandNumber, data.iCommandType, 
       
   705 			data.iCommandQualifier, RSat::ESetUpCall, respPck, KNullDesC16, resp.iGeneralResult );
       
   706 	AssertMockLtsyStatusL();
       
   707 
       
   708 	//
       
   709 	// Expected Sequence 3.2A (SET UP CALL, display of basic icon during confirmation phase, 
       
   710 	// selfexplanatory, successful)
       
   711 	//
       
   712 
       
   713 	const TUint8 KIconSelfExplanatory = 0x00;
       
   714 
       
   715 	_LIT8(KAlphaIdentifier8_10, "Set up call Icon 3.2.1");
       
   716 	_LIT16(KAlphaIdentifier16_10, "Set up call Icon 3.2.1");
       
   717 	data.iIcon1.iQualifier = KIconSelfExplanatory;
       
   718 	data.iIcon1.iIdentifier = 0x02;
       
   719 
       
   720 	ProactiveCommandCallL( setupCallData, data, KAlphaIdentifier8_10 );
       
   721 
       
   722 	DataCompareL(setupCallData, 
       
   723 			     data.iCommandQualifier,
       
   724 			     KAlphaIdentifier16_10, 
       
   725 			     RSat::EInternationalNumber, 
       
   726 			     RSat::EIsdnNumberPlan);
       
   727 
       
   728 	resp.iGeneralResult = RSat::KSuccess;
       
   729 	CCSatComponentTestBase::GenerateTerminalResponseL( data.iCommandNumber, data.iCommandType, 
       
   730 			data.iCommandQualifier, RSat::ESetUpCall, respPck, KNullDesC16, resp.iGeneralResult );
       
   731 	AssertMockLtsyStatusL();
       
   732 
       
   733 	//
       
   734 	// Expected Sequence 3.3A (SET UP CALL, display of colour icon during confirmation phase, 
       
   735 	// not self-explanatory, successful)
       
   736 	//
       
   737 
       
   738 	_LIT8(KAlphaIdentifier8_11, "Set up call Icon 3.3.1");
       
   739 	_LIT16(KAlphaIdentifier16_11, "Set up call Icon 3.3.1");
       
   740 	data.iIcon1.iQualifier = KIconNotSelfExplanatory;
       
   741 	data.iIcon1.iIdentifier = 0x02;
       
   742 
       
   743 	ProactiveCommandCallL( setupCallData, data, KAlphaIdentifier8_11 );
       
   744 
       
   745 	DataCompareL(setupCallData, 
       
   746 			     data.iCommandQualifier,
       
   747 			     KAlphaIdentifier16_11, 
       
   748 			     RSat::EInternationalNumber, 
       
   749 			     RSat::EIsdnNumberPlan);
       
   750 
       
   751 	resp.iGeneralResult = RSat::KSuccess;
       
   752 	CCSatComponentTestBase::GenerateTerminalResponseL( data.iCommandNumber, data.iCommandType, 
       
   753 			data.iCommandQualifier, RSat::ESetUpCall, respPck, KNullDesC16, resp.iGeneralResult );
       
   754 	AssertMockLtsyStatusL();
       
   755 
       
   756 	//
       
   757 	// Expected Sequence 3.4A (display of self explanatory basic icon during set up call,
       
   758 	// successful)
       
   759 	//
       
   760 
       
   761 	_LIT8(KAlphaIdentifier8_12_1, "Set up call Icon 3.4.1");
       
   762 	_LIT8(KAlphaIdentifier8_12_2, "Set up call Icon 3.4.2");
       
   763 	_LIT16(KAlphaIdentifier16_12, "Set up call Icon 3.4.1");
       
   764 	data.iIcon1.iQualifier = KIconSelfExplanatory;
       
   765 	data.iIcon1.iIdentifier = 0x01;
       
   766 	data.iIcon2.iIfUse = ETrue;
       
   767 	data.iIcon2.iIdentifier = 0x01;
       
   768 	data.iIcon2.iQualifier = KIconSelfExplanatory;
       
   769 
       
   770 	ProactiveCommandCallL( setupCallData, data, KAlphaIdentifier8_12_1, 
       
   771 			               KErrNone, KAlphaIdentifier8_12_2 );
       
   772 
       
   773 	DataCompareL(setupCallData, 
       
   774 			     data.iCommandQualifier,
       
   775 			     KAlphaIdentifier16_12, 
       
   776 			     RSat::EInternationalNumber, 
       
   777 			     RSat::EIsdnNumberPlan);
       
   778 
       
   779 	resp.iGeneralResult = RSat::KSuccess;
       
   780 	CCSatComponentTestBase::GenerateTerminalResponseL( data.iCommandNumber, data.iCommandType, 
       
   781 			data.iCommandQualifier, RSat::ESetUpCall, respPck, KNullDesC16, resp.iGeneralResult );
       
   782 	AssertMockLtsyStatusL();
       
   783 
       
   784 	//
       
   785 	// Expected Sequence 3.1B (SET UP CALL, display of basic icon during confirmation phase, 
       
   786 	// not selfexplanatory, requested icon could not be displayed)
       
   787 	//
       
   788 
       
   789 	// Parameters call for Expected Sequence 3.1A
       
   790 	data.iIcon1.iQualifier = KIconNotSelfExplanatory;
       
   791 	data.iIcon1.iIdentifier = 0x01;
       
   792 
       
   793 	ProactiveCommandCallL( setupCallData, data, KAlphaIdentifier8_9 );
       
   794 
       
   795 	
       
   796 	/*
       
   797 	 * The Expected Sequence 3.1B does not correspond to code. 
       
   798 	 * CSatNotifySetUpCall::TerminalResponseL function returns KErrCorrupt code error
       
   799 	 * in case of "resp.iGeneralResult = RSat::KSuccessRequestedIconNotDisplayed".
       
   800 	 * But 3GPP TS 31.124 ( Section 27.22.4.13.3.4.2 ) document says that in case of 
       
   801 	 * "resp.iGeneralResult = RSat::KSuccessRequestedIconNotDisplayed" 
       
   802 	 * CSatNotifySetUpCall::TerminalResponseL function should return KErrNone.
       
   803 	 */
       
   804 
       
   805 	resp.iGeneralResult = RSat::KSuccessRequestedIconNotDisplayed;
       
   806 
       
   807 	CCSatComponentTestBase::PrepareTerminalResponseMockDataL(
       
   808 			data.iCommandNumber,
       
   809 			data.iCommandType,
       
   810 			data.iCommandQualifier,
       
   811 			KNullDesC16,
       
   812 			resp.iGeneralResult,
       
   813 			KNullDesC8);
       
   814 
       
   815 	TRequestStatus reqStatus;
       
   816 	iSat.TerminalRsp(reqStatus, RSat::ESetUpCall, respPck);	
       
   817 	User::WaitForRequest(reqStatus);
       
   818 	ASSERT_EQUALS(KErrNone, reqStatus.Int());
       
   819 	AssertMockLtsyStatusL();
       
   820 
       
   821 	//
       
   822 	// Expected Sequence 3.2B (SET UP CALL, display of basic icon during confirmation phase, 
       
   823 	// selfexplanatory, requested icon could not be displayed)
       
   824 	//
       
   825 
       
   826 	data.iIcon1.iIdentifier = 0x02;
       
   827 
       
   828 	ProactiveCommandCallL( setupCallData, data, KAlphaIdentifier8_10 );
       
   829 
       
   830 	CCSatComponentTestBase::GenerateTerminalResponseL( data.iCommandNumber, data.iCommandType, 
       
   831 			data.iCommandQualifier, RSat::ESetUpCall, respPck, KNullDesC16, resp.iGeneralResult );
       
   832 	AssertMockLtsyStatusL();
       
   833 
       
   834 	//
       
   835 	// Expected Sequence 3.3B (SET UP CALL, display of colour icon during confirmation phase, 
       
   836 	// not self-explanatory, requested icon could not be displayed)
       
   837 	//
       
   838 
       
   839 	ProactiveCommandCallL( setupCallData, data, KAlphaIdentifier8_11 );
       
   840 
       
   841 	CCSatComponentTestBase::GenerateTerminalResponseL( data.iCommandNumber, data.iCommandType, 
       
   842 			data.iCommandQualifier, RSat::ESetUpCall, respPck, KNullDesC16, resp.iGeneralResult );
       
   843 	AssertMockLtsyStatusL();
       
   844 
       
   845 	//
       
   846 	// Expected Sequence 3.4B (SET UP CALL, display of self explanatory basic icon during 
       
   847 	// set up call, requested icon could not be displayed)
       
   848 	//
       
   849 
       
   850 	data.iIcon1.iQualifier = KIconSelfExplanatory;
       
   851 	data.iIcon1.iIdentifier = 0x01;
       
   852 
       
   853 	ProactiveCommandCallL( setupCallData, data, KAlphaIdentifier8_12_1, 
       
   854 			               KErrNone, KAlphaIdentifier8_12_2 );
       
   855 
       
   856 	CCSatComponentTestBase::GenerateTerminalResponseL( data.iCommandNumber, data.iCommandType, 
       
   857 			data.iCommandQualifier, RSat::ESetUpCall, respPck, KNullDesC16, resp.iGeneralResult );
       
   858 	AssertMockLtsyStatusL();
       
   859 
       
   860 	CleanupStack::PopAndDestroy(1, this); // this
       
   861 	}
       
   862 
       
   863 /**
       
   864 @SYMTestCaseID BA-CSAT-SUC-SNSUCPC-0001d
       
   865 @SYMPREQ 1780
       
   866 @SYMComponent telephony_ctsy
       
   867 @SYMTestCaseDesc Test support in CTSY for set up call ipc ( Expected Sequence 4 See 3GPP TS 31.124 ) 
       
   868 @SYMTestPriority High
       
   869 @SYMTestActions Invokes RSat.NotifySetUpCallPCmd
       
   870 @SYMTestExpectedResults Pass
       
   871 @SYMTestType CT
       
   872  */
       
   873 
       
   874 void CCSatSetUpCallFU::TestNotifySetUpCallPCmd0001dL()
       
   875 	{
       
   876 	OpenEtelServerL(EUseExtendedError);
       
   877 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
   878 	OpenPhoneL();
       
   879 	OpenSatL();
       
   880 	
       
   881 	//
       
   882 	// Expected Sequence 4.1 (SET UP CALL, Text Attribute ?Left Alignment)
       
   883 	//
       
   884 
       
   885 	TestTextAttributeL(CCSatSetUpCallFU::TData::TTextAttribute::ELeft);
       
   886 
       
   887 	//
       
   888 	// Expected Sequence 4.2 (SET UP CALL, Text Attribute ?Left Alignment)
       
   889 	//
       
   890 
       
   891 	TestTextAttributeL(CCSatSetUpCallFU::TData::TTextAttribute::ECenter);
       
   892 
       
   893 	//
       
   894 	// Expected Sequence 4.3 (SET UP CALL, Text Attribute ?Right Alignment)
       
   895 	//
       
   896 
       
   897 	TestTextAttributeL(CCSatSetUpCallFU::TData::TTextAttribute::ERight);
       
   898 
       
   899 	//
       
   900 	// Expected Sequence 4.4 (SET UP CALL, Text Attribute ?Large Font Size)
       
   901 	//
       
   902 
       
   903 	TestTextAttributeL(CCSatSetUpCallFU::TData::TTextAttribute::ELarge);
       
   904 
       
   905 	//
       
   906 	// Expected Sequence 4.5 (SET UP CALL, Text Attribute ?Small Font Size)
       
   907 	//
       
   908 
       
   909 	TestTextAttributeL(CCSatSetUpCallFU::TData::TTextAttribute::ESmall);
       
   910 
       
   911 	//
       
   912 	// Expected Sequence 4.6 (SET UP CALL, Text Attribute ?Bold On)
       
   913 	//
       
   914 
       
   915 	TestTextAttributeL(CCSatSetUpCallFU::TData::TTextAttribute::EBond);
       
   916 
       
   917 	//
       
   918 	// Expected Sequence 4.7 (SET UP CALL, Text Attribute ?Italic On)
       
   919 	//
       
   920 
       
   921 	TestTextAttributeL(CCSatSetUpCallFU::TData::TTextAttribute::EItalic);
       
   922 
       
   923 	//
       
   924 	// Expected Sequence 4.8 (SET UP CALL, Text Attribute ?Underline On)
       
   925 	//
       
   926 
       
   927 	TestTextAttributeL(CCSatSetUpCallFU::TData::TTextAttribute::EUnderline);
       
   928 
       
   929 	//
       
   930 	// Expected Sequence 4.9 (SET UP CALL, Text Attribute ?Strikethrough On)
       
   931 	//
       
   932 
       
   933 	TestTextAttributeL(CCSatSetUpCallFU::TData::TTextAttribute::EStrikethrough);
       
   934 
       
   935 	//
       
   936 	// Expected Sequence 4.10 (SET UP CALL, Text Attribute ?Foreground and Background Colour)
       
   937 	//
       
   938 
       
   939 	TestTextAttributeL( CCSatSetUpCallFU::TData::TTextAttribute::ELeft,
       
   940 			            CCSatSetUpCallFU::TData::TTextAttribute::EMode1, 
       
   941 			            CCSatSetUpCallFU::TData::TTextAttribute::EMode2 );
       
   942 
       
   943 	CleanupStack::PopAndDestroy(1, this); // this
       
   944 	}
       
   945 
       
   946 void CCSatSetUpCallFU::TestTextAttributeL( const TUint8 aMode,
       
   947 		                                   const TUint8 aColour1,
       
   948 		                                   const TUint8 aColour2 )
       
   949 	{
       
   950 
       
   951 	RSat::TSetUpCallRspV2 resp;
       
   952 	RSat::TSetUpCallRspV2Pckg respPck(resp);
       
   953 	RSat::TSetUpCallV6 setupCallData;
       
   954 
       
   955 	const TUint8 KAddress = 0x91; //10010001
       
   956 
       
   957 	TData data;
       
   958 	data.iCommandNumber = 1;
       
   959 	data.iCommandQualifier = KSetUpCallIfNotCurrentlyBusy;
       
   960 	data.iSourceDevice = KSim;
       
   961 	data.iDestinationDevice = KNetwork;
       
   962 	data.iAddress = KAddress;
       
   963 	data.iCommandType = KSetUpCall;
       
   964 	
       
   965 	data.iCallNumber.Append(0x10);
       
   966 	data.iCallNumber.Append(0x32);
       
   967 	data.iCallNumber.Append(0x04);
       
   968 	data.iCallNumber.Append(0x21);
       
   969 	data.iCallNumber.Append(0x43);
       
   970 	data.iCallNumber.Append(0x65);
       
   971 	data.iCallNumber.Append(0x1C);
       
   972 	data.iCallNumber.Append(0x2C);
       
   973 
       
   974 	_LIT8(KAlphaIdentifier8_1, "CONFIRMATION 1");
       
   975 	_LIT8(KAlphaIdentifier8_2, "CALL 1");
       
   976 	_LIT16(KAlphaIdentifier16, "CONFIRMATION 1");
       
   977 
       
   978 	data.iTextAttribute1.iIfUse = ETrue;
       
   979 	data.iTextAttribute1.iFormattingPosition = 0;
       
   980 	data.iTextAttribute1.iFormattingLength = 0x14;
       
   981 	data.iTextAttribute1.iFormattingMode = aMode;
       
   982 	
       
   983 	// Dark Green Foreground, Bright Yellow Background
       
   984 	data.iTextAttribute1.iColour = aColour1;
       
   985 
       
   986 	data.iTextAttribute2 = data.iTextAttribute1;
       
   987 	data.iTextAttribute2.iFormattingLength = 0x06;
       
   988 	data.iTextAttribute2.iColour = aColour2;
       
   989 
       
   990 	ProactiveCommandCallL( setupCallData, data, KAlphaIdentifier8_1,
       
   991 			               KErrNone, KAlphaIdentifier8_2 );
       
   992 
       
   993 	DataCompareL(setupCallData, 
       
   994 			     data.iCommandQualifier,
       
   995 			     KAlphaIdentifier16, 
       
   996 			     RSat::EInternationalNumber, 
       
   997 			     RSat::EIsdnNumberPlan);
       
   998 
       
   999 	resp.iInfoType = RSat::KNoAdditionalInfo;
       
  1000 	resp.iAdditionalInfo.Zero();
       
  1001 	resp.iGeneralResult = RSat::KSuccess;
       
  1002 
       
  1003 	CCSatComponentTestBase::GenerateTerminalResponseL( data.iCommandNumber, data.iCommandType, 
       
  1004 			data.iCommandQualifier, RSat::ESetUpCall, respPck, KNullDesC16, resp.iGeneralResult );
       
  1005 	AssertMockLtsyStatusL();
       
  1006 
       
  1007 	}
       
  1008 
       
  1009 /**
       
  1010 @SYMTestCaseID BA-CSAT-SUC-SNSUCPC-0001e
       
  1011 @SYMPREQ 1780
       
  1012 @SYMComponent telephony_ctsy
       
  1013 @SYMTestCaseDesc Test support in CTSY for set up call ipc ( Expected Sequence 1 See 3GPP TS 31.124 ) 
       
  1014 @SYMTestPriority High
       
  1015 @SYMTestActions Invokes RSat.NotifySetUpCallPCmd
       
  1016 @SYMTestExpectedResults Pass
       
  1017 @SYMTestType CT
       
  1018  */
       
  1019 
       
  1020 void CCSatSetUpCallFU::TestNotifySetUpCallPCmd0001eL()
       
  1021 	{
       
  1022 	OpenEtelServerL(EUseExtendedError);
       
  1023 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  1024 	OpenPhoneL();
       
  1025 	OpenSatL();
       
  1026 	
       
  1027 	RSat::TSetUpCallRspV2 resp;
       
  1028 	RSat::TSetUpCallRspV2Pckg respPck(resp);
       
  1029 	RSat::TSetUpCallV6 setupCallData;
       
  1030 
       
  1031 	const TUint8 KAddress = 0x91; //10010001
       
  1032 
       
  1033 	TData data;
       
  1034 	data.iCommandNumber = 1;
       
  1035 	data.iCommandQualifier = KSetUpCallIfNotCurrentlyBusy;
       
  1036 	data.iSourceDevice = KSim;
       
  1037 	data.iDestinationDevice = KNetwork;
       
  1038 	data.iAddress = KAddress;
       
  1039 	data.iCommandType = KSetUpCall;
       
  1040 	
       
  1041 	//
       
  1042 	// See 3GPP TS 31.124 V7.4.0 (2008-06) in subclause 27.22.4.13, 
       
  1043 	// Expected Sequence 1.1 (SET UP CALL, call confirmed by the user and connected)
       
  1044 	//
       
  1045 	
       
  1046 	_LIT8(KAlphaIdentifier8_1, "Not busy");
       
  1047 	_LIT16(KAlphaIdentifier16_1, "Not busy");
       
  1048 	
       
  1049 	data.iCallNumber.Append(0x10);
       
  1050 	data.iCallNumber.Append(0x32);
       
  1051 	data.iCallNumber.Append(0x04);
       
  1052 	data.iCallNumber.Append(0x21);
       
  1053 	data.iCallNumber.Append(0x43);
       
  1054 	data.iCallNumber.Append(0x65);
       
  1055 	data.iCallNumber.Append(0x1C);
       
  1056 	data.iCallNumber.Append(0x2C);
       
  1057 	
       
  1058 	ProactiveCommandCallL( setupCallData, data, KAlphaIdentifier8_1 );
       
  1059 	
       
  1060 	DataCompareL(setupCallData, 
       
  1061 			     data.iCommandQualifier,
       
  1062 			     KAlphaIdentifier16_1, 
       
  1063 			     RSat::EInternationalNumber, 
       
  1064 			     RSat::EIsdnNumberPlan);
       
  1065 
       
  1066 	resp.iGeneralResult = RSat::KSuccess;
       
  1067 	resp.iInfoType = RSat::KNoAdditionalInfo;
       
  1068 	resp.SetPCmdNumber(data.iCommandNumber);
       
  1069 	CCSatComponentTestBase::GenerateTerminalResponseL( data.iCommandNumber, data.iCommandType, 
       
  1070 			data.iCommandQualifier, RSat::ESetUpCall, respPck, KNullDesC16, resp.iGeneralResult );
       
  1071 	AssertMockLtsyStatusL();
       
  1072 
       
  1073 	//
       
  1074 	// Expected Sequence 1.4 (SET UP CALL, putting all other calls on hold, ME busy)
       
  1075 	//
       
  1076 		
       
  1077 	data.iCommandQualifier = KSetUpCallPuttingOtherCallsOnHold;
       
  1078 	_LIT8(KAlphaIdentifier8_2, "On hold");
       
  1079 	_LIT16(KAlphaIdentifier16_2, "On hold");
       
  1080 	ProactiveCommandCallL( setupCallData, data, KAlphaIdentifier8_2 );
       
  1081 
       
  1082 	DataCompareL(setupCallData, 
       
  1083 			     data.iCommandQualifier,
       
  1084 			     KAlphaIdentifier16_2, 
       
  1085 			     RSat::EInternationalNumber, 
       
  1086 			     RSat::EIsdnNumberPlan);
       
  1087 
       
  1088 	CCSatComponentTestBase::GenerateTerminalResponseL( data.iCommandNumber, data.iCommandType, 
       
  1089 			data.iCommandQualifier, RSat::ESetUpCall, respPck, KNullDesC16, resp.iGeneralResult );
       
  1090 	AssertMockLtsyStatusL();
       
  1091 
       
  1092 	//
       
  1093 	// Expected Sequence 1.5 (SET UP CALL, disconnecting all other calls, ME busy)
       
  1094 	//
       
  1095 
       
  1096 	data.iCommandQualifier = KSetUpCallDisconnectingOtherCalls;
       
  1097 	_LIT8(KAlphaIdentifier8_3, "Disconnect");
       
  1098 	_LIT16(KAlphaIdentifier16_3, "Disconnect");
       
  1099 	ProactiveCommandCallL( setupCallData, data, KAlphaIdentifier8_3 );
       
  1100 
       
  1101 	DataCompareL(setupCallData, 
       
  1102 			     data.iCommandQualifier,
       
  1103 			     KAlphaIdentifier16_3, 
       
  1104 			     RSat::EInternationalNumber, 
       
  1105 			     RSat::EIsdnNumberPlan);
       
  1106 
       
  1107 	CCSatComponentTestBase::GenerateTerminalResponseL( data.iCommandNumber, data.iCommandType, 
       
  1108 			data.iCommandQualifier, RSat::ESetUpCall, respPck, KNullDesC16, resp.iGeneralResult );
       
  1109 	AssertMockLtsyStatusL();
       
  1110 
       
  1111 	//
       
  1112 	// Expected Sequence 1.6 (SET UP CALL, only if not currently busy on another call, ME busy)
       
  1113 	//
       
  1114 
       
  1115 	data.iCommandQualifier = KSetUpCallIfNotCurrentlyBusy;
       
  1116 	ProactiveCommandCallL( setupCallData, data, KAlphaIdentifier8_1 );
       
  1117 
       
  1118 	DataCompareL(setupCallData, 
       
  1119 			     data.iCommandQualifier,
       
  1120 			     KAlphaIdentifier16_1, 
       
  1121 			     RSat::EInternationalNumber, 
       
  1122 			     RSat::EIsdnNumberPlan);
       
  1123 
       
  1124 	resp.iInfoType = RSat::KMeProblem;
       
  1125 	resp.iAdditionalInfo.Append(RSat::KMeBusyOnCall);
       
  1126 	resp.iGeneralResult = RSat::KMeUnableToProcessCmd;
       
  1127 	CCSatComponentTestBase::GenerateTerminalResponseL( data.iCommandNumber, data.iCommandType, 
       
  1128 			data.iCommandQualifier, RSat::ESetUpCall, respPck, resp.iAdditionalInfo, resp.iGeneralResult );
       
  1129 	AssertMockLtsyStatusL();
       
  1130 	
       
  1131 	//
       
  1132 	// Expected Sequence 1.7A (SET UP CALL, putting all other calls on hold, call hold is not allowed)
       
  1133 	//
       
  1134 
       
  1135 	data.iCommandQualifier = KSetUpCallPuttingOtherCallsOnHold;
       
  1136 	ProactiveCommandCallL( setupCallData, data, KAlphaIdentifier8_2 );
       
  1137 
       
  1138 	DataCompareL(setupCallData, 
       
  1139 			     data.iCommandQualifier,
       
  1140 			     KAlphaIdentifier16_2, 
       
  1141 			     RSat::EInternationalNumber, 
       
  1142 			     RSat::EIsdnNumberPlan);
       
  1143 
       
  1144 	resp.iInfoType = RSat::KMeProblem;
       
  1145 	resp.iAdditionalInfo.Zero();
       
  1146 	resp.iAdditionalInfo.Append(RSat::KNoSpecificMeProblem);
       
  1147 	resp.iGeneralResult = RSat::KNetworkUnableToProcessCmd;
       
  1148 	CCSatComponentTestBase::GenerateTerminalResponseL( data.iCommandNumber, data.iCommandType, 
       
  1149 			data.iCommandQualifier, RSat::ESetUpCall, respPck, resp.iAdditionalInfo, resp.iGeneralResult );
       
  1150 	AssertMockLtsyStatusL();
       
  1151 
       
  1152 	//
       
  1153 	// Expected Sequence 1.7B
       
  1154 	//
       
  1155 
       
  1156 	ProactiveCommandCallL( setupCallData, data, KAlphaIdentifier8_2 );
       
  1157 
       
  1158 	DataCompareL(setupCallData, 
       
  1159 			     data.iCommandQualifier,
       
  1160 			     KAlphaIdentifier16_2, 
       
  1161 			     RSat::EInternationalNumber, 
       
  1162 			     RSat::EIsdnNumberPlan);
       
  1163 
       
  1164 	const TUint KFacilityRejected = 0x9D;
       
  1165 	
       
  1166 	resp.iInfoType = RSat::KMeProblem;
       
  1167 	resp.iAdditionalInfo.Zero();
       
  1168 	resp.iAdditionalInfo.Append(KFacilityRejected);
       
  1169 	CCSatComponentTestBase::GenerateTerminalResponseL( data.iCommandNumber, data.iCommandType, 
       
  1170 			data.iCommandQualifier, RSat::ESetUpCall, respPck, resp.iAdditionalInfo, resp.iGeneralResult );
       
  1171 	AssertMockLtsyStatusL();
       
  1172 
       
  1173 	//
       
  1174 	// Expected Sequence 1.8 (SET UP CALL, Capability configuration)
       
  1175 	//
       
  1176 	
       
  1177 	RSat::TCcp infoTransferCap;
       
  1178 	data.iInfoTransferCap.Append(0x01);
       
  1179 	data.iInfoTransferCap.Append(0xA0);
       
  1180 	_LIT8(KAlphaIdentifier8_4, "Capability config");
       
  1181 	_LIT16(KAlphaIdentifier16_4, "Capability config");
       
  1182 	data.iCommandQualifier = KSetUpCallIfNotCurrentlyBusy;
       
  1183 	ProactiveCommandCallL( setupCallData, data, KAlphaIdentifier8_4 );
       
  1184 
       
  1185 	DataCompareL(setupCallData, 
       
  1186 			     data.iCommandQualifier,
       
  1187 			     KAlphaIdentifier16_4, 
       
  1188 			     RSat::EInternationalNumber, 
       
  1189 			     RSat::EIsdnNumberPlan);
       
  1190 
       
  1191 	resp.iInfoType = RSat::KNoAdditionalInfo;
       
  1192 	resp.iAdditionalInfo.Zero();
       
  1193 	resp.iGeneralResult = RSat::KSuccess;
       
  1194 	CCSatComponentTestBase::GenerateTerminalResponseL( data.iCommandNumber, data.iCommandType, 
       
  1195 			data.iCommandQualifier, RSat::ESetUpCall, respPck, KNullDesC16, resp.iGeneralResult );
       
  1196 	AssertMockLtsyStatusL();
       
  1197 
       
  1198 	//
       
  1199 	// Expected Sequence 1.9 (SET UP CALL, max dialling number string, no alpha identifier)
       
  1200 	//
       
  1201 	data.iInfoTransferCap.Zero();
       
  1202 	
       
  1203 	data.iCallNumber.Zero();
       
  1204 	data.iCallNumber.Append(0x10);
       
  1205 	data.iCallNumber.Append(0x32);
       
  1206 	data.iCallNumber.Append(0x54);
       
  1207 	data.iCallNumber.Append(0x76);
       
  1208 	data.iCallNumber.Append(0x98);
       
  1209 	data.iCallNumber.Append(0x10);
       
  1210 	data.iCallNumber.Append(0x32);
       
  1211 	data.iCallNumber.Append(0x54);
       
  1212 	data.iCallNumber.Append(0x76);
       
  1213 	data.iCallNumber.Append(0x98);
       
  1214 	data.iCallNumber.Append(0x10);
       
  1215 
       
  1216 	data.iCommandQualifier = KSetUpCallIfNotCurrentlyBusyWithRedial;
       
  1217 	ProactiveCommandCallL( setupCallData, data, KNullDesC8 );
       
  1218 
       
  1219 	DataCompareL(setupCallData, 
       
  1220 			     data.iCommandQualifier,
       
  1221 			     KNullDesC16, 
       
  1222 			     RSat::EInternationalNumber, 
       
  1223 			     RSat::EIsdnNumberPlan);
       
  1224 
       
  1225 	CCSatComponentTestBase::GenerateTerminalResponseL( data.iCommandNumber, data.iCommandType, 
       
  1226 			data.iCommandQualifier, RSat::ESetUpCall, respPck, KNullDesC16, resp.iGeneralResult );
       
  1227 	AssertMockLtsyStatusL();
       
  1228 	
       
  1229 	//
       
  1230 	// Expected Sequence 1.10 (SET UP CALL, 256 octets length, long first alpha identifier)
       
  1231 	//
       
  1232 
       
  1233 	data.iCallNumber.Zero();
       
  1234 	data.iCallNumber.Append(0x10);
       
  1235 
       
  1236 	_LIT8(KAlphaIdentifier8_5, "Three types are defined: - set up a call, but only if not currently busy on another\
       
  1237 call; - set up a call, putting all other calls (if any) on hold; - set up a call,\
       
  1238 disconnecting all other calls (if any) first. For each of these types,");
       
  1239 
       
  1240 	_LIT16(KAlphaIdentifier16_5, "Three types are defined: - set up a call, but only if not currently busy on another\
       
  1241 call; - set up a call, putting all other calls (if any) on hold; - set up a call,\
       
  1242 disconnecting all other calls (if any) first. For each of these types,");
       
  1243 
       
  1244 	ProactiveCommandCallL( setupCallData, data, KAlphaIdentifier8_5 );
       
  1245 
       
  1246 	DataCompareL(setupCallData, 
       
  1247 			     data.iCommandQualifier,
       
  1248 			     KAlphaIdentifier16_5, 
       
  1249 			     RSat::EInternationalNumber, 
       
  1250 			     RSat::EIsdnNumberPlan);
       
  1251 
       
  1252 	CCSatComponentTestBase::GenerateTerminalResponseL( data.iCommandNumber, data.iCommandType, 
       
  1253 			data.iCommandQualifier, RSat::ESetUpCall, respPck, KNullDesC16, resp.iGeneralResult );
       
  1254 	AssertMockLtsyStatusL();
       
  1255 
       
  1256 	//
       
  1257 	// Expected Sequence 1.11A (SET UP CALL, Called party subaddress, command performed successfully)
       
  1258 	//
       
  1259 
       
  1260 	data.iCallNumber.Zero();
       
  1261 	data.iCallNumber.Append(0x10);
       
  1262 	data.iCallNumber.Append(0x32);
       
  1263 	data.iCallNumber.Append(0x04);
       
  1264 	data.iCallNumber.Append(0x21);
       
  1265 	data.iCallNumber.Append(0x43);
       
  1266 	data.iCallNumber.Append(0x65);
       
  1267 	data.iCallNumber.Append(0x1C);
       
  1268 	data.iCallNumber.Append(0x2C);
       
  1269 	
       
  1270 	data.iSubAddress.Append(0x80);
       
  1271 	data.iSubAddress.Append(0x50);
       
  1272 	data.iSubAddress.Append(0x95);
       
  1273 	data.iSubAddress.Append(0x95);
       
  1274 	data.iSubAddress.Append(0x95);
       
  1275 	data.iSubAddress.Append(0x95);
       
  1276 	data.iSubAddress.Append(0x95);
       
  1277 	
       
  1278 	_LIT8(KAlphaIdentifier8_6, "Called party");
       
  1279 	_LIT16(KAlphaIdentifier16_6, "Called party");
       
  1280 	data.iCommandQualifier = KSetUpCallIfNotCurrentlyBusy;
       
  1281 	
       
  1282 	ProactiveCommandCallL( setupCallData, data, KAlphaIdentifier8_6 );
       
  1283 
       
  1284 	DataCompareL(setupCallData, 
       
  1285 			     data.iCommandQualifier,
       
  1286 			     KAlphaIdentifier16_6, 
       
  1287 			     RSat::EInternationalNumber, 
       
  1288 			     RSat::EIsdnNumberPlan);
       
  1289 
       
  1290 	CCSatComponentTestBase::GenerateTerminalResponseL( data.iCommandNumber, data.iCommandType, 
       
  1291 			data.iCommandQualifier, RSat::ESetUpCall, respPck, KNullDesC16, resp.iGeneralResult );
       
  1292 	AssertMockLtsyStatusL();
       
  1293 	
       
  1294 	//
       
  1295 	// Expected Sequence 1.11B
       
  1296 	//
       
  1297 
       
  1298 	ProactiveCommandCallL( setupCallData, data, KAlphaIdentifier8_6 );
       
  1299 
       
  1300 	resp.iGeneralResult = RSat::KCmdBeyondMeCapabilities;
       
  1301 	CCSatComponentTestBase::GenerateTerminalResponseL( data.iCommandNumber, data.iCommandType, 
       
  1302 			data.iCommandQualifier, RSat::ESetUpCall, respPck, KNullDesC16, resp.iGeneralResult );
       
  1303 	AssertMockLtsyStatusL();
       
  1304 
       
  1305 	//
       
  1306 	// Expected Sequence 1.12 (SET UP CALL, maximum duration for the redial mechanism)
       
  1307 	//
       
  1308 
       
  1309 	const TUint8 KDefualtTimeUnit = 0x7F;
       
  1310 	const TUint8 timeUnitArray[] = { KMinutes, KSeconds, KTenthsOfSeconds, KDefualtTimeUnit };
       
  1311 
       
  1312 	data.iSubAddress.Zero();
       
  1313 	_LIT8(KAlphaIdentifier8_7, "Duration");
       
  1314 	_LIT16(KAlphaIdentifier16_7, "Duration");
       
  1315 	data.iDuration.iIfUse = ETrue;
       
  1316 	data.iDuration.iInterval = 0x0A;
       
  1317 	data.iCommandQualifier = KSetUpCallIfNotCurrentlyBusyWithRedial;
       
  1318 
       
  1319 	resp.iInfoType = RSat::KMeProblem;
       
  1320 	resp.iAdditionalInfo.Zero();
       
  1321 	resp.iAdditionalInfo.Append(KFacilityRejected);
       
  1322 	resp.iGeneralResult = RSat::KNetworkUnableToProcessCmd;
       
  1323 
       
  1324 	TUint8 sizeArray = sizeof(timeUnitArray)/sizeof(timeUnitArray[0]);
       
  1325 	
       
  1326 	/*
       
  1327 	 * to increase CSatNotifySetUpCall::CompleteNotifyL coverage 
       
  1328 	 * in case of  "duration"
       
  1329 	 */
       
  1330 	for (TUint8 i = 0; i < sizeArray; i++)
       
  1331 		{
       
  1332 		data.iDuration.iUnit = timeUnitArray[i];
       
  1333 		
       
  1334 		ProactiveCommandCallL( setupCallData, data, KAlphaIdentifier8_7 );
       
  1335 
       
  1336 		DataCompareL(setupCallData, 
       
  1337 				     data.iCommandQualifier,
       
  1338 				     KAlphaIdentifier16_7, 
       
  1339 				     RSat::EInternationalNumber, 
       
  1340 				     RSat::EIsdnNumberPlan);
       
  1341 
       
  1342 		CCSatComponentTestBase::GenerateTerminalResponseL( data.iCommandNumber, data.iCommandType, 
       
  1343 				data.iCommandQualifier, RSat::ESetUpCall, respPck, resp.iAdditionalInfo, resp.iGeneralResult );
       
  1344 		AssertMockLtsyStatusL();
       
  1345 		}
       
  1346 
       
  1347 	CleanupStack::PopAndDestroy(1, this); // this
       
  1348 	}
       
  1349 
       
  1350