telephonyserverplugins/simatktsy/tests/src/ccsatselectitemfu.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 SelectItem in the SAT.
       
    20 */
       
    21 
       
    22 #include "ccsatselectitemfu.h"
       
    23 #include <etel.h>
       
    24 #include <etelmm.h>
       
    25 #include <satcs.h>
       
    26 #include <test/tmockltsydata.h>
       
    27 
       
    28 #include <cstktsy/tsatutility.h>
       
    29 
       
    30 const TUint8 KPCmdNumber = 1;
       
    31 const TUint8 KSelItmQualifierEmpty = 0x00;
       
    32 
       
    33 _LIT8(KToolkitSelectAlphaId, "Toolkit Select"); 
       
    34 const TUint8 KNumItemsThree = 3;
       
    35 const TUint8 KNumItemsFour = 4;
       
    36 const TUint8 KItemIds[KNumItemsFour] = {1,2,3,4};
       
    37 _LIT8(KItemName1, "Item 1");
       
    38 _LIT8(KItemName2, "Item 2");
       
    39 _LIT8(KItemName3, "Item 3");
       
    40 _LIT8(KItemName4, "Item 4");
       
    41 const TPtrC8 KItemNames[KNumItemsFour] = 
       
    42 	{
       
    43 		KItemName1(),
       
    44 		KItemName2(),
       
    45 		KItemName3(),
       
    46 		KItemName4()
       
    47 	};
       
    48 
       
    49 CTestSuite* CCSatSelectItemFU::CreateSuiteL(const TDesC& aName)
       
    50 	{
       
    51 	SUB_SUITE;
       
    52 
       
    53 	ADD_TEST_STEP_ISO_CPP(CCSatSelectItemFU, TestNotifySelectItemPCmd0001L);
       
    54 	ADD_TEST_STEP_ISO_CPP(CCSatSelectItemFU, TestNotifySelectItemPCmd0001bL);
       
    55 	ADD_TEST_STEP_ISO_CPP(CCSatSelectItemFU, TestNotifySelectItemPCmd0001cL);
       
    56 	ADD_TEST_STEP_ISO_CPP(CCSatSelectItemFU, TestNotifySelectItemPCmd0001dL);
       
    57 	ADD_TEST_STEP_ISO_CPP(CCSatSelectItemFU, TestNotifySelectItemPCmd0001eL);
       
    58 	ADD_TEST_STEP_ISO_CPP(CCSatSelectItemFU, TestNotifySelectItemPCmd0001fL);
       
    59 	ADD_TEST_STEP_ISO_CPP(CCSatSelectItemFU, TestNotifySelectItemPCmd0001gL);
       
    60 	ADD_TEST_STEP_ISO_CPP(CCSatSelectItemFU, TestNotifySelectItemPCmd0001hL);
       
    61 	ADD_TEST_STEP_ISO_CPP(CCSatSelectItemFU, TestNotifySelectItemPCmd0001iL);
       
    62 	ADD_TEST_STEP_ISO_CPP(CCSatSelectItemFU, TestNotifySelectItemPCmd0001jL);
       
    63 	ADD_TEST_STEP_ISO_CPP(CCSatSelectItemFU, TestNotifySelectItemPCmd0001kL);
       
    64 	ADD_TEST_STEP_ISO_CPP(CCSatSelectItemFU, TestNotifySelectItemPCmd0001lL);
       
    65 	ADD_TEST_STEP_ISO_CPP(CCSatSelectItemFU, TestNotifySelectItemPCmd0002L);
       
    66 	ADD_TEST_STEP_ISO_CPP(CCSatSelectItemFU, TestNotifySelectItemPCmd0004L);
       
    67 
       
    68 	END_SUITE;
       
    69 	}
       
    70 
       
    71 
       
    72 /**
       
    73 Resets RSat::SelectItemVx data fields
       
    74 @param aSelItmData data to be reset
       
    75 */
       
    76 LOCAL_C void ResetSelectItemData(RSat::TMenuItemBaseV1& aSelItmData)
       
    77 	{
       
    78 	// reset public members
       
    79 	switch( aSelItmData.ExtensionId() )
       
    80 		{
       
    81 		case RSat::KSatV2:
       
    82 			(static_cast<RSat::TSelectItemV2*>(&aSelItmData))->iPreference = 
       
    83 					RSat::ESelectionPreferenceNotSet;
       
    84 			// there is no need in break
       
    85 			// do the following for both cases
       
    86 		case RSat::KSatV1:
       
    87 		default:
       
    88 			{
       
    89 			RSat::TSelectItemV1& selItmDataV1( *static_cast<RSat::TSelectItemV1*>(&aSelItmData) );
       
    90 			
       
    91 			selItmDataV1.iAlphaId.iStatus = RSat::EAlphaIdNotSet;
       
    92 			selItmDataV1.iHelp = RSat::EHelpNotSet;
       
    93 			selItmDataV1.iDefaultItemId = 0;
       
    94 			selItmDataV1.iIconId.iQualifier = RSat::EIconQualifierNotSet;
       
    95 			selItmDataV1.iIconListQualifier = RSat::EIconQualifierNotSet;
       
    96 			selItmDataV1.iPresentationType = RSat::EPresentationTypeNotSet;
       
    97 			selItmDataV1.iAlphaId.iAlphaId.SetLength(0);
       
    98 			}
       
    99 			break;
       
   100 		}
       
   101 
       
   102 	// reset protected members;
       
   103 	aSelItmData.SetPCmdNumber(0);
       
   104 	aSelItmData.Reset();
       
   105 	}
       
   106 
       
   107 
       
   108 /**
       
   109 Fills in a Tlv with command details and device identities for DisplayText proactive command
       
   110 @param aTlv Tlv to fill in
       
   111 @param aPCmdNumber proactive command number
       
   112 @param aCommandQualifier DisplayText proactive command qualifier
       
   113 */
       
   114 LOCAL_C void SelectItemProactiveCmdTlvBegin( 
       
   115 		TTlv& aTlv, 
       
   116 		TUint8 aPCmdNumber,
       
   117 		TUint8 aCommandQualifier)
       
   118 	{
       
   119 	ProactiveCmdTlvBegin( aTlv, aPCmdNumber, KSelectItem, aCommandQualifier, KMe );
       
   120 	}
       
   121 
       
   122 
       
   123 /**
       
   124 Prepares Select Item proactive command complete data for Mock
       
   125 @param aPCmdNumber Proactive command number
       
   126 @param aCmdQual Command qualifier
       
   127 @param aAlphaIdStatus Alpha identifier status
       
   128 @param aAlphaId Alpha identifier
       
   129 @param aNumItems Number of menu items
       
   130 @param aItemIds Array of menu items identifier
       
   131 @param aItemNames Array of menu items names
       
   132 @param aActionArr Array of next actions
       
   133 @param aIconQual Type of icon
       
   134 @param aIcon Icon address
       
   135 @param aIconListQual Type of icons for menu items
       
   136 @param aIconList Array of icon addresses for menu items
       
   137 @param aDefaultItem Default item id
       
   138 @param aResult Proactive command notify result
       
   139 @param aDelay Delay value for MockLtsy completion
       
   140 */
       
   141 void CCSatSelectItemFU::PrepareSelItemCompleteDataL(
       
   142 		TUint8 aPCmdNumber,
       
   143 		TUint8 aCmdQual,
       
   144 		RSat::TAlphaIdStatus aAlphaIdStatus,
       
   145 		const TDesC8& aAlphaId,
       
   146 		TUint8 aNumItems,
       
   147 		const TUint8* aItemIds,
       
   148 		const TPtrC8* aItemNames,
       
   149 		const RArray<TUint32>* aActionArr,
       
   150 		RSat::TIconQualifier aIconQual,
       
   151 		TUint8 aIcon,
       
   152 		RSat::TIconQualifier aIconListQual,
       
   153 		const RArray<TUint32>* aIconList,
       
   154 		TUint8 aDefaultItem,
       
   155 		TInt aResult,
       
   156 		TInt aDelay)
       
   157 	{
       
   158 	TTlv tlv;
       
   159 	SelectItemProactiveCmdTlvBegin( tlv, aPCmdNumber, aCmdQual );
       
   160 
       
   161 	if( (RSat::EAlphaIdProvided == aAlphaIdStatus) ||
       
   162 			(RSat::EAlphaIdNull == aAlphaIdStatus))
       
   163 		{			
       
   164 		tlv.AddTag(KTlvAlphaIdentifierTag);
       
   165 		tlv.AddData(aAlphaId);//ETLV_AlphaIdentifier
       
   166 		}
       
   167 
       
   168 	for( TInt i = 0; i < aNumItems; i++)
       
   169 		{
       
   170 		tlv.AddTag(KTlvItemTag);
       
   171 		tlv.AddByte(aItemIds[i]); //item identifier
       
   172 		tlv.AddData(aItemNames[i]);
       
   173 		}
       
   174 
       
   175 	if(aActionArr)
       
   176 		{
       
   177 		tlv.AddTag(KTlvItemsNextActionIndicatorTag);
       
   178 				
       
   179 		TInt count = aActionArr->Count();
       
   180 		for( TInt i = 0; i < count; i++)
       
   181 			{
       
   182 			tlv.AddByte((*aActionArr)[i]); 
       
   183 			}
       
   184 		}
       
   185 	
       
   186 	if(RSat::EIconQualifierNotSet != aIconQual)
       
   187 		{
       
   188 		tlv.AddTag(KTlvIconIdentifierTag);
       
   189 		tlv.AddByte((RSat::ESelfExplanatory == aIconQual)?0:1);
       
   190 		tlv.AddByte(aIcon);
       
   191 		}
       
   192 
       
   193 	if(RSat::EIconQualifierNotSet != aIconListQual)
       
   194 		{
       
   195 		tlv.AddTag(KTlvItemIconIdentifierListTag);
       
   196 		tlv.AddByte((RSat::ESelfExplanatory == aIconListQual)?0:1);
       
   197 		
       
   198 		if ( aIconList )
       
   199 			{
       
   200 			TInt iconCount = aIconList->Count();
       
   201 			for( TInt i = 0; i < iconCount; i++)
       
   202 				{
       
   203 				tlv.AddByte((*aIconList)[i]);
       
   204 				}
       
   205 			}
       
   206 		}
       
   207 
       
   208 	if( 0 < aDefaultItem )
       
   209 		{
       
   210 		tlv.AddTag(KTlvItemIdentifierTag);
       
   211 		tlv.AddByte(aDefaultItem); // ETLV_IdentifierOfItemChosen
       
   212 		}
       
   213 	
       
   214 	PrepareMockWithCompleteDataForPCmdNotifyL(tlv.End(), aResult, aDelay);
       
   215 	}
       
   216 
       
   217 
       
   218 /**
       
   219 Prepares and calls Select Item proactive command
       
   220 @param aPCmdNumber Proactive command number
       
   221 @param aCmdQual Command qualifier
       
   222 @param aParamVersion Parameter version
       
   223 @param aAlphaIdStatus Alpha identifier status
       
   224 @param aAlphaId Alpha identifier
       
   225 @param aNumItems Number of menu items
       
   226 @param aItemIds Array of menu items identifier
       
   227 @param aItemNames Array of menu items names
       
   228 @param aActionArr Array of next actions
       
   229 @param aIconQual Type of icon
       
   230 @param aIcon Icon address
       
   231 @param aIconListQual Type of icons for menu items
       
   232 @param aIconList Array of icon addresses for menu items
       
   233 @param aDefaultItem Default item id
       
   234 @param aResult Proactive command notify result
       
   235 @param aAlphaIdCheck Alpha identifier value to ckeck with returned value
       
   236 @param aItemNamesCheck Array of menu items names to ckeck with returned value
       
   237 */
       
   238 void CCSatSelectItemFU::TestNotifySelectItemPCmdL(
       
   239 		TUint8 aPCmdNumber,
       
   240 		TUint8 aCmdQual,
       
   241 		RSat::TSatVersion aParamVersion,
       
   242 		RSat::TAlphaIdStatus aAlphaIdStatus,
       
   243 		const TDesC8& aAlphaId,
       
   244 		TUint8 aNumItems,
       
   245 		const TUint8* const aItemIds,
       
   246 		const TPtrC8* aItemNames,
       
   247 		const RArray<TUint32>* aActionArr,
       
   248 		RSat::TIconQualifier aIconQual,
       
   249 		TUint8 aIcon,
       
   250 		RSat::TIconQualifier aIconListQual,
       
   251 		const RArray<TUint32>* aIconList,
       
   252 		TUint8 aDefaultItem,
       
   253 		TInt aResult,
       
   254 		const TDesC16* aAlphaIdCheck,
       
   255 		const TPtrC16* aItemNamesCheck)
       
   256 	{
       
   257 	PrepareMockWithExpDataForPCmdNotifyL(KSelectItem);
       
   258 	
       
   259 	PrepareSelItemCompleteDataL(
       
   260 			aPCmdNumber, aCmdQual, aAlphaIdStatus, aAlphaId, aNumItems, aItemIds,
       
   261 			aItemNames, aActionArr, aIconQual, aIcon, aIconListQual, aIconList,
       
   262 			aDefaultItem, aResult);
       
   263 	
       
   264 	RSat::TMenuItemBaseV1* selItmData = NULL;
       
   265 	TInt selItmDataSize(0);
       
   266 	switch ( aParamVersion )
       
   267 		{
       
   268 		case RSat::KSatV1:
       
   269 			{
       
   270 			selItmData = new (ELeave) RSat::TSelectItemV1();
       
   271 			selItmDataSize = sizeof(RSat::TSelectItemV1);
       
   272 			}
       
   273 			break;
       
   274 		case RSat::KSatV2:
       
   275 		default:
       
   276 			{
       
   277 			selItmData = new (ELeave) RSat::TSelectItemV2();
       
   278 			selItmDataSize = sizeof(RSat::TSelectItemV2);
       
   279 			aParamVersion = RSat::KSatV2;
       
   280 			}
       
   281 			break;
       
   282 		}
       
   283 	CleanupStack::PushL(selItmData);
       
   284 	ResetSelectItemData(*selItmData);
       
   285 
       
   286 	TRequestStatus requestStatus;
       
   287 	TPtr8 selItmDataPckg(reinterpret_cast<TUint8*>(selItmData), selItmDataSize, selItmDataSize);
       
   288 	iSat.NotifySelectItemPCmd(requestStatus, selItmDataPckg);
       
   289 	
       
   290 	User::WaitForRequest(requestStatus);
       
   291 	
       
   292 	ASSERT_EQUALS(aResult, requestStatus.Int());
       
   293 
       
   294 	// check results
       
   295 	const RSat::TSelectItemV1& selItmDataV1(
       
   296 			*static_cast<RSat::TSelectItemV1*>(selItmData));
       
   297 	if ( KErrNone == aResult )
       
   298 		{
       
   299 		ASSERT_EQUALS(aPCmdNumber, selItmDataV1.PCmdNumber());
       
   300 		
       
   301 		if ( RSat::KSatV1 != aParamVersion )
       
   302 			{
       
   303 			if ( KSelectItemSelectUsingSoftKeyMask == 
       
   304 					(KSelectItemSelectUsingSoftKeyMask & aCmdQual) )
       
   305 				{
       
   306 				ASSERT_EQUALS( RSat::ESoftKeyPreferred,
       
   307 						static_cast<RSat::TSelectItemV2*>(selItmData)->iPreference );
       
   308 				}
       
   309 			else
       
   310 				{
       
   311 				ASSERT_TRUE( RSat::ESoftKeyPreferred !=
       
   312 						static_cast<RSat::TSelectItemV2*>(selItmData)->iPreference );
       
   313 				}
       
   314 			}
       
   315 		
       
   316 		if ( KHelpAvailabilityMask == (KHelpAvailabilityMask & aCmdQual) )
       
   317 			{
       
   318 			ASSERT_EQUALS(RSat::EHelpAvailable, selItmDataV1.iHelp);
       
   319 			}
       
   320 		else
       
   321 			{
       
   322 			ASSERT_EQUALS(RSat::ENoHelpAvailable, selItmDataV1.iHelp);
       
   323 			}
       
   324 
       
   325 		// Presentation as a choice of navigation options 
       
   326 		if ( KSelectItemChoiceOfNavigation == 
       
   327 				(KSelectItemPresentationTypeMask & aCmdQual) )
       
   328 			{
       
   329 			ASSERT_EQUALS(RSat::ENavigationOptions, selItmDataV1.iPresentationType);
       
   330 			}
       
   331 		// Presentation as a choice of data values 
       
   332 		else if ( KSelectItemChoiceOfData == 
       
   333 					(KSelectItemPresentationTypeMask & aCmdQual) )
       
   334 			{
       
   335 			ASSERT_EQUALS(RSat::EDataValues, selItmDataV1.iPresentationType);
       
   336 			}
       
   337 		else
       
   338 			{
       
   339 			ASSERT_TRUE( (RSat::ENotSpecified == selItmDataV1.iPresentationType) );
       
   340 			}
       
   341 
       
   342 		if(RSat::EIconQualifierNotSet != aIconQual)
       
   343 			{
       
   344 			ASSERT_EQUALS(aIconQual, selItmDataV1.iIconId.iQualifier);
       
   345 			ASSERT_EQUALS(aIcon, selItmDataV1.iIconId.iIdentifier);
       
   346 			}
       
   347 		else
       
   348 			{
       
   349 			ASSERT_EQUALS(RSat::ENoIconId, selItmDataV1.iIconId.iQualifier);
       
   350 			}
       
   351 		
       
   352 		if(RSat::EIconQualifierNotSet != aIconListQual)
       
   353 			{
       
   354 			ASSERT_EQUALS(aIconListQual, selItmDataV1.iIconListQualifier);
       
   355 			}
       
   356 		else
       
   357 			{
       
   358 			ASSERT_EQUALS(RSat::ENoIconId, selItmDataV1.iIconListQualifier);
       
   359 			}
       
   360 
       
   361 		ASSERT_EQUALS(static_cast<TUint8>(aDefaultItem), selItmDataV1.iDefaultItemId);
       
   362 
       
   363 		if( RSat::EAlphaIdProvided == aAlphaIdStatus )
       
   364 			{
       
   365 			ASSERT_EQUALS(RSat::EAlphaIdProvided, selItmDataV1.iAlphaId.iStatus);
       
   366 			if ( aAlphaIdCheck )
       
   367 				{
       
   368 				ASSERT_EQUALS( 0, aAlphaIdCheck->Compare(selItmDataV1.iAlphaId.iAlphaId));
       
   369 				}
       
   370 			else
       
   371 				{
       
   372 				ASSERT_EQUALS(0, Compare16bitDesWith8bitDesL(aAlphaId, selItmDataV1.iAlphaId.iAlphaId));
       
   373 				}
       
   374 			}
       
   375 		else if ( RSat::EAlphaIdNull == aAlphaIdStatus )
       
   376 			{
       
   377 			ASSERT_TRUE( RSat::EAlphaIdProvided != selItmDataV1.iAlphaId.iStatus );
       
   378 			}
       
   379 		else
       
   380 			{
       
   381 			ASSERT_TRUE( (RSat::EAlphaIdNotPresent == selItmDataV1.iAlphaId.iStatus) ||
       
   382 					(RSat::EAlphaIdNotSet == selItmDataV1.iAlphaId.iStatus) );
       
   383 			}
       
   384 
       
   385 		ASSERT_EQUALS(static_cast<TUint>(aNumItems), selItmDataV1.NumberOfItems());
       
   386 		
       
   387 		if(0 < aNumItems)
       
   388 			{
       
   389 			ASSERT_TRUE( !selItmDataV1.IsRemoveMenu() );
       
   390 			
       
   391 			for(TInt i = 0; i < aNumItems; i++)
       
   392 				{
       
   393 				RSat::TItem item;
       
   394 				TInt action;
       
   395 				TInt iconId;
       
   396 
       
   397 				ASSERT_EQUALS( KErrNone,
       
   398 						selItmDataV1.GetItem( i + 1, item, action, iconId));
       
   399 				
       
   400 				ASSERT_EQUALS( aItemIds[i], item.iItemId );
       
   401 
       
   402 				if ( aItemNamesCheck )
       
   403 					{
       
   404 					ASSERT_EQUALS( 0, aItemNamesCheck[i].Compare(item.iItemString) );
       
   405 					}
       
   406 				else
       
   407 					{
       
   408 					ASSERT_EQUALS(0, Compare16bitDesWith8bitDesL(aItemNames[i], item.iItemString));
       
   409 					}
       
   410 				
       
   411 				if( aActionArr && (aNumItems == aActionArr->Count()) )
       
   412 					{
       
   413 					ASSERT_EQUALS(static_cast<TInt>((*aActionArr)[i]), action);
       
   414 					}
       
   415 				else
       
   416 					{
       
   417 					ASSERT_EQUALS(KErrNotFound, action);
       
   418 					}
       
   419 				
       
   420 				if( (RSat::EIconQualifierNotSet != aIconListQual) && aIconList && ( aNumItems == aIconList->Count()) )
       
   421 					{
       
   422 					ASSERT_EQUALS(static_cast<TInt>((*aIconList)[i]), iconId);
       
   423 					}
       
   424 				else
       
   425 					{
       
   426 					ASSERT_EQUALS(KErrNotFound, iconId);
       
   427 					}
       
   428 				}
       
   429 			}
       
   430 		else
       
   431 			{
       
   432 			ASSERT_TRUE( selItmDataV1.IsRemoveMenu() );
       
   433 			}
       
   434 		}
       
   435 
       
   436 	CleanupStack::PopAndDestroy(selItmData);
       
   437 	AssertMockLtsyStatusL();
       
   438 	}
       
   439 
       
   440 
       
   441 /**
       
   442 Handles sending a terminal response
       
   443 @param aSelItmCmdQualifier select item proactive command qualifier
       
   444 @param aResp terminal response data
       
   445 @param aExpResult expected result of TerminalRsp() execution 
       
   446 */
       
   447 void CCSatSelectItemFU::GenerateSelItemTerminalResponseL(
       
   448 		TUint8 aSelectItemPCmdQualifier,
       
   449 		const RSat::TSelectItemRspV1& aResp,
       
   450 		const TInt aExpResult)
       
   451 	{
       
   452 
       
   453 	TPtrC genResultAddInfo(KNullDesC);
       
   454 	TPtrC8 additionalInfoTlv(KNullDesC8);
       
   455 	if ( (RSat::KItemIdentifier == aResp.iInfoType) && 
       
   456 			( (RSat::KHelpRequestedByUser == aResp.iGeneralResult) ||
       
   457 					(CommandPerformedSuccessfully(aResp.iGeneralResult)) ) )
       
   458 		{
       
   459 		TTlv itmChosenTlv;
       
   460 		itmChosenTlv.AddTag(KTlvItemIdentifierTag);
       
   461 		// ETLV_IdentifierOfItemChosen
       
   462 		itmChosenTlv.AddByte( static_cast<TUint8>(aResp.iAdditionalInfo[0]) );
       
   463 
       
   464 		additionalInfoTlv.Set( itmChosenTlv.GetDataWithoutTopLevelTag() );
       
   465 		}
       
   466 	else if ( RSat::KMeProblem == aResp.iInfoType )
       
   467 		{
       
   468 		genResultAddInfo.Set( aResp.iAdditionalInfo );
       
   469 		}
       
   470 
       
   471 	RSat::TSelectItemRspV1Pckg respPckg(aResp);
       
   472 	GenerateTerminalResponseL(
       
   473 			aResp.PCmdNumber(),
       
   474 			KSelectItem,
       
   475 			aSelectItemPCmdQualifier,
       
   476 			RSat::ESelectItem,
       
   477 			respPckg,
       
   478 			genResultAddInfo,
       
   479 			aResp.iGeneralResult,
       
   480 			additionalInfoTlv,
       
   481 			aExpResult);
       
   482 	}
       
   483 
       
   484 
       
   485 //
       
   486 // Actual test cases
       
   487 //
       
   488 
       
   489 
       
   490 /**
       
   491 @SYMTestCaseID BA-CSAT-SI-SNSIPC-0001
       
   492 @SYMPREQ 1780
       
   493 @SYMComponent  telephony_csat
       
   494 @SYMTestCaseDesc Test support in CSAT for RSat::NotifySelectItemPCmd
       
   495 @SYMTestPriority High
       
   496 @SYMTestActions Invokes RSat::NotifySelectItemPCmd
       
   497 @SYMTestExpectedResults Pass
       
   498 @SYMTestType CT
       
   499 */
       
   500 void CCSatSelectItemFU::TestNotifySelectItemPCmd0001L()
       
   501 	{
       
   502 
       
   503 	OpenEtelServerL(EUseExtendedError);
       
   504 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
   505 	OpenPhoneL();
       
   506 	OpenSatL();
       
   507 	
       
   508 	//-------------------------------------------------------------------------
       
   509 	// TEST E: Unsolicited completion of RSat::NotifySelectItemPCmd
       
   510 	// from LTSY.
       
   511  	//-------------------------------------------------------------------------
       
   512 
       
   513 	PrepareSelItemCompleteDataL(
       
   514 			KPCmdNumber, KSelItmQualifierEmpty, RSat::EAlphaIdProvided, KToolkitSelectAlphaId,
       
   515 			KNumItemsFour, KItemIds, KItemNames);
       
   516 	
       
   517 	RSat::TAdditionalInfo addInfo;
       
   518 	addInfo.Append(RSat::KNoSpecificMeProblem);
       
   519 	PrepareTerminalResponseMockDataL(
       
   520 			KPCmdNumber, KSelectItem, KSelItmQualifierEmpty,
       
   521 			addInfo, RSat::KMeUnableToProcessCmd);
       
   522 
       
   523 	WaitForMockLTSYTerminated();
       
   524 	AssertMockLtsyStatusL();
       
   525 
       
   526  	//-------------------------------------------------------------------------
       
   527 	// TEST F: Coverage test(s) for RSat::NotifySelectItemPCmd
       
   528  	//-------------------------------------------------------------------------
       
   529 	// test for RSat::NotifySelectItemPCmd with RSat::TSelectItemV1 parameter version
       
   530  	//-------------------------------------------------------------------------
       
   531 
       
   532 	TestNotifySelectItemPCmdL(
       
   533 			KPCmdNumber, KSelItmQualifierEmpty, RSat::KSatV1, RSat::EAlphaIdProvided, KToolkitSelectAlphaId,
       
   534 			KNumItemsFour, KItemIds, KItemNames);
       
   535 	
       
   536 	//generate the terminal response
       
   537 	RSat::TSelectItemRspV1 resp;
       
   538 	resp.iGeneralResult = RSat::KSuccess;
       
   539 	resp.iInfoType = RSat::KItemIdentifier;
       
   540 	// Identifier of item chosen(0x02) is passed as additional info
       
   541 	// and this value is sufficient because we set information type value as
       
   542 	// item identifier(RSat::KItemIdentifier)
       
   543 	resp.iAdditionalInfo.Append(0x02);
       
   544 	resp.SetPCmdNumber(KPCmdNumber);
       
   545 	GenerateSelItemTerminalResponseL( KSelItmQualifierEmpty, resp );
       
   546 	AssertMockLtsyStatusL();
       
   547 
       
   548 	//-------------------------------------------------------------------------
       
   549 	// null alpha identifier
       
   550  	//-------------------------------------------------------------------------
       
   551 	
       
   552 	TestNotifySelectItemPCmdL(
       
   553 			KPCmdNumber, KSelItmQualifierEmpty, RSat::KSatV2, RSat::EAlphaIdNull, KNullDesC8,
       
   554 			KNumItemsFour, KItemIds, KItemNames);
       
   555 	
       
   556 	//generate the terminal response
       
   557 	GenerateSelItemTerminalResponseL( KSelItmQualifierEmpty, resp );
       
   558 	AssertMockLtsyStatusL();
       
   559 	
       
   560 	//-------------------------------------------------------------------------
       
   561 	// no alpha identifier, large item, zero length item, screen busy
       
   562  	//-------------------------------------------------------------------------
       
   563 	
       
   564 	const TPtrC8 largeItemNames[KNumItemsFour] = {_L8("The SIM shall supply a set of item\
       
   565 s from which the user may choose one. Each item comprises a short identifier (u\
       
   566 sed to indicat"), KNullDesC8(), _L8("Item 3"), _L8("Item 4")};
       
   567 
       
   568 	TestNotifySelectItemPCmdL(
       
   569 			KPCmdNumber, KSelItmQualifierEmpty, RSat::KSatV2, RSat::EAlphaIdNotSet, KNullDesC8,
       
   570 			KNumItemsFour, KItemIds, largeItemNames);
       
   571 	
       
   572 	//generate the terminal response
       
   573 	resp.iGeneralResult = RSat::KMeUnableToProcessCmd;
       
   574 	resp.iInfoType = RSat::KMeProblem;
       
   575 	resp.iAdditionalInfo.Zero();
       
   576 	resp.iAdditionalInfo.Append(RSat::KScreenBusy);
       
   577 	GenerateSelItemTerminalResponseL( KSelItmQualifierEmpty, resp );
       
   578 	AssertMockLtsyStatusL();
       
   579 	
       
   580  	//-------------------------------------------------------------------------
       
   581 	// screen busy, without additional info
       
   582  	//-------------------------------------------------------------------------
       
   583 	
       
   584 	TestNotifySelectItemPCmdL(
       
   585 			KPCmdNumber, KSelItmQualifierEmpty, RSat::KSatV2, RSat::EAlphaIdProvided, KToolkitSelectAlphaId,
       
   586 			KNumItemsFour, KItemIds, KItemNames);
       
   587 
       
   588 	//generate the terminal response
       
   589 	resp.iGeneralResult = RSat::KMeUnableToProcessCmd;
       
   590 	resp.iInfoType = RSat::KMeProblem;
       
   591 	resp.iAdditionalInfo.Zero();
       
   592 
       
   593 	GenerateSelItemTerminalResponseL( KSelItmQualifierEmpty, resp, KErrCorrupt );
       
   594 	AssertMockLtsyStatusL();
       
   595 	
       
   596  	//-------------------------------------------------------------------------
       
   597 	// command beyond phone capabilities
       
   598  	//-------------------------------------------------------------------------
       
   599 	
       
   600 	TestNotifySelectItemPCmdL(
       
   601 			KPCmdNumber, KSelItmQualifierEmpty, RSat::KSatV2, RSat::EAlphaIdProvided, KToolkitSelectAlphaId,
       
   602 			KNumItemsFour, KItemIds, KItemNames);
       
   603 
       
   604 	//generate the terminal response
       
   605 	resp.iGeneralResult = RSat::KCmdBeyondMeCapabilities;
       
   606 	resp.iInfoType = RSat::KNoAdditionalInfo;
       
   607 
       
   608 	GenerateSelItemTerminalResponseL( KSelItmQualifierEmpty, resp );
       
   609 	AssertMockLtsyStatusL();
       
   610 	
       
   611 	//-------------------------------------------------------------------------
       
   612 	// TEST B: failure on completion of pending request from LTSY->CSATTSY
       
   613  	//-------------------------------------------------------------------------
       
   614 
       
   615 	TestNotifySelectItemPCmdL(
       
   616 			KPCmdNumber, KSelItmQualifierEmpty, RSat::KSatV2, RSat::EAlphaIdProvided, KToolkitSelectAlphaId,
       
   617 			KNumItemsFour, KItemIds, KItemNames,
       
   618 			NULL, RSat::EIconQualifierNotSet, 0, RSat::EIconQualifierNotSet, NULL, 0,
       
   619 			KErrUnknown);
       
   620 
       
   621 	CleanupStack::PopAndDestroy(this);
       
   622 
       
   623 	}
       
   624 
       
   625 
       
   626 /**
       
   627 @SYMTestCaseID BA-CSAT-SI-SNSIPC-0001b
       
   628 @SYMPREQ 1780
       
   629 @SYMComponent  telephony_csat
       
   630 @SYMTestCaseDesc Test support in CSAT for RSat::NotifySelectItemPCmd
       
   631 @SYMTestPriority High
       
   632 @SYMTestActions Invokes RSat::NotifySelectItemPCmd
       
   633 @SYMTestExpectedResults Pass
       
   634 @SYMTestType CT
       
   635 */
       
   636 void CCSatSelectItemFU::TestNotifySelectItemPCmd0001bL()
       
   637 	{
       
   638 
       
   639 	OpenEtelServerL(EUseExtendedError);
       
   640 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
   641 	OpenPhoneL();
       
   642 	OpenSatL();
       
   643 
       
   644  	//-------------------------------------------------------------------------
       
   645 	// Expected Sequence 1.1(ETSI TS 102 384), mandatory features
       
   646  	//-------------------------------------------------------------------------
       
   647 	
       
   648 	TestNotifySelectItemPCmdL(
       
   649 			KPCmdNumber, KSelItmQualifierEmpty, RSat::KSatV2, RSat::EAlphaIdProvided, KToolkitSelectAlphaId,
       
   650 			KNumItemsFour, KItemIds, KItemNames);
       
   651 	
       
   652 	//generate the terminal response
       
   653 	RSat::TSelectItemRspV1 resp;
       
   654 	resp.iGeneralResult = RSat::KSuccess;
       
   655 	resp.iInfoType = RSat::KItemIdentifier;
       
   656 	// Identifier of item chosen(0x02) is passed as additional info
       
   657 	// and this value is sufficient because we set information type value as
       
   658 	// item identifier(RSat::KItemIdentifier)
       
   659 	resp.iAdditionalInfo.Append(0x02); // Identifier of item chosen
       
   660 	resp.SetPCmdNumber(KPCmdNumber);
       
   661 	
       
   662 	GenerateSelItemTerminalResponseL( KSelItmQualifierEmpty, resp );
       
   663 	AssertMockLtsyStatusL();
       
   664 
       
   665 	//-------------------------------------------------------------------------
       
   666 	// Expected Sequence 1.2(ETSI TS 102 384), large menu, successful
       
   667 	//-------------------------------------------------------------------------
       
   668 
       
   669 	_LIT8(KAlphaIdentifierText2, "LargeMenu1"); 
       
   670 	const TUint8 KNumItems2 = 0x1E; // 0x50 - 0x1E + 1 = 0x33
       
   671 	TUint8 itemIds2[KNumItems2]; // = {0x50, 0x4F, ..., 0x33}
       
   672 	for (TUint8 i = 0; i < KNumItems2; i++)
       
   673 		{
       
   674 		itemIds2[i]= 0x50 - i;
       
   675 		}
       
   676 	const TPtrC8 itemNames2[KNumItems2] = 
       
   677 		{
       
   678 			_L8("Zero"), _L8("One"), _L8("Two"), _L8("Three"), _L8("Four"),
       
   679 			_L8("Five"), _L8("Six"), _L8("Seven"), _L8("Eight"), _L8("Nine"),
       
   680 			_L8("Alpha"), _L8("Bravo"), _L8("Charlie"), _L8("Delta"), _L8("Echo"),
       
   681 			_L8("Fox-trot"), _L8("Black"), _L8("Brown"), _L8("Red"), _L8("Orange"),
       
   682 			_L8("Yellow"), _L8("Green"), _L8("Blue"), _L8("Violet"), _L8("Grey"),
       
   683 			_L8("White"), _L8("milli"), _L8("micro"), _L8("nano"), _L8("pico")
       
   684 		};
       
   685 	TestNotifySelectItemPCmdL(
       
   686 			KPCmdNumber, KSelItmQualifierEmpty, RSat::KSatV2, RSat::EAlphaIdProvided, KAlphaIdentifierText2,
       
   687 			KNumItems2, itemIds2, itemNames2);
       
   688 	
       
   689 	//generate the terminal response
       
   690 	resp.iAdditionalInfo.Zero();
       
   691 	// Identifier of item chosen(0x3D) is passed as additional info
       
   692 	// and this value is sufficient because we set information type value as
       
   693 	// item identifier(RSat::KItemIdentifier)
       
   694 	resp.iAdditionalInfo.Append(0x3D); // Identifier of item chosen
       
   695 	GenerateSelItemTerminalResponseL( KSelItmQualifierEmpty, resp );
       
   696 	AssertMockLtsyStatusL();
       
   697 
       
   698 	//-------------------------------------------------------------------------
       
   699 	// Expected Sequence 1.3(ETSI TS 102 384), call options, successful
       
   700 	//-------------------------------------------------------------------------
       
   701 
       
   702 	_LIT8(KAlphaIdentifierText3, "LargeMenu2"); 
       
   703 	const TUint8 KNumItems3 = 7;
       
   704 	const TUint8 itemIds3[KNumItems3] = {0xFF, 0xFE, 0xFD, 0xFC, 0xFB, 0xFA, 0xF9};
       
   705 	const TPtrC8 itemNames3[KNumItems3] = 
       
   706 		{
       
   707 			_L8("Call Forwarding Unconditional"),
       
   708 			_L8("Call Forwarding On User Busy"),
       
   709 			_L8("Call Forwarding On No Reply"),
       
   710 			_L8("Call Forwarding On User Not Reachable"),
       
   711 			_L8("Barring Of All Outgoing Calls"),
       
   712 			_L8("Barring Of All Outgoing International Calls"),
       
   713 			_L8("CLI Presentation")
       
   714 		};
       
   715 	TestNotifySelectItemPCmdL(
       
   716 			KPCmdNumber, KSelItmQualifierEmpty, RSat::KSatV2, RSat::EAlphaIdProvided, KAlphaIdentifierText3,
       
   717 			KNumItems3, itemIds3, itemNames3);
       
   718 	
       
   719 	//generate the terminal response
       
   720 	resp.iAdditionalInfo.Zero();
       
   721 	// Identifier of item chosen(0xFB) is passed as additional info
       
   722 	// and this value is sufficient because we set information type value as
       
   723 	// item identifier(RSat::KItemIdentifier)
       
   724 	resp.iAdditionalInfo.Append(0xFB); // Identifier of item chosen
       
   725 	GenerateSelItemTerminalResponseL( KSelItmQualifierEmpty, resp );
       
   726 
       
   727 	AssertMockLtsyStatusL();
       
   728 
       
   729 	//-------------------------------------------------------------------------
       
   730 	// Expected Sequence 1.4(ETSI TS 102 384), backward move by user, successful
       
   731 	//-------------------------------------------------------------------------
       
   732 
       
   733 	// 1.4.1
       
   734 	_LIT8(KAlphaIdentifierText4, "Select Item"); 
       
   735 	const TUint8 KNumItems4 = 2;
       
   736 	const TUint8 itemIds4[KNumItems4] = {0x11, 0x12};
       
   737 	const TPtrC8 itemNames4[KNumItems4] = {_L8("One"), _L8("Two")};
       
   738 	TestNotifySelectItemPCmdL(
       
   739 			KPCmdNumber, KSelItmQualifierEmpty, RSat::KSatV2, RSat::EAlphaIdProvided, KAlphaIdentifierText4,
       
   740 			KNumItems4, itemIds4, itemNames4);
       
   741 	
       
   742 	//generate the terminal response
       
   743 	resp.iGeneralResult = RSat::KBackwardModeRequestedByUser;
       
   744 	resp.iInfoType = RSat::KNoAdditionalInfo;
       
   745 	resp.iAdditionalInfo.Zero();
       
   746 	GenerateSelItemTerminalResponseL( KSelItmQualifierEmpty, resp );
       
   747 
       
   748 	// 1.4.2
       
   749 	TestNotifySelectItemPCmdL(
       
   750 			KPCmdNumber, KSelItmQualifierEmpty, RSat::KSatV2, RSat::EAlphaIdProvided, KAlphaIdentifierText4,
       
   751 			KNumItems4, itemIds4, itemNames4);
       
   752 	
       
   753 	//generate the terminal response
       
   754 	resp.iGeneralResult = RSat::KPSessionTerminatedByUser;
       
   755 	GenerateSelItemTerminalResponseL( KSelItmQualifierEmpty, resp );
       
   756 
       
   757 	AssertMockLtsyStatusL();
       
   758 
       
   759 	//-------------------------------------------------------------------------
       
   760 	// Expected Sequence 1.5(ETSI TS 102 384), "Y", successful
       
   761 	//-------------------------------------------------------------------------
       
   762 
       
   763 	_LIT8(KAlphaIdentifierText5, "The SIM shall supply a set of items from whic\
       
   764 h the user may choose one. Each item comprises a short identifier (used to indi\
       
   765 cate the selection) and a text string.Optionally the SIM may include an alpha i\
       
   766 dentifier. The alpha identifier i"); 
       
   767 	const TUint8 KNumItems5 = 1;
       
   768 	TUint8 itemId5 = 0x01;
       
   769 	TPtrC8 itemName5(_L8("Y"));
       
   770 	TestNotifySelectItemPCmdL(
       
   771 			KPCmdNumber, KSelItmQualifierEmpty, RSat::KSatV2, RSat::EAlphaIdProvided, KAlphaIdentifierText5,
       
   772 			KNumItems5, &itemId5, &itemName5);
       
   773 	
       
   774 	//generate the terminal response
       
   775 	resp.iGeneralResult = RSat::KSuccess;
       
   776 	resp.iInfoType = RSat::KItemIdentifier;
       
   777 	// Identifier of item chosen(0x01) is passed as additional info
       
   778 	// and this value is sufficient because we set information type value as
       
   779 	// item identifier(RSat::KItemIdentifier)
       
   780 	resp.iAdditionalInfo.Append(0x01); // Identifier of item chosen
       
   781 	GenerateSelItemTerminalResponseL( KSelItmQualifierEmpty, resp );
       
   782 
       
   783 	AssertMockLtsyStatusL();
       
   784 
       
   785 	CleanupStack::PopAndDestroy(this);
       
   786 
       
   787 	}
       
   788 
       
   789 
       
   790 /**
       
   791 @SYMTestCaseID BA-CSAT-SI-SNSIPC-0001c
       
   792 @SYMPREQ 1780
       
   793 @SYMComponent  telephony_csat
       
   794 @SYMTestCaseDesc Test support in CSAT for RSat::NotifySelectItemPCmd
       
   795 @SYMTestPriority High
       
   796 @SYMTestActions Invokes RSat::NotifySelectItemPCmd
       
   797 @SYMTestExpectedResults Pass
       
   798 @SYMTestType CT
       
   799 */
       
   800 void CCSatSelectItemFU::TestNotifySelectItemPCmd0001cL()
       
   801 	{
       
   802 
       
   803 	OpenEtelServerL(EUseExtendedError);
       
   804 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
   805 	OpenPhoneL();
       
   806 	OpenSatL();
       
   807 
       
   808  	//-------------------------------------------------------------------------
       
   809 	// Expected Sequence 2.1(ETSI TS 102 384), next action support, successful
       
   810  	//-------------------------------------------------------------------------
       
   811 	
       
   812 	RArray<TUint32> actions(KNumItemsThree);
       
   813 	CleanupClosePushL(actions);
       
   814 	actions.Append(KSendShortMessage);
       
   815 	actions.Append(KSetUpCall);
       
   816 	actions.Append(KProvideLocalInformation);
       
   817 	
       
   818 	TestNotifySelectItemPCmdL(
       
   819 			KPCmdNumber, KSelItmQualifierEmpty, RSat::KSatV2, RSat::EAlphaIdProvided, KToolkitSelectAlphaId,
       
   820 			KNumItemsThree, KItemIds, KItemNames, &actions);
       
   821 	
       
   822 	//generate the terminal response
       
   823 	RSat::TSelectItemRspV1 resp;
       
   824 	resp.iGeneralResult = RSat::KSuccess;
       
   825 	resp.iInfoType = RSat::KItemIdentifier;
       
   826 	// Identifier of item chosen(0x02) is passed as additional info
       
   827 	// and this value is sufficient because we set information type value as
       
   828 	// item identifier(RSat::KItemIdentifier)
       
   829 	resp.iAdditionalInfo.Append(0x02); // Identifier of item chosen
       
   830 	resp.SetPCmdNumber(KPCmdNumber);
       
   831 	
       
   832 	GenerateSelItemTerminalResponseL( KSelItmQualifierEmpty, resp );
       
   833 	AssertMockLtsyStatusL();
       
   834 
       
   835  	//-------------------------------------------------------------------------
       
   836 	// number of items in the next action list doesn't match the number of items in the menu
       
   837  	//-------------------------------------------------------------------------
       
   838 	
       
   839 	TestNotifySelectItemPCmdL(
       
   840 			KPCmdNumber, KSelItmQualifierEmpty, RSat::KSatV2, RSat::EAlphaIdProvided, KToolkitSelectAlphaId,
       
   841 			KNumItemsFour, KItemIds, KItemNames, &actions);
       
   842 	
       
   843 	//generate the terminal response
       
   844 	TTlv itmChosenTlv;
       
   845 	itmChosenTlv.AddTag(KTlvItemIdentifierTag);
       
   846 	itmChosenTlv.AddByte( static_cast<TUint8>(resp.iAdditionalInfo[0]) ); // ETLV_IdentifierOfItemChosen
       
   847 
       
   848 	RSat::TSelectItemRspV1Pckg respPckg(resp);
       
   849 	GenerateTerminalResponseL(
       
   850 			KPCmdNumber, KSelectItem, KSelItmQualifierEmpty, RSat::ESelectItem,
       
   851 			respPckg, KNullDesC, RSat::KPartialComprehension, itmChosenTlv.GetDataWithoutTopLevelTag());
       
   852 	AssertMockLtsyStatusL();
       
   853 
       
   854 	//-------------------------------------------------------------------------
       
   855 	// action list and icons
       
   856  	//-------------------------------------------------------------------------
       
   857 	
       
   858 	RSat::TIconQualifier iconQual = RSat::ENotSelfExplanatory;
       
   859 	TUint8 icon = 1; // record 1 in EFIMG
       
   860 	RSat::TIconQualifier iconListQual = RSat::ENotSelfExplanatory;
       
   861 
       
   862 	RArray<TUint32> iconList(KNumItemsThree);
       
   863 	CleanupClosePushL(iconList);
       
   864 	 // record 5 in EFIMG for each item
       
   865 	iconList.Append(5);
       
   866 	iconList.Append(5);
       
   867 	iconList.Append(5);
       
   868 
       
   869 	TestNotifySelectItemPCmdL(
       
   870 			KPCmdNumber, KSelItmQualifierEmpty, RSat::KSatV2, RSat::EAlphaIdProvided, KToolkitSelectAlphaId,
       
   871 			KNumItemsThree, KItemIds, KItemNames, &actions,
       
   872 			iconQual, icon, iconListQual, &iconList);
       
   873 	
       
   874 	//generate the terminal response
       
   875 	GenerateSelItemTerminalResponseL( KSelItmQualifierEmpty, resp );
       
   876 	AssertMockLtsyStatusL();
       
   877 	
       
   878 	CleanupStack::PopAndDestroy(3, this); // iconList, actions, this
       
   879 
       
   880 	}
       
   881 
       
   882 
       
   883 /**
       
   884 @SYMTestCaseID BA-CSAT-SI-SNSIPC-0001d
       
   885 @SYMPREQ 1780
       
   886 @SYMComponent  telephony_csat
       
   887 @SYMTestCaseDesc Test support in CSAT for RSat::NotifySelectItemPCmd
       
   888 @SYMTestPriority High
       
   889 @SYMTestActions Invokes RSat::NotifySelectItemPCmd
       
   890 @SYMTestExpectedResults Pass
       
   891 @SYMTestType CT
       
   892 */
       
   893 void CCSatSelectItemFU::TestNotifySelectItemPCmd0001dL()
       
   894 	{
       
   895 
       
   896 	OpenEtelServerL(EUseExtendedError);
       
   897 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
   898 	OpenPhoneL();
       
   899 	OpenSatL();
       
   900 
       
   901  	//-------------------------------------------------------------------------
       
   902 	// Expected Sequence 3.1(ETSI TS 102 384), default item support, successful
       
   903  	//-------------------------------------------------------------------------
       
   904 	
       
   905 	const TUint8 KDefaultItem = 0x02;
       
   906 	TestNotifySelectItemPCmdL(
       
   907 			KPCmdNumber, KSelItmQualifierEmpty, RSat::KSatV2, RSat::EAlphaIdProvided, KToolkitSelectAlphaId,
       
   908 			KNumItemsThree, KItemIds, KItemNames,
       
   909 			NULL, RSat::EIconQualifierNotSet, 0, RSat::EIconQualifierNotSet, NULL,
       
   910 			KDefaultItem);
       
   911 	
       
   912 	//generate the terminal response
       
   913 	RSat::TSelectItemRspV1 resp;
       
   914 	resp.iGeneralResult = RSat::KSuccess;
       
   915 	resp.iInfoType = RSat::KItemIdentifier;
       
   916 	// Identifier of item chosen(0x03) is passed as additional info
       
   917 	// and this value is sufficient because we set information type value as
       
   918 	// item identifier(RSat::KItemIdentifier)
       
   919 	resp.iAdditionalInfo.Append(0x03); // Identifier of item chosen
       
   920 	resp.SetPCmdNumber(KPCmdNumber);
       
   921 
       
   922 	GenerateSelItemTerminalResponseL( KSelItmQualifierEmpty, resp );
       
   923 	AssertMockLtsyStatusL();
       
   924 
       
   925 	CleanupStack::PopAndDestroy(this);
       
   926 
       
   927 	}
       
   928 
       
   929 
       
   930 /**
       
   931 @SYMTestCaseID BA-CSAT-SI-SNSIPC-0001e
       
   932 @SYMPREQ 1780
       
   933 @SYMComponent  telephony_csat
       
   934 @SYMTestCaseDesc Test support in CSAT for RSat::NotifySelectItemPCmd
       
   935 @SYMTestPriority High
       
   936 @SYMTestActions Invokes RSat::NotifySelectItemPCmd
       
   937 @SYMTestExpectedResults Pass
       
   938 @SYMTestType CT
       
   939 */
       
   940 void CCSatSelectItemFU::TestNotifySelectItemPCmd0001eL()
       
   941 	{
       
   942 
       
   943 	OpenEtelServerL(EUseExtendedError);
       
   944 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
   945 	OpenPhoneL();
       
   946 	OpenSatL();
       
   947 
       
   948  	//-------------------------------------------------------------------------
       
   949 	// Expected Sequence 4.1(ETSI TS 102 384), help request support, successful
       
   950  	//-------------------------------------------------------------------------
       
   951 	
       
   952 	TUint8 selItmQualifier = KHelpAvailabilityMask;
       
   953 	TestNotifySelectItemPCmdL(
       
   954 			KPCmdNumber, selItmQualifier, RSat::KSatV2, RSat::EAlphaIdProvided, KToolkitSelectAlphaId,
       
   955 			KNumItemsThree, KItemIds, KItemNames);
       
   956 	
       
   957 	//generate the terminal response
       
   958 	RSat::TSelectItemRspV1 resp;
       
   959 	resp.iGeneralResult = RSat::KHelpRequestedByUser;
       
   960 	resp.iInfoType = RSat::KItemIdentifier;
       
   961 	// Identifier of item chosen(0x01) is passed as additional info
       
   962 	// and this value is sufficient because we set information type value as
       
   963 	// item identifier(RSat::KItemIdentifier)
       
   964 	resp.iAdditionalInfo.Append(0x01); // Identifier of item chosen
       
   965 	resp.SetPCmdNumber(KPCmdNumber);
       
   966 
       
   967 	GenerateSelItemTerminalResponseL( selItmQualifier, resp );
       
   968 	AssertMockLtsyStatusL();
       
   969 
       
   970 	CleanupStack::PopAndDestroy(this);
       
   971 
       
   972 	}
       
   973 
       
   974 
       
   975 /**
       
   976 @SYMTestCaseID BA-CSAT-SI-SNSIPC-0001f
       
   977 @SYMPREQ 1780
       
   978 @SYMComponent  telephony_csat
       
   979 @SYMTestCaseDesc Test support in CSAT for RSat::NotifySelectItemPCmd
       
   980 @SYMTestPriority High
       
   981 @SYMTestActions Invokes RSat::NotifySelectItemPCmd
       
   982 @SYMTestExpectedResults Pass
       
   983 @SYMTestType CT
       
   984 */
       
   985 void CCSatSelectItemFU::TestNotifySelectItemPCmd0001fL()
       
   986 	{
       
   987 
       
   988 	OpenEtelServerL(EUseExtendedError);
       
   989 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
   990 	OpenPhoneL();
       
   991 	OpenSatL();
       
   992 
       
   993 	//-------------------------------------------------------------------------
       
   994 	// Expected Sequence 5.1(ETSI TS 102 384), icons support, successful
       
   995  	//-------------------------------------------------------------------------
       
   996 	
       
   997 	// 5.1A BASIC ICON NOT SELF EXPLANATORY
       
   998 	RSat::TIconQualifier iconQual = RSat::ENotSelfExplanatory;
       
   999 	TUint8 icon = 1; // record 1 in EFIMG
       
  1000 	RSat::TIconQualifier iconListQual = RSat::ENotSelfExplanatory;
       
  1001 
       
  1002 	RArray<TUint32> iconList(KNumItemsThree);
       
  1003 	CleanupClosePushL(iconList);
       
  1004 	 // record 5 in EFIMG for each item
       
  1005 	iconList.Append(5);
       
  1006 	iconList.Append(5);
       
  1007 	iconList.Append(5);
       
  1008 	
       
  1009 	TestNotifySelectItemPCmdL(
       
  1010 			KPCmdNumber, KSelItmQualifierEmpty, RSat::KSatV2, RSat::EAlphaIdProvided, KToolkitSelectAlphaId,
       
  1011 			KNumItemsThree, KItemIds, KItemNames,
       
  1012 			NULL, iconQual, icon, iconListQual, &iconList);
       
  1013 	
       
  1014 	//generate the terminal response
       
  1015 	RSat::TSelectItemRspV1 resp;
       
  1016 	resp.iGeneralResult = RSat::KSuccess;
       
  1017 	resp.iInfoType = RSat::KItemIdentifier;
       
  1018 	// Identifier of item chosen(0x01) is passed as additional info
       
  1019 	// and this value is sufficient because we set information type value as
       
  1020 	// item identifier(RSat::KItemIdentifier)
       
  1021 	resp.iAdditionalInfo.Append(0x01); // Identifier of item chosen
       
  1022 	resp.SetPCmdNumber(KPCmdNumber);
       
  1023 	
       
  1024 	GenerateSelItemTerminalResponseL( KSelItmQualifierEmpty, resp );
       
  1025 	AssertMockLtsyStatusL();
       
  1026 
       
  1027 	// 5.1B BASIC ICON NOT SELF EXPLANATORY, requested icon could not be displayed
       
  1028 	TestNotifySelectItemPCmdL(
       
  1029 			KPCmdNumber, KSelItmQualifierEmpty, RSat::KSatV2, RSat::EAlphaIdProvided, KToolkitSelectAlphaId,
       
  1030 			KNumItemsThree, KItemIds, KItemNames,
       
  1031 			NULL, iconQual, icon, iconListQual, &iconList);
       
  1032 	
       
  1033 	//generate the terminal response
       
  1034 	resp.iGeneralResult = RSat::KSuccessRequestedIconNotDisplayed;
       
  1035 	
       
  1036 	GenerateSelItemTerminalResponseL( KSelItmQualifierEmpty, resp );
       
  1037 	AssertMockLtsyStatusL();
       
  1038 
       
  1039  	//-------------------------------------------------------------------------
       
  1040 	// Expected Sequence 5.2(ETSI TS 102 384), icons support, successful
       
  1041  	//-------------------------------------------------------------------------
       
  1042 	
       
  1043 	// 5.2A BASIC ICON SELF EXPLANATORY
       
  1044 	iconQual = RSat::ESelfExplanatory;
       
  1045 	iconListQual = RSat::ESelfExplanatory;
       
  1046 	
       
  1047 	TestNotifySelectItemPCmdL(
       
  1048 			KPCmdNumber, KSelItmQualifierEmpty, RSat::KSatV2, RSat::EAlphaIdProvided, KToolkitSelectAlphaId,
       
  1049 			KNumItemsThree, KItemIds, KItemNames,
       
  1050 			NULL, iconQual, icon, iconListQual, &iconList);
       
  1051 	
       
  1052 	//generate the terminal response
       
  1053 	resp.iGeneralResult = RSat::KSuccess;
       
  1054 	
       
  1055 	GenerateSelItemTerminalResponseL( KSelItmQualifierEmpty, resp );
       
  1056 	AssertMockLtsyStatusL();
       
  1057 
       
  1058 	// 5.2B BASIC ICON SELF EXPLANATORY, requested icon could not be displayed
       
  1059 	TestNotifySelectItemPCmdL(
       
  1060 			KPCmdNumber, KSelItmQualifierEmpty, RSat::KSatV2, RSat::EAlphaIdProvided, KToolkitSelectAlphaId,
       
  1061 			KNumItemsThree, KItemIds, KItemNames,
       
  1062 			NULL, iconQual, icon, iconListQual, &iconList);
       
  1063 	
       
  1064 	//generate the terminal response
       
  1065 	resp.iGeneralResult = RSat::KSuccessRequestedIconNotDisplayed;
       
  1066 	
       
  1067 	GenerateSelItemTerminalResponseL( KSelItmQualifierEmpty, resp );
       
  1068 	AssertMockLtsyStatusL();
       
  1069 
       
  1070 	//-------------------------------------------------------------------------
       
  1071 	// number of items in the icon list doesn't match the number of items in the menu
       
  1072  	//-------------------------------------------------------------------------
       
  1073 
       
  1074 	TestNotifySelectItemPCmdL(
       
  1075 			KPCmdNumber, KSelItmQualifierEmpty, RSat::KSatV2, RSat::EAlphaIdProvided, KToolkitSelectAlphaId,
       
  1076 			KNumItemsFour, KItemIds, KItemNames, NULL,
       
  1077 			iconQual, icon, iconListQual, &iconList);
       
  1078 	
       
  1079 	//generate the terminal response
       
  1080 	resp.iGeneralResult = RSat::KSuccess;
       
  1081 	resp.iAdditionalInfo.Zero();
       
  1082 	// Identifier of item chosen(0x02) is passed as additional info
       
  1083 	// and this value is sufficient because we set information type value as
       
  1084 	// item identifier(RSat::KItemIdentifier)
       
  1085 	resp.iAdditionalInfo.Append(0x02); // Identifier of item chosen
       
  1086 	
       
  1087 	TTlv itmChosenTlv;
       
  1088 	itmChosenTlv.AddTag(KTlvItemIdentifierTag);
       
  1089 	itmChosenTlv.AddByte( static_cast<TUint8>(resp.iAdditionalInfo[0]) ); // ETLV_IdentifierOfItemChosen
       
  1090 
       
  1091 	RSat::TSelectItemRspV1Pckg respPckg(resp);
       
  1092 	GenerateTerminalResponseL(
       
  1093 			KPCmdNumber, KSelectItem, KSelItmQualifierEmpty, RSat::ESelectItem,
       
  1094 			respPckg, KNullDesC, RSat::KPartialComprehension, itmChosenTlv.GetDataWithoutTopLevelTag());
       
  1095 	AssertMockLtsyStatusL();
       
  1096 
       
  1097 	CleanupStack::PopAndDestroy(2, this); // iconList, this
       
  1098 
       
  1099 	}
       
  1100 
       
  1101 
       
  1102 /**
       
  1103 @SYMTestCaseID BA-CSAT-SI-SNSIPC-0001g
       
  1104 @SYMPREQ 1780
       
  1105 @SYMComponent  telephony_csat
       
  1106 @SYMTestCaseDesc Test support in CSAT for RSat::NotifySelectItemPCmd
       
  1107 @SYMTestPriority High
       
  1108 @SYMTestActions Invokes RSat::NotifySelectItemPCmd
       
  1109 @SYMTestExpectedResults Pass
       
  1110 @SYMTestType CT
       
  1111 */
       
  1112 void CCSatSelectItemFU::TestNotifySelectItemPCmd0001gL()
       
  1113 	{
       
  1114 
       
  1115 	OpenEtelServerL(EUseExtendedError);
       
  1116 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  1117 	OpenPhoneL();
       
  1118 	OpenSatL();
       
  1119 
       
  1120 	//-------------------------------------------------------------------------
       
  1121 	// Expected Sequence 6.1(ETSI TS 102 384),
       
  1122 	// PRESENTATION AS A CHOICE OF NAVIGATION OPTIONS, successful
       
  1123  	//-------------------------------------------------------------------------
       
  1124 	
       
  1125 	TUint8 selItmQualifier = KSelectItemChoiceOfNavigation;
       
  1126 	TestNotifySelectItemPCmdL(
       
  1127 			KPCmdNumber, selItmQualifier, RSat::KSatV2, RSat::EAlphaIdProvided, KToolkitSelectAlphaId,
       
  1128 			KNumItemsThree, KItemIds, KItemNames);
       
  1129 	
       
  1130 	//generate the terminal response
       
  1131 	RSat::TSelectItemRspV1 resp;
       
  1132 	resp.iGeneralResult = RSat::KSuccess;
       
  1133 	resp.iInfoType = RSat::KItemIdentifier;
       
  1134 	// Identifier of item chosen(0x01) is passed as additional info
       
  1135 	// and this value is sufficient because we set information type value as
       
  1136 	// item identifier(RSat::KItemIdentifier)
       
  1137 	resp.iAdditionalInfo.Append(0x01); // Identifier of item chosen
       
  1138 	resp.SetPCmdNumber(KPCmdNumber);
       
  1139 	
       
  1140 	GenerateSelItemTerminalResponseL( selItmQualifier, resp );
       
  1141 	AssertMockLtsyStatusL();
       
  1142 
       
  1143  	//-------------------------------------------------------------------------
       
  1144 	// Expected Sequence 6.2(ETSI TS 102 384),
       
  1145 	// PRESENTATION AS A CHOICE OF DATA VALUES, successful
       
  1146  	//-------------------------------------------------------------------------
       
  1147 	
       
  1148 	selItmQualifier = KSelectItemChoiceOfData;
       
  1149 
       
  1150 	TestNotifySelectItemPCmdL(
       
  1151 			KPCmdNumber, selItmQualifier, RSat::KSatV2, RSat::EAlphaIdProvided, KToolkitSelectAlphaId,
       
  1152 			KNumItemsThree, KItemIds, KItemNames);
       
  1153 	
       
  1154 	// generate the terminal response
       
  1155 	GenerateSelItemTerminalResponseL( selItmQualifier, resp );
       
  1156 	AssertMockLtsyStatusL();
       
  1157 
       
  1158 	CleanupStack::PopAndDestroy(this);
       
  1159 
       
  1160 	}
       
  1161 
       
  1162 
       
  1163 /**
       
  1164 @SYMTestCaseID BA-CSAT-SI-SNSIPC-0001h
       
  1165 @SYMPREQ 1780
       
  1166 @SYMComponent  telephony_csat
       
  1167 @SYMTestCaseDesc Test support in CSAT for RSat::NotifySelectItemPCmd
       
  1168 @SYMTestPriority High
       
  1169 @SYMTestActions Invokes RSat::NotifySelectItemPCmd
       
  1170 @SYMTestExpectedResults Pass
       
  1171 @SYMTestType CT
       
  1172 */
       
  1173 void CCSatSelectItemFU::TestNotifySelectItemPCmd0001hL()
       
  1174 	{
       
  1175 
       
  1176 	OpenEtelServerL(EUseExtendedError);
       
  1177 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  1178 	OpenPhoneL();
       
  1179 	OpenSatL();
       
  1180 
       
  1181  	//-------------------------------------------------------------------------
       
  1182 	// Expected Sequence 7.1(ETSI TS 102 384), soft keys support, successful
       
  1183  	//-------------------------------------------------------------------------
       
  1184 	
       
  1185 	const TUint8 KNumItems7 = 2;
       
  1186 	TUint8 selItmQualifier = KSelectItemSelectUsingSoftKeyMask;
       
  1187 	TestNotifySelectItemPCmdL(
       
  1188 			KPCmdNumber, selItmQualifier, RSat::KSatV2, RSat::EAlphaIdProvided, KToolkitSelectAlphaId,
       
  1189 			KNumItems7, KItemIds, KItemNames);
       
  1190 	
       
  1191 	// generate the terminal response
       
  1192 	RSat::TSelectItemRspV1 resp;
       
  1193 	resp.iGeneralResult = RSat::KSuccess;
       
  1194 	resp.iInfoType = RSat::KItemIdentifier;
       
  1195 	// Identifier of item chosen(0x01) is passed as additional info
       
  1196 	// and this value is sufficient because we set information type value as
       
  1197 	// item identifier(RSat::KItemIdentifier)
       
  1198 	resp.iAdditionalInfo.Append(0x01); // Identifier of item chosen
       
  1199 	resp.SetPCmdNumber(KPCmdNumber);
       
  1200 
       
  1201 	GenerateSelItemTerminalResponseL( selItmQualifier, resp );
       
  1202 	AssertMockLtsyStatusL();
       
  1203 
       
  1204 	CleanupStack::PopAndDestroy(this);
       
  1205 
       
  1206 	}
       
  1207 
       
  1208 
       
  1209 /**
       
  1210 @SYMTestCaseID BA-CSAT-SI-SNSIPC-0001i
       
  1211 @SYMPREQ 1780
       
  1212 @SYMComponent  telephony_csat
       
  1213 @SYMTestCaseDesc Test support in CSAT for RSat::NotifySelectItemPCmd
       
  1214 @SYMTestPriority High
       
  1215 @SYMTestActions Invokes RSat::NotifySelectItemPCmd
       
  1216 @SYMTestExpectedResults Pass
       
  1217 @SYMTestType CT
       
  1218 */
       
  1219 void CCSatSelectItemFU::TestNotifySelectItemPCmd0001iL()
       
  1220 	{
       
  1221 
       
  1222 	OpenEtelServerL(EUseExtendedError);
       
  1223 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  1224 	OpenPhoneL();
       
  1225 	OpenSatL();
       
  1226 
       
  1227  	//-------------------------------------------------------------------------
       
  1228 	// Expected Sequence 8.1(ETSI TS 102 384), Support of "No response from user"
       
  1229  	//-------------------------------------------------------------------------
       
  1230 	
       
  1231 	_LIT8(KAlphaIdentifierText81,"<TIME-OUT>");
       
  1232 	TestNotifySelectItemPCmdL(
       
  1233 			KPCmdNumber, KSelItmQualifierEmpty, RSat::KSatV2, RSat::EAlphaIdProvided, KAlphaIdentifierText81,
       
  1234 			KNumItemsThree, KItemIds, KItemNames);
       
  1235 	
       
  1236 	// generate the terminal response
       
  1237 	RSat::TSelectItemRspV1 resp;
       
  1238 	resp.iGeneralResult = RSat::KNoResponseFromUser;
       
  1239 	resp.iInfoType = RSat::KNoAdditionalInfo;
       
  1240 	resp.SetPCmdNumber(KPCmdNumber);
       
  1241 
       
  1242 	GenerateSelItemTerminalResponseL( KSelItmQualifierEmpty, resp );
       
  1243 	AssertMockLtsyStatusL();
       
  1244 
       
  1245 	CleanupStack::PopAndDestroy(this);
       
  1246 
       
  1247 	}
       
  1248 
       
  1249 
       
  1250 /**
       
  1251 @SYMTestCaseID BA-CSAT-SI-SNSIPC-0001j
       
  1252 @SYMPREQ 1780
       
  1253 @SYMComponent  telephony_csat
       
  1254 @SYMTestCaseDesc Test support in CSAT for RSat::NotifySelectItemPCmd
       
  1255 @SYMTestPriority High
       
  1256 @SYMTestActions Invokes RSat::NotifySelectItemPCmd
       
  1257 @SYMTestExpectedResults Pass
       
  1258 @SYMTestType CT
       
  1259 */
       
  1260 void CCSatSelectItemFU::TestNotifySelectItemPCmd0001jL()
       
  1261 	{
       
  1262 
       
  1263 	OpenEtelServerL(EUseExtendedError);
       
  1264 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  1265 	OpenPhoneL();
       
  1266 	OpenSatL();
       
  1267 
       
  1268  	//-------------------------------------------------------------------------
       
  1269 	// Expected Sequence 10.1(ETSI TS 102 384), 
       
  1270 	// UCS2 in Cyrillic characters, 0x80 UCS2 coding, successful
       
  1271  	//-------------------------------------------------------------------------
       
  1272 
       
  1273 	_LIT8(KAlphaIdentifierText101, // "Hello" in russian, first byte "\x80" is 0x80 UCS2 coding type for Tlv data
       
  1274 			"\x80\x04\x17\x04\x14\x04\x20\x04\x10\x04\x12\x04\x21\x04\x22\x04\x12\x04\x23\x04\x19\x04\x22\x04\x15");
       
  1275 	_LIT8(KItemName1011, // "Hello1" in russian, first byte "\x80" is 0x80 UCS2 coding type for Tlv data
       
  1276 			"\x80\x04\x17\x04\x14\x04\x20\x04\x10\x04\x12\x04\x21\x04\x22\x04\x12\x04\x23\x04\x19\x04\x22\x04\x15\x00\x31");
       
  1277 	_LIT8(KItemName1012, // "Hello2" in russian, first byte "\x80" is 0x80 UCS2 coding type for Tlv data
       
  1278 			"\x80\x04\x17\x04\x14\x04\x20\x04\x10\x04\x12\x04\x21\x04\x22\x04\x12\x04\x23\x04\x19\x04\x22\x04\x15\x00\x32");
       
  1279 	_LIT8(KItemName1013, // "Hello3" in russian, first byte "\x80" is 0x80 UCS2 coding type for Tlv data
       
  1280 			"\x80\x04\x17\x04\x14\x04\x20\x04\x10\x04\x12\x04\x21\x04\x22\x04\x12\x04\x23\x04\x19\x04\x22\x04\x15\x00\x33");
       
  1281 	_LIT16(KAlphaIdentifierText10xU, // "Hello" in russian in unicode format for checking results
       
  1282 			"\x0417\x0414\x0420\x0410\x0412\x0421\x0422\x0412\x0423\x0419\x0422\x0415");
       
  1283 	const TPtrC8 itemNames101[KNumItemsThree] = {KItemName1011(), KItemName1012(), KItemName1013()};
       
  1284 	const TPtrC16 itemNames10xU[KNumItemsThree] =
       
  1285 		{ // data for checking results
       
  1286 		// "Hello1" in russian in unicode format
       
  1287 			_L16("\x0417\x0414\x0420\x0410\x0412\x0421\x0422\x0412\x0423\x0419\x0422\x0415\x0031"),
       
  1288 		// "Hello2" in russian in unicode format
       
  1289 			_L16("\x0417\x0414\x0420\x0410\x0412\x0421\x0422\x0412\x0423\x0419\x0422\x0415\x0032"),
       
  1290 		// "Hello3" in russian in unicode format
       
  1291 			_L16("\x0417\x0414\x0420\x0410\x0412\x0421\x0422\x0412\x0423\x0419\x0422\x0415\x0033")
       
  1292 		};
       
  1293 
       
  1294 	TestNotifySelectItemPCmdL(
       
  1295 			KPCmdNumber, KSelItmQualifierEmpty, RSat::KSatV2, RSat::EAlphaIdProvided, KAlphaIdentifierText101,
       
  1296 			KNumItemsThree, KItemIds, itemNames101,
       
  1297 			NULL, RSat::EIconQualifierNotSet, 0, RSat::EIconQualifierNotSet, NULL, 0,
       
  1298 			KErrNone, &KAlphaIdentifierText10xU, itemNames10xU);
       
  1299 	
       
  1300 	//generate the terminal response
       
  1301 	RSat::TSelectItemRspV1 resp;
       
  1302 	resp.iGeneralResult = RSat::KSuccess;
       
  1303 	resp.iInfoType = RSat::KItemIdentifier;
       
  1304 	// Identifier of item chosen(0x02) is passed as additional info
       
  1305 	// and this value is sufficient because we set information type value as
       
  1306 	// item identifier(RSat::KItemIdentifier)
       
  1307 	resp.iAdditionalInfo.Append(0x02); // Identifier of item chosen
       
  1308 	resp.SetPCmdNumber(KPCmdNumber);
       
  1309 
       
  1310 	GenerateSelItemTerminalResponseL( KSelItmQualifierEmpty, resp );
       
  1311 	AssertMockLtsyStatusL();
       
  1312 
       
  1313  	//-------------------------------------------------------------------------
       
  1314 	// Expected Sequence 10.2(ETSI TS 102 384), 
       
  1315 	// UCS2 in Cyrillic characters, 0x81 UCS2 coding, successful
       
  1316  	//-------------------------------------------------------------------------
       
  1317 
       
  1318 	_LIT8(KAlphaIdentifierText102, // "Hello" in russian, first byte "\x81" is 0x81 UCS2 coding type for Tlv data
       
  1319 			"\x81\x0C\x08\x97\x94\xA0\x90\x92\xA1\xA2\x92\xA3\x99\xA2\x95");
       
  1320 	const TPtrC8 itemNames102[KNumItemsThree] =
       
  1321 		{ // first bytes "\x81" is 0x81 UCS2 coding type for Tlv data
       
  1322 		// "Hello1" in russian
       
  1323 			_L8("\x81\x0D\x08\x97\x94\xA0\x90\x92\xA1\xA2\x92\xA3\x99\xA2\x95\x31"),
       
  1324 		// "Hello2" in russian
       
  1325 			_L8("\x81\x0D\x08\x97\x94\xA0\x90\x92\xA1\xA2\x92\xA3\x99\xA2\x95\x32"),
       
  1326 		// "Hello3" in russian
       
  1327 			_L8("\x81\x0D\x08\x97\x94\xA0\x90\x92\xA1\xA2\x92\xA3\x99\xA2\x95\x33")
       
  1328 		};
       
  1329 
       
  1330 	TestNotifySelectItemPCmdL(
       
  1331 			KPCmdNumber, KSelItmQualifierEmpty, RSat::KSatV2, RSat::EAlphaIdProvided, KAlphaIdentifierText102,
       
  1332 			KNumItemsThree, KItemIds, itemNames102,
       
  1333 			NULL, RSat::EIconQualifierNotSet, 0, RSat::EIconQualifierNotSet, NULL, 0,
       
  1334 			KErrNone, &KAlphaIdentifierText10xU, itemNames10xU);
       
  1335 
       
  1336 	//generate the terminal response
       
  1337 	GenerateSelItemTerminalResponseL( KSelItmQualifierEmpty, resp );
       
  1338 	AssertMockLtsyStatusL();
       
  1339 
       
  1340  	//-------------------------------------------------------------------------
       
  1341 	// Expected Sequence 10.3(ETSI TS 102 384), 
       
  1342 	// UCS2 in Cyrillic characters, 0x82 UCS2 coding, successful
       
  1343  	//-------------------------------------------------------------------------
       
  1344 
       
  1345 	_LIT8(KAlphaIdentifierText103, // "Hello" in russian, first byte "\x82" is 0x82 UCS2 coding type for Tlv data
       
  1346 			"\x82\x0C\x04\x10\x87\x84\x90\x80\x82\x91\x92\x82\x93\x89\x92\x85");
       
  1347 	const TPtrC8 itemNames103[KNumItemsThree] =
       
  1348 		{ // first bytes "\x82" is 0x82 UCS2 coding type for Tlv data
       
  1349 		// "Hello1" in russian
       
  1350 			_L8("\x82\x0D\x04\x10\x87\x84\x90\x80\x82\x91\x92\x82\x93\x89\x92\x85\x31"),
       
  1351 		// "Hello2" in russian
       
  1352 			_L8("\x82\x0D\x04\x10\x87\x84\x90\x80\x82\x91\x92\x82\x93\x89\x92\x85\x32"),
       
  1353 		// "Hello3" in russian
       
  1354 			_L8("\x82\x0D\x04\x10\x87\x84\x90\x80\x82\x91\x92\x82\x93\x89\x92\x85\x33")
       
  1355 		};
       
  1356 
       
  1357 	TestNotifySelectItemPCmdL(
       
  1358 			KPCmdNumber, KSelItmQualifierEmpty, RSat::KSatV2, RSat::EAlphaIdProvided, KAlphaIdentifierText103,
       
  1359 			KNumItemsThree, KItemIds, itemNames103,
       
  1360 			NULL, RSat::EIconQualifierNotSet, 0, RSat::EIconQualifierNotSet, NULL, 0,
       
  1361 			KErrNone, &KAlphaIdentifierText10xU, itemNames10xU);
       
  1362 
       
  1363 	//generate the terminal response
       
  1364 	GenerateSelItemTerminalResponseL( KSelItmQualifierEmpty, resp );
       
  1365 	AssertMockLtsyStatusL();
       
  1366 
       
  1367 	CleanupStack::PopAndDestroy(this);
       
  1368 
       
  1369 	}
       
  1370 
       
  1371 
       
  1372 /**
       
  1373 @SYMTestCaseID BA-CSAT-SI-SNSIPC-0001k
       
  1374 @SYMPREQ 1780
       
  1375 @SYMComponent  telephony_csat
       
  1376 @SYMTestCaseDesc Test support in CSAT for RSat::NotifySelectItemPCmd
       
  1377 @SYMTestPriority High
       
  1378 @SYMTestActions Invokes RSat::NotifySelectItemPCmd
       
  1379 @SYMTestExpectedResults Pass
       
  1380 @SYMTestType CT
       
  1381 */
       
  1382 void CCSatSelectItemFU::TestNotifySelectItemPCmd0001kL()
       
  1383 	{
       
  1384 
       
  1385 	OpenEtelServerL(EUseExtendedError);
       
  1386 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  1387 	OpenPhoneL();
       
  1388 	OpenSatL();
       
  1389 
       
  1390  	//-------------------------------------------------------------------------
       
  1391 	// Expected Sequence 11.1(ETSI TS 102 384), UCS2 in Chinese Characters, successful
       
  1392  	//-------------------------------------------------------------------------
       
  1393 
       
  1394 	_LIT8(KAlphaIdentifierText111, // "Toolkit Select" in Chinese, first byte "\x80" is 0x80 UCS2 coding type for Tlv data
       
  1395 			"\x80\x5D\xE5\x51\x77\x7B\xB1\x90\x09\x62\xE9");
       
  1396 	_LIT8(KItemName111, // "Item 1" in Chinese, first byte "\x80" is 0x80 UCS2 coding type for Tlv data
       
  1397 			"\x80\x98\x79\x76\xEE\x4E\x00");
       
  1398 	_LIT8(KItemName112, // "Item 2" in Chinese, first byte "\x80" is 0x80 UCS2 coding type for Tlv data
       
  1399 			"\x80\x98\x79\x76\xEE\x4E\x8C");
       
  1400 	_LIT8(KItemName113, // "Item 3" in Chinese, first byte "\x80" is 0x80 UCS2 coding type for Tlv data
       
  1401 			"\x80\x98\x79\x76\xEE\x4E\x09");
       
  1402 	_LIT8(KItemName114, // "Item 4" in Chinese, first byte "\x80" is 0x80 UCS2 coding type for Tlv data
       
  1403 			"\x80\x98\x79\x76\xEE\x56\xDB");
       
  1404 	_LIT16(KAlphaIdentifierText11U, // "Toolkit Select" in Chinese in unicode format for checking results
       
  1405 			"\x5DE5\x5177\x7BB1\x9009\x62E9");
       
  1406 	const TPtrC8 itemNames111[KNumItemsFour] = {KItemName111(), KItemName112(), KItemName113(), KItemName114()};
       
  1407 	const TPtrC16 itemNames11U[KNumItemsFour] =
       
  1408 		{ // data for checking results
       
  1409 		// "Item 1" in Chinese in unicode format
       
  1410 			_L16("\x9879\x76EE\x4E00"),
       
  1411 		// "Item 2" in Chinese in unicode format
       
  1412 			_L16("\x9879\x76EE\x4E8C"),
       
  1413 		// "Item 3" in Chinese in unicode format
       
  1414 			_L16("\x9879\x76EE\x4E09"),
       
  1415 		// "Item 4" in Chinese in unicode format
       
  1416 			_L16("\x9879\x76EE\x56DB")
       
  1417 		};
       
  1418 
       
  1419 	TestNotifySelectItemPCmdL(
       
  1420 			KPCmdNumber, KSelItmQualifierEmpty, RSat::KSatV2, RSat::EAlphaIdProvided, KAlphaIdentifierText111,
       
  1421 			KNumItemsFour, KItemIds, itemNames111,
       
  1422 			NULL, RSat::EIconQualifierNotSet, 0, RSat::EIconQualifierNotSet, NULL, 0,
       
  1423 			KErrNone, &KAlphaIdentifierText11U, itemNames11U);
       
  1424 	
       
  1425 	//generate the terminal response
       
  1426 	RSat::TSelectItemRspV1 resp;
       
  1427 	resp.iGeneralResult = RSat::KSuccess;
       
  1428 	resp.iInfoType = RSat::KItemIdentifier;
       
  1429 	// Identifier of item chosen(0x02) is passed as additional info
       
  1430 	// and this value is sufficient because we set information type value as
       
  1431 	// item identifier(RSat::KItemIdentifier)
       
  1432 	resp.iAdditionalInfo.Append(0x02); // Identifier of item chosen
       
  1433 	resp.SetPCmdNumber(KPCmdNumber);
       
  1434 
       
  1435 	GenerateSelItemTerminalResponseL( KSelItmQualifierEmpty, resp );
       
  1436 	AssertMockLtsyStatusL();
       
  1437 
       
  1438 	CleanupStack::PopAndDestroy(this);
       
  1439 
       
  1440 	}
       
  1441 
       
  1442 
       
  1443 /**
       
  1444 @SYMTestCaseID BA-CSAT-SI-SNSIPC-0001l
       
  1445 @SYMPREQ 1780
       
  1446 @SYMComponent  telephony_csat
       
  1447 @SYMTestCaseDesc Test support in CSAT for RSat::NotifySelectItemPCmd
       
  1448 @SYMTestPriority High
       
  1449 @SYMTestActions Invokes RSat::NotifySelectItemPCmd
       
  1450 @SYMTestExpectedResults Pass
       
  1451 @SYMTestType CT
       
  1452 */
       
  1453 void CCSatSelectItemFU::TestNotifySelectItemPCmd0001lL()
       
  1454 	{
       
  1455 
       
  1456 	OpenEtelServerL(EUseExtendedError);
       
  1457 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  1458 	OpenPhoneL();
       
  1459 	OpenSatL();
       
  1460 
       
  1461  	//-------------------------------------------------------------------------
       
  1462 	// Expected Sequence 12.1(ETSI TS 102 384), 
       
  1463 	// UCS2 in Katakana characters, 0x80 UCS2 coding, successful
       
  1464  	//-------------------------------------------------------------------------
       
  1465 
       
  1466 	_LIT8(KAlphaIdentifierText121, // Use characters in Katakana, first byte "\x80" is 0x80 UCS2 coding type for Tlv data
       
  1467 			"\x80\x00\x38\x00\x30\x30\xEB\x00\x30");
       
  1468 	_LIT8(KItemName1211, // Use characters in Katakana, first byte "\x80" is 0x80 UCS2 coding type for Tlv data
       
  1469 			"\x80\x00\x38\x00\x30\x30\xEB\x00\x31");
       
  1470 	_LIT8(KItemName1212, // Use characters in Katakana, first byte "\x80" is 0x80 UCS2 coding type for Tlv data
       
  1471 			"\x80\x00\x38\x00\x30\x30\xEB\x00\x32");
       
  1472 	_LIT8(KItemName1213, // Use characters in Katakana, first byte "\x80" is 0x80 UCS2 coding type for Tlv data
       
  1473 			"\x80\x00\x38\x00\x30\x30\xEB\x00\x33");
       
  1474 	const TPtrC8 itemNames121[KNumItemsThree] = {KItemName1211(), KItemName1212(), KItemName1213()};
       
  1475 	_LIT16(KAlphaIdentifierText121U, // Katakana in unicode format for checking results
       
  1476 			"\x0038\x0030\x30EB\x0030");
       
  1477 	const TPtrC16 itemNames121U[KNumItemsThree] =
       
  1478 		{ // Katakana in unicode format for checking results
       
  1479 			_L16("\x0038\x0030\x30EB\x0031"),
       
  1480 			_L16("\x0038\x0030\x30EB\x0032"),
       
  1481 			_L16("\x0038\x0030\x30EB\x0033")
       
  1482 		};
       
  1483 
       
  1484 	TestNotifySelectItemPCmdL(
       
  1485 			KPCmdNumber, KSelItmQualifierEmpty, RSat::KSatV2, RSat::EAlphaIdProvided, KAlphaIdentifierText121,
       
  1486 			KNumItemsThree, KItemIds, itemNames121,
       
  1487 			NULL, RSat::EIconQualifierNotSet, 0, RSat::EIconQualifierNotSet, NULL, 0,
       
  1488 			KErrNone, &KAlphaIdentifierText121U, itemNames121U);
       
  1489 	
       
  1490 	//generate the terminal response
       
  1491 	RSat::TSelectItemRspV1 resp;
       
  1492 	resp.iGeneralResult = RSat::KSuccess;
       
  1493 	resp.iInfoType = RSat::KItemIdentifier;
       
  1494 	// Identifier of item chosen(0x02) is passed as additional info
       
  1495 	// and this value is sufficient because we set information type value as
       
  1496 	// item identifier(RSat::KItemIdentifier)
       
  1497 	resp.iAdditionalInfo.Append(0x02); // Identifier of item chosen
       
  1498 	resp.SetPCmdNumber(KPCmdNumber);
       
  1499 
       
  1500 	GenerateSelItemTerminalResponseL( KSelItmQualifierEmpty, resp );
       
  1501 	AssertMockLtsyStatusL();
       
  1502 
       
  1503  	//-------------------------------------------------------------------------
       
  1504 	// Expected Sequence 12.2(ETSI TS 102 384), 
       
  1505 	// UCS2 in Cyrillic characters, 0x81 UCS2 coding, successful
       
  1506  	//-------------------------------------------------------------------------
       
  1507 
       
  1508 	_LIT8(KAlphaIdentifierText122, // Use characters in Katakana, first byte "\x81" is 0x81 UCS2 coding type for Tlv data
       
  1509 			"\x81\x04\x61\x38\x31\xEB\x30");
       
  1510 	const TPtrC8 itemNames122[KNumItemsThree] =
       
  1511 		{ // Use characters in Katakana, first bytes "\x81" is 0x81 UCS2 coding type for Tlv data
       
  1512 			_L8("\x81\x04\x61\x38\x31\xEB\x31"),
       
  1513 			_L8("\x81\x04\x61\x38\x31\xEB\x32"),
       
  1514 			_L8("\x81\x04\x61\x38\x31\xEB\x33")
       
  1515 		};
       
  1516 	_LIT16(KAlphaIdentifierText122U, // Katakana in unicode format for checking results
       
  1517 			"\x0038\x0031\x30EB\x0030");
       
  1518 	const TPtrC16 itemNames122U[KNumItemsThree] =
       
  1519 		{ // Katakana in unicode format for checking results
       
  1520 			_L16("\x0038\x0031\x30EB\x0031"),
       
  1521 			_L16("\x0038\x0031\x30EB\x0032"),
       
  1522 			_L16("\x0038\x0031\x30EB\x0033")
       
  1523 		};
       
  1524 
       
  1525 	TestNotifySelectItemPCmdL(
       
  1526 			KPCmdNumber, KSelItmQualifierEmpty, RSat::KSatV2, RSat::EAlphaIdProvided, KAlphaIdentifierText122,
       
  1527 			KNumItemsThree, KItemIds, itemNames122,
       
  1528 			NULL, RSat::EIconQualifierNotSet, 0, RSat::EIconQualifierNotSet, NULL, 0,
       
  1529 			KErrNone, &KAlphaIdentifierText122U, itemNames122U);
       
  1530 
       
  1531 	//generate the terminal response
       
  1532 	GenerateSelItemTerminalResponseL( KSelItmQualifierEmpty, resp );
       
  1533 	AssertMockLtsyStatusL();
       
  1534 
       
  1535  	//-------------------------------------------------------------------------
       
  1536 	// Expected Sequence 12.3(ETSI TS 102 384), 
       
  1537 	// UCS2 in Cyrillic characters, 0x82 UCS2 coding, successful
       
  1538  	//-------------------------------------------------------------------------
       
  1539 
       
  1540 	_LIT8(KAlphaIdentifierText123, // Use characters in Katakana, first byte "\x82" is 0x82 UCS2 coding type for Tlv data
       
  1541 			"\x82\x04\x30\xA0\x38\x32\xCB\x30");
       
  1542 	const TPtrC8 itemNames123[KNumItemsThree] =
       
  1543 		{ // Use characters in Katakana, first bytes "\x82" is 0x82 UCS2 coding type for Tlv data
       
  1544 			_L8("\x82\x04\x30\xA0\x38\x32\xCB\x31"),
       
  1545 			_L8("\x82\x04\x30\xA0\x38\x32\xCB\x32"),
       
  1546 			_L8("\x82\x04\x30\xA0\x38\x32\xCB\x33")
       
  1547 		};
       
  1548 	_LIT16(KAlphaIdentifierText123U, // Katakana in unicode format for checking results
       
  1549 			"\x0038\x0032\x30EB\x0030");
       
  1550 	const TPtrC16 itemNames123U[KNumItemsThree] =
       
  1551 		{ // Katakana in unicode format for checking results
       
  1552 			_L16("\x0038\x0032\x30EB\x0031"),
       
  1553 			_L16("\x0038\x0032\x30EB\x0032"),
       
  1554 			_L16("\x0038\x0032\x30EB\x0033")
       
  1555 		};
       
  1556 
       
  1557 	TestNotifySelectItemPCmdL(
       
  1558 			KPCmdNumber, KSelItmQualifierEmpty, RSat::KSatV2, RSat::EAlphaIdProvided, KAlphaIdentifierText123,
       
  1559 			KNumItemsThree, KItemIds, itemNames123,
       
  1560 			NULL, RSat::EIconQualifierNotSet, 0, RSat::EIconQualifierNotSet, NULL, 0,
       
  1561 			KErrNone, &KAlphaIdentifierText123U, itemNames123U);
       
  1562 
       
  1563 	//generate the terminal response
       
  1564 	GenerateSelItemTerminalResponseL( KSelItmQualifierEmpty, resp );
       
  1565 	AssertMockLtsyStatusL();
       
  1566 
       
  1567 	CleanupStack::PopAndDestroy(this);
       
  1568 
       
  1569 	}
       
  1570 
       
  1571 
       
  1572 /**
       
  1573 @SYMTestCaseID BA-CSAT-SI-SNSIPC-0002
       
  1574 @SYMPREQ 1780
       
  1575 @SYMComponent  telephony_csat
       
  1576 @SYMTestCaseDesc Test support in CSAT for cancelling of RSat::NotifySelectItemPCmd
       
  1577 @SYMTestPriority High
       
  1578 @SYMTestActions Invokes cancelling of RSat::NotifySelectItemPCmd
       
  1579 @SYMTestExpectedResults Pass
       
  1580 @SYMTestType CT
       
  1581 */
       
  1582 void CCSatSelectItemFU::TestNotifySelectItemPCmd0002L()
       
  1583 	{
       
  1584 
       
  1585 	OpenEtelServerL(EUseExtendedError);
       
  1586 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  1587 	OpenPhoneL();
       
  1588 	OpenSatL();
       
  1589 
       
  1590 	TRequestStatus mockLtsyStatus;
       
  1591 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
  1592 
       
  1593  	//-------------------------------------------------------------------------
       
  1594 	// Test cancelling of RSat::NotifySelectItemPCmd
       
  1595  	//-------------------------------------------------------------------------
       
  1596 
       
  1597 	PrepareMockWithExpDataForPCmdNotifyL(KSelectItem);
       
  1598 	
       
  1599 	PrepareSelItemCompleteDataL(
       
  1600 			KPCmdNumber, KSelItmQualifierEmpty, RSat::EAlphaIdProvided, KToolkitSelectAlphaId,
       
  1601 			KNumItemsFour, KItemIds, KItemNames,
       
  1602 			NULL, RSat::EIconQualifierNotSet, 0, RSat::EIconQualifierNotSet, NULL, 0,
       
  1603 			KErrNone, 10);
       
  1604 	
       
  1605 	RSat::TAdditionalInfo addInfo;
       
  1606 	addInfo.Append(RSat::KNoSpecificMeProblem);
       
  1607 	PrepareTerminalResponseMockDataL(
       
  1608 			KPCmdNumber, KSelectItem, KSelItmQualifierEmpty,
       
  1609 			addInfo, RSat::KMeUnableToProcessCmd);
       
  1610 
       
  1611 	RSat::TSelectItemV2 selItmData;
       
  1612 	ResetSelectItemData(selItmData);
       
  1613 	RSat::TSelectItemV2Pckg selItmDataPck(selItmData);
       
  1614 	TRequestStatus requestStatus;
       
  1615 	
       
  1616 	iSat.NotifySelectItemPCmd(requestStatus, selItmDataPck);
       
  1617 	
       
  1618 	iSat.CancelAsyncRequest(ESatNotifySelectItemPCmd);
       
  1619 	
       
  1620 	User::WaitForRequest(requestStatus);
       
  1621 	ASSERT_EQUALS(KErrCancel, requestStatus.Int());
       
  1622 
       
  1623 	// Wait for completion of iMockLTSY.NotifyTerminated
       
  1624 	User::WaitForRequest(mockLtsyStatus);
       
  1625 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
  1626 
       
  1627 	AssertMockLtsyStatusL();
       
  1628 
       
  1629 	CleanupStack::PopAndDestroy(this);
       
  1630 
       
  1631 	}
       
  1632 
       
  1633 
       
  1634 /**
       
  1635 @SYMTestCaseID BA-CSAT-SI-SNSIPC-0004
       
  1636 @SYMPREQ 1780
       
  1637 @SYMComponent  telephony_csat
       
  1638 @SYMTestCaseDesc Test support in CSAT for multiple client requests to RSat::NotifySelectItemPCmd
       
  1639 @SYMTestPriority High
       
  1640 @SYMTestActions Invokes multiple client requests to RSat::NotifySelectItemPCmd
       
  1641 @SYMTestExpectedResults Pass
       
  1642 @SYMTestType CT
       
  1643 */
       
  1644 void CCSatSelectItemFU::TestNotifySelectItemPCmd0004L()
       
  1645 	{
       
  1646 
       
  1647 	OpenEtelServerL(EUseExtendedError);
       
  1648 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  1649 	OpenPhoneL();
       
  1650 	OpenSatL();
       
  1651 
       
  1652 	// Open second client
       
  1653 	RTelServer telServer2;
       
  1654 	TInt ret = telServer2.Connect();
       
  1655 	ASSERT_EQUALS(KErrNone, ret);
       
  1656 	CleanupClosePushL(telServer2);
       
  1657 
       
  1658 	RMobilePhone phone2;
       
  1659 	ret = phone2.Open(telServer2, KMmTsyPhoneName);
       
  1660 	ASSERT_EQUALS(KErrNone, ret);
       
  1661 	CleanupClosePushL(phone2);
       
  1662 
       
  1663 	RSat sat2;
       
  1664 	ret = sat2.Open(phone2);
       
  1665 	ASSERT_EQUALS(KErrNone, ret);
       
  1666 	CleanupClosePushL(sat2);
       
  1667 
       
  1668 	// prepare proactive command data
       
  1669 	_LIT8(KAlphaIdentifierText, "Toolkit Select 1"); 
       
  1670 	_LIT16(KAlphaIdentifierText16, "Toolkit Select 1"); 
       
  1671 
       
  1672 	// prepare Test A data
       
  1673 	TRequestStatus requestStatus;
       
  1674 	TRequestStatus requestStatus2;
       
  1675 
       
  1676 	RSat::TSelectItemV2 selItmData;
       
  1677 	RSat::TSelectItemV2 selItmData2;
       
  1678 	RSat::TSelectItemV2Pckg selItmDataPckg(selItmData);
       
  1679 	RSat::TSelectItemV2Pckg selItmDataPckg2(selItmData2);
       
  1680 
       
  1681 	ResetSelectItemData(selItmData);
       
  1682 	ResetSelectItemData(selItmData2);
       
  1683 
       
  1684 	// prepare Test B data
       
  1685 	RSat::TSelectItemV1 selItmDataV1;
       
  1686 	RSat::TSelectItemV1Pckg selItmDataV1Pckg(selItmDataV1);
       
  1687 	ResetSelectItemData(selItmDataV1);
       
  1688 
       
  1689 	// prepare terminal response data
       
  1690 	RSat::TSelectItemRspV1 resp;
       
  1691 	resp.iGeneralResult = RSat::KSuccess;
       
  1692 	resp.iInfoType = RSat::KItemIdentifier;
       
  1693 	// Identifier of item chosen(0x02) is passed as additional info
       
  1694 	// and this value is sufficient because we set information type value as
       
  1695 	// item identifier(RSat::KItemIdentifier)
       
  1696 	resp.iAdditionalInfo.Append(0x02);
       
  1697 	resp.SetPCmdNumber(KPCmdNumber);
       
  1698 
       
  1699 	//-------------------------------------------------------------------------
       
  1700 	// Test A: Test multiple clients requesting RSat::NotifySelectItemPCmd
       
  1701 	// when they both pass the same T-class version
       
  1702  	//-------------------------------------------------------------------------
       
  1703 
       
  1704 	// prepare Mock data
       
  1705 	PrepareMockWithExpDataForPCmdNotifyL(KSelectItem);
       
  1706 	PrepareSelItemCompleteDataL(
       
  1707 			KPCmdNumber, KSelItmQualifierEmpty, RSat::EAlphaIdProvided, KAlphaIdentifierText,
       
  1708 			KNumItemsFour, KItemIds, KItemNames,
       
  1709 			NULL, RSat::EIconQualifierNotSet, 0, RSat::EIconQualifierNotSet, NULL, 0,
       
  1710 			KErrNone, 10);
       
  1711 
       
  1712 	// send requests
       
  1713 	iSat.NotifySelectItemPCmd(requestStatus, selItmDataPckg);
       
  1714 	sat2.NotifySelectItemPCmd(requestStatus2, selItmDataPckg2);
       
  1715 	
       
  1716 	// wait for completion
       
  1717 	User::WaitForRequest(requestStatus);
       
  1718 	User::WaitForRequest(requestStatus2);
       
  1719 	
       
  1720 	// check results
       
  1721 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
  1722 	ASSERT_EQUALS(KErrNone, requestStatus2.Int());
       
  1723 
       
  1724 	const TUint8 KNumClients = 2;
       
  1725 	const RSat::TSelectItemV2* selItmDataArr[KNumClients] = { &selItmData, &selItmData2};
       
  1726 	for(TUint8 clientNo = 0; clientNo < KNumClients; clientNo++)
       
  1727 		{
       
  1728 		const RSat::TSelectItemV2& selItmData( *(selItmDataArr[clientNo]) );
       
  1729 		
       
  1730 		ASSERT_EQUALS( KPCmdNumber, selItmData.PCmdNumber() );
       
  1731 		ASSERT_TRUE( RSat::ESoftKeyPreferred != selItmData.iPreference );
       
  1732 		ASSERT_EQUALS( RSat::ENoHelpAvailable, selItmData.iHelp );
       
  1733 		ASSERT_TRUE( ( RSat::ENotSpecified == selItmData.iPresentationType ) ||
       
  1734 				( RSat::EPresentationTypeNotSet == selItmData.iPresentationType ) );
       
  1735 		ASSERT_EQUALS( RSat::ENoIconId, selItmData.iIconId.iQualifier );
       
  1736 		ASSERT_EQUALS( RSat::ENoIconId, selItmData.iIconListQualifier );
       
  1737 		ASSERT_EQUALS( static_cast<TUint8>(0), selItmData.iDefaultItemId );
       
  1738 		ASSERT_EQUALS( 0, KAlphaIdentifierText16().Compare(selItmData.iAlphaId.iAlphaId) );
       
  1739 		ASSERT_EQUALS( RSat::EAlphaIdProvided, selItmData.iAlphaId.iStatus );
       
  1740 		ASSERT_TRUE( !selItmData.IsRemoveMenu() );
       
  1741 		ASSERT_EQUALS( static_cast<TUint>(KNumItemsFour), selItmData.NumberOfItems() );
       
  1742 		for(TInt i = 0; i < KNumItemsFour; i++)
       
  1743 			{
       
  1744 			RSat::TItem item;
       
  1745 			TInt action;
       
  1746 			TInt iconId;
       
  1747 	
       
  1748 			ASSERT_EQUALS( KErrNone, selItmData.GetItem( i + 1, item, action, iconId ) );
       
  1749 			ASSERT_EQUALS( KItemIds[i], item.iItemId );
       
  1750 			ASSERT_EQUALS( 0, Compare16bitDesWith8bitDesL(KItemNames[i], item.iItemString) );
       
  1751 			ASSERT_EQUALS( KErrNotFound, action );
       
  1752 			ASSERT_EQUALS( KErrNotFound, iconId );
       
  1753 			}
       
  1754 		}
       
  1755 
       
  1756 	AssertMockLtsyStatusL();
       
  1757 	
       
  1758 	//generate terminal responses
       
  1759 	GenerateSelItemTerminalResponseL( KSelItmQualifierEmpty, resp);
       
  1760 	GenerateSelItemTerminalResponseL( KSelItmQualifierEmpty, resp);
       
  1761 	AssertMockLtsyStatusL();
       
  1762 
       
  1763 	//-------------------------------------------------------------------------
       
  1764 	// Test B: Test multiple clients requesting RSat::NotifySelectItemPCmd
       
  1765 	// when they both pass different T-class versions
       
  1766  	//-------------------------------------------------------------------------	
       
  1767 
       
  1768 	// When multiple clients requesting RSat::NotifySelectItemPCmd and they both pass
       
  1769 	// different packaged parameter versions only the last request completes, because
       
  1770 	// etel reposts request with new parameter size and looses previous requests.
       
  1771 	// May be it would be worth to make ESatNotifySelectItemPCmd ipc requests flow controlled
       
  1772 	// by CSATTSY instead of multiple completed by ETEL.
       
  1773 	ERR_PRINTF2(_L("<font color=Orange>$CSATKnownFailure: defect id = %d</font>"), 51);
       
  1774 	ASSERT_TRUE( EFalse );
       
  1775 
       
  1776 	// send requests
       
  1777 	PrepareMockWithExpDataForPCmdNotifyL(KSelectItem);
       
  1778 	PrepareSelItemCompleteDataL(
       
  1779 			KPCmdNumber, KSelItmQualifierEmpty, RSat::EAlphaIdProvided, KAlphaIdentifierText,
       
  1780 			KNumItemsFour, KItemIds, KItemNames,
       
  1781 			NULL, RSat::EIconQualifierNotSet, 0, RSat::EIconQualifierNotSet, NULL, 0,
       
  1782 			KErrNone, 10);
       
  1783 
       
  1784 	ResetSelectItemData(selItmData);
       
  1785 	iSat.NotifySelectItemPCmd(requestStatus, selItmDataPckg);
       
  1786 	sat2.NotifySelectItemPCmd(requestStatus2, selItmDataV1Pckg);
       
  1787 
       
  1788 	// wait for completion
       
  1789 	User::WaitForRequest(requestStatus2);
       
  1790 	User::WaitForRequest(requestStatus);
       
  1791 	
       
  1792 	// check results
       
  1793 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
  1794 	ASSERT_EQUALS(KErrNone, requestStatus2.Int());
       
  1795 	
       
  1796 	// check results general for V2 and V1 parameter versions
       
  1797 	const RSat::TSelectItemV1* selItmDataV1Arr[KNumClients] = { &selItmData, &selItmDataV1};
       
  1798 	for(TInt clientNo = 0; clientNo < KNumClients; clientNo++)
       
  1799 		{
       
  1800 		const RSat::TSelectItemV1& selItmData( *(selItmDataV1Arr[clientNo]) );
       
  1801 		
       
  1802 		ASSERT_EQUALS( KPCmdNumber, selItmData.PCmdNumber() );
       
  1803 		ASSERT_EQUALS( RSat::ENoHelpAvailable, selItmData.iHelp );
       
  1804 		ASSERT_TRUE( ( RSat::ENotSpecified == selItmData.iPresentationType ) ||
       
  1805 				( RSat::EPresentationTypeNotSet == selItmData.iPresentationType ) );
       
  1806 		ASSERT_EQUALS( RSat::ENoIconId, selItmData.iIconId.iQualifier );
       
  1807 		ASSERT_EQUALS( RSat::ENoIconId, selItmData.iIconListQualifier );
       
  1808 		ASSERT_EQUALS( static_cast<TUint8>(0), selItmData.iDefaultItemId );
       
  1809 		ASSERT_EQUALS( 0, KAlphaIdentifierText16().Compare(selItmData.iAlphaId.iAlphaId) );
       
  1810 		ASSERT_EQUALS( RSat::EAlphaIdProvided, selItmData.iAlphaId.iStatus );
       
  1811 		ASSERT_TRUE( !selItmData.IsRemoveMenu() );
       
  1812 		ASSERT_EQUALS( static_cast<TUint>(KNumItemsFour), selItmData.NumberOfItems() );
       
  1813 		for(TInt i = 0; i < KNumItemsFour; i++)
       
  1814 			{
       
  1815 			RSat::TItem item;
       
  1816 			TInt action;
       
  1817 			TInt iconId;
       
  1818 	
       
  1819 			ASSERT_EQUALS( KErrNone, selItmData.GetItem( i + 1, item, action, iconId ) );
       
  1820 			ASSERT_EQUALS( KItemIds[i], item.iItemId );
       
  1821 			ASSERT_EQUALS( 0, Compare16bitDesWith8bitDesL(KItemNames[i], item.iItemString) );
       
  1822 			ASSERT_EQUALS( KErrNotFound, action );
       
  1823 			ASSERT_EQUALS( KErrNotFound, iconId );
       
  1824 			}
       
  1825 		}
       
  1826 
       
  1827 	// check results of V2 parameter version
       
  1828 	ASSERT_TRUE( RSat::ESoftKeyPreferred != selItmData.iPreference );
       
  1829 
       
  1830 	AssertMockLtsyStatusL();
       
  1831 	
       
  1832 	//generate terminal responses
       
  1833 	GenerateSelItemTerminalResponseL( KSelItmQualifierEmpty, resp );
       
  1834 	GenerateSelItemTerminalResponseL( KSelItmQualifierEmpty, resp );
       
  1835 	AssertMockLtsyStatusL();
       
  1836 
       
  1837 	CleanupStack::PopAndDestroy(4, this); // sat2, phone2, telServer2, this
       
  1838 
       
  1839 	}
       
  1840 
       
  1841