telephonyserverplugins/common_tsy/test/integration/src/cctsyintegrationtestcallforwarding.cpp
changeset 0 3553901f7fa8
child 24 6638e7f4bd8f
child 26 8767c6acf334
equal deleted inserted replaced
-1:000000000000 0:3553901f7fa8
       
     1 // Copyright (c) 2007-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 // Test step definitions for the CallForwarding functional unit.
       
    15 // 
       
    16 //
       
    17 
       
    18 /**
       
    19  @internalTechnology
       
    20 */
       
    21 
       
    22 #include "cctsyintegrationtestcallforwarding.h"
       
    23 
       
    24 #include "cctsyinidata.h"
       
    25 
       
    26 #include "listretrievalhelpers.h"
       
    27 
       
    28 
       
    29 CCTSYIntegrationTestCallForwardingBase::CCTSYIntegrationTestCallForwardingBase(CEtelSessionMgr& aEtelSessionMgr)
       
    30 	: CCTSYIntegrationTestSuiteStepBase(aEtelSessionMgr), iCallForwardingSupplementalHelper(*this), iCallForwardingControlHelper(*this), iNetworkTestHelper(*this)
       
    31 /**
       
    32  * Constructor
       
    33  */
       
    34 	{
       
    35 	}
       
    36 
       
    37 CCTSYIntegrationTestCallForwardingBase::~CCTSYIntegrationTestCallForwardingBase()
       
    38 /*
       
    39  * Destructor
       
    40  */
       
    41 	{
       
    42 	}
       
    43 
       
    44 TBool CCTSYIntegrationTestCallForwardingBase::SetCallForwardingStatusUtilL(RMobilePhone& aMobilePhone, RMobilePhone::TMobilePhoneCFChangeV1 aNewSetting, RMobilePhone::TMobilePhoneCFCondition aCFConditionSet, TInt aExpected=KErrNone)
       
    45 /**
       
    46  * Util function which performs a SetCallForwardingStatus operation and relevant
       
    47  * checks using the arguments passed.
       
    48  *
       
    49  * @param aMobilePhone Mobile phone
       
    50  * @param aNewSetting The new setting to be set
       
    51  * @param aCFConditionSet The call forwarding condition.
       
    52  * @param aExpected A expect value for the status
       
    53  * @return TBool which represents whether cfCondition==aCFConditionSet
       
    54  */
       
    55 	{
       
    56 	// Post notification for RMobilePhone::NotifyCallForwardingStatusChange
       
    57 
       
    58 	TExtEtelRequestStatus notifyCallForwardStatus(aMobilePhone, EMobilePhoneNotifyCallForwardingStatusChange);
       
    59 	RMobilePhone::TMobilePhoneCFCondition cfCondition;
       
    60 	CleanupStack::PushL(notifyCallForwardStatus);
       
    61 	
       
    62 	if(aExpected==KErrNone)
       
    63 		{
       
    64 		aMobilePhone.NotifyCallForwardingStatusChange(notifyCallForwardStatus, cfCondition);	
       
    65 		}
       
    66 	
       
    67 	TExtEtelRequestStatus setCallForwardStatus(aMobilePhone, EMobilePhoneSetCallForwardingStatus);
       
    68 	CleanupStack::PushL(setCallForwardStatus);
       
    69 	aMobilePhone.SetCallForwardingStatus(setCallForwardStatus, aCFConditionSet, aNewSetting);
       
    70 	
       
    71 	ASSERT_EQUALS(WaitForRequestWithTimeOut(setCallForwardStatus, ETimeMedium), KErrNone, _L("RMobilePhone::SetCallForwardingStatus timed-out"));
       
    72 	ASSERT_EQUALS(setCallForwardStatus.Int(), aExpected, _L("RMobilePhone::SetCallForwardingStatus setCallForwardStatus completed with incorrect error"));
       
    73 	
       
    74 	// Check RMobilePhone::NotifyCallForwardingStatusChange completes with cfcondition==aCFConditionSet
       
    75 	if(aExpected==KErrNone)
       
    76 		{
       
    77 		iCallForwardingSupplementalHelper.WaitForMobilePhoneNotifyCallForwardingStatusChange(aMobilePhone,
       
    78 																						 notifyCallForwardStatus,
       
    79 																						 cfCondition,
       
    80 																						 aCFConditionSet,
       
    81 																					 	 KErrNone);	
       
    82 		}
       
    83 		CleanupStack::PopAndDestroy(&setCallForwardStatus);
       
    84 		CleanupStack::PopAndDestroy(&notifyCallForwardStatus);
       
    85 	
       
    86 	if(aExpected==KErrNone)
       
    87 		{	
       
    88 		return cfCondition==aCFConditionSet;
       
    89 		}
       
    90 	else
       
    91 		{
       
    92 		return ETrue;
       
    93 		}	
       
    94 	}
       
    95 
       
    96 CCTSYIntegrationTestCallForwarding0001::CCTSYIntegrationTestCallForwarding0001(CEtelSessionMgr& aEtelSessionMgr)
       
    97 	: CCTSYIntegrationTestCallForwardingBase(aEtelSessionMgr)
       
    98 /**
       
    99  * Constructor.
       
   100  */
       
   101 	{
       
   102 	SetTestStepName(CCTSYIntegrationTestCallForwarding0001::GetTestStepName());
       
   103 	}
       
   104 
       
   105 CCTSYIntegrationTestCallForwarding0001::~CCTSYIntegrationTestCallForwarding0001()
       
   106 /**
       
   107  * Destructor.
       
   108  */
       
   109 	{
       
   110 	}
       
   111 
       
   112 TVerdict CCTSYIntegrationTestCallForwarding0001::doTestStepL()
       
   113 /**
       
   114  * @SYMTestCaseID BA-CTSY-INT-CFOR-0001
       
   115  * @SYMFssID BA/CTSY/CFOR-0001
       
   116  * @SYMTestCaseDesc Register call forwarding for all services.
       
   117  * @SYMTestPriority High
       
   118  * @SYMTestActions RMobilePhone::NotifyCallForwardingStatusChange
       
   119  * @SYMTestExpectedResults Pass - Call forwarding is registered for all services with each condition.
       
   120  * @SYMTestType CIT
       
   121  * @SYMTestCaseDependencies live/automatic
       
   122  *
       
   123  * Reason for test: Verify call forwarding is registered and call forwarding notification completes.
       
   124  *
       
   125  * @return - TVerdict code
       
   126  */
       
   127 	{
       
   128 
       
   129 	//
       
   130 	// SET UP
       
   131 	//
       
   132 
       
   133 	// Ensure RMobilePhone::GetCallServiceCaps returns caps in set of KCapsSetCFStatus | KCapsNotifyCFStatus 
       
   134 	RMobilePhone& mobilePhone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone);		
       
   135 	TUint32 callServiceCaps = 0;
       
   136 	
       
   137 	// Call TNetworkTsyTestHelper::WaitForRegisteredOnHomeNetworkL		
       
   138 	CHECK_EQUALS_L(iNetworkTestHelper.WaitForRegisteredOnHomeNetworkL(mobilePhone), KErrNone, _L("TNetworkTsyTestHelper::WaitForRegisteredOnHomeNetworkL returned with an error"));
       
   139 	
       
   140 	CHECK_EQUALS_L(mobilePhone.GetCallServiceCaps(callServiceCaps), KErrNone, _L("RMobilePhone::GetCallServiceCaps return value is not KErrNone"));
       
   141 	TUint32 expectedServiceCaps = RMobilePhone::KCapsSetCFStatus | RMobilePhone::KCapsNotifyCFStatus;
       
   142 	CHECK_BITS_SET_L(callServiceCaps, expectedServiceCaps, KNoUnwantedBits, _L("RMobilePhone::GetCallServiceCaps returned wrong caps"));
       
   143 
       
   144 	TPtrC number; 
       
   145 	CHECK_TRUE_L(GetStringFromConfig(KIniVoiceNumSection, KIniVoiceNumber1, number) != EFalse, _L("GetStringFromConfig did not complete as expected"));
       
   146 	DEBUG_PRINTF2(_L("Number obtained: %S"), &number);
       
   147 	
       
   148 	// Ensure all call forwarding is erased by calling 
       
   149 
       
   150 	// RMobilePhone::SetCallForwardingStatus with aCondition=RMobilePhone::ECallForwardingAllCases and 
       
   151 
       
   152 	// aInfo.iAction=RMobilePhone::EServiceActionErase and aInfo.iServiceGroup=RMobilePhone::EAllServices 
       
   153 	RMobilePhone::TMobilePhoneCFChangeV1 newSetting;
       
   154 	newSetting.iServiceGroup=RMobilePhone::EAllServices;
       
   155 	newSetting.iAction=RMobilePhone::EServiceActionErase;
       
   156 	newSetting.iTimeout=-1;
       
   157 	
       
   158 	DEBUG_PRINTF1(_L("Setting call forward EServiceActionErase ECallForwardingAllCases for EAllServices"));
       
   159 	CHECK_TRUE_L(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingAllCases), _L("SetCallForwardingStatusUtil with EServiceActionErase ECallForwardingAllCases for EAllServices failed"));
       
   160 
       
   161 	//
       
   162 	// SET UP END
       
   163 	//
       
   164 	
       
   165 	StartTest();
       
   166 	
       
   167 	//
       
   168 	// TEST START
       
   169 	//
       
   170 	
       
   171 	RMobilePhone::TMobilePhoneNetworkInfoV1 info;
       
   172 	RMobilePhone::TMobilePhoneNetworkInfoV1Pckg infopckg(info);
       
   173 	RMobilePhone::TMobilePhoneLocationAreaV1 area;
       
   174 	TOperatorName operatorName = EOperatorUnknown;
       
   175 	TInt err = iNetworkTestHelper.GetCurrentNetworkL( mobilePhone, infopckg, area, operatorName );	
       
   176 	ASSERT_EQUALS(err, KErrNone, _L("RMobilePhone::GetCurrentNetwork failed to get current network id (1)"));
       
   177 	
       
   178 	// ===  Register call forwarding and check notification completes ===
       
   179 
       
   180 	// RMobilePhone::SetCallForwardingStatus with aCondition=ECallForwardingUnconditional and aInfo.iAction=RMobilePhone::EServiceActionRegister,  aInfo.iServiceGroup=RMobilePhone::EAllServices, aInfo.iNumber.iNumberPlan=EIsdnNumberPlan, aInfo.iNumber.iTelNumber=valid number, aInfo.iNumber.iTypeOfNumber=ENationalNumber, aInfo.iTimeout=-1 
       
   181 	
       
   182 	// Check RMobilePhone::NotifyCallForwardingStatusChange completes with aCondition=ECallForwardingUnconditional
       
   183 	newSetting.iServiceGroup=RMobilePhone::EVoiceService;
       
   184 	newSetting.iAction=RMobilePhone::EServiceActionRegister;
       
   185 	newSetting.iNumber.iTelNumber=number;
       
   186 	newSetting.iNumber.iNumberPlan=RMobilePhone::EIsdnNumberPlan;
       
   187 	newSetting.iNumber.iTypeOfNumber=RMobilePhone::ENationalNumber;
       
   188 	newSetting.iTimeout=-1;
       
   189 
       
   190 	// $CTSYProblem The status returned from SetCallForwardingStatus does not return KErrNone.
       
   191 	// Instead the status varies depending on what iAction is requested. It is presumed that this is CTSY problem.
       
   192 	// Have had to change the test to expect the current retrieved value. 
       
   193 	// The error codes are being returned by the LTSY and the CTSY is propagating them back to the client correctly
       
   194 	// therefore these error codes do not indicate an error in the CTSY but rather that the LTSY / network is not supporting the requested operation. 
       
   195 	if(operatorName==EOperatorVodafone)
       
   196 		{
       
   197 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionRegister ECallForwardingUnconditional for EAllServices"));
       
   198 		ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional, KErrGsmSSUnexpectedDataValue), _L("SetCallForwardingStatusUtil with EServiceActionRegister ECallForwardingUnconditional for EAllServices failed"));
       
   199 	
       
   200 		// Repeat whole test with aCondition in RMobilePhone::SetCallForwardingStatus and RMobilePhone::NotifyCallForwardingStatusChange =ECallForwardingBusy, ECallForwardingNoReply, ECallForwardingNotReachable, ECallForwardingAllConditionalCases 
       
   201 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionRegister ECallForwardingBusy for EAllServices"));
       
   202 		ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingBusy, KErrGsmSSUnexpectedDataValue), _L("SetCallForwardingStatusUtil with EServiceActionRegister ECallForwardingBusy for EAllServices failed"));
       
   203 	
       
   204 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionRegister ECallForwardingNoReply for EAllServices"));
       
   205 		ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingNoReply, KErrGsmSSUnexpectedDataValue), _L("SetCallForwardingStatusUtil with EServiceActionRegister ECallForwardingNoReply for EAllServices failed"));
       
   206 	
       
   207 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionRegister ECallForwardingNotReachable for EAllServices"));
       
   208 		ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingNotReachable, KErrGsmSSUnexpectedDataValue), _L("SetCallForwardingStatusUtil with EServiceActionRegister ECallForwardingNotReachable for EAllServices failed"));
       
   209 	
       
   210 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionRegister ECallForwardingAllConditionalCases for EAllServices"));
       
   211 		ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingAllConditionalCases, KErrGsmSSUnexpectedDataValue), _L("SetCallForwardingStatusUtil with EServiceActionRegister ECallForwardingAllConditionalCases for EAllServices failed"));
       
   212 		}
       
   213 	else if(operatorName==EOperatorO2 || operatorName==EOperatorOrange || operatorName==EOperatorTMobile)
       
   214 		{
       
   215 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionRegister ECallForwardingUnconditional for EAllServices"));
       
   216 		ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional), _L("SetCallForwardingStatusUtil with EServiceActionRegister ECallForwardingUnconditional for EAllServices failed"));
       
   217 	
       
   218 		// Repeat whole test with aCondition in RMobilePhone::SetCallForwardingStatus and RMobilePhone::NotifyCallForwardingStatusChange =ECallForwardingBusy, ECallForwardingNoReply, ECallForwardingNotReachable, ECallForwardingAllConditionalCases 
       
   219 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionRegister ECallForwardingBusy for EAllServices"));
       
   220 		ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingBusy, KErrGsmSSIncompatibility), _L("SetCallForwardingStatusUtil with EServiceActionRegister ECallForwardingBusy for EAllServices failed"));
       
   221 	
       
   222 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionRegister ECallForwardingNoReply for EAllServices"));
       
   223 		ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingNoReply, KErrGsmSSIncompatibility), _L("SetCallForwardingStatusUtil with EServiceActionRegister ECallForwardingNoReply for EAllServices failed"));
       
   224 	
       
   225 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionRegister ECallForwardingNotReachable for EAllServices"));
       
   226 		ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingNotReachable, KErrGsmSSIncompatibility), _L("SetCallForwardingStatusUtil with EServiceActionRegister ECallForwardingNotReachable for EAllServices failed"));
       
   227 	
       
   228 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionRegister ECallForwardingAllConditionalCases for EAllServices"));
       
   229 		ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingAllConditionalCases, KErrGsmSSIncompatibility), _L("SetCallForwardingStatusUtil with EServiceActionRegister ECallForwardingAllConditionalCases for EAllServices failed"));	
       
   230 		}
       
   231 	else
       
   232 		{	
       
   233 		ASSERT_EQUALS(1,0,_L("Failed to identify current network"));
       
   234 		TEST_CHECK_POINT_L(_L("Failed to identify current network."));
       
   235 		}
       
   236 	
       
   237 	//
       
   238 	// TEST END
       
   239 	//
       
   240 
       
   241     StartCleanup();
       
   242 	
       
   243 	// Ensure all call forwarding setting are erased
       
   244 	newSetting.iServiceGroup=RMobilePhone::EAllServices;
       
   245 	newSetting.iAction=RMobilePhone::EServiceActionErase;
       
   246 	
       
   247 	DEBUG_PRINTF1(_L("Setting call forward EServiceActionErase ECallForwardingAllCases for EAllServices"));
       
   248 	ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingAllCases), _L("SetCallForwardingStatusUtil with EServiceActionErase ECallForwardingAllCases for EAllServices failed"));
       
   249 	
       
   250 	return TestStepResult();
       
   251 	}
       
   252 
       
   253 TPtrC CCTSYIntegrationTestCallForwarding0001::GetTestStepName()
       
   254 /**
       
   255  * @return The test step name.
       
   256  */
       
   257 	{
       
   258 	return _L("CCTSYIntegrationTestCallForwarding0001");
       
   259 	}
       
   260 
       
   261 
       
   262 
       
   263 CCTSYIntegrationTestCallForwarding0002::CCTSYIntegrationTestCallForwarding0002(CEtelSessionMgr& aEtelSessionMgr)
       
   264 	: CCTSYIntegrationTestCallForwardingBase(aEtelSessionMgr)
       
   265 /**
       
   266  * Constructor.
       
   267  */
       
   268 	{
       
   269 	SetTestStepName(CCTSYIntegrationTestCallForwarding0002::GetTestStepName());
       
   270 	}
       
   271 
       
   272 CCTSYIntegrationTestCallForwarding0002::~CCTSYIntegrationTestCallForwarding0002()
       
   273 /**
       
   274  * Destructor.
       
   275  */
       
   276 	{
       
   277 	}
       
   278 
       
   279 TVerdict CCTSYIntegrationTestCallForwarding0002::doTestStepL()
       
   280 /**
       
   281  * @SYMTestCaseID BA-CTSY-INT-CFOR-0002
       
   282  * @SYMFssID BA/CTSY/CFOR-0002
       
   283  * @SYMTestCaseDesc Register call forwarding for each provisioned basic service.
       
   284  * @SYMTestPriority High
       
   285  * @SYMTestActions RMobilePhone::NotifyCallForwardingStatusChange
       
   286  * @SYMTestExpectedResults Pass - Call forwarding is registered for each provisioned basic service.
       
   287  * @SYMTestType CIT
       
   288  * @SYMTestCaseDependencies live/automatic
       
   289  *
       
   290  * Reason for test: Verify call forwarding is registered and call forwarding notification completes.
       
   291  *
       
   292  * @return - TVerdict code
       
   293  */
       
   294 	{
       
   295 	
       
   296 	//
       
   297 	// SET UP
       
   298 	//
       
   299 
       
   300 	// Ensure RMobilePhone::GetCallServiceCaps returns caps in set of KCapsSetCFStatus | KCapsNotifyCFStatus 
       
   301 	RMobilePhone& mobilePhone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone);		
       
   302 
       
   303 	// Call TNetworkTsyTestHelper::WaitForRegisteredOnHomeNetworkL		
       
   304 	CHECK_EQUALS_L(iNetworkTestHelper.WaitForRegisteredOnHomeNetworkL(mobilePhone), KErrNone, _L("TNetworkTsyTestHelper::WaitForRegisteredOnHomeNetworkL returned with an error"));
       
   305 
       
   306 	TUint32 callServiceCaps = 0;	
       
   307 	CHECK_EQUALS_L(mobilePhone.GetCallServiceCaps(callServiceCaps), KErrNone, _L("RMobilePhone::GetCallServiceCaps return value is not KErrNone"));
       
   308 	TUint32 expectedServiceCaps = RMobilePhone::KCapsSetCFStatus | RMobilePhone::KCapsGetCFStatusNetwork;
       
   309 	CHECK_BITS_SET_L(callServiceCaps, expectedServiceCaps, KNoUnwantedBits, _L("RMobilePhone::GetCallServiceCaps returned wrong caps"));
       
   310 
       
   311 	TPtrC number; 
       
   312 	CHECK_TRUE_L(GetStringFromConfig(KIniVoiceNumSection, KIniVoiceNumber1, number) != EFalse, _L("GetStringFromConfig did not complete as expected"));
       
   313 	DEBUG_PRINTF2(_L("Number obtained: %S"), &number);
       
   314 
       
   315 	// Ensure all call forwarding is erased by calling 
       
   316 
       
   317 	// RMobilePhone::SetCallForwardingStatus with aCondition=RMobilePhone::ECallForwardingAllCases and 
       
   318 	
       
   319 	// aInfo.iAction=RMobilePhone::EServiceActionErase and aInfo.iServiceGroup=RMobilePhone::EAllServices, aInfo.iTimeOut=-1 
       
   320 	RMobilePhone::TMobilePhoneCFChangeV1 newSetting;
       
   321 	newSetting.iServiceGroup=RMobilePhone::EAllServices;
       
   322 	newSetting.iAction=RMobilePhone::EServiceActionErase;
       
   323 	newSetting.iTimeout=-1;
       
   324 	
       
   325 	DEBUG_PRINTF1(_L("Setting call forward EServiceActionErase ECallForwardingUnconditional for EAllServices"));
       
   326 	ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional), _L("SetCallForwardingStatusUtil with EServiceActionErase ECallForwardingUnconditional for EAllServices failed"));
       
   327 	  
       
   328 	//
       
   329 	// SET UP END
       
   330 	//
       
   331 	
       
   332 	StartTest();
       
   333 	
       
   334 	//
       
   335 	// TEST START
       
   336 	//
       
   337 
       
   338 	RMobilePhone::TMobilePhoneNetworkInfoV1 info;
       
   339 	RMobilePhone::TMobilePhoneNetworkInfoV1Pckg infopckg(info);
       
   340 	RMobilePhone::TMobilePhoneLocationAreaV1 area;
       
   341 	TOperatorName operatorName = EOperatorUnknown;
       
   342 	TInt err = iNetworkTestHelper.GetCurrentNetworkL( mobilePhone, infopckg, area, operatorName );	
       
   343 	ASSERT_EQUALS(err, KErrNone, _L("RMobilePhone::GetCurrentNetwork failed to get current network id (1)"));
       
   344 	
       
   345 	// ===  Register call forwarding and check notification completes ===
       
   346 	
       
   347 	// RMobilePhone::SetCallForwardingStatus with aCondition=ECallForwardingUnconditional and aInfo.iAction=RMobilePhone::EServiceActionRegister and aInfo.iServiceGroup=RMobilePhone::EVoiceService and aInfo.iNumber.iNumberPlan=EIsdnNumberPlan, aInfo.iNumber.iTelNumber=valid number, aInfo.iNumber.iTypeOfNumber=ENationalNumber, aInfo.iTimeout=-1 
       
   348 	newSetting.iServiceGroup=RMobilePhone::EVoiceService;
       
   349 	newSetting.iAction=RMobilePhone::EServiceActionRegister;
       
   350 	newSetting.iNumber.iTelNumber=number;
       
   351 	newSetting.iNumber.iNumberPlan=RMobilePhone::EIsdnNumberPlan;
       
   352 	newSetting.iNumber.iTypeOfNumber=RMobilePhone::ENationalNumber;
       
   353 	newSetting.iTimeout=-1;
       
   354 	
       
   355 	// $CTSYProblem The status returned from SetCallForwardingStatus does not return KErrNone.
       
   356 	// Instead the status varies depending on what iAction is requested. It is presumed that this is CTSY problem.
       
   357 	// Have had to change the test to expect the current retrieved value. 
       
   358 	// The error codes are being returned by the LTSY and the CTSY is propagating them back to the client correctly
       
   359 	// therefore these error codes do not indicate an error in the CTSY but rather that the LTSY / network is not supporting the requested operation. 
       
   360 	if(operatorName==EOperatorVodafone)
       
   361 		{
       
   362 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionRegister ECallForwardingUnconditional for EVoiceService"));
       
   363 		ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional, KErrGsmSSUnexpectedDataValue), _L("SetCallForwardingStatusUtil with EServiceActionRegister ECallForwardingUnconditional for EVoiceService failed"));
       
   364 	
       
   365 		// Repeat test with aInfo.iServiceGroup= EAuxVoiceService...	
       
   366 		newSetting.iServiceGroup=RMobilePhone::EAuxVoiceService;
       
   367 		
       
   368 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionRegister ECallForwardingUnconditional for EAuxVoiceService"));
       
   369 		ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional, KErrGsmSSUnexpectedDataValue), _L("SetCallForwardingStatusUtil with EServiceActionRegister ECallForwardingUnconditional for EAuxVoiceService failed"));
       
   370 		
       
   371 		// Repeat test with aInfo.iServiceGroup= ECircuitDataService...	
       
   372 		newSetting.iServiceGroup=RMobilePhone::ECircuitDataService;
       
   373 	
       
   374 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionRegister ECallForwardingUnconditional for ECircuitDataService"));
       
   375 		ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional, KErrGsmSSUnexpectedDataValue), _L("SetCallForwardingStatusUtil with EServiceActionRegister ECallForwardingUnconditional for ECircuitDataService failed"));
       
   376 		
       
   377 		// Repeat test with aInfo.iServiceGroup= EPacketDataService...
       
   378 		newSetting.iServiceGroup=RMobilePhone::EPacketDataService;
       
   379 	
       
   380 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionRegister ECallForwardingUnconditional for EPacketDataService"));
       
   381 		ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional, KErrGsmSSBearerServiceNotProvisioned), _L("SetCallForwardingStatusUtil with EServiceActionRegister ECallForwardingUnconditional for EPacketDataService failed"));
       
   382 		
       
   383 		// Repeat test with aInfo.iServiceGroup= EFaxService...
       
   384 		newSetting.iServiceGroup=RMobilePhone::EFaxService;
       
   385 	
       
   386 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionRegister ECallForwardingUnconditional for EFaxService"));
       
   387 		ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional, KErrGsmSSUnexpectedDataValue), _L("SetCallForwardingStatusUtil with EServiceActionRegister ECallForwardingUnconditional for EFaxService failed"));
       
   388 			
       
   389 		// Repeat test with aInfo.iServiceGroup= EShortMessageService...
       
   390 		newSetting.iServiceGroup=RMobilePhone::EShortMessageService;
       
   391 	
       
   392 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionRegister ECallForwardingUnconditional for EShortMessageService"));
       
   393 		ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional, KErrGsmSSTeleserviceNotProvisioned), _L("SetCallForwardingStatusUtil with EServiceActionRegister ECallForwardingUnconditional for EShortMessageService failed"));
       
   394 		
       
   395 		// Repeat test with aInfo.iServiceGroup= ETelephony...
       
   396 		newSetting.iServiceGroup=RMobilePhone::ETelephony;
       
   397 	
       
   398 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionRegister ECallForwardingUnconditional for ETelephony"));
       
   399 		ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional, KErrGsmSSUnexpectedDataValue), _L("SetCallForwardingStatusUtil with EServiceActionRegister ECallForwardingUnconditional for ETelephony failed"));
       
   400 		}
       
   401 	else if(operatorName==EOperatorTMobile || operatorName==EOperatorOrange || operatorName==EOperatorO2)
       
   402 		{
       
   403 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionRegister ECallForwardingUnconditional for EVoiceService"));
       
   404 		ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional), _L("SetCallForwardingStatusUtil with EServiceActionRegister ECallForwardingUnconditional for EVoiceService failed"));
       
   405 	
       
   406 		// Repeat test with aInfo.iServiceGroup= EAuxVoiceService...	
       
   407 		newSetting.iServiceGroup=RMobilePhone::EAuxVoiceService;
       
   408 		
       
   409 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionRegister ECallForwardingUnconditional for EAuxVoiceService"));
       
   410 		ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional, KErrGsmSSTeleserviceNotProvisioned), _L("SetCallForwardingStatusUtil with EServiceActionRegister ECallForwardingUnconditional for EAuxVoiceService failed"));
       
   411 		
       
   412 		// Repeat test with aInfo.iServiceGroup= ECircuitDataService...	
       
   413 		newSetting.iServiceGroup=RMobilePhone::ECircuitDataService;
       
   414 	
       
   415 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionRegister ECallForwardingUnconditional for ECircuitDataService"));
       
   416 		ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional), _L("SetCallForwardingStatusUtil with EServiceActionRegister ECallForwardingUnconditional for ECircuitDataService failed"));
       
   417 		
       
   418 		// Repeat test with aInfo.iServiceGroup= EPacketDataService...
       
   419 		newSetting.iServiceGroup=RMobilePhone::EPacketDataService;
       
   420 	
       
   421 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionRegister ECallForwardingUnconditional for EPacketDataService"));
       
   422 		ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional, KErrGsmSSUnexpectedDataValue), _L("SetCallForwardingStatusUtil with EServiceActionRegister ECallForwardingUnconditional for EPacketDataService failed"));
       
   423 		
       
   424 		// Repeat test with aInfo.iServiceGroup= EFaxService...
       
   425 		newSetting.iServiceGroup=RMobilePhone::EFaxService;
       
   426 	
       
   427 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionRegister ECallForwardingUnconditional for EFaxService"));
       
   428 		
       
   429 		if(operatorName==EOperatorTMobile)
       
   430 			{
       
   431 			ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional), _L("SetCallForwardingStatusUtil with EServiceActionRegister ECallForwardingUnconditional for EFaxService failed"));
       
   432 			}
       
   433 		else if(operatorName==EOperatorOrange || operatorName==EOperatorO2)
       
   434 			{
       
   435 			ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional, KErrGsmSSTeleserviceNotProvisioned), _L("SetCallForwardingStatusUtil with EServiceActionRegister ECallForwardingUnconditional for EFaxService failed"));			
       
   436 			}
       
   437 		
       
   438 		// Repeat test with aInfo.iServiceGroup= EShortMessageService...
       
   439 		newSetting.iServiceGroup=RMobilePhone::EShortMessageService;
       
   440 	
       
   441 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionRegister ECallForwardingUnconditional for EShortMessageService"));
       
   442 		
       
   443 		if(operatorName==EOperatorTMobile || operatorName==EOperatorO2)
       
   444 			{
       
   445 			ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional, KErrGsmSSIncompatibility), _L("SetCallForwardingStatusUtil with EServiceActionRegister ECallForwardingUnconditional for EShortMessageService failed"));
       
   446 			}
       
   447 		else if(operatorName==EOperatorOrange)
       
   448 			{
       
   449 			ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional, KErrGsmSSCallBarred), _L("SetCallForwardingStatusUtil with EServiceActionRegister ECallForwardingUnconditional for EShortMessageService failed"));
       
   450 			}
       
   451 		
       
   452 		// Repeat test with aInfo.iServiceGroup= ETelephony...
       
   453 		newSetting.iServiceGroup=RMobilePhone::ETelephony;
       
   454 	
       
   455 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionRegister ECallForwardingUnconditional for ETelephony"));
       
   456 		ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional), _L("SetCallForwardingStatusUtil with EServiceActionRegister ECallForwardingUnconditional for ETelephony failed"));
       
   457 		}
       
   458 	else
       
   459 		{	
       
   460 		ASSERT_EQUALS(1,0,_L("Failed to identify current network"));
       
   461 		TEST_CHECK_POINT_L(_L("Failed to identify current network."));
       
   462 		}
       
   463 		
       
   464 	//
       
   465 	// TEST END
       
   466 	//
       
   467 
       
   468     StartCleanup();
       
   469 	
       
   470 	// Ensure all call forwarding setting are erased
       
   471 	newSetting.iServiceGroup=RMobilePhone::EAllServices;
       
   472 	newSetting.iAction=RMobilePhone::EServiceActionErase;
       
   473 	
       
   474 	DEBUG_PRINTF1(_L("Setting call forward EServiceActionErase ECallForwardingUnconditional for EAllServices"));
       
   475 	ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional), _L("SetCallForwardingStatusUtil with EServiceActionErase ECallForwardingUnconditional for EAllServices failed"));
       
   476 
       
   477 	return TestStepResult();
       
   478 	}
       
   479 
       
   480 TPtrC CCTSYIntegrationTestCallForwarding0002::GetTestStepName()
       
   481 /**
       
   482  * @return The test step name.
       
   483  */
       
   484 	{
       
   485 	return _L("CCTSYIntegrationTestCallForwarding0002");
       
   486 	}
       
   487 
       
   488 
       
   489 
       
   490 CCTSYIntegrationTestCallForwarding0003::CCTSYIntegrationTestCallForwarding0003(CEtelSessionMgr& aEtelSessionMgr)
       
   491 	: CCTSYIntegrationTestCallForwardingBase(aEtelSessionMgr)
       
   492 /**
       
   493  * Constructor.
       
   494  */
       
   495 	{
       
   496 	SetTestStepName(CCTSYIntegrationTestCallForwarding0003::GetTestStepName());
       
   497 	}
       
   498 
       
   499 CCTSYIntegrationTestCallForwarding0003::~CCTSYIntegrationTestCallForwarding0003()
       
   500 /**
       
   501  * Destructor.
       
   502  */
       
   503 	{
       
   504 	}
       
   505 
       
   506 TVerdict CCTSYIntegrationTestCallForwarding0003::doTestStepL()
       
   507 /**
       
   508  * @SYMTestCaseID BA-CTSY-INT-CFOR-0003
       
   509  * @SYMFssID BA/CTSY/CFOR-0003
       
   510  * @SYMTestCaseDesc Erase call forwarding for all services.
       
   511  * @SYMTestPriority High
       
   512  * @SYMTestActions RMobilePhone::NotifyCallForwardingStatusChange
       
   513  * @SYMTestExpectedResults Pass - Call forwarding is erased for all services.
       
   514  * @SYMTestType CIT
       
   515  * @SYMTestCaseDependencies live/automatic
       
   516  *
       
   517  * Reason for test: Verify call forwarding is erased and notification completes.
       
   518  *
       
   519  * @return - TVerdict code
       
   520  */
       
   521 	{
       
   522 
       
   523 	//
       
   524 	// SET UP
       
   525 	//
       
   526 
       
   527 	// Ensure RMobilePhone::GetCallServiceCaps returns caps in set of KCapsSetCFStatus | KCapsNotifyCFStatus 
       
   528 	RMobilePhone& mobilePhone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone);		
       
   529 	TUint32 callServiceCaps = 0;
       
   530 	TPtrC number;
       
   531 	
       
   532 	// Call TNetworkTsyTestHelper::WaitForRegisteredOnHomeNetworkL		
       
   533 	CHECK_EQUALS_L(iNetworkTestHelper.WaitForRegisteredOnHomeNetworkL(mobilePhone), KErrNone, _L("TNetworkTsyTestHelper::WaitForRegisteredOnHomeNetworkL returned with an error"));
       
   534 
       
   535 	CHECK_EQUALS_L(mobilePhone.GetCallServiceCaps(callServiceCaps), KErrNone, _L("RMobilePhone::GetCallServiceCaps return value is not KErrNone"));
       
   536 	TUint32 expectedServiceCaps = RMobilePhone::KCapsSetCFStatus | RMobilePhone::KCapsNotifyCFStatus;
       
   537 	CHECK_BITS_SET_L(callServiceCaps, expectedServiceCaps, KNoUnwantedBits, _L("RMobilePhone::GetCallServiceCaps returned wrong caps"));
       
   538 
       
   539 	CHECK_TRUE_L(GetStringFromConfig(KIniVoiceNumSection, KIniVoiceNumber1, number) != EFalse, _L("GetStringFromConfig did not complete as expected"));
       
   540 	DEBUG_PRINTF2(_L("Number obtained: %S"), &number);
       
   541 	
       
   542 	RMobilePhone::TMobilePhoneNetworkInfoV1 info;
       
   543 	RMobilePhone::TMobilePhoneNetworkInfoV1Pckg infopckg(info);
       
   544 	RMobilePhone::TMobilePhoneLocationAreaV1 area;
       
   545 	TOperatorName operatorName = EOperatorUnknown;
       
   546 	TInt err = iNetworkTestHelper.GetCurrentNetworkL( mobilePhone, infopckg, area, operatorName );	
       
   547 	CHECK_EQUALS_L(err, KErrNone, _L("RMobilePhone::GetCurrentNetwork failed to get current network id (1)"));
       
   548 	
       
   549 	RMobilePhone::TMobilePhoneCFChangeV1 newSetting;
       
   550 	newSetting.iServiceGroup=RMobilePhone::EAllServices;
       
   551 	newSetting.iNumber.iTelNumber=number;
       
   552 	newSetting.iNumber.iNumberPlan=RMobilePhone::EIsdnNumberPlan;
       
   553 	newSetting.iNumber.iTypeOfNumber=RMobilePhone::ENationalNumber;
       
   554 	newSetting.iTimeout=-1;
       
   555 	
       
   556 	if(operatorName==EOperatorVodafone)
       
   557 		{
       
   558 		// Activate call forwarding using RMobilePhone::SetCallForwardingStatus with aCondition=ECallForwardingUnconditional and aInfo.iAction=RMobilePhone::EServiceActionActivate and aInfo.iServiceGroup=RMobilePhone::EAllServices and aInfo.iNumber.iNumberPlan=EIsdnNumberPlan, aInfo.iNumber.iTelNumber=valid number, aInfo.iNumber.iTypeOfNumber=ENationalNumber, aInfo.iTimeout=-1 
       
   559 		newSetting.iAction=RMobilePhone::EServiceActionActivate;
       
   560 		
       
   561 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionActivate ECallForwardingUnconditional for EAllServices"));
       
   562 		CHECK_TRUE_L(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional), _L("SetCallForwardingStatusUtil with EServiceActionActivate ECallForwardingUnconditional for EAllServices failed"));
       
   563 		}
       
   564 	else if(operatorName==EOperatorTMobile || operatorName==EOperatorOrange || operatorName==EOperatorO2)
       
   565 		{
       
   566 		// Register call forwarding using RMobilePhone::SetCallForwardingStatus with aCondition=ECallForwardingUnconditional and aInfo.iAction=RMobilePhone::EServiceActionRegister and aInfo.iServiceGroup=RMobilePhone::EAllServices and aInfo.iNumber.iNumberPlan=EIsdnNumberPlan, aInfo.iNumber.iTelNumber=valid number, aInfo.iNumber.iTypeOfNumber=ENationalNumber, aInfo.iTimeout=-1 
       
   567 		newSetting.iAction=RMobilePhone::EServiceActionRegister;
       
   568 		
       
   569 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionRegister ECallForwardingUnconditional for EAllServices"));
       
   570 		CHECK_TRUE_L(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional), _L("SetCallForwardingStatusUtil with EServiceActionRegister ECallForwardingUnconditional for EAllServices failed"));
       
   571 		}
       
   572 	else
       
   573 		{	
       
   574 		CHECK_EQUALS_L(1,0,_L("Failed to identify current network"));
       
   575 		}
       
   576 	
       
   577 	//
       
   578 	// SET UP END
       
   579 	//
       
   580 	
       
   581 	StartTest();
       
   582 	
       
   583 	//
       
   584 	// TEST START
       
   585 	//
       
   586 	
       
   587 	// ===  Erase call forwarding ===
       
   588 
       
   589 	// RMobilePhone::SetCallForwardingStatus with aCondition=ECallForwardingUnconditional and aInfo.iAction=RMobilePhone::EServiceActionErase and aInfo.iServiceGroup=RMobilePhone::EAllServices, aInfo.iTimeout=-1 
       
   590 	// Check RMobilePhone::NotifyCallForwardingStatusChange completes with aCondition=ECallForwardingUnconditional
       
   591 	newSetting.iServiceGroup=RMobilePhone::EAllServices;
       
   592 	newSetting.iAction=RMobilePhone::EServiceActionErase;
       
   593 	newSetting.iTimeout=-1;
       
   594 	
       
   595 	DEBUG_PRINTF1(_L("Setting call forward EServiceActionErase ECallForwardingUnconditional for EAllServices"));
       
   596 	ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional), _L("SetCallForwardingStatusUtil with EServiceActionErase ECallForwardingUnconditional for EAllServices failed"));
       
   597 
       
   598 	//
       
   599 	// TEST END
       
   600 	//
       
   601 
       
   602     StartCleanup();
       
   603 	
       
   604 	return TestStepResult();
       
   605 	}
       
   606 
       
   607 TPtrC CCTSYIntegrationTestCallForwarding0003::GetTestStepName()
       
   608 /**
       
   609  * @return The test step name.
       
   610  */
       
   611 	{
       
   612 	return _L("CCTSYIntegrationTestCallForwarding0003");
       
   613 	}
       
   614 
       
   615 
       
   616 
       
   617 CCTSYIntegrationTestCallForwarding0004::CCTSYIntegrationTestCallForwarding0004(CEtelSessionMgr& aEtelSessionMgr)
       
   618 	: CCTSYIntegrationTestCallForwardingBase(aEtelSessionMgr)
       
   619 /**
       
   620  * Constructor.
       
   621  */
       
   622 	{
       
   623 	SetTestStepName(CCTSYIntegrationTestCallForwarding0004::GetTestStepName());
       
   624 	}
       
   625 
       
   626 CCTSYIntegrationTestCallForwarding0004::~CCTSYIntegrationTestCallForwarding0004()
       
   627 /**
       
   628  * Destructor.
       
   629  */
       
   630 	{
       
   631 	}
       
   632 
       
   633 TVerdict CCTSYIntegrationTestCallForwarding0004::doTestStepL()
       
   634 /**
       
   635  * @SYMTestCaseID BA-CTSY-INT-CFOR-0004
       
   636  * @SYMFssID BA/CTSY/CFOR-0004
       
   637  * @SYMTestCaseDesc Erase call forwarding for each provisioned basic service.
       
   638  * @SYMTestPriority High
       
   639  * @SYMTestActions RMobilePhone::NotifyCallForwardingStatusChange
       
   640  * @SYMTestExpectedResults Pass - Call forwarding is erased for each provisioned service group.
       
   641  * @SYMTestType CIT
       
   642  * @SYMTestCaseDependencies live/automatic
       
   643  *
       
   644  * Reason for test: Verify call forwarding is erased and notification completes.
       
   645  *
       
   646  * @return - TVerdict code
       
   647  */
       
   648 	{
       
   649 
       
   650 	//
       
   651 	// SET UP
       
   652 	//
       
   653 
       
   654 	// Ensure RMobilePhone::GetCallServiceCaps returns caps in set of KCapsSetCFStatus | KCapsNotifyCFStatus 
       
   655 	RMobilePhone& mobilePhone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone);		
       
   656 	TUint32 callServiceCaps = 0;
       
   657 	TPtrC number;
       
   658 	
       
   659 	// Call TNetworkTsyTestHelper::WaitForRegisteredOnHomeNetworkL		
       
   660 	CHECK_EQUALS_L(iNetworkTestHelper.WaitForRegisteredOnHomeNetworkL(mobilePhone), KErrNone, _L("TNetworkTsyTestHelper::WaitForRegisteredOnHomeNetworkL returned with an error"));
       
   661 
       
   662 	CHECK_EQUALS_L(mobilePhone.GetCallServiceCaps(callServiceCaps), KErrNone, _L("RMobilePhone::GetCallServiceCaps return value is not KErrNone"));
       
   663 	TUint32 expectedServiceCaps = RMobilePhone::KCapsSetCFStatus | RMobilePhone::KCapsNotifyCFStatus;
       
   664 	CHECK_BITS_SET_L(callServiceCaps, expectedServiceCaps, KNoUnwantedBits, _L("RMobilePhone::GetCallServiceCaps returned wrong caps"));
       
   665 
       
   666 	CHECK_TRUE_L(GetStringFromConfig(KIniVoiceNumSection, KIniVoiceNumber1, number) != EFalse, _L("GetStringFromConfig did not complete as expected"));
       
   667 	DEBUG_PRINTF2(_L("Number obtained: %S"), &number);
       
   668 	
       
   669 	RMobilePhone::TMobilePhoneNetworkInfoV1 info;
       
   670 	RMobilePhone::TMobilePhoneNetworkInfoV1Pckg infopckg(info);
       
   671 	RMobilePhone::TMobilePhoneLocationAreaV1 area;
       
   672 	TOperatorName operatorName = EOperatorUnknown;
       
   673 	TInt err = iNetworkTestHelper.GetCurrentNetworkL( mobilePhone, infopckg, area, operatorName );	
       
   674 	CHECK_EQUALS_L(err, KErrNone, _L("RMobilePhone::GetCurrentNetwork failed to get current network id (1)"));
       
   675 	
       
   676 	RMobilePhone::TMobilePhoneCFChangeV1 newSetting;
       
   677 	newSetting.iServiceGroup=RMobilePhone::EAllServices;
       
   678 	newSetting.iNumber.iTelNumber=number;
       
   679 	newSetting.iNumber.iNumberPlan=RMobilePhone::EIsdnNumberPlan;
       
   680 	newSetting.iNumber.iTypeOfNumber=RMobilePhone::ENationalNumber;
       
   681 	newSetting.iTimeout=-1;
       
   682 	
       
   683 	if(operatorName==EOperatorVodafone)
       
   684 		{
       
   685 		// Activate call forwarding using RMobilePhone::SetCallForwardingStatus with aCondition=ECallForwardingUnconditional and aInfo.iAction=RMobilePhone::EServiceActionActivate and aInfo.iServiceGroup=RMobilePhone::EAllServices and aInfo.iNumber.iNumberPlan=EIsdnNumberPlan, aInfo.iNumber.iTelNumber=valid number, aInfo.iNumber.iTypeOfNumber=ENationalNumber, aInfo.iTimeout=-1 
       
   686 		newSetting.iAction=RMobilePhone::EServiceActionActivate;
       
   687 		
       
   688 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionActivate ECallForwardingUnconditional for EAllServices"));
       
   689 		CHECK_TRUE_L(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional), _L("SetCallForwardingStatusUtil with EServiceActionActivate ECallForwardingUnconditional for EAllServices failed"));
       
   690 		}
       
   691 	else if(operatorName==EOperatorTMobile || operatorName==EOperatorOrange || operatorName==EOperatorO2)
       
   692 		{
       
   693 		// Register call forwarding using RMobilePhone::SetCallForwardingStatus with aCondition=ECallForwardingUnconditional and aInfo.iAction=RMobilePhone::EServiceActionRegister and aInfo.iServiceGroup=RMobilePhone::EAllServices and aInfo.iNumber.iNumberPlan=EIsdnNumberPlan, aInfo.iNumber.iTelNumber=valid number, aInfo.iNumber.iTypeOfNumber=ENationalNumber, aInfo.iTimeout=-1 
       
   694 		newSetting.iAction=RMobilePhone::EServiceActionRegister;
       
   695 		
       
   696 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionRegister ECallForwardingUnconditional for EAllServices"));
       
   697 		CHECK_TRUE_L(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional), _L("SetCallForwardingStatusUtil with EServiceActionRegister ECallForwardingUnconditional for EAllServices failed"));
       
   698 		}
       
   699 	else
       
   700 		{	
       
   701 		CHECK_EQUALS_L(1,0,_L("Failed to identify current network"));
       
   702 		TEST_CHECK_POINT_L(_L("Failed to identify current network."));
       
   703 		}
       
   704 	
       
   705 	//
       
   706 	// SET UP END
       
   707 	//
       
   708 	
       
   709 	StartTest();
       
   710 	
       
   711 	//
       
   712 	// TEST START
       
   713 	//
       
   714 	
       
   715 	// ===  Erase call forwarding ===
       
   716 
       
   717 	// RMobilePhone::SetCallForwardingStatus with aCondition=ECallForwardingUnconditional and aInfo.iAction=RMobilePhone::EServiceActionErase and aInfo.iServiceGroup=RMobilePhone::EVoiceService, aInfo.iTimeOut=-1 
       
   718 	// Check RMobilePhone::NotifyCallForwardingStatusChange completes with aCondition=ECallForwardingUnconditional
       
   719 	newSetting.iServiceGroup=RMobilePhone::EVoiceService;
       
   720 	newSetting.iAction=RMobilePhone::EServiceActionErase;
       
   721 	newSetting.iTimeout=-1;
       
   722 	
       
   723 	DEBUG_PRINTF1(_L("Setting call forward EServiceActionErase ECallForwardingUnconditional for EVoiceService"));
       
   724 	ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional), _L("SetCallForwardingStatusUtil with EServiceActionErase ECallForwardingUnconditional for EVoiceService failed"));
       
   725 
       
   726 	newSetting.iServiceGroup=RMobilePhone::EAuxVoiceService;
       
   727 
       
   728 	DEBUG_PRINTF1(_L("Setting call forward EServiceActionErase ECallForwardingUnconditional for EAuxVoiceService"));
       
   729 	
       
   730 	if(operatorName==EOperatorVodafone)
       
   731 		{
       
   732 		ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional, KErrGsmSSUnexpectedDataValue), _L("SetCallForwardingStatusUtil with EServiceActionErase ECallForwardingUnconditional for EAuxVoiceService failed"));
       
   733 		}
       
   734 	else if(operatorName==EOperatorTMobile || operatorName==EOperatorOrange || operatorName==EOperatorO2)
       
   735 		{
       
   736 		ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional, KErrGsmSSTeleserviceNotProvisioned), _L("SetCallForwardingStatusUtil with EServiceActionErase ECallForwardingUnconditional for EAuxVoiceService failed"));
       
   737 		}
       
   738 	
       
   739 	newSetting.iServiceGroup=RMobilePhone::ECircuitDataService;
       
   740 	
       
   741 	DEBUG_PRINTF1(_L("Setting call forward EServiceActionErase ECallForwardingUnconditional for ECircuitDataService"));
       
   742 	ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional), _L("SetCallForwardingStatusUtil with EServiceActionErase ECallForwardingUnconditional for ECircuitDataService failed"));
       
   743 	
       
   744 	newSetting.iServiceGroup=RMobilePhone::EPacketDataService;
       
   745 	
       
   746 	DEBUG_PRINTF1(_L("Setting call forward EServiceActionErase ECallForwardingUnconditional for EPacketDataService"));
       
   747 	
       
   748 	if(operatorName==EOperatorVodafone)
       
   749 		{
       
   750 		ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional, KErrGsmSSIllegalOperation), _L("SetCallForwardingStatusUtil with EServiceActionErase ECallForwardingUnconditional for EPacketDataService failed"));
       
   751 		}
       
   752 	else if(operatorName==EOperatorTMobile || operatorName==EOperatorOrange || operatorName==EOperatorO2)
       
   753 		{
       
   754 		ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional, KErrGsmSSUnexpectedDataValue), _L("SetCallForwardingStatusUtil with EServiceActionErase ECallForwardingUnconditional for EPacketDataService failed"));
       
   755 		}
       
   756 	
       
   757 	newSetting.iServiceGroup=RMobilePhone::EFaxService;
       
   758 	
       
   759 	DEBUG_PRINTF1(_L("Setting call forward EServiceActionErase ECallForwardingUnconditional for EFaxService"));
       
   760 	
       
   761 	if(operatorName==EOperatorVodafone || operatorName==EOperatorTMobile)
       
   762 		{
       
   763 		ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional), _L("SetCallForwardingStatusUtil with EServiceActionErase ECallForwardingUnconditional for EFaxService failed"));
       
   764 		}
       
   765 	else if(operatorName==EOperatorOrange || operatorName==EOperatorO2)
       
   766 		{
       
   767 		ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional, KErrGsmSSTeleserviceNotProvisioned), _L("SetCallForwardingStatusUtil with EServiceActionErase ECallForwardingUnconditional for EFaxService failed"));
       
   768 		}
       
   769 	
       
   770 	newSetting.iServiceGroup=RMobilePhone::EShortMessageService;
       
   771 	
       
   772 	DEBUG_PRINTF1(_L("Setting call forward EServiceActionErase ECallForwardingUnconditional for EShortMessageService"));
       
   773 	
       
   774 	if(operatorName==EOperatorVodafone)
       
   775 		{
       
   776 		ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional, KErrGsmSSIllegalOperation), _L("SetCallForwardingStatusUtil with EServiceActionErase ECallForwardingUnconditional for EShortMessageService failed"));
       
   777 		}
       
   778 	else if(operatorName==EOperatorTMobile)
       
   779 		{
       
   780 		ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional, KErrGsmSSUnexpectedDataValue), _L("SetCallForwardingStatusUtil with EServiceActionErase ECallForwardingUnconditional for EShortMessageService failed"));
       
   781 		}
       
   782 	else if(operatorName==EOperatorO2)
       
   783 		{
       
   784 		ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional, KErrGsmSSUnexpectedDataValue), _L("SetCallForwardingStatusUtil with EServiceActionErase ECallForwardingUnconditional for EShortMessageService failed")); 
       
   785 		}
       
   786 	else if(operatorName==EOperatorOrange)
       
   787 		{
       
   788 		ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional, KErrGsmSSCallBarred), _L("SetCallForwardingStatusUtil with EServiceActionErase ECallForwardingUnconditional for EShortMessageService failed"));
       
   789 		}
       
   790 	
       
   791 	newSetting.iServiceGroup=RMobilePhone::ETelephony;
       
   792 	
       
   793 	DEBUG_PRINTF1(_L("Setting call forward EServiceActionErase ECallForwardingUnconditional for ETelephony"));
       
   794 	ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional), _L("SetCallForwardingStatusUtil with EServiceActionErase ECallForwardingUnconditional for ETelephony failed"));
       
   795 	
       
   796 	//
       
   797 	// TEST END
       
   798 	//
       
   799 
       
   800     StartCleanup();
       
   801 	
       
   802 	return TestStepResult();
       
   803 	}
       
   804 
       
   805 TPtrC CCTSYIntegrationTestCallForwarding0004::GetTestStepName()
       
   806 /**
       
   807  * @return The test step name.
       
   808  */
       
   809 	{
       
   810 	return _L("CCTSYIntegrationTestCallForwarding0004");
       
   811 	}
       
   812 
       
   813 
       
   814 
       
   815 CCTSYIntegrationTestCallForwarding0005::CCTSYIntegrationTestCallForwarding0005(CEtelSessionMgr& aEtelSessionMgr)
       
   816 	: CCTSYIntegrationTestCallForwardingBase(aEtelSessionMgr)
       
   817 /**
       
   818  * Constructor.
       
   819  */
       
   820 	{
       
   821 	SetTestStepName(CCTSYIntegrationTestCallForwarding0005::GetTestStepName());
       
   822 	}
       
   823 
       
   824 CCTSYIntegrationTestCallForwarding0005::~CCTSYIntegrationTestCallForwarding0005()
       
   825 /**
       
   826  * Destructor.
       
   827  */
       
   828 	{
       
   829 	}
       
   830 
       
   831 TVerdict CCTSYIntegrationTestCallForwarding0005::doTestStepL()
       
   832 /**
       
   833  * @SYMTestCaseID BA-CTSY-INT-CFOR-0005
       
   834  * @SYMFssID BA/CTSY/CFOR-0005
       
   835  * @SYMTestCaseDesc Activate call forwarding for all services.
       
   836  * @SYMTestPriority High
       
   837  * @SYMTestActions RMobilePhone::NotifyCallForwardingStatusChange
       
   838  * @SYMTestExpectedResults Pass - Call forwarding is activated for all services.
       
   839  * @SYMTestType CIT
       
   840  * @SYMTestCaseDependencies live/automatic
       
   841  *
       
   842  * Reason for test: Verify call forwarding activated and notification completes.
       
   843  *
       
   844  * @return - TVerdict code
       
   845  */
       
   846 	{
       
   847 
       
   848 	//
       
   849 	// SET UP
       
   850 	//
       
   851 
       
   852 	// Ensure RMobilePhone::GetCallServiceCaps returns caps in set of KCapsSetCFStatus | KCapsNotifyCFStatus 
       
   853 	RMobilePhone& mobilePhone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone);	
       
   854 	
       
   855 	// Call TNetworkTsyTestHelper::WaitForRegisteredOnHomeNetworkL		
       
   856 	CHECK_EQUALS_L(iNetworkTestHelper.WaitForRegisteredOnHomeNetworkL(mobilePhone), KErrNone, _L("TNetworkTsyTestHelper::WaitForRegisteredOnHomeNetworkL returned with an error"));
       
   857 
       
   858 	TUint32 callServiceCaps = 0;
       
   859 	CHECK_EQUALS_L(mobilePhone.GetCallServiceCaps(callServiceCaps), KErrNone, _L("RMobilePhone::GetCallServiceCaps return value is not KErrNone"));
       
   860 	TUint32 expectedServiceCaps = RMobilePhone::KCapsSetCFStatus | RMobilePhone::KCapsNotifyCFStatus;
       
   861 	CHECK_BITS_SET_L(callServiceCaps, expectedServiceCaps, KNoUnwantedBits, _L("RMobilePhone::GetCallServiceCaps returned wrong caps"));
       
   862 
       
   863 	// Ensure all call forwarding is erased by calling 
       
   864 
       
   865 	// RMobilePhone::SetCallForwardingStatus with aCondition=RMobilePhone::ECallForwardingAllCases and aInfo.iAction=RMobilePhone::EServiceActionErase and aInfo.iServiceGroup=RMobilePhone::EAllServices, aInfo.iTimeout=-1 
       
   866 	TPtrC number; 
       
   867 	CHECK_TRUE_L(GetStringFromConfig(KIniVoiceNumSection, KIniVoiceNumber1, number) != EFalse, _L("GetStringFromConfig did not complete as expected"));
       
   868 	DEBUG_PRINTF2(_L("Number obtained: %S"), &number);
       
   869 
       
   870 	RMobilePhone::TMobilePhoneCFChangeV1 newSetting;
       
   871 	newSetting.iServiceGroup=RMobilePhone::EAllServices;
       
   872 	newSetting.iAction=RMobilePhone::EServiceActionErase;
       
   873 	newSetting.iNumber.iTelNumber=number;
       
   874 	newSetting.iTimeout=-1;
       
   875 		
       
   876 	TExtEtelRequestStatus setCallForwardStatus(mobilePhone, EMobilePhoneSetCallForwardingStatus);
       
   877 	CleanupStack::PushL(setCallForwardStatus);
       
   878 	mobilePhone.SetCallForwardingStatus(setCallForwardStatus, RMobilePhone::ECallForwardingAllCases, newSetting);
       
   879 	CHECK_EQUALS_L(WaitForRequestWithTimeOut(setCallForwardStatus, ETimeMedium), KErrNone, _L("RMobilePhone::SetCallForwardingStatus timed-out"));
       
   880 	CHECK_EQUALS_L(setCallForwardStatus.Int(), KErrNone, _L("RMobilePhone::SetCallForwardingStatus setCallForwardStatus completed with incorrect error"));
       
   881    
       
   882 	//
       
   883 	// SET UP END
       
   884 	//
       
   885 	
       
   886 	StartTest();
       
   887 	
       
   888 	//
       
   889 	// TEST START
       
   890 	//
       
   891 
       
   892 	RMobilePhone::TMobilePhoneNetworkInfoV1 info;
       
   893 	RMobilePhone::TMobilePhoneNetworkInfoV1Pckg infopckg(info);
       
   894 	RMobilePhone::TMobilePhoneLocationAreaV1 area;
       
   895 	TOperatorName operatorName = EOperatorUnknown;
       
   896 	TInt err = iNetworkTestHelper.GetCurrentNetworkL( mobilePhone, infopckg, area, operatorName );	
       
   897 	CHECK_EQUALS_L(err, KErrNone, _L("RMobilePhone::GetCurrentNetwork failed to get current network id (1)"));
       
   898 	
       
   899 	// ===  Activate call forwarding and check notification completes ===
       
   900 	
       
   901 	// RMobilePhone::SetCallForwardingStatus with aCondition=ECallForwardingUnconditional and aInfo.iAction=RMobilePhone::EServiceActionActivate and aInfo.iServiceGroup=RMobilePhone::EAllServices, aInfo.iTimeOut=-1 
       
   902 	
       
   903 	newSetting.iServiceGroup=RMobilePhone::EAllServices;
       
   904 	newSetting.iAction=RMobilePhone::EServiceActionActivate;
       
   905 	newSetting.iNumber.iTelNumber=number;
       
   906 	newSetting.iTimeout=-1;
       
   907 
       
   908 	DEBUG_PRINTF1(_L("Setting call forward EServiceActionActivate ECallForwardingUnconditional for EAllServices"));	
       
   909 	
       
   910 	if(operatorName==EOperatorVodafone)
       
   911 		{		
       
   912 		CHECK_TRUE_L(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional), _L("SetCallForwardingStatusUtil with EServiceActionActivate ECallForwardingUnconditional for EAllServices failed"));
       
   913 		}
       
   914 	else if(operatorName==EOperatorTMobile || operatorName==EOperatorOrange || operatorName==EOperatorO2)
       
   915 		{
       
   916 		CHECK_TRUE_L(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional, KErrGsmSSErrorStatus), _L("SetCallForwardingStatusUtil with EServiceActionRegister ECallForwardingUnconditional for EAllServices failed"));
       
   917 		}
       
   918 	else
       
   919 		{	
       
   920 		CHECK_EQUALS_L(1,0,_L("Failed to identify current network"));
       
   921 		}
       
   922  
       
   923 	//
       
   924 	// TEST END
       
   925 	//
       
   926 
       
   927     StartCleanup();
       
   928 	
       
   929 	// Ensure all call forwarding setting are erased
       
   930 	newSetting.iServiceGroup=RMobilePhone::EAllServices;
       
   931 	newSetting.iAction=RMobilePhone::EServiceActionErase;
       
   932 	
       
   933 	mobilePhone.SetCallForwardingStatus(setCallForwardStatus, RMobilePhone::ECallForwardingAllCases, newSetting);
       
   934 	CHECK_EQUALS_L(WaitForRequestWithTimeOut(setCallForwardStatus, ETimeMedium), KErrNone, _L("RMobilePhone::SetCallForwardingStatus timed-out"));
       
   935 	CHECK_EQUALS_L(setCallForwardStatus.Int(), KErrNone, _L("RMobilePhone::SetCallForwardingStatus setCallForwardStatus completed with incorrect error"));
       
   936 
       
   937 	CleanupStack::PopAndDestroy(&setCallForwardStatus);
       
   938 	
       
   939 	return TestStepResult();
       
   940 	}
       
   941 
       
   942 TPtrC CCTSYIntegrationTestCallForwarding0005::GetTestStepName()
       
   943 /**
       
   944  * @return The test step name.
       
   945  */
       
   946 	{
       
   947 	return _L("CCTSYIntegrationTestCallForwarding0005");
       
   948 	}
       
   949 
       
   950 
       
   951 
       
   952 CCTSYIntegrationTestCallForwarding0006::CCTSYIntegrationTestCallForwarding0006(CEtelSessionMgr& aEtelSessionMgr)
       
   953 	: CCTSYIntegrationTestCallForwardingBase(aEtelSessionMgr)
       
   954 /**
       
   955  * Constructor.
       
   956  */
       
   957 	{
       
   958 	SetTestStepName(CCTSYIntegrationTestCallForwarding0006::GetTestStepName());
       
   959 	}
       
   960 
       
   961 CCTSYIntegrationTestCallForwarding0006::~CCTSYIntegrationTestCallForwarding0006()
       
   962 /**
       
   963  * Destructor.
       
   964  */
       
   965 	{
       
   966 	}
       
   967 
       
   968 TVerdict CCTSYIntegrationTestCallForwarding0006::doTestStepL()
       
   969 /**
       
   970  * @SYMTestCaseID BA-CTSY-INT-CFOR-0006
       
   971  * @SYMFssID BA/CTSY/CFOR-0006
       
   972  * @SYMTestCaseDesc Activate call forwarding for each provisioned basic service.
       
   973  * @SYMTestPriority High
       
   974  * @SYMTestActions RMobilePhone::NotifyCallForwardingStatusChange
       
   975  * @SYMTestExpectedResults Pass - Call forwarding is activated for each provisioned basic service.
       
   976  * @SYMTestType CIT
       
   977  * @SYMTestCaseDependencies live/automatic
       
   978  *
       
   979  * Reason for test: Verify call forwarding activated and notification completes.
       
   980  *
       
   981  * @return - TVerdict code
       
   982  */
       
   983 	{
       
   984 
       
   985 	//
       
   986 	// SET UP
       
   987 	//
       
   988 
       
   989 	// Ensure RMobilePhone::GetCallServiceCaps returns caps in set of KCapsSetCFStatus | KCapsNotifyCFStatus 
       
   990 	RMobilePhone& mobilePhone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone);	
       
   991 	TUint32 callServiceCaps = 0;
       
   992 	TPtrC number; 
       
   993 	
       
   994 	// Call TNetworkTsyTestHelper::WaitForRegisteredOnHomeNetworkL		
       
   995 	CHECK_EQUALS_L(iNetworkTestHelper.WaitForRegisteredOnHomeNetworkL(mobilePhone), KErrNone, _L("TNetworkTsyTestHelper::WaitForRegisteredOnHomeNetworkL returned with an error"));
       
   996 	
       
   997 	CHECK_EQUALS_L(mobilePhone.GetCallServiceCaps(callServiceCaps), KErrNone, _L("RMobilePhone::GetCallServiceCaps return value is not KErrNone"));
       
   998 	TUint32 expectedServiceCaps = RMobilePhone::KCapsSetCFStatus | RMobilePhone::KCapsNotifyCFStatus;
       
   999 	CHECK_BITS_SET_L(callServiceCaps, expectedServiceCaps, KNoUnwantedBits, _L("RMobilePhone::GetCallServiceCaps returned wrong caps"));
       
  1000 
       
  1001 	CHECK_TRUE_L(GetStringFromConfig(KIniVoiceNumSection, KIniVoiceNumber1, number) != EFalse, _L("GetStringFromConfig did not complete as expected"));
       
  1002 	DEBUG_PRINTF2(_L("Number obtained: %S"), &number);
       
  1003 
       
  1004 	// Ensure all call forwarding is erased by calling 
       
  1005 
       
  1006 	// RMobilePhone::SetCallForwardingStatus with aCondition=RMobilePhone::ECallForwardingAllCases and 
       
  1007 
       
  1008 	// aInfo.iAction=RMobilePhone::EServiceActionErase and aInfo.iServiceGroup=RMobilePhone::EAllServices, aInfo.iTimeOut=-1 
       
  1009 	RMobilePhone::TMobilePhoneCFChangeV1 newSetting;
       
  1010 	newSetting.iServiceGroup=RMobilePhone::EAllServices;
       
  1011 	newSetting.iAction=RMobilePhone::EServiceActionErase;
       
  1012 	newSetting.iTimeout=-1;
       
  1013 		
       
  1014 	DEBUG_PRINTF1(_L("Setting call forward EServiceActionErase ECallForwardingAllCases for EAllServices"));
       
  1015 	CHECK_TRUE_L(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingAllCases), _L("SetCallForwardingStatusUtil with EServiceActionErase ECallForwardingAllCases for EAllServices failed"));
       
  1016 
       
  1017 	//
       
  1018 	// SET UP END
       
  1019 	//
       
  1020 	
       
  1021 	StartTest();
       
  1022 	
       
  1023 	//
       
  1024 	// TEST START
       
  1025 	//
       
  1026 	
       
  1027 	RMobilePhone::TMobilePhoneNetworkInfoV1 info;
       
  1028 	RMobilePhone::TMobilePhoneNetworkInfoV1Pckg infopckg(info);
       
  1029 	RMobilePhone::TMobilePhoneLocationAreaV1 area;
       
  1030 	TOperatorName operatorName = EOperatorUnknown;
       
  1031 	TInt err = iNetworkTestHelper.GetCurrentNetworkL( mobilePhone, infopckg, area, operatorName );	
       
  1032 	ASSERT_EQUALS(err, KErrNone, _L("RMobilePhone::GetCurrentNetwork failed to get current network id (1)"));
       
  1033 	
       
  1034 	// ===  Activate call forwarding and check notification completes ===
       
  1035 
       
  1036 	// RMobilePhone::SetCallForwardingStatus with aCondition=ECallForwardingUnconditional and aInfo.iAction=RMobilePhone::EServiceActionActivate and aInfo.iServiceGroup=RMobilePhone::EVoiceService, aInfo.iTimeOut=-1 
       
  1037 
       
  1038 	// Check RMobilePhone::NotifyCallForwardingStatusChange completes with aCondition=ECallForwardingUnconditional
       
  1039 	newSetting.iServiceGroup=RMobilePhone::EVoiceService;
       
  1040 	newSetting.iAction=RMobilePhone::EServiceActionActivate;
       
  1041 	newSetting.iNumber.iTelNumber=number;
       
  1042 	newSetting.iNumber.iNumberPlan=RMobilePhone::EIsdnNumberPlan;
       
  1043 	newSetting.iNumber.iTypeOfNumber=RMobilePhone::ENationalNumber;
       
  1044 
       
  1045 	// $CTSYProblem The status returned from SetCallForwardingStatus does not return KErrNone.
       
  1046 	// Instead the status varies depending on what iAction is requested. It is presumed that this is LTSY / network problem.
       
  1047 
       
  1048 	if(operatorName==EOperatorVodafone)
       
  1049 		{
       
  1050 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionActivate ECallForwardingUnconditional for EVoiceService"));
       
  1051 		ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional), _L("SetCallForwardingStatusUtil with EServiceActionActivate ECallForwardingUnconditional for EVoiceService failed"));
       
  1052 	
       
  1053 		// Repeat test with aInfo.iServiceGroup=EAuxVoiceService, ECircuitDataService, EPacketDataService, EFaxService, EShortMessageService, ETelephony 	
       
  1054 		newSetting.iServiceGroup=RMobilePhone::EAuxVoiceService;
       
  1055 		
       
  1056 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionActivate ECallForwardingUnconditional for EAuxVoiceService"));
       
  1057 		ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional, KErrGsmSSUnexpectedDataValue), _L("SetCallForwardingStatusUtil with EServiceActionActivate ECallForwardingUnconditional for EAuxVoiceService failed"));
       
  1058 		
       
  1059 		newSetting.iServiceGroup=RMobilePhone::ECircuitDataService;
       
  1060 		
       
  1061 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionActivate ECallForwardingUnconditional for ECircuitDataService"));
       
  1062 		ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional), _L("SetCallForwardingStatusUtil with EServiceActionActivate ECallForwardingUnconditional for ECircuitDataService failed"));
       
  1063 		
       
  1064 		newSetting.iServiceGroup=RMobilePhone::EPacketDataService;
       
  1065 		
       
  1066 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionActivate ECallForwardingUnconditional for EPacketDataService"));
       
  1067 		ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional, KErrGsmSSIllegalOperation), _L("SetCallForwardingStatusUtil with EServiceActionActivate ECallForwardingUnconditional for EPacketDataService failed"));
       
  1068 		
       
  1069 		newSetting.iServiceGroup=RMobilePhone::EFaxService;
       
  1070 		
       
  1071 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionActivate ECallForwardingUnconditional for EFaxService"));
       
  1072 		ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional), _L("SetCallForwardingStatusUtil with EServiceActionActivate ECallForwardingUnconditional for EFaxService failed"));
       
  1073 		
       
  1074 		newSetting.iServiceGroup=RMobilePhone::EShortMessageService;
       
  1075 		
       
  1076 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionActivate ECallForwardingUnconditional for EShortMessageService"));
       
  1077 		ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional, KErrGsmSSIllegalOperation), _L("SetCallForwardingStatusUtil with EServiceActionActivate ECallForwardingUnconditional for EShortMessageService failed"));
       
  1078 		
       
  1079 		newSetting.iServiceGroup=RMobilePhone::ETelephony;
       
  1080 		
       
  1081 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionActivate ECallForwardingUnconditional for ETelephony"));
       
  1082 		ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional), _L("SetCallForwardingStatusUtil with EServiceActionActivate ECallForwardingUnconditional for ETelephony failed"));
       
  1083 		}
       
  1084 	else if(operatorName==EOperatorTMobile || operatorName==EOperatorOrange || operatorName==EOperatorO2)
       
  1085 		{
       
  1086 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionActivate ECallForwardingUnconditional for EVoiceService"));
       
  1087 		ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional, KErrGsmSSErrorStatus), _L("SetCallForwardingStatusUtil with EServiceActionActivate ECallForwardingUnconditional for EVoiceService failed"));
       
  1088 	
       
  1089 		// Repeat test with aInfo.iServiceGroup=EAuxVoiceService, ECircuitDataService, EPacketDataService, EFaxService, EShortMessageService, ETelephony 	
       
  1090 		newSetting.iServiceGroup=RMobilePhone::EAuxVoiceService;
       
  1091 		
       
  1092 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionActivate ECallForwardingUnconditional for EAuxVoiceService"));
       
  1093 		ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional, KErrGsmSSTeleserviceNotProvisioned ), _L("SetCallForwardingStatusUtil with EServiceActionActivate ECallForwardingUnconditional for EAuxVoiceService failed"));
       
  1094 		
       
  1095 		newSetting.iServiceGroup=RMobilePhone::ECircuitDataService;
       
  1096 		
       
  1097 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionActivate ECallForwardingUnconditional for ECircuitDataService"));
       
  1098 		ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional, KErrGsmSSErrorStatus), _L("SetCallForwardingStatusUtil with EServiceActionActivate ECallForwardingUnconditional for ECircuitDataService failed"));
       
  1099 
       
  1100 		newSetting.iServiceGroup=RMobilePhone::EPacketDataService;
       
  1101 		
       
  1102 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionActivate ECallForwardingUnconditional for EPacketDataService"));
       
  1103 		ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional, KErrGsmSSUnexpectedDataValue), _L("SetCallForwardingStatusUtil with EServiceActionActivate ECallForwardingUnconditional for EPacketDataService failed"));
       
  1104 		
       
  1105 		newSetting.iServiceGroup=RMobilePhone::EFaxService;
       
  1106 		
       
  1107 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionActivate ECallForwardingUnconditional for EFaxService"));
       
  1108 		
       
  1109 		if(operatorName==EOperatorOrange || operatorName==EOperatorO2)
       
  1110 			{
       
  1111 			ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional, KErrGsmSSTeleserviceNotProvisioned ), _L("SetCallForwardingStatusUtil with EServiceActionActivate ECallForwardingUnconditional for EFaxService failed"));
       
  1112 			}
       
  1113 		else if(operatorName==EOperatorTMobile)
       
  1114 			{
       
  1115 			ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional, KErrGsmSSErrorStatus), _L("SetCallForwardingStatusUtil with EServiceActionActivate ECallForwardingUnconditional for EFaxService failed"));
       
  1116 			}
       
  1117 		
       
  1118 		newSetting.iServiceGroup=RMobilePhone::EShortMessageService;
       
  1119 		
       
  1120 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionActivate ECallForwardingUnconditional for EShortMessageService"));
       
  1121 		
       
  1122 		if(operatorName==EOperatorTMobile || operatorName==EOperatorO2)
       
  1123 			{
       
  1124 			ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional, KErrGsmSSIncompatibility), _L("SetCallForwardingStatusUtil with EServiceActionActivate ECallForwardingUnconditional for EShortMessageService failed"));
       
  1125 			}
       
  1126 		else if(operatorName==EOperatorOrange)
       
  1127 			{
       
  1128 			ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional, KErrGsmSSCallBarred), _L("SetCallForwardingStatusUtil with EServiceActionActivate ECallForwardingUnconditional for EShortMessageService failed"));
       
  1129 			}
       
  1130 		
       
  1131 		newSetting.iServiceGroup=RMobilePhone::ETelephony;
       
  1132 		
       
  1133 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionActivate ECallForwardingUnconditional for ETelephony"));
       
  1134 		ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional, KErrGsmSSErrorStatus), _L("SetCallForwardingStatusUtil with EServiceActionActivate ECallForwardingUnconditional for ETelephony failed"));
       
  1135 		}
       
  1136 	else
       
  1137 		{	
       
  1138 		ASSERT_EQUALS(1,0,_L("Failed to identify current network"));
       
  1139 		TEST_CHECK_POINT_L(_L("Failed to identify current network."));
       
  1140 		}
       
  1141 	
       
  1142 	//
       
  1143 	// TEST END
       
  1144 	//
       
  1145 
       
  1146     StartCleanup();
       
  1147 	
       
  1148 	// Ensure all call forwarding setting are erased
       
  1149 	newSetting.iServiceGroup=RMobilePhone::EAllServices;
       
  1150 	newSetting.iAction=RMobilePhone::EServiceActionErase;
       
  1151 		
       
  1152 	DEBUG_PRINTF1(_L("Setting call forward EServiceActionErase ECallForwardingAllCases for EAllServices"));
       
  1153 	ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingAllCases), _L("SetCallForwardingStatusUtil with EServiceActionErase ECallForwardingAllCases for EAllServices failed"));
       
  1154 	
       
  1155 	return TestStepResult();
       
  1156 	}
       
  1157 
       
  1158 TPtrC CCTSYIntegrationTestCallForwarding0006::GetTestStepName()
       
  1159 /**
       
  1160  * @return The test step name.
       
  1161  */
       
  1162 	{
       
  1163 	return _L("CCTSYIntegrationTestCallForwarding0006");
       
  1164 	}
       
  1165 
       
  1166 
       
  1167 
       
  1168 CCTSYIntegrationTestCallForwarding0007::CCTSYIntegrationTestCallForwarding0007(CEtelSessionMgr& aEtelSessionMgr)
       
  1169 	: CCTSYIntegrationTestCallForwardingBase(aEtelSessionMgr)
       
  1170 /**
       
  1171  * Constructor.
       
  1172  */
       
  1173 	{
       
  1174 	SetTestStepName(CCTSYIntegrationTestCallForwarding0007::GetTestStepName());
       
  1175 	}
       
  1176 
       
  1177 CCTSYIntegrationTestCallForwarding0007::~CCTSYIntegrationTestCallForwarding0007()
       
  1178 /**
       
  1179  * Destructor.
       
  1180  */
       
  1181 	{
       
  1182 	}
       
  1183 
       
  1184 TVerdict CCTSYIntegrationTestCallForwarding0007::doTestStepL()
       
  1185 /**
       
  1186  * @SYMTestCaseID BA-CTSY-INT-CFOR-0007
       
  1187  * @SYMFssID BA/CTSY/CFOR-0007
       
  1188  * @SYMTestCaseDesc Deactivate call forwarding for all services.
       
  1189  * @SYMTestPriority High
       
  1190  * @SYMTestActions RMobilePhone::NotifyCallForwardingStatusChange
       
  1191  * @SYMTestExpectedResults Pass - Call forwarding is deactivated.
       
  1192  * @SYMTestType CIT
       
  1193  * @SYMTestCaseDependencies live/automatic
       
  1194  *
       
  1195  * Reason for test: Verify call forwarding deactivated and notification completes.
       
  1196  *
       
  1197  * @return - TVerdict code
       
  1198  */
       
  1199 	{
       
  1200 
       
  1201 	//
       
  1202 	// SET UP
       
  1203 	//
       
  1204 
       
  1205 	// Ensure RMobilePhone::GetCallServiceCaps returns caps in set of KCapsSetCFStatus | KCapsNotifyCFStatus 
       
  1206 	RMobilePhone& mobilePhone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone);	
       
  1207 	
       
  1208 	// Call TNetworkTsyTestHelper::WaitForRegisteredOnHomeNetworkL		
       
  1209 	CHECK_EQUALS_L(iNetworkTestHelper.WaitForRegisteredOnHomeNetworkL(mobilePhone), KErrNone, _L("TNetworkTsyTestHelper::WaitForRegisteredOnHomeNetworkL returned with an error"));
       
  1210 
       
  1211 	TUint32 callServiceCaps = 0;
       
  1212 	CHECK_EQUALS_L(mobilePhone.GetCallServiceCaps(callServiceCaps), KErrNone, _L("RMobilePhone::GetCallServiceCaps return value is not KErrNone"));
       
  1213 	TUint32 expectedServiceCaps = RMobilePhone::KCapsSetCFStatus | RMobilePhone::KCapsNotifyCFStatus;
       
  1214 	CHECK_BITS_SET_L(callServiceCaps, expectedServiceCaps, KNoUnwantedBits, _L("RMobilePhone::GetCallServiceCaps returned wrong caps"));
       
  1215 
       
  1216 	TPtrC number; 
       
  1217 	CHECK_TRUE_L(GetStringFromConfig(KIniVoiceNumSection, KIniVoiceNumber1, number) != EFalse, _L("GetStringFromConfig did not complete as expected"));
       
  1218 	DEBUG_PRINTF2(_L("Number obtained: %S"), &number);
       
  1219 
       
  1220 	RMobilePhone::TMobilePhoneNetworkInfoV1 info;
       
  1221 	RMobilePhone::TMobilePhoneNetworkInfoV1Pckg infopckg(info);
       
  1222 	RMobilePhone::TMobilePhoneLocationAreaV1 area;
       
  1223 	TOperatorName operatorName = EOperatorUnknown;
       
  1224 	TInt err = iNetworkTestHelper.GetCurrentNetworkL( mobilePhone, infopckg, area, operatorName );	
       
  1225 	CHECK_EQUALS_L(err, KErrNone, _L("RMobilePhone::GetCurrentNetwork failed to get current network id (1)"));
       
  1226 	
       
  1227 	RMobilePhone::TMobilePhoneCFChangeV1 newSetting;
       
  1228 	newSetting.iServiceGroup=RMobilePhone::EAllServices;
       
  1229 	newSetting.iNumber.iTelNumber=number;
       
  1230 	newSetting.iNumber.iNumberPlan=RMobilePhone::EIsdnNumberPlan;
       
  1231 	newSetting.iNumber.iTypeOfNumber=RMobilePhone::ENationalNumber;
       
  1232 	newSetting.iTimeout=-1;
       
  1233 	
       
  1234 	if(operatorName==EOperatorVodafone)
       
  1235 		{
       
  1236 		// Activate call forwarding using RMobilePhone::SetCallForwardingStatus with aCondition=ECallForwardingUnconditional and aInfo.iAction=RMobilePhone::EServiceActionActivate and aInfo.iServiceGroup=RMobilePhone::EAllServices, aInfo.iNumber.iNumberPlan=EIsdnNumberPlan, aInfo.iNumber.iTelNumber=valid number, aInfo.iNumber.iTypeOfNumber=ENationalNumber, aInfo.iTimeout=-1 
       
  1237 		newSetting.iAction=RMobilePhone::EServiceActionActivate;
       
  1238 		
       
  1239 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionActivate ECallForwardingUnconditional for EAllServices"));
       
  1240 		CHECK_TRUE_L(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional), _L("SetCallForwardingStatusUtil with EServiceActionActivate ECallForwardingUnconditional for EAllServices failed"));
       
  1241 		}
       
  1242 	else if(operatorName==EOperatorTMobile || operatorName==EOperatorOrange || operatorName==EOperatorO2)
       
  1243 		{
       
  1244 		// Register call forwarding using RMobilePhone::SetCallForwardingStatus with aCondition=ECallForwardingUnconditional and aInfo.iAction=RMobilePhone::EServiceActionActivate and aInfo.iServiceGroup=RMobilePhone::EAllServices, aInfo.iNumber.iNumberPlan=EIsdnNumberPlan, aInfo.iNumber.iTelNumber=valid number, aInfo.iNumber.iTypeOfNumber=ENationalNumber, aInfo.iTimeout=-1 
       
  1245 		newSetting.iAction=RMobilePhone::EServiceActionRegister;
       
  1246 		
       
  1247 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionRegister ECallForwardingUnconditional for EAllServices"));
       
  1248 		CHECK_TRUE_L(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional), _L("SetCallForwardingStatusUtil with EServiceActionRegister ECallForwardingUnconditional for EAllServices failed"));
       
  1249 		}
       
  1250 	else
       
  1251 		{	
       
  1252 		CHECK_EQUALS_L(1,0,_L("Failed to identify current network"));
       
  1253 		}
       
  1254 	
       
  1255 	//
       
  1256 	// SET UP END
       
  1257 	//
       
  1258 	
       
  1259 	StartTest();
       
  1260 	
       
  1261 	//
       
  1262 	// TEST START
       
  1263 	//
       
  1264 	
       
  1265 	// ===  Deactivate call forwarding and check notification completes ===
       
  1266 
       
  1267 	// RMobilePhone::SetCallForwardingStatus with aCondition=ECallForwardingUnconditional and aInfo.iAction=RMobilePhone::EServiceActionDeactivate and aInfo.iServiceGroup=RMobilePhone::EAllServices, aInfo.iTimeOut = -1 
       
  1268 	newSetting.iAction=RMobilePhone::EServiceActionDeactivate;
       
  1269 	newSetting.iServiceGroup=RMobilePhone::EAllServices;
       
  1270 	
       
  1271 	DEBUG_PRINTF1(_L("Setting call forward EServiceActionDeactivate ECallForwardingUnconditional for EAllServices"));
       
  1272 	ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional), _L("SetCallForwardingStatusUtil with EServiceActionDeactivate ECallForwardingUnconditional for EAllServices failed"));
       
  1273 
       
  1274 	//
       
  1275 	// TEST END
       
  1276 	//
       
  1277 
       
  1278     StartCleanup();
       
  1279 	
       
  1280 	// Ensure all call forwarding setting are erased
       
  1281 	newSetting.iServiceGroup=RMobilePhone::EAllServices;
       
  1282 	newSetting.iAction=RMobilePhone::EServiceActionErase;
       
  1283 	
       
  1284 	DEBUG_PRINTF1(_L("Setting call forward EServiceActionErase ECallForwardingAllCases for EAllServices"));
       
  1285 	ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingAllCases), _L("SetCallForwardingStatusUtil with EServiceActionErase ECallForwardingAllCases for EAllServices failed"));
       
  1286 	
       
  1287 	return TestStepResult();
       
  1288 	}
       
  1289 
       
  1290 TPtrC CCTSYIntegrationTestCallForwarding0007::GetTestStepName()
       
  1291 /**
       
  1292  * @return The test step name.
       
  1293  */
       
  1294 	{
       
  1295 	return _L("CCTSYIntegrationTestCallForwarding0007");
       
  1296 	}
       
  1297 
       
  1298 
       
  1299 
       
  1300 CCTSYIntegrationTestCallForwarding0008::CCTSYIntegrationTestCallForwarding0008(CEtelSessionMgr& aEtelSessionMgr)
       
  1301 	: CCTSYIntegrationTestCallForwardingBase(aEtelSessionMgr)
       
  1302 /**
       
  1303  * Constructor.
       
  1304  */
       
  1305 	{
       
  1306 	SetTestStepName(CCTSYIntegrationTestCallForwarding0008::GetTestStepName());
       
  1307 	}
       
  1308 
       
  1309 CCTSYIntegrationTestCallForwarding0008::~CCTSYIntegrationTestCallForwarding0008()
       
  1310 /**
       
  1311  * Destructor.
       
  1312  */
       
  1313 	{
       
  1314 	}
       
  1315 
       
  1316 TVerdict CCTSYIntegrationTestCallForwarding0008::doTestStepL()
       
  1317 /**
       
  1318  * @SYMTestCaseID BA-CTSY-INT-CFOR-0008
       
  1319  * @SYMFssID BA/CTSY/CFOR-0008
       
  1320  * @SYMTestCaseDesc Deactivate call forwarding for each provisioned basic service.
       
  1321  * @SYMTestPriority High
       
  1322  * @SYMTestActions RMobilePhone::NotifyCallForwardingStatusChange
       
  1323  * @SYMTestExpectedResults Pass - Call forwarding is deactivated for each provisioned basic service.
       
  1324  * @SYMTestType CIT
       
  1325  * @SYMTestCaseDependencies live/automatic
       
  1326  *
       
  1327  * Reason for test: Verify call forwarding deactivated and notification completes.
       
  1328  *
       
  1329  * @return - TVerdict code
       
  1330  */
       
  1331 	{
       
  1332 
       
  1333 	//
       
  1334 	// SET UP
       
  1335 	//
       
  1336 
       
  1337 	// Ensure RMobilePhone::GetCallServiceCaps returns caps in set of KCapsSetCFStatus | KCapsNotifyCFStatus 
       
  1338 	RMobilePhone& mobilePhone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone);	
       
  1339 	TUint32 callServiceCaps = 0;
       
  1340 	TPtrC number;
       
  1341 	
       
  1342 	// Call TNetworkTsyTestHelper::WaitForRegisteredOnHomeNetworkL		
       
  1343 	CHECK_EQUALS_L(iNetworkTestHelper.WaitForRegisteredOnHomeNetworkL(mobilePhone), KErrNone, _L("TNetworkTsyTestHelper::WaitForRegisteredOnHomeNetworkL returned with an error"));
       
  1344 
       
  1345 	CHECK_EQUALS_L(mobilePhone.GetCallServiceCaps(callServiceCaps), KErrNone, _L("RMobilePhone::GetCallServiceCaps return value is not KErrNone"));
       
  1346 	TUint32 expectedServiceCaps = RMobilePhone::KCapsSetCFStatus | RMobilePhone::KCapsNotifyCFStatus;
       
  1347 	CHECK_BITS_SET_L(callServiceCaps, expectedServiceCaps, KNoUnwantedBits, _L("RMobilePhone::GetCallServiceCaps returned wrong caps"));
       
  1348 	
       
  1349 	CHECK_TRUE_L(GetStringFromConfig(KIniVoiceNumSection, KIniVoiceNumber1, number) != EFalse, _L("GetStringFromConfig did not complete as expected"));
       
  1350 	DEBUG_PRINTF2(_L("Number obtained: %S"), &number);
       
  1351 
       
  1352 	RMobilePhone::TMobilePhoneNetworkInfoV1 info;
       
  1353 	RMobilePhone::TMobilePhoneNetworkInfoV1Pckg infopckg(info);
       
  1354 	RMobilePhone::TMobilePhoneLocationAreaV1 area;
       
  1355 	TOperatorName operatorName = EOperatorUnknown;
       
  1356 	TInt err = iNetworkTestHelper.GetCurrentNetworkL( mobilePhone, infopckg, area, operatorName );	
       
  1357 	CHECK_EQUALS_L(err, KErrNone, _L("RMobilePhone::GetCurrentNetwork failed to get current network id (1)"));
       
  1358 	
       
  1359 	RMobilePhone::TMobilePhoneCFChangeV1 newSetting;
       
  1360 	newSetting.iServiceGroup=RMobilePhone::EAllServices;
       
  1361 	newSetting.iNumber.iTelNumber=number;
       
  1362 	newSetting.iNumber.iNumberPlan=RMobilePhone::EIsdnNumberPlan;
       
  1363 	newSetting.iNumber.iTypeOfNumber=RMobilePhone::ENationalNumber;
       
  1364 	newSetting.iTimeout=-1;
       
  1365 	
       
  1366 	if(operatorName==EOperatorVodafone)
       
  1367 		{
       
  1368 		// Activate call forwarding using RMobilePhone::SetCallForwardingStatus with aCondition=ECallForwardingUnconditional and aInfo.iAction=RMobilePhone::EServiceActionActivate and aInfo.iServiceGroup=RMobilePhone::EAllServices, aInfo.iNumber.iNumberPlan=EIsdnNumberPlan, aInfo.iNumber.iTelNumber=valid number, aInfo.iNumber.iTypeOfNumber=ENationalNumber, aInfo.iTimeout=-1 
       
  1369 		newSetting.iAction=RMobilePhone::EServiceActionActivate;
       
  1370 		
       
  1371 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionActivate ECallForwardingUnconditional for EAllServices"));
       
  1372 		CHECK_TRUE_L(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional), _L("SetCallForwardingStatusUtil with EServiceActionActivate ECallForwardingUnconditional for EAllServices failed"));
       
  1373 		}
       
  1374 	else if(operatorName==EOperatorTMobile || operatorName==EOperatorOrange || operatorName==EOperatorO2)
       
  1375 		{
       
  1376 		// Register call forwarding using RMobilePhone::SetCallForwardingStatus with aCondition=ECallForwardingUnconditional and aInfo.iAction=RMobilePhone::EServiceActionActivate and aInfo.iServiceGroup=RMobilePhone::EAllServices, aInfo.iNumber.iNumberPlan=EIsdnNumberPlan, aInfo.iNumber.iTelNumber=valid number, aInfo.iNumber.iTypeOfNumber=ENationalNumber, aInfo.iTimeout=-1 
       
  1377 		newSetting.iAction=RMobilePhone::EServiceActionRegister;
       
  1378 		
       
  1379 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionRegister ECallForwardingUnconditional for EAllServices"));
       
  1380 		CHECK_TRUE_L(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional), _L("SetCallForwardingStatusUtil with EServiceActionRegister ECallForwardingUnconditional for EAllServices failed"));
       
  1381 		}
       
  1382 	else
       
  1383 		{	
       
  1384 		CHECK_EQUALS_L(1,0,_L("Failed to identify current network"));
       
  1385 		}
       
  1386 		
       
  1387 	//
       
  1388 	// SET UP END
       
  1389 	//
       
  1390 	
       
  1391 	StartTest();
       
  1392 	
       
  1393 	//
       
  1394 	// TEST START
       
  1395 	//
       
  1396 	
       
  1397 	// $CTSYProblem The status returned from SetCallForwardingStatus does not return KErrNone.
       
  1398 	// Instead the status varies depending on what iAction is requested. It is presumed that this is LTSY / network problem.
       
  1399 	
       
  1400 	// ===  Deactivate call forwarding ===
       
  1401 
       
  1402 	// RMobilePhone::SetCallForwardingStatus with aCondition=ECallForwardingUnconditional and aInfo.iAction=RMobilePhone::EServiceActionDeactivate and aInfo.iServiceGroup=RMobilePhone::EVoiceService, aInfo.iTimeOut=-1 
       
  1403 	// Check RMobilePhone::NotifyCallForwardingStatusChange completes with aCondition=ECallForwardingUnconditional
       
  1404 	newSetting.iServiceGroup=RMobilePhone::EVoiceService;
       
  1405 	newSetting.iAction=RMobilePhone::EServiceActionDeactivate;
       
  1406 	
       
  1407 	if(operatorName==EOperatorVodafone)
       
  1408 		{
       
  1409 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionDeactivate ECallForwardingUnconditional for EVoiceService"));
       
  1410 		ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional), _L("SetCallForwardingStatusUtil with EServiceActionDeactivate ECallForwardingUnconditional for EVoiceService failed"));
       
  1411 		
       
  1412 		// Repeat test with aInfo.iServiceGroup=EAuxVoiceService, ECircuitDataService, EPacketDataService, EFaxService, EShortMessageService, ETelephony 	
       
  1413 		newSetting.iServiceGroup=RMobilePhone::EAuxVoiceService;
       
  1414 		
       
  1415 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionDeactivate ECallForwardingUnconditional for EAuxVoiceService"));
       
  1416 		ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional, KErrGsmSSUnexpectedDataValue), _L("SetCallForwardingStatusUtil with EServiceActionDeactivate ECallForwardingUnconditional for EAuxVoiceService failed"));
       
  1417 		
       
  1418 		newSetting.iServiceGroup=RMobilePhone::ECircuitDataService;
       
  1419 		
       
  1420 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionDeactivate ECallForwardingUnconditional for ECircuitDataService"));
       
  1421 		ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional), _L("SetCallForwardingStatusUtil with EServiceActionDeactivate ECallForwardingUnconditional for ECircuitDataService failed"));
       
  1422 		
       
  1423 		newSetting.iServiceGroup=RMobilePhone::EPacketDataService;
       
  1424 		
       
  1425 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionDeactivate ECallForwardingUnconditional for EPacketDataService"));
       
  1426 		ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional, KErrGsmSSIllegalOperation), _L("SetCallForwardingStatusUtil with EServiceActionDeactivate ECallForwardingUnconditional for EPacketDataService failed"));
       
  1427 		
       
  1428 		newSetting.iServiceGroup=RMobilePhone::EFaxService;
       
  1429 		
       
  1430 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionDeactivate ECallForwardingUnconditional for EFaxService"));
       
  1431 		ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional), _L("SetCallForwardingStatusUtil with EServiceActionDeactivate ECallForwardingUnconditional for EFaxService failed"));
       
  1432 		
       
  1433 		newSetting.iServiceGroup=RMobilePhone::EShortMessageService;
       
  1434 		
       
  1435 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionDeactivate ECallForwardingUnconditional for EShortMessageService"));
       
  1436 		ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional, KErrGsmSSIllegalOperation), _L("SetCallForwardingStatusUtil with EServiceActionDeactivate ECallForwardingUnconditional for EShortMessageService failed"));
       
  1437 		
       
  1438 		newSetting.iServiceGroup=RMobilePhone::ETelephony;
       
  1439 		
       
  1440 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionDeactivate ECallForwardingUnconditional for ETelephony"));
       
  1441 		ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional), _L("SetCallForwardingStatusUtil with EServiceActionDeactivate ECallForwardingUnconditional for ETelephony failed"));
       
  1442 		}	
       
  1443 	else if(operatorName==EOperatorO2 || operatorName==EOperatorOrange || operatorName==EOperatorTMobile)
       
  1444 		{
       
  1445 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionDeactivate ECallForwardingUnconditional for EVoiceService"));
       
  1446 		ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional), _L("SetCallForwardingStatusUtil with EServiceActionDeactivate ECallForwardingUnconditional for EVoiceService failed"));
       
  1447 		
       
  1448 		// Repeat test with aInfo.iServiceGroup=EAuxVoiceService, ECircuitDataService, EPacketDataService, EFaxService, EShortMessageService, ETelephony 	
       
  1449 		newSetting.iServiceGroup=RMobilePhone::EAuxVoiceService;
       
  1450 		
       
  1451 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionDeactivate ECallForwardingUnconditional for EAuxVoiceService"));
       
  1452 		ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional, KErrGsmSSTeleserviceNotProvisioned), _L("SetCallForwardingStatusUtil with EServiceActionDeactivate ECallForwardingUnconditional for EAuxVoiceService failed"));
       
  1453 		
       
  1454 		newSetting.iServiceGroup=RMobilePhone::ECircuitDataService;
       
  1455 		
       
  1456 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionDeactivate ECallForwardingUnconditional for ECircuitDataService"));
       
  1457 		ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional), _L("SetCallForwardingStatusUtil with EServiceActionDeactivate ECallForwardingUnconditional for ECircuitDataService failed"));
       
  1458 		
       
  1459 		newSetting.iServiceGroup=RMobilePhone::EPacketDataService;
       
  1460 		
       
  1461 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionDeactivate ECallForwardingUnconditional for EPacketDataService"));
       
  1462 		ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional, KErrGsmSSUnexpectedDataValue), _L("SetCallForwardingStatusUtil with EServiceActionDeactivate ECallForwardingUnconditional for EPacketDataService failed"));
       
  1463 		
       
  1464 		newSetting.iServiceGroup=RMobilePhone::EFaxService;
       
  1465 		
       
  1466 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionDeactivate ECallForwardingUnconditional for EFaxService"));
       
  1467 
       
  1468 		if(operatorName==EOperatorO2 || operatorName==EOperatorOrange)
       
  1469 			{	
       
  1470 			ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional, KErrGsmSSTeleserviceNotProvisioned), _L("SetCallForwardingStatusUtil with EServiceActionDeactivate ECallForwardingUnconditional for EFaxService failed"));
       
  1471 			}
       
  1472 		else if(operatorName==EOperatorTMobile)
       
  1473 			{
       
  1474 			ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional), _L("SetCallForwardingStatusUtil with EServiceActionDeactivate ECallForwardingUnconditional for EFaxService failed"));
       
  1475 			}
       
  1476 
       
  1477 		newSetting.iServiceGroup=RMobilePhone::EShortMessageService;
       
  1478 		
       
  1479 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionDeactivate ECallForwardingUnconditional for EShortMessageService"));
       
  1480 
       
  1481 		if(operatorName==EOperatorO2 || operatorName==EOperatorTMobile) 
       
  1482 			{
       
  1483 			ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional, KErrGsmSSUnexpectedDataValue), _L("SetCallForwardingStatusUtil with EServiceActionDeactivate ECallForwardingUnconditional for EShortMessageService failed"));
       
  1484 			}
       
  1485 		else if(operatorName==EOperatorOrange)
       
  1486 			{
       
  1487 			ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional, KErrGsmSSCallBarred), _L("SetCallForwardingStatusUtil with EServiceActionDeactivate ECallForwardingUnconditional for EShortMessageService failed"));
       
  1488 			}
       
  1489 		
       
  1490 		newSetting.iServiceGroup=RMobilePhone::ETelephony;
       
  1491 		
       
  1492 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionDeactivate ECallForwardingUnconditional for ETelephony"));
       
  1493 		ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional), _L("SetCallForwardingStatusUtil with EServiceActionDeactivate ECallForwardingUnconditional for ETelephony failed"));
       
  1494 		}
       
  1495 	
       
  1496 	//
       
  1497 	// TEST END
       
  1498 	//
       
  1499 	
       
  1500 	StartCleanup();
       
  1501 	
       
  1502 	// Ensure all call forwarding setting are erased
       
  1503 	newSetting.iServiceGroup=RMobilePhone::EAllServices;
       
  1504 	newSetting.iAction=RMobilePhone::EServiceActionErase;
       
  1505 		
       
  1506 	DEBUG_PRINTF1(_L("Setting call forward EServiceActionErase ECallForwardingAllCases for EAllServices"));
       
  1507 	ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingAllCases), _L("SetCallForwardingStatusUtil with EServiceActionErase ECallForwardingAllCases for EAllServices failed"));
       
  1508 	
       
  1509 	return TestStepResult();
       
  1510 	}
       
  1511 
       
  1512 TPtrC CCTSYIntegrationTestCallForwarding0008::GetTestStepName()
       
  1513 /**
       
  1514  * @return The test step name.
       
  1515  */
       
  1516 	{
       
  1517 	return _L("CCTSYIntegrationTestCallForwarding0008");
       
  1518 	}
       
  1519 
       
  1520 
       
  1521 
       
  1522 CCTSYIntegrationTestCallForwarding0009::CCTSYIntegrationTestCallForwarding0009(CEtelSessionMgr& aEtelSessionMgr)
       
  1523 	: CCTSYIntegrationTestCallForwardingBase(aEtelSessionMgr)
       
  1524 /**
       
  1525  * Constructor.
       
  1526  */
       
  1527 	{
       
  1528 	SetTestStepName(CCTSYIntegrationTestCallForwarding0009::GetTestStepName());
       
  1529 	}
       
  1530 
       
  1531 CCTSYIntegrationTestCallForwarding0009::~CCTSYIntegrationTestCallForwarding0009()
       
  1532 /**
       
  1533  * Destructor.
       
  1534  */
       
  1535 	{
       
  1536 	}
       
  1537 
       
  1538 TVerdict CCTSYIntegrationTestCallForwarding0009::doTestStepL()
       
  1539 /**
       
  1540  * @SYMTestCaseID BA-CTSY-INT-CFOR-0009
       
  1541  * @SYMFssID BA/CTSY/CFOR-0009
       
  1542  * @SYMTestCaseDesc Interrogate call forwarding status when all services have the same status.
       
  1543  * @SYMTestPriority High
       
  1544  * @SYMTestActions RMobilePhone::SetCallForwardingStatus, CRetrieveMobilePhoneCFList::NewL
       
  1545  * @SYMTestExpectedResults Pass - Call forwarding status is retrieved, contains one entry and is correct.
       
  1546  * @SYMTestType CIT
       
  1547  * @SYMTestCaseDependencies live/automatic
       
  1548  *
       
  1549  * Reason for test: Verify call forwarding supplementary service list contains one entry and is correct.
       
  1550  *
       
  1551  * @return - TVerdict code
       
  1552  */
       
  1553 	{
       
  1554 
       
  1555 	//
       
  1556 	// SET UP
       
  1557 	//
       
  1558 
       
  1559 	// Ensure RMobilePhone::GetCallServiceCaps returns caps in set of KCapsGetCFStatusNetwork | KCapsGetCFStatusCache capabilities.
       
  1560 	RMobilePhone& mobilePhone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone);	
       
  1561 	
       
  1562 	// Call TNetworkTsyTestHelper::WaitForRegisteredOnHomeNetworkL		
       
  1563 	CHECK_EQUALS_L(iNetworkTestHelper.WaitForRegisteredOnHomeNetworkL(mobilePhone), KErrNone, _L("TNetworkTsyTestHelper::WaitForRegisteredOnHomeNetworkL returned with an error"));
       
  1564 	
       
  1565 	TUint32 callServiceCaps = 0;	
       
  1566 	CHECK_EQUALS_L(mobilePhone.GetCallServiceCaps(callServiceCaps), KErrNone, _L("RMobilePhone::GetCallServiceCaps return value is not KErrNone"));
       
  1567 	TUint32 expectedServiceCaps = RMobilePhone::KCapsGetCFStatusNetwork;
       
  1568 	CHECK_BITS_SET_L(callServiceCaps, expectedServiceCaps, KNoUnwantedBits, _L("RMobilePhone::GetCallServiceCaps returned wrong caps"));
       
  1569 
       
  1570 	TPtrC number; 
       
  1571 	CHECK_TRUE_L(GetStringFromConfig(KIniVoiceNumSection, KIniVoiceNumber1, number) != EFalse, _L("GetStringFromConfig did not complete as expected"));
       
  1572 	DEBUG_PRINTF2(_L("Number obtained: %S"), &number);
       
  1573 
       
  1574 	// Ensure all call forwarding is erased by calling 
       
  1575 
       
  1576 	// RMobilePhone::SetCallForwardingStatus with aCondition=RMobilePhone::ECallForwardingAllCases and 
       
  1577 
       
  1578 	// aInfo.iAction=RMobilePhone::EServiceActionErase and aInfo.iServiceGroup=RMobilePhone::EAllServices, aInfo.iTimeOut=-1 
       
  1579 	RMobilePhone::TMobilePhoneCFChangeV1 newSetting;
       
  1580 	newSetting.iServiceGroup=RMobilePhone::EAllServices;
       
  1581 	newSetting.iAction=RMobilePhone::EServiceActionErase;
       
  1582 	newSetting.iTimeout=-1;
       
  1583 		
       
  1584 	DEBUG_PRINTF1(_L("Setting call forward EServiceActionErase ECallForwardingUnconditional for EAllServices"));
       
  1585 	ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional), _L("SetCallForwardingStatusUtil with EServiceActionErase ECallForwardingUnconditional for EAllServices failed"));
       
  1586 	
       
  1587 	//
       
  1588 	// SET UP END
       
  1589 	//
       
  1590 	
       
  1591 	StartTest();
       
  1592 	
       
  1593 	//
       
  1594 	// TEST START
       
  1595 	//
       
  1596 	
       
  1597 	RMobilePhone::TMobilePhoneNetworkInfoV1 info;
       
  1598 	RMobilePhone::TMobilePhoneNetworkInfoV1Pckg infopckg(info);
       
  1599 	RMobilePhone::TMobilePhoneLocationAreaV1 area;
       
  1600 	TOperatorName operatorName = EOperatorUnknown;
       
  1601 	ASSERT_EQUALS(iNetworkTestHelper.GetCurrentNetworkL( mobilePhone, infopckg, area, operatorName), KErrNone, _L("RMobilePhone::GetCurrentNetwork failed to get current network id (1)"));
       
  1602 	
       
  1603 	newSetting.iServiceGroup=RMobilePhone::EVoiceService;
       
  1604 	newSetting.iNumber.iTelNumber=number;
       
  1605 	newSetting.iNumber.iNumberPlan=RMobilePhone::EIsdnNumberPlan;
       
  1606 	newSetting.iNumber.iTypeOfNumber=RMobilePhone::ENationalNumber;
       
  1607 	newSetting.iTimeout=-1;
       
  1608 	
       
  1609 	if(operatorName==EOperatorVodafone)
       
  1610 		{
       
  1611 		// ===  Activate call forwarding unconditional for all services ===
       
  1612 	
       
  1613 		// Activate call forwarding using RMobilePhone::SetCallForwardingStatus with aCondition=ECallForwardingUnconditional and aInfo.iAction=RMobilePhone::EServiceActionActivate and aInfo.iServiceGroup=RMobilePhone::EAllServices and aInfo.iNumber.iNumberPlan=EIsdnNumberPlan, aInfo.iNumber.iTelNumber=valid number, aInfo.iNumber.iTypeOfNumber=ENationalNumber, aInfo.iTimeout=-1 
       
  1614 		newSetting.iAction=RMobilePhone::EServiceActionActivate;
       
  1615 		
       
  1616 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionActivate ECallForwardingUnconditional for EVoiceService"));
       
  1617 		ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional), _L("SetCallForwardingStatusUtil with EServiceActionActivate ECallForwardingUnconditional for EVoiceService failed"));
       
  1618 	
       
  1619 		newSetting.iServiceGroup=RMobilePhone::ECircuitDataService;
       
  1620 		
       
  1621 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionActivate ECallForwardingUnconditional for ECircuitDataService"));
       
  1622 		ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional), _L("SetCallForwardingStatusUtil with EServiceActionActivate ECallForwardingUnconditional for ECircuitDataService failed"));
       
  1623 	
       
  1624 		newSetting.iServiceGroup=RMobilePhone::ETelephony;
       
  1625 		
       
  1626 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionActivate ECallForwardingUnconditional for ETelephony"));
       
  1627 		ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional), _L("SetCallForwardingStatusUtil with EServiceActionActivate ECallForwardingUnconditional for ETelephony failed"));
       
  1628 		}
       
  1629 	else if(operatorName==EOperatorO2 || operatorName==EOperatorOrange || operatorName==EOperatorTMobile)
       
  1630 		{
       
  1631 		// ===  Register call forwarding unconditional for all services ===
       
  1632 		
       
  1633 		// Register call forwarding using RMobilePhone::SetCallForwardingStatus with aCondition=ECallForwardingUnconditional and aInfo.iAction=RMobilePhone::EServiceActionRegister and aInfo.iServiceGroup=RMobilePhone::EAllServices and aInfo.iNumber.iNumberPlan=EIsdnNumberPlan, aInfo.iNumber.iTelNumber=valid number, aInfo.iNumber.iTypeOfNumber=ENationalNumber, aInfo.iTimeout=-1 
       
  1634 		newSetting.iAction=RMobilePhone::EServiceActionRegister;
       
  1635 		
       
  1636 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionRegister ECallForwardingUnconditional for EVoiceService"));
       
  1637 		ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional), _L("SetCallForwardingStatusUtil with EServiceActionRegister ECallForwardingUnconditional for EVoiceService failed"));
       
  1638 	
       
  1639 		newSetting.iServiceGroup=RMobilePhone::ECircuitDataService;
       
  1640 		
       
  1641 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionRegister ECallForwardingUnconditional for ECircuitDataService"));
       
  1642 		ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional), _L("SetCallForwardingStatusUtil with EServiceActionRegister ECallForwardingUnconditional for ECircuitDataService failed"));
       
  1643 	
       
  1644 		newSetting.iServiceGroup=RMobilePhone::ETelephony;
       
  1645 		
       
  1646 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionRegister ECallForwardingUnconditional for ETelephony"));
       
  1647 		ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional), _L("SetCallForwardingStatusUtil with EServiceActionRegister ECallForwardingUnconditional for ETelephony failed"));
       
  1648 		}
       
  1649 	else
       
  1650 		{	
       
  1651 		ASSERT_EQUALS(1,0,_L("Failed to identify current network"));
       
  1652 		TEST_CHECK_POINT_L(_L("Failed to identify current network."));
       
  1653 		}
       
  1654 	
       
  1655 	// ===  Retrieve the call forwarding status list ===
       
  1656 
       
  1657 	// Use helper class for CRetrieveMobilePhoneCFList to get the call forwarding status list with aCondition=RMobilePhone::ECallForwardingUnconditional, aServiceGroup=RMobilePhone::EAllServices, aLocation=RMobilePhone::EInfoLocationCachePreferred 
       
  1658 	TInt err;
       
  1659 
       
  1660 	CRetrieveMobilePhoneCFListExec* mainCfList = CRetrieveMobilePhoneCFListHelper::NewL(mobilePhone, RMobilePhone::ECallForwardingUnconditional, RMobilePhone::EAllServices, RMobilePhone::EInfoLocationCachePreferred);
       
  1661 	CleanupStack::PushL(mainCfList);
       
  1662 	CMobilePhoneCFList* callForwardingList = mainCfList->DoGetList(err);
       
  1663 	ASSERT_EQUALS(err, KErrNone, _L("CRetrieveMobilePhoneCFListExec::DoGetList is not able to get the list"));
       
  1664 	
       
  1665 	ASSERT_TRUE(callForwardingList != NULL, _L("CRetrieveMobilePhoneCFListExec::DoGetList callForwardingList is NULL"));
       
  1666 	TEST_CHECK_POINT_L(_L("CRetrieveMobilePhoneCFListExec::DoGetList callForwardingList is NULL"));
       
  1667 	
       
  1668 	// ===  Get the entries from the call forwarding status list and check the entries are correct ===
       
  1669 
       
  1670 	// Check CMobilePhoneCFList::Enumerate returns > 0
       
  1671 	RMobilePhone::TMobilePhoneCFInfoEntryV1 entry;
       
  1672 		
       
  1673 	TInt entries = callForwardingList->Enumerate();
       
  1674 		
       
  1675 	ASSERT_TRUE(entries>0, _L("CMobilePhoneCFList::Enumerate return value not greater than 0"));
       
  1676 	
       
  1677 	// Check CMobilePhoneCFList::GetEntryL with aIndex=0 returns a RMobilePhone::TMobilePhoneCFInfoEntryV1 with iServiceGroup=RMobilePhone::EAllServices, iStatus=RMobilePhone::ECallForwardingStatusActive, iNumber=same number used to register		
       
  1678 	TBuf<20> numberToCompare;
       
  1679 	
       
  1680 	if(number.Locate('0')==0)
       
  1681 		{
       
  1682 		// For the case when 0 is added
       
  1683 		numberToCompare=number.Mid(1);
       
  1684 		}
       
  1685 	else if(number.Locate('4')==0 || number.Locate('4')==1)
       
  1686 		{
       
  1687 		// For the case when +440 is added (or something like this)
       
  1688 		numberToCompare=number.Mid(5);
       
  1689 		}
       
  1690 
       
  1691 	for(TInt i = 0; i<entries; i++)
       
  1692 		{
       
  1693 		DEBUG_PRINTF2(_L("Performing CMobilePhoneCFList::GetEntryL on entry at position %d"), i);
       
  1694 			
       
  1695 		entry=callForwardingList->GetEntryL(i);
       
  1696 			
       
  1697 		switch(entry.iServiceGroup)
       
  1698 			{
       
  1699 			case RMobilePhone::EVoiceService:
       
  1700 			case RMobilePhone::ECircuitDataService:
       
  1701 			case RMobilePhone::ETelephony:
       
  1702 				{
       
  1703 				ASSERT_EQUALS(entry.iStatus, RMobilePhone::ECallForwardingStatusActive, _L("CMobilePhoneCFList::GetEntryL iStatus did not get RMobilePhone::ECallForwardingStatusActive"));
       
  1704 				DEBUG_PRINTF2(_L("Value for entry.iNumber.iTelNumber: %S"), &entry.iNumber.iTelNumber);
       
  1705 				ASSERT_TRUE(entry.iNumber.iTelNumber.Find(numberToCompare)>=0, _L("CMobilePhoneCFList::GetEntryL iTelNumber did not find number"));
       
  1706 				
       
  1707 				break;
       
  1708 				}
       
  1709 			case RMobilePhone::EFaxService:
       
  1710 			case RMobilePhone::EAuxVoiceService:
       
  1711 			case RMobilePhone::EPacketDataService:
       
  1712 				{
       
  1713 				ASSERT_EQUALS(entry.iStatus, RMobilePhone::ECallForwardingStatusNotRegistered, _L("CMobilePhoneCFList::GetEntryL iStatus did not get RMobilePhone::ECallForwardingStatusNotRegistered"));			
       
  1714 				break;
       
  1715 				}
       
  1716 			default:
       
  1717 				{
       
  1718 				DEBUG_PRINTF2(_L("Service %d not accounted for"), entry.iServiceGroup);
       
  1719 				break;
       
  1720 				}
       
  1721 			}
       
  1722 		}
       
  1723 				
       
  1724 	// ===  Erase all call forwarding unconditional ===
       
  1725 
       
  1726 	// Erase all call forwarding by calling RMobilePhone::SetCallForwardingStatus with aCondition=RMobilePhone::ECallForwardingUnconditional and aInfo.iAction=RMobilePhone::EServiceActionErase and aInfo.iServiceGroup=RMobilePhone::EAllServices, aInfo.iTimeOut=-1 
       
  1727 	newSetting.iAction=RMobilePhone::EServiceActionErase;
       
  1728 	newSetting.iServiceGroup=RMobilePhone::EAllServices;
       
  1729 	newSetting.iTimeout=-1;
       
  1730 	
       
  1731 	DEBUG_PRINTF1(_L("Setting call forward EServiceActionErase ECallForwardingUnconditional for EAllServices"));	
       
  1732 	ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional), _L("SetCallForwardingStatusUtil with EServiceActionErase ECallForwardingUnconditional for EAllServices failed"));
       
  1733 
       
  1734 	// ===  Retrieve the call forwarding status list ===
       
  1735 	
       
  1736 	// Use the helper class for CRetrieveMobilePhoneCFList to get the call forwarding status list with aCondition=RMobilePhone::ECallForwardingUnconditional, aServiceGroup=RMobilePhone::EAllServices, aLocation=RMobilePhone::EInfoLocationCachePreferred 
       
  1737 	CRetrieveMobilePhoneCFListExec* mainCfList2 = CRetrieveMobilePhoneCFListHelper::NewL(mobilePhone, RMobilePhone::ECallForwardingUnconditional, RMobilePhone::EAllServices, RMobilePhone::EInfoLocationCachePreferred);
       
  1738 	CleanupStack::PushL(mainCfList2);
       
  1739 	callForwardingList = mainCfList2->DoGetList(err);
       
  1740 	ASSERT_EQUALS(err, KErrNone, _L("CRetrieveMobilePhoneCFListExec::DoGetList is not able to get the list"));
       
  1741 	
       
  1742 	ASSERT_TRUE(callForwardingList != NULL, _L("CRetrieveMobilePhoneCFListExec::DoGetList callForwardingList is NULL"));
       
  1743 	
       
  1744 	// ===  Get the entries from the call forwarding status list and check the entries are correct ===
       
  1745 
       
  1746 	// Check CMobilePhoneCFList::Enumerate returns > 0
       
  1747 	
       
  1748 	entries = callForwardingList->Enumerate();
       
  1749 		
       
  1750 	ASSERT_TRUE(entries>0, _L("CMobilePhoneCFList::Enumerate return value not greater than 0"));
       
  1751 			
       
  1752 	// Check CMobilePhoneCFList::GetEntryL with aIndex=0 returns a RMobilePhone::TMobilePhoneCFInfoEntryV1 with iServiceGroup=RMobilePhone::EAllServices and iStatus=RMobilePhone::ECallForwardingStatusNotRegistered		
       
  1753 	for(TInt i = 0; i<entries; i++)
       
  1754 		{
       
  1755 		DEBUG_PRINTF2(_L("Performing CMobilePhoneCFList::GetEntryL on entry at position %d"), i);
       
  1756 			
       
  1757 		entry=callForwardingList->GetEntryL(i);
       
  1758 			
       
  1759 		switch(entry.iServiceGroup)
       
  1760 			{
       
  1761 			case RMobilePhone::EVoiceService:
       
  1762 			case RMobilePhone::ECircuitDataService:
       
  1763 			case RMobilePhone::EFaxService:	
       
  1764 			case RMobilePhone::EAuxVoiceService:
       
  1765 			case RMobilePhone::EPacketDataService:
       
  1766 			case RMobilePhone::ETelephony:
       
  1767 				{
       
  1768 				ASSERT_EQUALS(entry.iStatus, RMobilePhone::ECallForwardingStatusNotRegistered, _L("CMobilePhoneCFList::GetEntryL iStatus did not get RMobilePhone::ECallForwardingStatusNotRegistered"));			
       
  1769 				break;
       
  1770 				}
       
  1771 			default:
       
  1772 				{
       
  1773 				DEBUG_PRINTF2(_L("Service %d not accounted for"), entry.iServiceGroup);
       
  1774 				break;
       
  1775 				}
       
  1776 			}
       
  1777 		}
       
  1778 			
       
  1779 	//
       
  1780 	// TEST END
       
  1781 	//
       
  1782 	
       
  1783     StartCleanup();
       
  1784 	
       
  1785 	// Ensure all call forwarding setting are erased
       
  1786 	newSetting.iServiceGroup=RMobilePhone::EAllServices;
       
  1787 	newSetting.iAction=RMobilePhone::EServiceActionErase;
       
  1788 	
       
  1789 	DEBUG_PRINTF1(_L("Setting call forward EServiceActionErase ECallForwardingUnconditional for EAllServices"));
       
  1790 	ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional), _L("SetCallForwardingStatusUtil with EServiceActionErase ECallForwardingUnconditional for EAllServices failed"));
       
  1791 	
       
  1792 	CleanupStack::PopAndDestroy(2,mainCfList);
       
  1793 	return TestStepResult();
       
  1794 	}
       
  1795 
       
  1796 TPtrC CCTSYIntegrationTestCallForwarding0009::GetTestStepName()
       
  1797 /**
       
  1798  * @return The test step name.
       
  1799  */
       
  1800 	{
       
  1801 	return _L("CCTSYIntegrationTestCallForwarding0009");
       
  1802 	}
       
  1803 
       
  1804 
       
  1805 
       
  1806 CCTSYIntegrationTestCallForwarding0010::CCTSYIntegrationTestCallForwarding0010(CEtelSessionMgr& aEtelSessionMgr)
       
  1807 	: CCTSYIntegrationTestCallForwardingBase(aEtelSessionMgr)
       
  1808 /**
       
  1809  * Constructor.
       
  1810  */
       
  1811 	{
       
  1812 	SetTestStepName(CCTSYIntegrationTestCallForwarding0010::GetTestStepName());
       
  1813 	}
       
  1814 
       
  1815 CCTSYIntegrationTestCallForwarding0010::~CCTSYIntegrationTestCallForwarding0010()
       
  1816 /**
       
  1817  * Destructor.
       
  1818  */
       
  1819 	{
       
  1820 	}
       
  1821 
       
  1822 TVerdict CCTSYIntegrationTestCallForwarding0010::doTestStepL()
       
  1823 /**
       
  1824  * @SYMTestCaseID BA-CTSY-INT-CFOR-0010
       
  1825  * @SYMFssID BA/CTSY/CFOR-0010
       
  1826  * @SYMTestCaseDesc Interrogate call forwarding status for different conditions and provisioned basic services.
       
  1827  * @SYMTestPriority High
       
  1828  * @SYMTestActions RMobilePhone::SetCallForwardingStatus, CRetrieveMobilePhoneCFList::NewL
       
  1829  * @SYMTestExpectedResults Pass - Call forwarding status is retrieved and status is that set.
       
  1830  * @SYMTestType CIT
       
  1831  * @SYMTestCaseDependencies live/automatic
       
  1832  *
       
  1833  * Reason for test: Verify call forwarding status list is retrieved with correct entries.
       
  1834  *
       
  1835  * @return - TVerdict code
       
  1836  */
       
  1837 	{
       
  1838 	
       
  1839 	//
       
  1840 	// SET UP
       
  1841 	//
       
  1842 
       
  1843 	// Ensure RMobilePhone::GetCallServiceCaps returns caps in set of KCapsSetCFStatus | KCapsGetCFStatusNetwork | KCapsGetCFStatusCache capabilities.
       
  1844 	RMobilePhone& mobilePhone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone);		
       
  1845 
       
  1846 	// Call TNetworkTsyTestHelper::WaitForRegisteredOnHomeNetworkL		
       
  1847 	CHECK_EQUALS_L(iNetworkTestHelper.WaitForRegisteredOnHomeNetworkL(mobilePhone), KErrNone, _L("TNetworkTsyTestHelper::WaitForRegisteredOnHomeNetworkL returned with an error"));
       
  1848 
       
  1849 	TUint32 callServiceCaps = 0;	
       
  1850 	CHECK_EQUALS_L(mobilePhone.GetCallServiceCaps(callServiceCaps), KErrNone, _L("RMobilePhone::GetCallServiceCaps return value is not KErrNone"));
       
  1851 	TUint32 expectedServiceCaps = RMobilePhone::KCapsSetCFStatus | RMobilePhone::KCapsGetCFStatusNetwork;
       
  1852 	CHECK_BITS_SET_L(callServiceCaps, expectedServiceCaps, KNoUnwantedBits, _L("RMobilePhone::GetCallServiceCaps returned wrong caps"));
       
  1853 
       
  1854 	TPtrC number; 
       
  1855 	CHECK_TRUE_L(GetStringFromConfig(KIniVoiceNumSection, KIniVoiceNumber1, number) != EFalse, _L("GetStringFromConfig did not complete as expected"));
       
  1856 	DEBUG_PRINTF2(_L("Number obtained: %S"), &number);
       
  1857 
       
  1858 	// Ensure all call forwarding is erased by calling 
       
  1859 
       
  1860 	// RMobilePhone::SetCallForwardingStatus with aCondition=RMobilePhone::ECallForwardingAllCases and 
       
  1861 	
       
  1862 	// aInfo.iAction=RMobilePhone::EServiceActionErase and aInfo.iServiceGroup=RMobilePhone::EAllServices, aInfo.iTimeOut=-1 
       
  1863 	RMobilePhone::TMobilePhoneCFChangeV1 newSetting;
       
  1864 	newSetting.iServiceGroup=RMobilePhone::EAllServices;
       
  1865 	newSetting.iAction=RMobilePhone::EServiceActionErase;
       
  1866 	newSetting.iTimeout=-1;
       
  1867 	
       
  1868 	DEBUG_PRINTF1(_L("Setting call forward EServiceActionErase ECallForwardingUnconditional for EAllServices"));
       
  1869 	ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional), _L("SetCallForwardingStatusUtil with EServiceActionErase ECallForwardingUnconditional for EAllServices failed"));
       
  1870 	
       
  1871 	//
       
  1872 	// SET UP END
       
  1873 	//
       
  1874 	
       
  1875 	StartTest();
       
  1876 	
       
  1877 	//
       
  1878 	// TEST START
       
  1879 	//
       
  1880 	
       
  1881 	RMobilePhone::TMobilePhoneNetworkInfoV1 info;
       
  1882 	RMobilePhone::TMobilePhoneNetworkInfoV1Pckg infopckg(info);
       
  1883 	RMobilePhone::TMobilePhoneLocationAreaV1 area;
       
  1884 	TOperatorName operatorName = EOperatorUnknown;
       
  1885 	ASSERT_EQUALS(iNetworkTestHelper.GetCurrentNetworkL(mobilePhone, infopckg, area, operatorName), KErrNone, _L("RMobilePhone::GetCurrentNetwork failed to get current network id (1)"));
       
  1886 		
       
  1887 	// ===   1. Register/Activate call forwarding busy for voice ===
       
  1888 
       
  1889 	// Register/Activate call forwarding using RMobilePhone::SetCallForwardingStatus with aCondition=RMobilePhone::ECallForwardingUnconditional and aInfo.iAction=RMobilePhone::EServiceActionActivate (or RMobilePhone::EServiceActionRegister) and aInfo.iServiceGroup=RMobilePhone::EVoiceService and aInfo.iNumber.iNumberPlan=EIsdnNumberPlan, aInfo.iNumber.iTelNumber=valid number, aInfo.iNumber.iTypeOfNumber=ENationalNumber, aInfo.iTimeout=-1 
       
  1890 
       
  1891 	// ===  Retrieve the call forwarding busy status list and check that voice is active and other provisioned basic services are not registered ===
       
  1892 	newSetting.iServiceGroup=RMobilePhone::EVoiceService;
       
  1893 	newSetting.iNumber.iTelNumber=number;
       
  1894 	newSetting.iNumber.iNumberPlan=RMobilePhone::EIsdnNumberPlan;
       
  1895 	newSetting.iNumber.iTypeOfNumber=RMobilePhone::ENationalNumber;
       
  1896 	
       
  1897 	if(operatorName==EOperatorVodafone)
       
  1898 		{
       
  1899 		// aInfo.iAction=RMobilePhone::EServiceActionActivate and aInfo.iServiceGroup=RMobilePhone::EVoiceService and aInfo.iNumber.iNumberPlan=EIsdnNumberPlan, aInfo.iNumber.iTelNumber=valid number, aInfo.iNumber.iTypeOfNumber=ENationalNumber, aInfo.iTimeout=-1 
       
  1900 		newSetting.iAction=RMobilePhone::EServiceActionActivate;
       
  1901 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionActivate ECallForwardingBusy for EVoiceService"));
       
  1902 		ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingBusy), _L("SetCallForwardingStatusUtil with EServiceActionActivate ECallForwardingBusy for EVoiceService failed"));
       
  1903 		}
       
  1904 	else if(operatorName==EOperatorO2 || operatorName==EOperatorOrange || operatorName==EOperatorTMobile)
       
  1905 		{
       
  1906 		// aInfo.iAction=RMobilePhone::EServiceActionRegister and aInfo.iServiceGroup=RMobilePhone::EVoiceService and aInfo.iNumber.iNumberPlan=EIsdnNumberPlan, aInfo.iNumber.iTelNumber=valid number, aInfo.iNumber.iTypeOfNumber=ENationalNumber, aInfo.iTimeout=-1 
       
  1907 		newSetting.iAction=RMobilePhone::EServiceActionRegister;
       
  1908 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionRegister ECallForwardingBusy for EVoiceService"));
       
  1909 		ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingBusy), _L("SetCallForwardingStatusUtil with EServiceActionRegister ECallForwardingBusy for EVoiceService failed"));
       
  1910 		}
       
  1911 	else
       
  1912 		{	
       
  1913 		ASSERT_EQUALS(1,0,_L("Failed to identify current network"));
       
  1914 		TEST_CHECK_POINT_L(_L("Failed to identify current network."));
       
  1915 		}
       
  1916 
       
  1917 	// Use the helper class for CRetrieveMobilePhoneCFList::Start to get the call forwarding status list with aCondition=RMobilePhone::ECallForwardingBusy, aServiceGroup=RMobilePhone::EAllServices, aLocation=RMobilePhone::EInfoLocationCachePreferred 
       
  1918 	TInt err;
       
  1919 
       
  1920 	CRetrieveMobilePhoneCFListExec* mainCfList = CRetrieveMobilePhoneCFListHelper::NewL(mobilePhone, RMobilePhone::ECallForwardingBusy, RMobilePhone::EAllServices, RMobilePhone::EInfoLocationCachePreferred);
       
  1921 	CMobilePhoneCFList* callForwardingList = mainCfList->DoGetList(err);
       
  1922 	ASSERT_EQUALS(err, KErrNone, _L("CRetrieveMobilePhoneCFListExec::DoGetList is not able to get the list"));
       
  1923 
       
  1924 	ASSERT_TRUE(callForwardingList != NULL, _L("CRetrieveMobilePhoneCFListExec::DoGetList callForwardingList is NULL"));
       
  1925 
       
  1926 	// Check CMobilePhoneCFList::Enumerate returns > 0
       
  1927 	RMobilePhone::TMobilePhoneCFInfoEntryV1 entry;
       
  1928 	TBuf<20> numberToCompare;
       
  1929 	
       
  1930 	if(number.Locate('0')==0)
       
  1931 		{
       
  1932 		// For the case when 0 is added
       
  1933 		numberToCompare=number.Mid(1);
       
  1934 		}
       
  1935 	else if(number.Locate('4')==0 || number.Locate('4')==1)
       
  1936 		{
       
  1937 		// For the case when +440 is added (or something like this)
       
  1938 		numberToCompare=number.Mid(5);
       
  1939 		}
       
  1940 	
       
  1941 	TInt entries = callForwardingList->Enumerate();
       
  1942 		
       
  1943 	ASSERT_TRUE(entries>0, _L("CMobilePhoneCFList::Enumerate return value not greater than 0"));
       
  1944 		
       
  1945 	for(TInt i = 0; i<entries; i++)
       
  1946 		{
       
  1947 		DEBUG_PRINTF2(_L("Performing CMobilePhoneCFList::GetEntryL on entry at position %d"), i);
       
  1948 			
       
  1949 		entry=callForwardingList->GetEntryL(i);
       
  1950 				
       
  1951 		switch(entry.iServiceGroup)
       
  1952 			{
       
  1953 			case RMobilePhone::EVoiceService:
       
  1954 				{
       
  1955 				ASSERT_EQUALS(entry.iStatus, RMobilePhone::ECallForwardingStatusActive, _L("CMobilePhoneCFList::GetEntryL iStatus did not get RMobilePhone::ECallForwardingStatusActive"));
       
  1956 				DEBUG_PRINTF2(_L("Value for entry.iNumber.iTelNumber: %S"), &entry.iNumber.iTelNumber);
       
  1957 				ASSERT_TRUE(entry.iNumber.iTelNumber.Find(numberToCompare)>=0, _L("CMobilePhoneCFList::GetEntryL iTelNumber did not find number"));
       
  1958 			
       
  1959 				break;
       
  1960 				}
       
  1961 			case RMobilePhone::EAuxVoiceService:
       
  1962 			case RMobilePhone::ECircuitDataService:
       
  1963 			case RMobilePhone::EPacketDataService:
       
  1964 			case RMobilePhone::EFaxService:
       
  1965 				{
       
  1966 				ASSERT_EQUALS(entry.iStatus, RMobilePhone::ECallForwardingStatusNotRegistered, _L("CMobilePhoneCFList::GetEntryL iStatus did not get RMobilePhone::ECallForwardingStatusNotRegistered"));
       
  1967 				break;
       
  1968 				}				
       
  1969 			default:
       
  1970 				{
       
  1971 				DEBUG_PRINTF2(_L("Service %d not accounted for"), entry.iServiceGroup);
       
  1972 				break;
       
  1973 				}
       
  1974 			}
       
  1975 		}
       
  1976 
       
  1977 	// ===  Erase all call forwarding and repeat test ===
       
  1978 
       
  1979 	// Erase all call forwarding by calling RMobilePhone::SetCallForwardingStatus with aCondition=RMobilePhone::ECallForwardingAllCases and aInfo.iAction=RMobilePhone::EServiceActionErase and aInfo.iServiceGroup=RMobilePhone::EAllServices, aInfo.iTimeOut=-1 
       
  1980 	newSetting.iServiceGroup=RMobilePhone::EAllServices;
       
  1981 	newSetting.iAction=RMobilePhone::EServiceActionErase;
       
  1982 	newSetting.iTimeout=-1;
       
  1983 	
       
  1984 	DEBUG_PRINTF1(_L("Setting call forward EServiceActionErase ECallForwardingAllCases for EAllServices"));
       
  1985 	ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingAllCases), _L("SetCallForwardingStatusUtil with EServiceActionErase ECallForwardingAllCases for EAllServices failed"));
       
  1986 
       
  1987 	// Repeat from step 1. registering call forwarding with aInfo.iServiceGroup=RMobilePhone::ECircuitDataService, 
       
  1988 	// checking that call forwarding is registered for that basic service and not registered for the others.
       
  1989 	newSetting.iServiceGroup=RMobilePhone::ECircuitDataService;
       
  1990 	newSetting.iNumber.iTelNumber=number;
       
  1991 	newSetting.iNumber.iNumberPlan=RMobilePhone::EIsdnNumberPlan;
       
  1992 	newSetting.iNumber.iTypeOfNumber=RMobilePhone::ENationalNumber;
       
  1993 	
       
  1994 	if(operatorName==EOperatorVodafone)
       
  1995 		{
       
  1996 		newSetting.iAction=RMobilePhone::EServiceActionActivate;
       
  1997 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionActivate ECallForwardingUnconditional for ECircuitDataService"));
       
  1998 		ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional), _L("SetCallForwardingStatusUtil with EServiceActionActivate ECallForwardingUnconditional for ECircuitDataService failed"));
       
  1999 		}
       
  2000 	else if(operatorName==EOperatorO2 || operatorName==EOperatorOrange || operatorName==EOperatorTMobile)
       
  2001 		{
       
  2002 		newSetting.iAction=RMobilePhone::EServiceActionRegister;
       
  2003 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionRegister ECallForwardingUnconditional for ECircuitDataService"));
       
  2004 		ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional), _L("SetCallForwardingStatusUtil with EServiceActionRegister ECallForwardingUnconditional for ECircuitDataService failed"));
       
  2005 		}
       
  2006 	
       
  2007 	mainCfList = CRetrieveMobilePhoneCFListHelper::NewL(mobilePhone, RMobilePhone::ECallForwardingUnconditional, RMobilePhone::EAllServices, RMobilePhone::EInfoLocationCachePreferred);
       
  2008 	callForwardingList = mainCfList->DoGetList(err);
       
  2009 	ASSERT_EQUALS(err, KErrNone, _L("CRetrieveMobilePhoneCFListExec::DoGetList is not able to get the list"));
       
  2010 	
       
  2011 	ASSERT_TRUE(callForwardingList != NULL, _L("CRetrieveMobilePhoneCFListExec::DoGetList callForwardingList is NULL"));
       
  2012 	
       
  2013 	// Check CMobilePhoneCFList::Enumerate returns > 0
       
  2014 	
       
  2015 	entries = callForwardingList->Enumerate();
       
  2016 		
       
  2017 	ASSERT_TRUE(entries>0, _L("CMobilePhoneCFList::Enumerate return value not greater than 0"));
       
  2018 		
       
  2019 	for(TInt i = 0; i<entries; i++)
       
  2020 		{
       
  2021 		DEBUG_PRINTF2(_L("Performing CMobilePhoneCFList::GetEntryL on entry at position %d"), i);
       
  2022 			
       
  2023 		entry=callForwardingList->GetEntryL(i);
       
  2024 			
       
  2025 		switch(entry.iServiceGroup)
       
  2026 			{
       
  2027 			case RMobilePhone::ECircuitDataService:
       
  2028 				{
       
  2029 				ASSERT_EQUALS(entry.iStatus, RMobilePhone::ECallForwardingStatusActive, _L("CMobilePhoneCFList::GetEntryL iStatus did not get RMobilePhone::ECallForwardingStatusActive"));
       
  2030 				DEBUG_PRINTF2(_L("Value for entry.iNumber.iTelNumber: %S"), &entry.iNumber.iTelNumber);
       
  2031 				ASSERT_TRUE(entry.iNumber.iTelNumber.Find(numberToCompare)>=0, _L("CMobilePhoneCFList::GetEntryL iTelNumber did not find number"));
       
  2032 	
       
  2033 				break;
       
  2034 				}
       
  2035 			case RMobilePhone::EVoiceService:
       
  2036 			case RMobilePhone::EAuxVoiceService:
       
  2037 			case RMobilePhone::EPacketDataService:
       
  2038 			case RMobilePhone::EFaxService:
       
  2039 				{
       
  2040 				ASSERT_EQUALS(entry.iStatus, RMobilePhone::ECallForwardingStatusNotRegistered, _L("CMobilePhoneCFList::GetEntryL iStatus did not get RMobilePhone::ECallForwardingStatusNotRegistered"));			
       
  2041 				break;
       
  2042 				}
       
  2043 			default:
       
  2044 				{
       
  2045 				DEBUG_PRINTF2(_L("Service %d not accounted for"), entry.iServiceGroup);
       
  2046 				break;
       
  2047 				}
       
  2048 			}
       
  2049 		}
       
  2050 	
       
  2051 	// Erase ECallForwardingAllCases...
       
  2052 	newSetting.iServiceGroup=RMobilePhone::EAllServices;
       
  2053 	newSetting.iAction=RMobilePhone::EServiceActionErase;
       
  2054 	newSetting.iTimeout=-1;
       
  2055 	
       
  2056 	DEBUG_PRINTF1(_L("Setting call forward EServiceActionErase ECallForwardingAllCases for EAllServices"));	
       
  2057 	ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingAllCases), _L("SetCallForwardingStatusUtil with EServiceActionErase ECallForwardingAllCases for EAllServices failed"));
       
  2058 	
       
  2059 	// Repeat the whole test with aCondition=RMobilePhone::ECallForwardingNoReply...
       
  2060 	newSetting.iServiceGroup=RMobilePhone::ECircuitDataService;
       
  2061 
       
  2062 	if(operatorName==EOperatorVodafone)
       
  2063 		{
       
  2064 		newSetting.iAction=RMobilePhone::EServiceActionActivate;
       
  2065 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionActivate ECallForwardingNoReply for ECircuitDataService"));
       
  2066 		ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingNoReply), _L("SetCallForwardingStatusUtil with EServiceActionActivate ECallForwardingNoReply for ECircuitDataService failed"));
       
  2067 		}
       
  2068 	else if(operatorName==EOperatorO2 || operatorName==EOperatorOrange || operatorName==EOperatorTMobile)
       
  2069 		{
       
  2070 		newSetting.iAction=RMobilePhone::EServiceActionRegister;
       
  2071 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionRegister ECallForwardingNoReply for ECircuitDataService"));
       
  2072 		ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingNoReply), _L("SetCallForwardingStatusUtil with EServiceActionRegister ECallForwardingNoReply for ECircuitDataService failed"));		
       
  2073 		}
       
  2074 	
       
  2075 	// Retrieve List	
       
  2076 	mainCfList = CRetrieveMobilePhoneCFListHelper::NewL(mobilePhone, RMobilePhone::ECallForwardingNoReply, RMobilePhone::EAllServices, RMobilePhone::EInfoLocationCachePreferred);
       
  2077 	callForwardingList = mainCfList->DoGetList(err);
       
  2078 	ASSERT_EQUALS(err, KErrNone, _L("CRetrieveMobilePhoneCFListExec::DoGetList is not able to get the list"));
       
  2079 	
       
  2080 	ASSERT_TRUE(callForwardingList != NULL, _L("CRetrieveMobilePhoneCFListExec::DoGetList callForwardingList is NULL"));
       
  2081 	
       
  2082 	// Check CMobilePhoneCFList::Enumerate returns > 0
       
  2083 	entries = callForwardingList->Enumerate();
       
  2084 		
       
  2085 	ASSERT_TRUE(entries>0, _L("CMobilePhoneCFList::Enumerate return value not greater than 0"));
       
  2086 		
       
  2087 	for(TInt i = 0; i<entries; i++)
       
  2088 		{
       
  2089 		DEBUG_PRINTF2(_L("Performing CMobilePhoneCFList::GetEntryL on entry at position %d"), i);
       
  2090 			
       
  2091 		entry=callForwardingList->GetEntryL(i);
       
  2092 			
       
  2093 		switch(entry.iServiceGroup)
       
  2094 			{
       
  2095 			case RMobilePhone::ECircuitDataService:
       
  2096 				{
       
  2097 				ASSERT_EQUALS(entry.iStatus, RMobilePhone::ECallForwardingStatusActive, _L("CMobilePhoneCFList::GetEntryL iStatus did not get RMobilePhone::ECallForwardingStatusActive"));
       
  2098 				DEBUG_PRINTF2(_L("Value for entry.iNumber.iTelNumber: %S"), &entry.iNumber.iTelNumber);
       
  2099 				ASSERT_TRUE(entry.iNumber.iTelNumber.Find(numberToCompare)>=0, _L("CMobilePhoneCFList::GetEntryL iTelNumber did not find number"));
       
  2100 	
       
  2101 				break;
       
  2102 				}
       
  2103 			case RMobilePhone::EVoiceService:
       
  2104 			case RMobilePhone::EAuxVoiceService:
       
  2105 			case RMobilePhone::EPacketDataService:
       
  2106 			case RMobilePhone::EFaxService:
       
  2107 				{
       
  2108 				ASSERT_EQUALS(entry.iStatus, RMobilePhone::ECallForwardingStatusNotRegistered, _L("CMobilePhoneCFList::GetEntryL iStatus did not get RMobilePhone::ECallForwardingStatusNotRegistered"));			
       
  2109 				break;
       
  2110 				}
       
  2111 			default:
       
  2112 				{
       
  2113 				DEBUG_PRINTF2(_L("Service %d not accounted for"), entry.iServiceGroup);
       
  2114 				break;
       
  2115 				}
       
  2116 			}
       
  2117 		}
       
  2118 	
       
  2119 	// Erase ECallForwardingAllCases...
       
  2120 	newSetting.iServiceGroup=RMobilePhone::EAllServices;
       
  2121 	newSetting.iAction=RMobilePhone::EServiceActionErase;
       
  2122 	newSetting.iTimeout=-1;
       
  2123 	
       
  2124 	DEBUG_PRINTF1(_L("Setting call forward EServiceActionErase ECallForwardingAllCases for EAllServices"));
       
  2125 	ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingAllCases), _L("SetCallForwardingStatusUtil with EServiceActionErase ECallForwardingAllCases for EAllServices failed"));
       
  2126 	
       
  2127 	// Repeat the whole test with aCondition=RMobilePhone::ECallForwardingNotReachable...
       
  2128 	newSetting.iServiceGroup=RMobilePhone::EVoiceService;
       
  2129 	
       
  2130 	if(operatorName==EOperatorVodafone)
       
  2131 		{
       
  2132 		newSetting.iAction=RMobilePhone::EServiceActionActivate;
       
  2133 	
       
  2134 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionActivate ECallForwardingNotReachable for EVoiceService"));
       
  2135 		ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingNotReachable), _L("SetCallForwardingStatusUtil with EServiceActionActivate ECallForwardingNotReachable for EVoiceService failed"));
       
  2136 		}
       
  2137 	else if(operatorName==EOperatorO2 || operatorName==EOperatorOrange || operatorName==EOperatorTMobile)
       
  2138 		{
       
  2139 		newSetting.iAction=RMobilePhone::EServiceActionRegister;
       
  2140 		
       
  2141 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionRegister ECallForwardingNotReachable for EVoiceService"));
       
  2142 		ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingNotReachable), _L("SetCallForwardingStatusUtil with EServiceActionRegister ECallForwardingNotReachable for EVoiceService failed"));
       
  2143 		}
       
  2144 	
       
  2145 	// Retrieve List
       
  2146 	mainCfList = CRetrieveMobilePhoneCFListHelper::NewL(mobilePhone, RMobilePhone::ECallForwardingNotReachable, RMobilePhone::EAllServices, RMobilePhone::EInfoLocationCachePreferred);
       
  2147 	callForwardingList = mainCfList->DoGetList(err);
       
  2148 	ASSERT_EQUALS(err, KErrNone, _L("CRetrieveMobilePhoneCFListExec::DoGetList is not able to get the list"));
       
  2149 	
       
  2150 	ASSERT_TRUE(callForwardingList != NULL, _L("CRetrieveMobilePhoneCFListExec::DoGetList callForwardingList is NULL"));
       
  2151 	
       
  2152 	// Check CMobilePhoneCFList::Enumerate returns > 0
       
  2153 	entries = callForwardingList->Enumerate();
       
  2154 		
       
  2155 	ASSERT_TRUE(entries>0, _L("CMobilePhoneCFList::Enumerate return value not greater than 0"));
       
  2156 		
       
  2157 	for(TInt i = 0; i<entries; i++)
       
  2158 		{
       
  2159 		DEBUG_PRINTF2(_L("Performing CMobilePhoneCFList::GetEntryL on entry at position %d"), i);
       
  2160 			
       
  2161 		entry=callForwardingList->GetEntryL(i);
       
  2162 			
       
  2163 		switch(entry.iServiceGroup)
       
  2164 			{
       
  2165 			case RMobilePhone::EVoiceService:
       
  2166 				{
       
  2167 				ASSERT_EQUALS(entry.iStatus, RMobilePhone::ECallForwardingStatusActive, _L("CMobilePhoneCFList::GetEntryL iStatus did not get RMobilePhone::ECallForwardingStatusActive"));
       
  2168 				DEBUG_PRINTF2(_L("Value for entry.iNumber.iTelNumber: %S"), &entry.iNumber.iTelNumber);
       
  2169 				ASSERT_TRUE(entry.iNumber.iTelNumber.Find(numberToCompare)>=0, _L("CMobilePhoneCFList::GetEntryL iTelNumber did not find number"));
       
  2170 	
       
  2171 				break;
       
  2172 				}
       
  2173 			case RMobilePhone::EFaxService:
       
  2174 			case RMobilePhone::EAuxVoiceService:
       
  2175 			case RMobilePhone::ECircuitDataService:
       
  2176 			case RMobilePhone::EPacketDataService:
       
  2177 				{
       
  2178 				ASSERT_EQUALS(entry.iStatus, RMobilePhone::ECallForwardingStatusNotRegistered, _L("CMobilePhoneCFList::GetEntryL iStatus did not get RMobilePhone::ECallForwardingStatusNotRegistered"));			
       
  2179 				break;
       
  2180 				}
       
  2181 			default:
       
  2182 				{
       
  2183 				DEBUG_PRINTF2(_L("Service %d not accounted for"), entry.iServiceGroup);
       
  2184 				break;
       
  2185 				}
       
  2186 			}
       
  2187 		}
       
  2188 	
       
  2189 	//
       
  2190 	// TEST END
       
  2191 	//
       
  2192 
       
  2193     StartCleanup();
       
  2194 	
       
  2195 	// Ensure all call forwarding setting are erased
       
  2196 	newSetting.iServiceGroup=RMobilePhone::EAllServices;
       
  2197 	newSetting.iAction=RMobilePhone::EServiceActionErase;
       
  2198 	
       
  2199 	DEBUG_PRINTF1(_L("Setting call forward EServiceActionErase ECallForwardingUnconditional for EAllServices"));
       
  2200 	ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional), _L("SetCallForwardingStatusUtil with EServiceActionErase ECallForwardingUnconditional for EAllServices failed"));
       
  2201 
       
  2202 	return TestStepResult();
       
  2203 	}
       
  2204 
       
  2205 TPtrC CCTSYIntegrationTestCallForwarding0010::GetTestStepName()
       
  2206 /**
       
  2207  * @return The test step name.
       
  2208  */
       
  2209 	{
       
  2210 	return _L("CCTSYIntegrationTestCallForwarding0010");
       
  2211 	}
       
  2212 
       
  2213 
       
  2214 
       
  2215 CCTSYIntegrationTestCallForwarding0011::CCTSYIntegrationTestCallForwarding0011(CEtelSessionMgr& aEtelSessionMgr)
       
  2216 	: CCTSYIntegrationTestCallForwardingBase(aEtelSessionMgr)
       
  2217 /**
       
  2218  * Constructor.
       
  2219  */
       
  2220 	{
       
  2221 	SetTestStepName(CCTSYIntegrationTestCallForwarding0011::GetTestStepName());
       
  2222 	}
       
  2223 
       
  2224 CCTSYIntegrationTestCallForwarding0011::~CCTSYIntegrationTestCallForwarding0011()
       
  2225 /**
       
  2226  * Destructor.
       
  2227  */
       
  2228 	{
       
  2229 	}
       
  2230 
       
  2231 TVerdict CCTSYIntegrationTestCallForwarding0011::doTestStepL()
       
  2232 /**
       
  2233  * @SYMTestCaseID BA-CTSY-INT-CFOR-0011
       
  2234  * @SYMFssID BA/CTSY/CFOR-0011
       
  2235  * @SYMTestCaseDesc Dial a call on a line with call forwarding unconditional active on it.
       
  2236  * @SYMTestPriority High
       
  2237  * @SYMTestActions RMobilePhone::SetCallForwardingStatus, RCall::Dial, RCall::HangUp, RMobileCall::NotifyMobileCallStatusChange
       
  2238  * @SYMTestExpectedResults Pass - Call forwarding active notification completes.
       
  2239  * @SYMTestType CIT
       
  2240  * @SYMTestCaseDependencies live/automatic
       
  2241  *
       
  2242  * Reason for test: Verify call forwarding active notification compeltes.
       
  2243  *
       
  2244  * @return - TVerdict code
       
  2245  */
       
  2246 	{
       
  2247 
       
  2248 	//
       
  2249 	// SET UP
       
  2250 	//
       
  2251 
       
  2252 	// Ensure RMobilePhone::GetCallServiceCaps returns caps in set of KCapsSetCFStatus | KCapsNotifyCFStatus  
       
  2253 	RMobilePhone& mobilePhone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone);
       
  2254 	
       
  2255 	// Call TNetworkTsyTestHelper::WaitForRegisteredOnHomeNetworkL		
       
  2256 	CHECK_EQUALS_L(iNetworkTestHelper.WaitForRegisteredOnHomeNetworkL(mobilePhone), KErrNone, _L("TNetworkTsyTestHelper::WaitForRegisteredOnHomeNetworkL returned with an error"));
       
  2257 	
       
  2258 	TUint32 callServiceCaps = 0;
       
  2259 	CHECK_EQUALS_L(mobilePhone.GetCallServiceCaps(callServiceCaps), KErrNone, _L("RMobilePhone::GetCallServiceCaps return value is not KErrNone"));
       
  2260 	TUint32 expectedServiceCaps = RMobilePhone::KCapsSetCFStatus | RMobilePhone::KCapsNotifyCFStatus;
       
  2261 	CHECK_BITS_SET_L(callServiceCaps, expectedServiceCaps, KNoUnwantedBits, _L("RMobilePhone::GetCallServiceCaps returned wrong caps"));
       
  2262 	
       
  2263 	TPtrC number;
       
  2264 	CHECK_TRUE_L(GetStringFromConfig(KIniVoiceNumSection, KIniVoiceNumber1, number) != EFalse, _L("GetStringFromConfig did not complete as expected"));
       
  2265 	
       
  2266 	// Ensure all call forwarding is erased by calling 
       
  2267 
       
  2268 	// RMobilePhone::SetCallForwardingStatus with aCondition=RMobilePhone::ECallForwardingAllCases and 
       
  2269 
       
  2270 	// aInfo.iAction=RMobilePhone::EServiceActionErase and aInfo.iServiceGroup=RMobilePhone::EAllServices, aInfo.iTimeOut=-1 
       
  2271 	RMobilePhone::TMobilePhoneCFChangeV1 newSetting;
       
  2272 	newSetting.iServiceGroup=RMobilePhone::EAllServices;
       
  2273 	newSetting.iAction=RMobilePhone::EServiceActionErase;
       
  2274 	newSetting.iTimeout=-1;
       
  2275 	
       
  2276 	TExtEtelRequestStatus setCallForwardStatus(mobilePhone, EMobilePhoneSetCallForwardingStatus);
       
  2277 	CleanupStack::PushL(setCallForwardStatus);
       
  2278 	mobilePhone.SetCallForwardingStatus(setCallForwardStatus, RMobilePhone::ECallForwardingAllCases, newSetting);
       
  2279 	CHECK_EQUALS_L(WaitForRequestWithTimeOut(setCallForwardStatus, ETimeMedium), KErrNone, _L("RMobilePhone::SetCallForwardingStatus timed-out"));
       
  2280 	CHECK_EQUALS_L(setCallForwardStatus.Int(), KErrNone, _L("RMobilePhone::SetCallForwardingStatus setCallForwardStatus completed with incorrect error"));
       
  2281 
       
  2282 	// Get Voice Line 1.
       
  2283 	RMobileLine& mobileLine= iEtelSessionMgr.GetLineL(KMainServer, KMainPhone, KVoiceLine);
       
  2284 
       
  2285 	// Get Call 1.
       
  2286 	RMobileCall& mobileCall= iEtelSessionMgr.GetCallL(KMainServer, KMainPhone, KVoiceLine, KCall1);	
       
  2287 
       
  2288 	//
       
  2289 	// SET UP END
       
  2290 	//
       
  2291 	
       
  2292 	StartTest();
       
  2293 	
       
  2294 	//
       
  2295 	// TEST START
       
  2296 	//
       
  2297 
       
  2298 	// ===  Activate/Register call forwarding unconditional for voice ===
       
  2299 	
       
  2300 	RMobilePhone::TMobilePhoneNetworkInfoV1 info;
       
  2301 	RMobilePhone::TMobilePhoneNetworkInfoV1Pckg infopckg(info);
       
  2302 	RMobilePhone::TMobilePhoneLocationAreaV1 area;
       
  2303 	TOperatorName operatorName = EOperatorUnknown;
       
  2304 	ASSERT_EQUALS(iNetworkTestHelper.GetCurrentNetworkL(mobilePhone, infopckg, area, operatorName), KErrNone, _L("RMobilePhone::GetCurrentNetwork failed to get current network id (1)"));
       
  2305 		
       
  2306 	newSetting.iServiceGroup=RMobilePhone::EVoiceService;
       
  2307 	newSetting.iNumber.iTelNumber=number;
       
  2308 	newSetting.iNumber.iNumberPlan=RMobilePhone::EIsdnNumberPlan;
       
  2309 	newSetting.iNumber.iTypeOfNumber=RMobilePhone::ENationalNumber;
       
  2310 	
       
  2311 	if(operatorName==EOperatorVodafone)
       
  2312 		{
       
  2313 		// Activate call forwarding using RMobilePhone::SetCallForwardingStatus with aCondition=ECallForwardingUnconditional and aInfo.iAction=RMobilePhone::EServiceActionActivate and aInfo.iServiceGroup=RMobilePhone::EVoiceService and aInfo.iNumber.iNumberPlan=EIsdnNumberPlan, aInfo.iNumber.iTelNumber=valid number, aInfo.iNumber.iTypeOfNumber=ENationalNumber, aInfo.iTimeout=-1 
       
  2314 		newSetting.iAction=RMobilePhone::EServiceActionActivate;
       
  2315 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionActivate ECallForwardingUnconditional for EVoiceService"));
       
  2316 		ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional), _L("SetCallForwardingStatusUtil with EServiceActionActivate ECallForwardingUnconditional for EVoiceService failed"));
       
  2317 		}
       
  2318 	else if(operatorName==EOperatorO2 || operatorName==EOperatorOrange || operatorName==EOperatorTMobile)
       
  2319 		{
       
  2320 		// Register call forwarding using RMobilePhone::SetCallForwardingStatus with aCondition=ECallForwardingUnconditional and aInfo.iAction=RMobilePhone::EServiceActionRegister and aInfo.iServiceGroup=RMobilePhone::EVoiceService and aInfo.iNumber.iNumberPlan=EIsdnNumberPlan, aInfo.iNumber.iTelNumber=valid number, aInfo.iNumber.iTypeOfNumber=ENationalNumber, aInfo.iTimeout=-1 
       
  2321 		newSetting.iAction=RMobilePhone::EServiceActionRegister;
       
  2322 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionRegister ECallForwardingUnconditional for EVoiceService"));
       
  2323 		ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional), _L("SetCallForwardingStatusUtil with EServiceActionRegister ECallForwardingUnconditional for EVoiceService failed"));
       
  2324 		}
       
  2325 	else
       
  2326 		{	
       
  2327 		ASSERT_EQUALS(1,0,_L("Failed to identify current network"));
       
  2328 		TEST_CHECK_POINT_L(_L("Failed to identify current network."));
       
  2329 		}
       
  2330 
       
  2331 	// Post notifier for RMobileCall::NotifyMobileCallStatusChange
       
  2332 	TExtEtelRequestStatus notifyMobileCallStatus(mobileCall, EMobileCallNotifyMobileCallStatusChange);
       
  2333 	CleanupStack::PushL(notifyMobileCallStatus);
       
  2334 	RMobileCall::TMobileCallStatus mobileCallStatus;
       
  2335 	mobileCall.NotifyMobileCallStatusChange(notifyMobileCallStatus, mobileCallStatus);
       
  2336 	
       
  2337 	// Post notifier for RMobilePhone::NotifyCallForwardingActive
       
  2338 	TExtEtelRequestStatus notifyCallForwardStatus(mobilePhone, EMobilePhoneNotifyCallForwardingActive);
       
  2339 	CleanupStack::PushL(notifyCallForwardStatus);
       
  2340 	RMobilePhone::TMobileService serviceGroup;
       
  2341 	RMobilePhone::TMobilePhoneCFActive activeType;
       
  2342 	mobilePhone.NotifyCallForwardingActive(notifyCallForwardStatus, serviceGroup, activeType);
       
  2343 	
       
  2344 	// Dial a number that answers on call 1 with RCall::Dial.
       
  2345 	TPtrC outgoingnumber; 
       
  2346 	ASSERT_TRUE(GetStringFromConfig(KIniVoiceNumSection, KIniVoiceNumber2, outgoingnumber) != EFalse, _L("GetStringFromConfig did not complete as expected"));
       
  2347 	DEBUG_PRINTF2(_L("Board Now Dialling: %S"), &outgoingnumber);
       
  2348 	TCoreEtelRequestStatus<RCall> dialStatus(mobileCall, &RCall::DialCancel);
       
  2349 	CleanupStack::PushL(dialStatus);
       
  2350 	mobileCall.Dial(dialStatus, outgoingnumber);
       
  2351 	
       
  2352 	ASSERT_EQUALS(WaitForRequestWithTimeOut(dialStatus, ETimeMedium), KErrNone, _L("RMobileCall::Dial timed-out"));
       
  2353 	ASSERT_EQUALS(dialStatus.Int(), KErrNone, _L("RMobileCall::Dial error whilst dialing"));
       
  2354 	
       
  2355 	// Check RMobileCall::NotifyMobileCallStatusChange completes with EStatusDialling -> EStatusConnecting -> EStatusConnected.
       
  2356 	RMobileCall::TMobileCallStatus expectedMobileCallStatus=RMobileCall::EStatusDialling;
       
  2357 	iCallForwardingControlHelper.WaitForMobileCallNotifyMobileCallStatusChange(mobileCall,
       
  2358 																			   notifyMobileCallStatus,
       
  2359 																			   mobileCallStatus,
       
  2360 																			   expectedMobileCallStatus,
       
  2361 																			   KErrNone);
       
  2362 	
       
  2363 	mobileCall.NotifyMobileCallStatusChange(notifyMobileCallStatus, mobileCallStatus);
       
  2364 	
       
  2365 	expectedMobileCallStatus=RMobileCall::EStatusConnecting;
       
  2366 	iCallForwardingControlHelper.WaitForMobileCallNotifyMobileCallStatusChange(mobileCall,
       
  2367 																			   notifyMobileCallStatus,
       
  2368 																			   mobileCallStatus,
       
  2369 																			   expectedMobileCallStatus,
       
  2370 																			   KErrNone);
       
  2371 	
       
  2372 	mobileCall.NotifyMobileCallStatusChange(notifyMobileCallStatus, mobileCallStatus);
       
  2373 		
       
  2374 	expectedMobileCallStatus=RMobileCall::EStatusConnected;
       
  2375 	iCallForwardingControlHelper.WaitForMobileCallNotifyMobileCallStatusChange(mobileCall,
       
  2376 																			   notifyMobileCallStatus,
       
  2377 																			   mobileCallStatus,
       
  2378 																			   expectedMobileCallStatus,
       
  2379 																			   KErrNone);
       
  2380 	
       
  2381 	mobileCall.NotifyMobileCallStatusChange(notifyMobileCallStatus, mobileCallStatus);
       
  2382 	
       
  2383 	// $CTSYProblem Currently NotifyCallForwardingActive is not being completed by LTSY. Hence
       
  2384 	// this will not return the correct values which are expected for this test.
       
  2385 	// If this API becomes supported, then the following code can be uncommented.
       
  2386     
       
  2387 	// Check RMobilePhone::NotifyCallForwardingActive completes with aServiceGroup=EVoiceService , aActiveType=ECFUnconditionalActive
       
  2388 	/*iCallForwardingSupplementalHelper.WaitForMobilePhoneNotifyCallForwardingActive(mobilePhone,
       
  2389 																				   notifyCallForwardStatus,
       
  2390 																				   serviceGroup,
       
  2391 																				   RMobilePhone::EVoiceService,
       
  2392 																				   activeType,
       
  2393 																				   KErrNone);*/
       
  2394 
       
  2395 	//ASSERT_EQUALS(activeType, RMobilePhone::ECFUnconditionalActive, _L("activeType is not RMobilePhone::ECFUnconditionalActive"));
       
  2396 	
       
  2397 	
       
  2398 	// ===  Check call forwarding active indication completes ===
       
  2399 
       
  2400 	// Hang up call with RCall::HangUp
       
  2401 	DEBUG_PRINTF1(_L("Hangup call"));
       
  2402 	ASSERT_EQUALS(mobileCall.HangUp(), KErrNone, _L("RCall::HangUp return value not KErrNone"));
       
  2403 	
       
  2404 	// Check RCall::NotifyMobileCallStatusChange completes with EStatusDisconnecting -> EStatusIdle.
       
  2405 	expectedMobileCallStatus=RMobileCall::EStatusDisconnecting;
       
  2406 	iCallForwardingControlHelper.WaitForMobileCallNotifyMobileCallStatusChange(mobileCall,
       
  2407 																			   notifyMobileCallStatus,
       
  2408 																			   mobileCallStatus,
       
  2409 																			   expectedMobileCallStatus,
       
  2410 																			   KErrNone);
       
  2411 
       
  2412 	mobileCall.NotifyMobileCallStatusChange(notifyMobileCallStatus, mobileCallStatus);
       
  2413 	
       
  2414 	expectedMobileCallStatus=RMobileCall::EStatusIdle;
       
  2415 	iCallForwardingControlHelper.WaitForMobileCallNotifyMobileCallStatusChange(mobileCall,
       
  2416 																			   notifyMobileCallStatus,
       
  2417 																			   mobileCallStatus,
       
  2418 																			   expectedMobileCallStatus,
       
  2419 																			   KErrNone);
       
  2420 
       
  2421 	// ===  Erase all call forwarding for next part of test ===
       
  2422 
       
  2423 	// Erase call forwarding by calling RMobilePhone::SetCallForwardingStatus with aCondition=RMobilePhone::ECallForwardingAllCases and aInfo.iAction=RMobilePhone::EServiceActionErase and aInfo.iServiceGroup=RMobilePhone::EAllServices, aInfo.iTimeOut=-1 
       
  2424 	newSetting.iServiceGroup=RMobilePhone::EAllServices;
       
  2425 	newSetting.iAction=RMobilePhone::EServiceActionErase;
       
  2426 	
       
  2427 	DEBUG_PRINTF1(_L("Setting call forward EServiceActionErase ECallForwardingAllCases for EAllServices"));
       
  2428 	ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingAllCases), _L("SetCallForwardingStatusUtil with EServiceActionErase ECallForwardingAllCases for EAllServices failed"));
       
  2429 	
       
  2430 	//
       
  2431 	// TEST END
       
  2432 	//
       
  2433 	
       
  2434     StartCleanup();
       
  2435     
       
  2436 	CleanupStack::PopAndDestroy(&dialStatus);
       
  2437 	CleanupStack::PopAndDestroy(&notifyCallForwardStatus);
       
  2438 	CleanupStack::PopAndDestroy(&notifyMobileCallStatus);
       
  2439 	CleanupStack::PopAndDestroy(&setCallForwardStatus);
       
  2440 	
       
  2441 	return TestStepResult();
       
  2442 	}
       
  2443 
       
  2444 TPtrC CCTSYIntegrationTestCallForwarding0011::GetTestStepName()
       
  2445 /**
       
  2446  * @return The test step name.
       
  2447  */
       
  2448 	{
       
  2449 	return _L("CCTSYIntegrationTestCallForwarding0011");
       
  2450 	}
       
  2451 
       
  2452 
       
  2453 
       
  2454 CCTSYIntegrationTestCallForwarding0012::CCTSYIntegrationTestCallForwarding0012(CEtelSessionMgr& aEtelSessionMgr)
       
  2455 	: CCTSYIntegrationTestCallForwardingBase(aEtelSessionMgr)
       
  2456 /**
       
  2457  * Constructor.
       
  2458  */
       
  2459 	{
       
  2460 	SetTestStepName(CCTSYIntegrationTestCallForwarding0012::GetTestStepName());
       
  2461 	}
       
  2462 
       
  2463 CCTSYIntegrationTestCallForwarding0012::~CCTSYIntegrationTestCallForwarding0012()
       
  2464 /**
       
  2465  * Destructor.
       
  2466  */
       
  2467 	{
       
  2468 	}
       
  2469 
       
  2470 TVerdict CCTSYIntegrationTestCallForwarding0012::doTestStepL()
       
  2471 /**
       
  2472  * @SYMTestCaseID BA-CTSY-INT-CFOR-0012
       
  2473  * @SYMFssID BA/CTSY/CFOR-0012
       
  2474  * @SYMTestCaseDesc Dial a call on a line with call forwarding active.
       
  2475  * @SYMTestPriority High
       
  2476  * @SYMTestActions RMobilePhone::SetCallForwardingStatus, RCall::Dial, RCall::HangUp, RMobileCall::NotifyMobileCallStatusChange
       
  2477  * @SYMTestExpectedResults Pass - Call forwarding active notification completes.
       
  2478  * @SYMTestType CIT
       
  2479  * @SYMTestCaseDependencies live/automatic
       
  2480  *
       
  2481  * Reason for test: Verify call forwarding active notification compeltes.
       
  2482  *
       
  2483  * @return - TVerdict code
       
  2484  */
       
  2485 	{
       
  2486 
       
  2487 	//
       
  2488 	// SET UP
       
  2489 	//
       
  2490 
       
  2491 	// Ensure RMobilePhone::GetCallServiceCaps returns caps in set of KCapsSetCFStatus | KCapsNotifyCFStatus  
       
  2492 	RMobilePhone& mobilePhone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone);
       
  2493 	TUint32 callServiceCaps = 0;
       
  2494 	TPtrC number;
       
  2495 	
       
  2496 	// Call TNetworkTsyTestHelper::WaitForRegisteredOnHomeNetworkL		
       
  2497 	CHECK_EQUALS_L(iNetworkTestHelper.WaitForRegisteredOnHomeNetworkL(mobilePhone), KErrNone, _L("TNetworkTsyTestHelper::WaitForRegisteredOnHomeNetworkL returned with an error"));
       
  2498 	
       
  2499 	CHECK_EQUALS_L(mobilePhone.GetCallServiceCaps(callServiceCaps), KErrNone, _L("RMobilePhone::GetCallServiceCaps return value is not KErrNone"));
       
  2500 	TUint32 expectedServiceCaps = RMobilePhone::KCapsSetCFStatus | RMobilePhone::KCapsNotifyCFStatus;
       
  2501 	CHECK_BITS_SET_L(callServiceCaps, expectedServiceCaps, KNoUnwantedBits, _L("RMobilePhone::GetCallServiceCaps returned wrong caps"));
       
  2502 	
       
  2503 	CHECK_TRUE_L(GetStringFromConfig(KIniVoiceNumSection, KIniVoiceNumber1, number) != EFalse, _L("GetStringFromConfig did not complete as expected"));
       
  2504 
       
  2505 	// Ensure all call forwarding is erased by calling 
       
  2506 
       
  2507 	// RMobilePhone::SetCallForwardingStatus with aCondition=RMobilePhone::ECallForwardingAllCases and 
       
  2508 
       
  2509 	// aInfo.iAction=RMobilePhone::EServiceActionErase and aInfo.iServiceGroup=RMobilePhone::EAllServices, aInfo.iTimeOut=-1 
       
  2510 	RMobilePhone::TMobilePhoneCFChangeV1 newSetting;
       
  2511 	newSetting.iServiceGroup=RMobilePhone::EAllServices;
       
  2512 	newSetting.iAction=RMobilePhone::EServiceActionErase;
       
  2513 	newSetting.iTimeout=-1;
       
  2514 	
       
  2515 	DEBUG_PRINTF1(_L("Setting call forward EServiceActionErase ECallForwardingAllCases for EAllServices"));
       
  2516 	ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingAllCases), _L("SetCallForwardingStatusUtil with EServiceActionErase ECallForwardingAllCases for EAllServices failed"));
       
  2517 
       
  2518 	// Get voice line 1. 	
       
  2519 	RMobileLine& mobileLine= iEtelSessionMgr.GetLineL(KMainServer, KMainPhone, KVoiceLine);
       
  2520 	
       
  2521 	// Get call 1. 			
       
  2522 	RMobileCall& mobileCall= iEtelSessionMgr.GetCallL(KMainServer,KMainPhone, KVoiceLine, KCall1);
       
  2523 	
       
  2524 	//
       
  2525 	// SET UP END
       
  2526 	//
       
  2527 	
       
  2528 	StartTest();
       
  2529 	
       
  2530 	//
       
  2531 	// TEST START
       
  2532 	//
       
  2533 	
       
  2534 	// ===  Activate/Register call forwarding ===
       
  2535 
       
  2536 	RMobilePhone::TMobilePhoneNetworkInfoV1 info;
       
  2537 	RMobilePhone::TMobilePhoneNetworkInfoV1Pckg infopckg(info);
       
  2538 	RMobilePhone::TMobilePhoneLocationAreaV1 area;
       
  2539 	TOperatorName operatorName = EOperatorUnknown;
       
  2540 	ASSERT_EQUALS(iNetworkTestHelper.GetCurrentNetworkL(mobilePhone, infopckg, area, operatorName), KErrNone, _L("RMobilePhone::GetCurrentNetwork failed to get current network id (1)"));
       
  2541 
       
  2542 	newSetting.iServiceGroup=RMobilePhone::EVoiceService;
       
  2543 	newSetting.iNumber.iTelNumber=number;
       
  2544 	newSetting.iNumber.iNumberPlan=RMobilePhone::EIsdnNumberPlan;
       
  2545 	newSetting.iNumber.iTypeOfNumber=RMobilePhone::ENationalNumber;
       
  2546 	
       
  2547 	if(operatorName==EOperatorVodafone)
       
  2548 		{
       
  2549 		newSetting.iAction=RMobilePhone::EServiceActionActivate;
       
  2550 		// Activate call forwarding using RMobilePhone::SetCallForwardingStatus with aCondition=ECallForwardingBusy and aInfo.iAction=RMobilePhone::EServiceActionActivate and aInfo.iServiceGroup=RMobilePhone::EVoiceService and aInfo.iNumber.iNumberPlan=EIsdnNumberPlan, aInfo.iNumber.iTelNumber=valid number, aInfo.iNumber.iTypeOfNumber=ENationalNumber, aInfo.iTimeout=-1 
       
  2551 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionActivate ECallForwardingBusy for EVoiceService"));
       
  2552 		ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingBusy), _L("SetCallForwardingStatusUtil with EServiceActionActivate ECallForwardingBusy for EVoiceService failed"));
       
  2553 		}
       
  2554 	else if(operatorName==EOperatorO2 || operatorName==EOperatorOrange || operatorName==EOperatorTMobile)
       
  2555 		{
       
  2556 		newSetting.iAction=RMobilePhone::EServiceActionRegister;
       
  2557 		// Register call forwarding using RMobilePhone::SetCallForwardingStatus with aCondition=ECallForwardingBusy and aInfo.iAction=RMobilePhone::EServiceActionRegister and aInfo.iServiceGroup=RMobilePhone::EVoiceService and aInfo.iNumber.iNumberPlan=EIsdnNumberPlan, aInfo.iNumber.iTelNumber=valid number, aInfo.iNumber.iTypeOfNumber=ENationalNumber, aInfo.iTimeout=-1 
       
  2558 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionRegister ECallForwardingBusy for EVoiceService"));
       
  2559 		ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingBusy), _L("SetCallForwardingStatusUtil with EServiceActionRegister ECallForwardingBusy for EVoiceService failed"));
       
  2560 		}
       
  2561 	else
       
  2562 		{	
       
  2563 		ASSERT_EQUALS(1,0,_L("Failed to identify current network"));
       
  2564 		TEST_CHECK_POINT_L(_L("Failed to identify current network."));
       
  2565 		}
       
  2566 	
       
  2567 	// Post notifier for RMobileCall::NotifyMobileCallStatusChange
       
  2568 	TExtEtelRequestStatus notifyMobileCallStatus(mobileCall, EMobileCallNotifyMobileCallStatusChange);
       
  2569 	CleanupStack::PushL(notifyMobileCallStatus);
       
  2570 	RMobileCall::TMobileCallStatus mobileCallStatus;
       
  2571 	mobileCall.NotifyMobileCallStatusChange(notifyMobileCallStatus, mobileCallStatus);
       
  2572 
       
  2573 	// Post notifier for RMobilePhone::NotifyCallForwardingActive
       
  2574 	TExtEtelRequestStatus notifyCallForwardStatus(mobilePhone, EMobilePhoneNotifyCallForwardingActive);
       
  2575 	CleanupStack::PushL(notifyCallForwardStatus);
       
  2576 	RMobilePhone::TMobileService serviceGroup;
       
  2577 	RMobilePhone::TMobilePhoneCFActive activeType;
       
  2578 	mobilePhone.NotifyCallForwardingActive(notifyCallForwardStatus, serviceGroup, activeType);
       
  2579 	
       
  2580 	// Dial a number that answers on call 1 with RCall::Dial. 
       
  2581 	TPtrC outGoingNumber; 
       
  2582 	ASSERT_TRUE(GetStringFromConfig(KIniVoiceNumSection, KIniVoiceNumber2, outGoingNumber) != EFalse, _L("GetStringFromConfig did not complete as expected"));
       
  2583 	DEBUG_PRINTF2(_L("Board Now Dialling: %S"), &outGoingNumber);
       
  2584 	TCoreEtelRequestStatus<RCall> dialStatus(mobileCall, &RCall::DialCancel);
       
  2585 	CleanupStack::PushL(dialStatus);
       
  2586 	mobileCall.Dial(dialStatus, outGoingNumber);
       
  2587 	
       
  2588 	ASSERT_EQUALS(WaitForRequestWithTimeOut(dialStatus, ETimeMedium), KErrNone, _L("RMobileCall::Dial timed-out"));
       
  2589 	ASSERT_EQUALS(dialStatus.Int(), KErrNone, _L("RMobileCall::Dial error whilst dialing"));
       
  2590 
       
  2591 	// Check RMobileCall::NotifyMobileCallStatusChange completes with EStatusDialling -> EStatusConnecting -> EStatusConnected.
       
  2592 	RMobileCall::TMobileCallStatus expectedMobileCallStatus=RMobileCall::EStatusDialling;
       
  2593 	iCallForwardingControlHelper.WaitForMobileCallNotifyMobileCallStatusChange(mobileCall,
       
  2594 																			   notifyMobileCallStatus,
       
  2595 																			   mobileCallStatus,
       
  2596 																			   expectedMobileCallStatus,
       
  2597 																			   KErrNone);
       
  2598 	
       
  2599 	mobileCall.NotifyMobileCallStatusChange(notifyMobileCallStatus, mobileCallStatus);
       
  2600 	
       
  2601 	expectedMobileCallStatus=RMobileCall::EStatusConnecting;
       
  2602 	iCallForwardingControlHelper.WaitForMobileCallNotifyMobileCallStatusChange(mobileCall,
       
  2603 																			   notifyMobileCallStatus,
       
  2604 																			   mobileCallStatus,
       
  2605 																			   expectedMobileCallStatus,
       
  2606 																			   KErrNone);
       
  2607 	
       
  2608 	mobileCall.NotifyMobileCallStatusChange(notifyMobileCallStatus, mobileCallStatus);
       
  2609 		
       
  2610 	expectedMobileCallStatus=RMobileCall::EStatusConnected;
       
  2611 	iCallForwardingControlHelper.WaitForMobileCallNotifyMobileCallStatusChange(mobileCall,
       
  2612 																			   notifyMobileCallStatus,
       
  2613 																			   mobileCallStatus,
       
  2614 																			   expectedMobileCallStatus,
       
  2615 																			   KErrNone);
       
  2616 	
       
  2617 	// ===  Check call forwarding active indication completes ===
       
  2618 
       
  2619 	// $CTSYProblem Currently NotifyCallForwardingActive is not being completed by LTSY. Hence
       
  2620 	// this will not return the correct values which are expected for this test.
       
  2621 	// The following section can be uncommented if RMobilePhone::NotifyCallForwardingActive is correctly implemented.
       
  2622 	// The request is sent from CTSY to the LTSY, but the CTSY never gets a response back from the LTSY.
       
  2623 	/*
       
  2624 	// Check RMobilePhone::NotifyCallForwardingActive completes with aServiceGroup=EVoiceService , aActiveType=ECFConditionalActive
       
  2625 	iCallForwardingSupplementalHelper.WaitForMobilePhoneNotifyCallForwardingActive(mobilePhone,
       
  2626 																				   notifyCallForwardStatus,
       
  2627 																				   serviceGroup,
       
  2628 																				   RMobilePhone::EVoiceService,
       
  2629 																				   activeType,
       
  2630 																				   KErrNone);
       
  2631 	
       
  2632 	ASSERT_EQUALS(activeType, RMobilePhone::ECFUnconditionalActive, _L("activeType is not RMobilePhone::ECFUnconditionalActive"));
       
  2633 	*/
       
  2634 	
       
  2635 	mobileCall.NotifyMobileCallStatusChange(notifyMobileCallStatus, mobileCallStatus);
       
  2636 	
       
  2637 	// Hang up call with RCall::HangUp 
       
  2638 	DEBUG_PRINTF1(_L("Hangup call"));
       
  2639 	ASSERT_EQUALS(mobileCall.HangUp(), KErrNone, _L("RCall::HangUp return value not KErrNone"));
       
  2640 	
       
  2641 	// Check RCall::NotifyStatusChange completes with EStatusDisconnecting -> EStatusIdle.
       
  2642 	expectedMobileCallStatus=RMobileCall::EStatusDisconnecting;
       
  2643 	iCallForwardingControlHelper.WaitForMobileCallNotifyMobileCallStatusChange(mobileCall,
       
  2644 																			   notifyMobileCallStatus,
       
  2645 																			   mobileCallStatus,
       
  2646 																			   expectedMobileCallStatus,
       
  2647 																			   KErrNone);
       
  2648 
       
  2649 	mobileCall.NotifyMobileCallStatusChange(notifyMobileCallStatus, mobileCallStatus);
       
  2650 	
       
  2651 	expectedMobileCallStatus=RMobileCall::EStatusIdle;
       
  2652 	iCallForwardingControlHelper.WaitForMobileCallNotifyMobileCallStatusChange(mobileCall,
       
  2653 																			   notifyMobileCallStatus,
       
  2654 																			   mobileCallStatus,
       
  2655 																			   expectedMobileCallStatus,
       
  2656 																			   KErrNone);
       
  2657 	
       
  2658 	// ===  Erase all call forwarding for next part of test ===
       
  2659 
       
  2660 	// Erase call forwarding by calling RMobilePhone::SetCallForwardingStatus with aCondition=RMobilePhone::ECallForwardingAllCases and aInfo.iAction=RMobilePhone::EServiceActionErase and aInfo.iServiceGroup=RMobilePhone::EAllServices, aInfo.iTimeOut=-1 
       
  2661 	newSetting.iServiceGroup=RMobilePhone::EAllServices;
       
  2662 	newSetting.iAction=RMobilePhone::EServiceActionErase;
       
  2663 	newSetting.iTimeout=-1;
       
  2664 	
       
  2665 	DEBUG_PRINTF1(_L("Setting call forward EServiceActionErase ECallForwardingAllCases for EAllServices"));
       
  2666 	ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingAllCases), _L("SetCallForwardingStatusUtil with EServiceActionErase ECallForwardingAllCases for EAllServices failed"));
       
  2667 	
       
  2668 	// Repeat test with ECallForwardingNotReachable
       
  2669 	newSetting.iServiceGroup=RMobilePhone::EVoiceService;
       
  2670 	newSetting.iNumber.iTelNumber=number;
       
  2671 	newSetting.iNumber.iNumberPlan=RMobilePhone::EIsdnNumberPlan;
       
  2672 	newSetting.iNumber.iTypeOfNumber=RMobilePhone::ENationalNumber;
       
  2673 	
       
  2674 	if(operatorName==EOperatorVodafone)
       
  2675 		{
       
  2676 		newSetting.iAction=RMobilePhone::EServiceActionActivate;
       
  2677 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionActivate ECallForwardingNotReachable for EVoiceService"));
       
  2678 		ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingNotReachable), _L("SetCallForwardingStatusUtil with EServiceActionActivate ECallForwardingNotReachable for EVoiceService failed"));
       
  2679 		}
       
  2680 	else if(operatorName==EOperatorO2 || operatorName==EOperatorOrange || operatorName==EOperatorTMobile)
       
  2681 		{
       
  2682 		newSetting.iAction=RMobilePhone::EServiceActionRegister;
       
  2683 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionRegister ECallForwardingNotReachable for EVoiceService"));
       
  2684 		ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingNotReachable), _L("SetCallForwardingStatusUtil with EServiceActionRegister ECallForwardingNotReachable for EVoiceService failed"));
       
  2685 		}
       
  2686 
       
  2687 	// Repost notifiers
       
  2688 	mobileCall.NotifyMobileCallStatusChange(notifyMobileCallStatus, mobileCallStatus);
       
  2689 	// $CTSYProblem Currently NotifyCallForwardingActive is not being completed by LTSY. Hence
       
  2690 	// this will not return the correct values which are expected for this test.
       
  2691 	// The following section can be uncommented if RMobilePhone::NotifyCallForwardingActive is correctly implemented.
       
  2692 	// The request is sent from CTSY to the LTSY, but the CTSY never gets a response back from the LTSY.
       
  2693 	/*
       
  2694 	mobilePhone.NotifyCallForwardingActive(notifyCallForwardStatus, serviceGroup, activeType);
       
  2695 	*/
       
  2696 	mobileCall.Dial(dialStatus, outGoingNumber);
       
  2697 	
       
  2698 	ASSERT_EQUALS(WaitForRequestWithTimeOut(dialStatus, ETimeMedium), KErrNone, _L("RMobileCall::Dial timed-out"));
       
  2699 	ASSERT_EQUALS(dialStatus.Int(), KErrNone, _L("RMobileCall::Dial error whilst dialing"));
       
  2700 	
       
  2701 	// Check RMobileCall::NotifyMobileCallStatusChange completes with EStatusDialling -> EStatusConnecting -> EStatusConnected.
       
  2702 	expectedMobileCallStatus=RMobileCall::EStatusDialling;
       
  2703 	iCallForwardingControlHelper.WaitForMobileCallNotifyMobileCallStatusChange(mobileCall,
       
  2704 																			   notifyMobileCallStatus,
       
  2705 																			   mobileCallStatus,
       
  2706 																			   expectedMobileCallStatus,
       
  2707 																			   KErrNone);
       
  2708 	
       
  2709 	mobileCall.NotifyMobileCallStatusChange(notifyMobileCallStatus, mobileCallStatus);
       
  2710 	
       
  2711 	expectedMobileCallStatus=RMobileCall::EStatusConnecting;
       
  2712 	iCallForwardingControlHelper.WaitForMobileCallNotifyMobileCallStatusChange(mobileCall,
       
  2713 																			   notifyMobileCallStatus,
       
  2714 																			   mobileCallStatus,
       
  2715 																			   expectedMobileCallStatus,
       
  2716 																			   KErrNone);
       
  2717 	
       
  2718 	mobileCall.NotifyMobileCallStatusChange(notifyMobileCallStatus, mobileCallStatus);
       
  2719 		
       
  2720 	expectedMobileCallStatus=RMobileCall::EStatusConnected;
       
  2721 	iCallForwardingControlHelper.WaitForMobileCallNotifyMobileCallStatusChange(mobileCall,
       
  2722 																			   notifyMobileCallStatus,
       
  2723 																			   mobileCallStatus,
       
  2724 																			   expectedMobileCallStatus,
       
  2725 																			   KErrNone);
       
  2726 	
       
  2727 	// ===  Check call forwarding active indication completes ===
       
  2728 
       
  2729 	// $CTSYProblem Currently NotifyCallForwardingActive is not being completed by LTSY. Hence
       
  2730 	// this will not return the correct values which are expected for this test.
       
  2731 	// The following section can be uncommented if RMobilePhone::NotifyCallForwardingActive is correctly implemented.
       
  2732 	// The request is sent from CTSY to the LTSY, but the CTSY never gets a response back from the LTSY.
       
  2733 	
       
  2734 	/*
       
  2735 	// Check RMobilePhone::NotifyCallForwardingActive completes with aServiceGroup=EVoiceService , aActiveType=ECFConditionalActive
       
  2736 	iCallForwardingSupplementalHelper.WaitForMobilePhoneNotifyCallForwardingActive(mobilePhone,
       
  2737 			   																	   notifyCallForwardStatus,
       
  2738 			   																	   serviceGroup,
       
  2739 			   																	   RMobilePhone::EVoiceService,
       
  2740 			   																	   activeType,
       
  2741 			   																	   KErrNone);
       
  2742 
       
  2743 	ASSERT_EQUALS(activeType, RMobilePhone::ECFUnconditionalActive, _L("activeType is not RMobilePhone::ECFUnconditionalActive"));
       
  2744 	*/
       
  2745 	
       
  2746 	mobileCall.NotifyMobileCallStatusChange(notifyMobileCallStatus, mobileCallStatus);
       
  2747 	
       
  2748 	// Hang up call with RCall::HangUp 
       
  2749 	DEBUG_PRINTF1(_L("Hangup call"));
       
  2750 	ASSERT_EQUALS(mobileCall.HangUp(), KErrNone, _L("RCall::HangUp return value not KErrNone"));
       
  2751 	
       
  2752 	// Check RCall::NotifyStatusChange completes with EStatusDisconnecting -> EStatusIdle.
       
  2753 	expectedMobileCallStatus=RMobileCall::EStatusDisconnecting;
       
  2754 	iCallForwardingControlHelper.WaitForMobileCallNotifyMobileCallStatusChange(mobileCall,
       
  2755 																			   notifyMobileCallStatus,
       
  2756 																			   mobileCallStatus,
       
  2757 																			   expectedMobileCallStatus,
       
  2758 																			   KErrNone);
       
  2759 
       
  2760 	mobileCall.NotifyMobileCallStatusChange(notifyMobileCallStatus, mobileCallStatus);
       
  2761 	
       
  2762 	expectedMobileCallStatus=RMobileCall::EStatusIdle;
       
  2763 	iCallForwardingControlHelper.WaitForMobileCallNotifyMobileCallStatusChange(mobileCall,
       
  2764 																			   notifyMobileCallStatus,
       
  2765 																			   mobileCallStatus,
       
  2766 																			   expectedMobileCallStatus,
       
  2767 																			   KErrNone);
       
  2768 	
       
  2769 	// Erase call forwarding by calling RMobilePhone::SetCallForwardingStatus with aCondition=RMobilePhone::ECallForwardingAllCases and aInfo.iAction=RMobilePhone::EServiceActionErase and aInfo.iServiceGroup=RMobilePhone::EAllServices, aInfo.iTimeOut=-1 
       
  2770 	newSetting.iServiceGroup=RMobilePhone::EAllServices;
       
  2771 	newSetting.iAction=RMobilePhone::EServiceActionErase;
       
  2772 	newSetting.iTimeout=-1;
       
  2773 	
       
  2774 	DEBUG_PRINTF1(_L("Setting call forward EServiceActionErase ECallForwardingAllCases for EAllServices"));
       
  2775 	ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingAllCases), _L("SetCallForwardingStatusUtil with EServiceActionErase ECallForwardingAllCases for EAllServices failed"));
       
  2776 
       
  2777 	// Repeat test with ECallForwardingNoReply and aInfo.iTimeOut=20 
       
  2778 	newSetting.iServiceGroup=RMobilePhone::EVoiceService;
       
  2779 	newSetting.iNumber.iTelNumber=number;
       
  2780 	newSetting.iNumber.iNumberPlan=RMobilePhone::EIsdnNumberPlan;
       
  2781 	newSetting.iNumber.iTypeOfNumber=RMobilePhone::ENationalNumber;
       
  2782 	newSetting.iTimeout=20;
       
  2783 	
       
  2784 	if(operatorName==EOperatorVodafone)
       
  2785 		{
       
  2786 		newSetting.iAction=RMobilePhone::EServiceActionActivate;
       
  2787 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionActivate ECallForwardingNoReply for EVoiceService"));
       
  2788 		ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingNoReply), _L("SetCallForwardingStatusUtil with EServiceActionActivate ECallForwardingNoReply for EVoiceService failed"));
       
  2789 		}
       
  2790 	else if(operatorName==EOperatorO2 || operatorName==EOperatorOrange || operatorName==EOperatorTMobile)
       
  2791 		{
       
  2792 		newSetting.iAction=RMobilePhone::EServiceActionRegister;
       
  2793 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionRegister ECallForwardingNoReply for EVoiceService"));
       
  2794 		ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingNoReply), _L("SetCallForwardingStatusUtil with EServiceActionRegister ECallForwardingNoReply for EVoiceService failed"));
       
  2795 		}
       
  2796 	
       
  2797 	// Repost notifiers
       
  2798 	mobileCall.NotifyMobileCallStatusChange(notifyMobileCallStatus, mobileCallStatus);
       
  2799 	
       
  2800 	// $CTSYProblem Currently NotifyCallForwardingActive is not being completed by LTSY. Hence
       
  2801 	// this will not return the correct values which are expected for this test.
       
  2802 	// The following section can be uncommented if RMobilePhone::NotifyCallForwardingActive is correctly implemented.
       
  2803 	// The request is sent from CTSY to the LTSY, but the CTSY never gets a response back from the LTSY.
       
  2804 	
       
  2805 	/*
       
  2806 	mobilePhone.NotifyCallForwardingActive(notifyCallForwardStatus, serviceGroup, activeType);
       
  2807 	*/
       
  2808 	mobileCall.Dial(dialStatus, outGoingNumber);
       
  2809 	
       
  2810 	ASSERT_EQUALS(WaitForRequestWithTimeOut(dialStatus, ETimeMedium), KErrNone, _L("RMobileCall::Dial timed-out"));
       
  2811 	ASSERT_EQUALS(dialStatus.Int(), KErrNone, _L("RMobileCall::Dial error whilst dialing"));
       
  2812 	
       
  2813 	// Check RMobileCall::NotifyMobileCallStatusChange completes with EStatusDialling -> EStatusConnecting -> EStatusConnected.
       
  2814 	expectedMobileCallStatus=RMobileCall::EStatusDialling;
       
  2815 	iCallForwardingControlHelper.WaitForMobileCallNotifyMobileCallStatusChange(mobileCall,
       
  2816 																			   notifyMobileCallStatus,
       
  2817 																			   mobileCallStatus,
       
  2818 																			   expectedMobileCallStatus,
       
  2819 																			   KErrNone);
       
  2820 	
       
  2821 	mobileCall.NotifyMobileCallStatusChange(notifyMobileCallStatus, mobileCallStatus);
       
  2822 	
       
  2823 	expectedMobileCallStatus=RMobileCall::EStatusConnecting;
       
  2824 	iCallForwardingControlHelper.WaitForMobileCallNotifyMobileCallStatusChange(mobileCall,
       
  2825 																			   notifyMobileCallStatus,
       
  2826 																			   mobileCallStatus,
       
  2827 																			   expectedMobileCallStatus,
       
  2828 																			   KErrNone);
       
  2829 	
       
  2830 	mobileCall.NotifyMobileCallStatusChange(notifyMobileCallStatus, mobileCallStatus);
       
  2831 		
       
  2832 	expectedMobileCallStatus=RMobileCall::EStatusConnected;
       
  2833 	iCallForwardingControlHelper.WaitForMobileCallNotifyMobileCallStatusChange(mobileCall,
       
  2834 																			   notifyMobileCallStatus,
       
  2835 																			   mobileCallStatus,
       
  2836 																			   expectedMobileCallStatus,
       
  2837 																			   KErrNone);
       
  2838 	
       
  2839 	mobileCall.NotifyMobileCallStatusChange(notifyMobileCallStatus, mobileCallStatus);
       
  2840 	
       
  2841 	// ===  Check call forwarding active indication completes ===
       
  2842 	
       
  2843 	// $CTSYProblem Currently NotifyCallForwardingActive is not being completed by LTSY. Hence
       
  2844 	// this will not return the correct values which are expected for this test.
       
  2845 	// The following section can be uncommented if RMobilePhone::NotifyCallForwardingActive is correctly implemented.
       
  2846 	// The request is sent from CTSY to the LTSY, but the CTSY never gets a response back from the LTSY.
       
  2847 	
       
  2848 	/*
       
  2849 	// Check RMobilePhone::NotifyCallForwardingActive completes with aServiceGroup=EVoiceService , aActiveType=ECFConditionalActive
       
  2850 	iCallForwardingSupplementalHelper.WaitForMobilePhoneNotifyCallForwardingActive(mobilePhone,
       
  2851 			   																	   notifyCallForwardStatus,
       
  2852 			   																	   serviceGroup,
       
  2853 			   																	   RMobilePhone::EVoiceService,
       
  2854 			   																	   activeType,
       
  2855 			   																	   KErrNone);
       
  2856 
       
  2857 	ASSERT_EQUALS(activeType, RMobilePhone::ECFUnconditionalActive, _L("activeType is not RMobilePhone::ECFUnconditionalActive"));
       
  2858 	*/
       
  2859 	
       
  2860 	// Hang up call with RCall::HangUp 
       
  2861 	DEBUG_PRINTF1(_L("Hangup call"));
       
  2862 	ASSERT_EQUALS(mobileCall.HangUp(), KErrNone, _L("RCall::HangUp return value not KErrNone"));
       
  2863 	
       
  2864 	// Check RCall::NotifyStatusChange completes with EStatusDisconnecting -> EStatusIdle.
       
  2865 	expectedMobileCallStatus=RMobileCall::EStatusDisconnecting;
       
  2866 	iCallForwardingControlHelper.WaitForMobileCallNotifyMobileCallStatusChange(mobileCall,
       
  2867 																			   notifyMobileCallStatus,
       
  2868 																			   mobileCallStatus,
       
  2869 																			   expectedMobileCallStatus,
       
  2870 																			   KErrNone);
       
  2871 
       
  2872 	mobileCall.NotifyMobileCallStatusChange(notifyMobileCallStatus, mobileCallStatus);
       
  2873 	
       
  2874 	expectedMobileCallStatus=RMobileCall::EStatusIdle;
       
  2875 	iCallForwardingControlHelper.WaitForMobileCallNotifyMobileCallStatusChange(mobileCall,
       
  2876 																			   notifyMobileCallStatus,
       
  2877 																			   mobileCallStatus,
       
  2878 																			   expectedMobileCallStatus,
       
  2879 																			   KErrNone);
       
  2880 	
       
  2881 	//
       
  2882 	// TEST END
       
  2883 	//
       
  2884 
       
  2885     StartCleanup(); 
       
  2886 	
       
  2887     CleanupStack::PopAndDestroy(&dialStatus);
       
  2888 	CleanupStack::PopAndDestroy(&notifyCallForwardStatus);
       
  2889     CleanupStack::PopAndDestroy(&notifyMobileCallStatus);
       
  2890 	
       
  2891 	return TestStepResult();
       
  2892 	}
       
  2893 
       
  2894 TPtrC CCTSYIntegrationTestCallForwarding0012::GetTestStepName()
       
  2895 /**
       
  2896  * @return The test step name.
       
  2897  */
       
  2898 	{
       
  2899 	return _L("CCTSYIntegrationTestCallForwarding0012");
       
  2900 	}
       
  2901 
       
  2902 
       
  2903 
       
  2904 CCTSYIntegrationTestCallForwarding0013::CCTSYIntegrationTestCallForwarding0013(CEtelSessionMgr& aEtelSessionMgr)
       
  2905 	: CCTSYIntegrationTestCallForwardingBase(aEtelSessionMgr)
       
  2906 /**
       
  2907  * Constructor.
       
  2908  */
       
  2909 	{
       
  2910 	SetTestStepName(CCTSYIntegrationTestCallForwarding0013::GetTestStepName());
       
  2911 	}
       
  2912 
       
  2913 CCTSYIntegrationTestCallForwarding0013::~CCTSYIntegrationTestCallForwarding0013()
       
  2914 /**
       
  2915  * Destructor.
       
  2916  */
       
  2917 	{
       
  2918 	}
       
  2919 
       
  2920 TVerdict CCTSYIntegrationTestCallForwarding0013::doTestStepL()
       
  2921 /**
       
  2922  * @SYMTestCaseID BA-CTSY-INT-CFOR-0013
       
  2923  * @SYMFssID BA/CTSY/CFOR-0013
       
  2924  * @SYMTestCaseDesc Change the 'forward to' number.
       
  2925  * @SYMTestPriority High
       
  2926  * @SYMTestActions RMobilePhone::NotifyCallForwardingStatusChange
       
  2927  * @SYMTestExpectedResults Pass - Call forwarding status change notification completes when forward to number is changed.
       
  2928  * @SYMTestType CIT
       
  2929  * @SYMTestCaseDependencies live/automatic
       
  2930  *
       
  2931  * Reason for test: Verify call forwarding status change notification completes.
       
  2932  *
       
  2933  * @return - TVerdict code
       
  2934  */
       
  2935 	{
       
  2936 
       
  2937 	//
       
  2938 	// SET UP
       
  2939 	//
       
  2940 	
       
  2941 	// Ensure RMobilePhone::GetCallServiceCaps returns caps in set of KCapsSetCFStatus | KCapsNotifyCFStatus
       
  2942 	RMobilePhone& mobilePhone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone);	
       
  2943 	TUint32 callServiceCaps = 0;
       
  2944 
       
  2945 	// Call TNetworkTsyTestHelper::WaitForRegisteredOnHomeNetworkL		
       
  2946 	CHECK_EQUALS_L(iNetworkTestHelper.WaitForRegisteredOnHomeNetworkL(mobilePhone), KErrNone, _L("TNetworkTsyTestHelper::WaitForRegisteredOnHomeNetworkL returned with an error"));
       
  2947 	
       
  2948 	CHECK_EQUALS_L(mobilePhone.GetCallServiceCaps(callServiceCaps), KErrNone, _L("RMobilePhone::GetCallServiceCaps return value is not KErrNone"));
       
  2949 	TUint32 expectedServiceCaps = RMobilePhone::KCapsSetCFStatus | RMobilePhone::KCapsNotifyCFStatus;
       
  2950 	CHECK_BITS_SET_L(callServiceCaps, expectedServiceCaps, KNoUnwantedBits, _L("RMobilePhone::GetCallServiceCaps returned wrong caps"));
       
  2951 
       
  2952 	TPtrC number; 
       
  2953 	CHECK_TRUE_L(GetStringFromConfig(KIniVoiceNumSection, KIniVoiceNumber1, number) != EFalse, _L("GetStringFromConfig did not complete as expected"));
       
  2954 	DEBUG_PRINTF2(_L("Number obtained: %S"), &number);
       
  2955 
       
  2956 	// Ensure all call forwarding is erased by calling 
       
  2957 
       
  2958 	// RMobilePhone::SetCallForwardingStatus with aCondition=RMobilePhone::ECallForwardingAllCases and 
       
  2959 
       
  2960 	// aInfo.iAction=RMobilePhone::EServiceActionErase and aInfo.iServiceGroup=RMobilePhone::EAllServices, aInfo.iTimeOut=-1 
       
  2961 	RMobilePhone::TMobilePhoneCFChangeV1 newSetting;
       
  2962 	newSetting.iServiceGroup=RMobilePhone::EAllServices;
       
  2963 	newSetting.iAction=RMobilePhone::EServiceActionErase;
       
  2964 	newSetting.iTimeout=-1;
       
  2965 	
       
  2966 	DEBUG_PRINTF1(_L("Setting call forward EServiceActionErase ECallForwardingUnconditional for EAllServices"));
       
  2967 	ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional), _L("SetCallForwardingStatusUtil with EServiceActionErase ECallForwardingUnconditional for EAllServices failed"));
       
  2968 	
       
  2969 	//
       
  2970 	// SET UP END
       
  2971 	//
       
  2972 	
       
  2973 	StartTest();
       
  2974 	
       
  2975 	//
       
  2976 	// TEST START
       
  2977 	//
       
  2978 
       
  2979 	// ===  Activate/Register call forwarding busy for voice ===
       
  2980 	RMobilePhone::TMobilePhoneNetworkInfoV1 info;
       
  2981 	RMobilePhone::TMobilePhoneNetworkInfoV1Pckg infopckg(info);
       
  2982 	RMobilePhone::TMobilePhoneLocationAreaV1 area;
       
  2983 	TOperatorName operatorName = EOperatorUnknown;
       
  2984 	ASSERT_EQUALS(iNetworkTestHelper.GetCurrentNetworkL(mobilePhone, infopckg, area, operatorName), KErrNone, _L("RMobilePhone::GetCurrentNetwork failed to get current network id (1)"));
       
  2985 	
       
  2986 	newSetting.iServiceGroup=RMobilePhone::EVoiceService;
       
  2987 	newSetting.iNumber.iTelNumber=number;
       
  2988 	newSetting.iNumber.iNumberPlan=RMobilePhone::EIsdnNumberPlan;
       
  2989 	newSetting.iNumber.iTypeOfNumber=RMobilePhone::ENationalNumber;
       
  2990 	
       
  2991 	if(operatorName==EOperatorVodafone)
       
  2992 		{
       
  2993 		// Activate call forwarding using RMobilePhone::SetCallForwardingStatus with aCondition=RMobilePhone::ECallForwardingUnconditional and aInfo.iAction=RMobilePhone::EServiceActionActivate and aInfo.iServiceGroup=RMobilePhone::EVoiceService and aInfo.iNumber.iNumberPlan=EIsdnNumberPlan, aInfo.iNumber.iTelNumber=valid number, aInfo.iNumber.iTypeOfNumber=ENationalNumber, aInfo.iTimeout=-1 
       
  2994 		newSetting.iAction=RMobilePhone::EServiceActionActivate;
       
  2995 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionActivate ECallForwardingUnconditional for EVoiceService"));
       
  2996 		ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional), _L("SetCallForwardingStatusUtil with ECallForwardingUnconditional for EVoiceService failed"));
       
  2997 		}
       
  2998 	else if(operatorName==EOperatorO2 || operatorName==EOperatorOrange || operatorName==EOperatorTMobile)
       
  2999 		{
       
  3000 		// Register call forwarding using RMobilePhone::SetCallForwardingStatus with aCondition=RMobilePhone::ECallForwardingUnconditional and aInfo.iAction=RMobilePhone::EServiceActionRegister and aInfo.iServiceGroup=RMobilePhone::EVoiceService and aInfo.iNumber.iNumberPlan=EIsdnNumberPlan, aInfo.iNumber.iTelNumber=valid number, aInfo.iNumber.iTypeOfNumber=ENationalNumber, aInfo.iTimeout=-1 
       
  3001 		newSetting.iAction=RMobilePhone::EServiceActionRegister;
       
  3002 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionRegister ECallForwardingUnconditional for EVoiceService"));
       
  3003 		ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional), _L("SetCallForwardingStatusUtil with ECallForwardingUnconditional for EVoiceService failed"));
       
  3004 		}
       
  3005 	else
       
  3006 		{	
       
  3007 		ASSERT_EQUALS(1,0,_L("Failed to identify current network"));
       
  3008 		TEST_CHECK_POINT_L(_L("Failed to identify current network."));
       
  3009 		}
       
  3010 
       
  3011 	// aInfo.iAction=RMobilePhone::EServiceActionDeactivate and aInfo.iServiceGroup=RMobilePhone::EVoiceService, aInfo.iTimeOut=-1 
       
  3012 	newSetting.iServiceGroup=RMobilePhone::EVoiceService;
       
  3013 	newSetting.iAction=RMobilePhone::EServiceActionDeactivate;
       
  3014 	
       
  3015 	DEBUG_PRINTF1(_L("Setting call forward EServiceActionDeactivate ECallForwardingUnconditional for EVoiceService"));
       
  3016 	ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional), _L("SetCallForwardingStatusUtil with EServiceActionDeactivate ECallForwardingUnconditional for EVoiceService failed"));
       
  3017 	
       
  3018 	// ===  Activate/Register call forwarding busy for voice with a different number ===
       
  3019 	TPtrC anotherNumber; 
       
  3020 	CHECK_TRUE_L(GetStringFromConfig(KIniVoiceNumSection, KIniVoiceNumber2, anotherNumber) != EFalse, _L("GetStringFromConfig did not complete as expected"));
       
  3021 	DEBUG_PRINTF2(_L("New number obtained: %S"), &anotherNumber);
       
  3022 	
       
  3023 	newSetting.iServiceGroup=RMobilePhone::EVoiceService;
       
  3024 	newSetting.iNumber.iTelNumber=anotherNumber;
       
  3025 
       
  3026 	if(operatorName==EOperatorVodafone)
       
  3027 		{
       
  3028 		// Activate call forwarding using RMobilePhone::SetCallForwardingStatus with aCondition=RMobilePhone::ECallForwardingUnconditional and aInfo.iAction=RMobilePhone::EServiceActionActivate and aInfo.iServiceGroup=RMobilePhone::EVoiceService and aInfo.iNumber.iNumberPlan=EIsdnNumberPlan, aInfo.iNumber.iTelNumber=different valid number, aInfo.iNumber.iTypeOfNumber=ENationalNumber, aInfo.iTimeout=-1 
       
  3029 		newSetting.iAction=RMobilePhone::EServiceActionActivate;
       
  3030 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionActivate ECallForwardingUnconditional for EVoiceService"));	
       
  3031 		ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional), _L("SetCallForwardingStatusUtil with ECallForwardingUnconditional for EVoiceService failed"));
       
  3032 		}
       
  3033 	else if(operatorName==EOperatorO2 || operatorName==EOperatorOrange || operatorName==EOperatorTMobile)
       
  3034 		{
       
  3035 		// Register call forwarding using RMobilePhone::SetCallForwardingStatus with aCondition=RMobilePhone::ECallForwardingUnconditional and aInfo.iAction=RMobilePhone::EServiceActionRegister and aInfo.iServiceGroup=RMobilePhone::EVoiceService and aInfo.iNumber.iNumberPlan=EIsdnNumberPlan, aInfo.iNumber.iTelNumber=different valid number, aInfo.iNumber.iTypeOfNumber=ENationalNumber, aInfo.iTimeout=-1 
       
  3036 		newSetting.iAction=RMobilePhone::EServiceActionRegister;
       
  3037 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionRegister ECallForwardingUnconditional for EVoiceService"));	
       
  3038 		ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional), _L("SetCallForwardingStatusUtil with ECallForwardingUnconditional for EVoiceService failed"));
       
  3039 		}
       
  3040 	//
       
  3041 	// TEST END
       
  3042 	//
       
  3043 
       
  3044     StartCleanup();
       
  3045 	
       
  3046 	// Ensure all call forwarding setting are erased
       
  3047 	newSetting.iServiceGroup=RMobilePhone::EAllServices;
       
  3048 	newSetting.iAction=RMobilePhone::EServiceActionErase;
       
  3049 	
       
  3050 	DEBUG_PRINTF1(_L("Setting call forward EServiceActionErase ECallForwardingUnconditional for EAllServices"));
       
  3051 	ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional), _L("SetCallForwardingStatusUtil with EServiceActionErase ECallForwardingUnconditional for EAllServices failed"));
       
  3052     
       
  3053 	return TestStepResult();
       
  3054 	}
       
  3055 
       
  3056 TPtrC CCTSYIntegrationTestCallForwarding0013::GetTestStepName()
       
  3057 /**
       
  3058  * @return The test step name.
       
  3059  */
       
  3060 	{
       
  3061 	return _L("CCTSYIntegrationTestCallForwarding0013");
       
  3062 	}
       
  3063 
       
  3064 
       
  3065 
       
  3066 CCTSYIntegrationTestCallForwarding0014::CCTSYIntegrationTestCallForwarding0014(CEtelSessionMgr& aEtelSessionMgr)
       
  3067 	: CCTSYIntegrationTestCallForwardingBase(aEtelSessionMgr)
       
  3068 /**
       
  3069  * Constructor.
       
  3070  */
       
  3071 	{
       
  3072 	SetTestStepName(CCTSYIntegrationTestCallForwarding0014::GetTestStepName());
       
  3073 	}
       
  3074 
       
  3075 CCTSYIntegrationTestCallForwarding0014::~CCTSYIntegrationTestCallForwarding0014()
       
  3076 /**
       
  3077  * Destructor.
       
  3078  */
       
  3079 	{
       
  3080 	}
       
  3081 
       
  3082 TVerdict CCTSYIntegrationTestCallForwarding0014::doTestStepL()
       
  3083 /**
       
  3084  * @SYMTestCaseID BA-CTSY-INT-CFOR-0014
       
  3085  * @SYMFssID BA/CTSY/CFOR-0014
       
  3086  * @SYMTestCaseDesc Change the 'no reply' time out.
       
  3087  * @SYMTestPriority High
       
  3088  * @SYMTestActions RMobilePhone::NotifyCallForwardingStatusChange
       
  3089  * @SYMTestExpectedResults Pass - Call forwarding status change notification completes when time out is changed.
       
  3090  * @SYMTestType CIT
       
  3091  * @SYMTestCaseDependencies live/automatic
       
  3092  *
       
  3093  * Reason for test: Verify call forwarding status change notification completes.
       
  3094  *
       
  3095  * @return - TVerdict code
       
  3096  */
       
  3097 	{
       
  3098 
       
  3099 	//
       
  3100 	// SET UP
       
  3101 	//
       
  3102 
       
  3103 	// Ensure RMobilePhone::GetCallServiceCaps returns caps in set of KCapsSetCFStatus | KCapsNotifyCFStatus
       
  3104 	RMobilePhone& mobilePhone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone);	
       
  3105 	TUint32 callServiceCaps = 0;
       
  3106 
       
  3107 	// Call TNetworkTsyTestHelper::WaitForRegisteredOnHomeNetworkL		
       
  3108 	CHECK_EQUALS_L(iNetworkTestHelper.WaitForRegisteredOnHomeNetworkL(mobilePhone), KErrNone, _L("TNetworkTsyTestHelper::WaitForRegisteredOnHomeNetworkL returned with an error"));
       
  3109 	
       
  3110 	CHECK_EQUALS_L(mobilePhone.GetCallServiceCaps(callServiceCaps), KErrNone, _L("RMobilePhone::GetCallServiceCaps return value is not KErrNone"));
       
  3111 	TUint32 expectedServiceCaps = RMobilePhone::KCapsSetCFStatus | RMobilePhone::KCapsNotifyCFStatus;
       
  3112 	CHECK_BITS_SET_L(callServiceCaps, expectedServiceCaps, KNoUnwantedBits, _L("RMobilePhone::GetCallServiceCaps returned wrong caps"));
       
  3113 
       
  3114 	TPtrC number; 
       
  3115 	CHECK_TRUE_L(GetStringFromConfig(KIniVoiceNumSection, KIniVoiceNumber1, number) != EFalse, _L("GetStringFromConfig did not complete as expected"));
       
  3116 	DEBUG_PRINTF2(_L("Number obtained: %S"), &number);
       
  3117 
       
  3118 	// Ensure all call forwarding is erased by calling 
       
  3119 
       
  3120 	// RMobilePhone::SetCallForwardingStatus with aCondition=RMobilePhone::ECallForwardingAllCases and 
       
  3121 
       
  3122 	// aInfo.iAction=RMobilePhone::EServiceActionErase and aInfo.iServiceGroup=RMobilePhone::EAllServices, aInfo.iTimeOut=-1 
       
  3123 	RMobilePhone::TMobilePhoneCFChangeV1 newSetting;
       
  3124 	newSetting.iServiceGroup=RMobilePhone::EAllServices;
       
  3125 	newSetting.iAction=RMobilePhone::EServiceActionErase;
       
  3126 	newSetting.iTimeout=-1;
       
  3127 	
       
  3128 	DEBUG_PRINTF1(_L("Setting call forward EServiceActionErase ECallForwardingAllCases for EAllServices"));
       
  3129 	CHECK_TRUE_L(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingAllCases), _L("SetCallForwardingStatusUtil with EServiceActionErase ECallForwardingAllCases for EAllServices failed"));
       
  3130 	
       
  3131 	//
       
  3132 	// SET UP END
       
  3133 	//
       
  3134 	
       
  3135 	StartTest();
       
  3136 	
       
  3137 	//
       
  3138 	// TEST START
       
  3139 	//
       
  3140 	
       
  3141 	// === Activate/Register call forwarding no reply for voice ===
       
  3142 	RMobilePhone::TMobilePhoneNetworkInfoV1 info;
       
  3143 	RMobilePhone::TMobilePhoneNetworkInfoV1Pckg infopckg(info);
       
  3144 	RMobilePhone::TMobilePhoneLocationAreaV1 area;
       
  3145 	TOperatorName operatorName = EOperatorUnknown;
       
  3146 	ASSERT_EQUALS(iNetworkTestHelper.GetCurrentNetworkL(mobilePhone, infopckg, area, operatorName), KErrNone, _L("RMobilePhone::GetCurrentNetwork failed to get current network id (1)"));
       
  3147 	
       
  3148 	newSetting.iServiceGroup=RMobilePhone::EVoiceService;
       
  3149 	newSetting.iNumber.iTelNumber=number;
       
  3150 	newSetting.iNumber.iNumberPlan=RMobilePhone::EIsdnNumberPlan;
       
  3151 	newSetting.iNumber.iTypeOfNumber=RMobilePhone::ENationalNumber;
       
  3152 	newSetting.iTimeout=10;
       
  3153 
       
  3154 	if(operatorName==EOperatorVodafone)
       
  3155 		{
       
  3156 		// Activate call forwarding using RMobilePhone::SetCallForwardingStatus with aCondition=RMobilePhone::ECallForwardingNoReply and aInfo.iAction=RMobilePhone::EServiceActionActivate and aInfo.iServiceGroup=RMobilePhone::EVoiceService and aInfo.iNumber.iNumberPlan=EIsdnNumberPlan, aInfo.iNumber.iTelNumber=valid number, aInfo.iNumber.iTypeOfNumber=ENationalNumber, aInfo.iTimeout=10 
       
  3157 		// Check RMobilePhone::NotifyCallForwardingStatusChange completes with aCondition=ECallForwardingBusy
       
  3158 		newSetting.iAction=RMobilePhone::EServiceActionActivate;
       
  3159 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionActivate ECallForwardingBusy for EVoiceService"));
       
  3160 		ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingBusy), _L("SetCallForwardingStatusUtil with EServiceActionActivate ECallForwardingBusy for EVoiceService failed"));
       
  3161 		}
       
  3162 	else if(operatorName==EOperatorO2 || operatorName==EOperatorOrange || operatorName==EOperatorTMobile)
       
  3163 		{	
       
  3164 		// Register call forwarding using RMobilePhone::SetCallForwardingStatus with aCondition=RMobilePhone::ECallForwardingNoReply and aInfo.iAction=RMobilePhone::EServiceActionRegister and aInfo.iServiceGroup=RMobilePhone::EVoiceService and aInfo.iNumber.iNumberPlan=EIsdnNumberPlan, aInfo.iNumber.iTelNumber=valid number, aInfo.iNumber.iTypeOfNumber=ENationalNumber, aInfo.iTimeout=10 
       
  3165 		// Check RMobilePhone::NotifyCallForwardingStatusChange completes with aCondition=ECallForwardingBusy
       
  3166 		newSetting.iAction=RMobilePhone::EServiceActionRegister;
       
  3167 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionRegister ECallForwardingBusy for EVoiceService"));
       
  3168 		if(operatorName==EOperatorTMobile || operatorName==EOperatorO2)
       
  3169 			{
       
  3170 			ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingBusy, KErrGsmSSUnexpectedDataValue), _L("SetCallForwardingStatusUtil with EServiceActionRegister ECallForwardingBusy for EVoiceService failed"));			
       
  3171 			}
       
  3172 		else
       
  3173 			{
       
  3174 			ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingBusy), _L("SetCallForwardingStatusUtil with EServiceActionRegister ECallForwardingBusy for EVoiceService failed"));			
       
  3175 			}
       
  3176 		}
       
  3177 	else
       
  3178 		{	
       
  3179 		ASSERT_EQUALS(1,0,_L("Failed to identify current network"));
       
  3180 		TEST_CHECK_POINT_L(_L("Failed to identify current network."));
       
  3181 		}
       
  3182 	
       
  3183 	// ===  Activate/Register call forwarding no reply for voice with a different time out ===
       
  3184 
       
  3185 	newSetting.iServiceGroup=RMobilePhone::EVoiceService;
       
  3186 	newSetting.iAction=RMobilePhone::EServiceActionActivate;
       
  3187 	newSetting.iTimeout=20;
       
  3188 	
       
  3189 	if(operatorName==EOperatorVodafone)
       
  3190 		{	
       
  3191 		// Activate call forwarding using RMobilePhone::SetCallForwardingStatus with aCondition=RMobilePhone::ECallForwardingNoReply and aInfo.iAction=RMobilePhone::EServiceActionActivate and aInfo.iServiceGroup=RMobilePhone::EVoiceService and aInfo.iNumber.iNumberPlan=EIsdnNumberPlan, aInfo.iNumber.iTelNumber=different valid number, aInfo.iNumber.iTypeOfNumber=ENationalNumber, aInfo.iTimeout=20 
       
  3192 		// Check RMobilePhone::NotifyCallForwardingStatusChange completes with aCondition=ECallForwardingBusy
       
  3193 		newSetting.iAction=RMobilePhone::EServiceActionActivate;
       
  3194 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionActivate ECallForwardingBusy for EVoiceService"));
       
  3195 		ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingBusy), _L("SetCallForwardingStatusUtil with EServiceActionActivate ECallForwardingBusy for EVoiceService failed"));
       
  3196 		}
       
  3197 	else if(operatorName==EOperatorO2 || operatorName==EOperatorOrange || operatorName==EOperatorTMobile)
       
  3198 		{
       
  3199 		// Register call forwarding using RMobilePhone::SetCallForwardingStatus with aCondition=RMobilePhone::ECallForwardingNoReply and aInfo.iAction=RMobilePhone::EServiceActionRegister and aInfo.iServiceGroup=RMobilePhone::EVoiceService and aInfo.iNumber.iNumberPlan=EIsdnNumberPlan, aInfo.iNumber.iTelNumber=different valid number, aInfo.iNumber.iTypeOfNumber=ENationalNumber, aInfo.iTimeout=20 
       
  3200 		// Check RMobilePhone::NotifyCallForwardingStatusChange completes with aCondition=ECallForwardingBusy
       
  3201 		newSetting.iAction=RMobilePhone::EServiceActionRegister;
       
  3202 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionRegister ECallForwardingBusy for EVoiceService"));
       
  3203 		if(operatorName==EOperatorTMobile || operatorName==EOperatorO2)
       
  3204 			{
       
  3205 			ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingBusy, KErrGsmSSUnexpectedDataValue), _L("SetCallForwardingStatusUtil with EServiceActionRegister ECallForwardingBusy for EVoiceService failed"));
       
  3206 			}
       
  3207 		else
       
  3208 			{
       
  3209 			ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingBusy), _L("SetCallForwardingStatusUtil with EServiceActionRegister ECallForwardingBusy for EVoiceService failed"));
       
  3210 			}
       
  3211 		}
       
  3212 	
       
  3213 	//
       
  3214 	// TEST END
       
  3215 	//
       
  3216 
       
  3217     StartCleanup();
       
  3218 	
       
  3219 	// Ensure all call forwarding setting are erased
       
  3220 	newSetting.iServiceGroup=RMobilePhone::EAllServices;
       
  3221 	newSetting.iAction=RMobilePhone::EServiceActionErase;
       
  3222 	newSetting.iTimeout=-1;
       
  3223 	
       
  3224 	DEBUG_PRINTF1(_L("Setting call forward EServiceActionErase ECallForwardingAllCases for EAllServices"));
       
  3225 	ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingAllCases), _L("SetCallForwardingStatusUtil with EServiceActionErase ECallForwardingAllCases for EAllServices failed"));
       
  3226 	
       
  3227 	return TestStepResult();
       
  3228 	}
       
  3229 
       
  3230 TPtrC CCTSYIntegrationTestCallForwarding0014::GetTestStepName()
       
  3231 /**
       
  3232  * @return The test step name.
       
  3233  */
       
  3234 	{
       
  3235 	return _L("CCTSYIntegrationTestCallForwarding0014");
       
  3236 	}
       
  3237 
       
  3238 
       
  3239 
       
  3240 CCTSYIntegrationTestCallForwarding0015::CCTSYIntegrationTestCallForwarding0015(CEtelSessionMgr& aEtelSessionMgr)
       
  3241 	: CCTSYIntegrationTestCallForwardingBase(aEtelSessionMgr)
       
  3242 /**
       
  3243  * Constructor.
       
  3244  */
       
  3245 	{
       
  3246 	SetTestStepName(CCTSYIntegrationTestCallForwarding0015::GetTestStepName());
       
  3247 	}
       
  3248 
       
  3249 CCTSYIntegrationTestCallForwarding0015::~CCTSYIntegrationTestCallForwarding0015()
       
  3250 /**
       
  3251  * Destructor.
       
  3252  */
       
  3253 	{
       
  3254 	}
       
  3255 
       
  3256 TVerdict CCTSYIntegrationTestCallForwarding0015::doTestStepL()
       
  3257 /**
       
  3258  * @SYMTestCaseID BA-CTSY-INT-CFOR-0015
       
  3259  * @SYMFssID BA/CTSY/CFOR-0015
       
  3260  * @SYMTestCaseDesc Get call forwarding indication status.
       
  3261  * @SYMTestPriority High
       
  3262  * @SYMTestActions RMobilePhone::SetCallForwardingStatus
       
  3263  * @SYMTestExpectedResults Pass - Call forwarding indicator is retrieved.
       
  3264  * @SYMTestType CIT
       
  3265  * @SYMTestCaseDependencies live/automatic
       
  3266  *
       
  3267  * Reason for test: Verify call forwarding indication retrieved.
       
  3268  *
       
  3269  * @return - TVerdict code
       
  3270  */
       
  3271 	{
       
  3272 
       
  3273 	//
       
  3274 	// SET UP
       
  3275 	//
       
  3276 
       
  3277 	// Ensure RMobilePhone::GetCallServiceCaps returns caps in set of KCapsSetCFStatus | KCapsNotifyCFStatus
       
  3278 	RMobilePhone& mobilePhone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone);	
       
  3279 	
       
  3280 	// Call TNetworkTsyTestHelper::WaitForRegisteredOnHomeNetworkL		
       
  3281 	CHECK_EQUALS_L(iNetworkTestHelper.WaitForRegisteredOnHomeNetworkL(mobilePhone), KErrNone, _L("TNetworkTsyTestHelper::WaitForRegisteredOnHomeNetworkL returned with an error"));
       
  3282 	
       
  3283 	TUint32 callServiceCaps = 0;
       
  3284 	CHECK_EQUALS_L(mobilePhone.GetCallServiceCaps(callServiceCaps), KErrNone, _L("RMobilePhone::GetCallServiceCaps return value is not KErrNone"));
       
  3285 	TUint32 expectedServiceCaps = RMobilePhone::KCapsSetCFStatus | RMobilePhone::KCapsNotifyCFStatus;
       
  3286 	CHECK_BITS_SET_L(callServiceCaps, expectedServiceCaps, KNoUnwantedBits, _L("RMobilePhone::GetCallServiceCaps returned wrong caps"));
       
  3287 
       
  3288 	TPtrC number; 
       
  3289 	CHECK_TRUE_L(GetStringFromConfig(KIniVoiceNumSection, KIniVoiceNumber1, number) != EFalse, _L("GetStringFromConfig did not complete as expected"));
       
  3290 	DEBUG_PRINTF2(_L("Number obtained: %S"), &number);
       
  3291 
       
  3292 	// Ensure all call forwarding is erased by calling 
       
  3293 
       
  3294 	// RMobilePhone::SetCallForwardingStatus with aCondition=RMobilePhone::ECallForwardingAllCases and 
       
  3295 
       
  3296 	// aInfo.iAction=RMobilePhone::EServiceActionErase and aInfo.iServiceGroup=RMobilePhone::EAllServices, aInfo.iTimeOut=-1 
       
  3297 	RMobilePhone::TMobilePhoneCFChangeV1 newSetting;
       
  3298 	newSetting.iServiceGroup=RMobilePhone::EAllServices;
       
  3299 	newSetting.iAction=RMobilePhone::EServiceActionErase;
       
  3300 	newSetting.iTimeout=-1;
       
  3301 	
       
  3302 	TExtEtelRequestStatus setCallForwardStatus(mobilePhone, EMobilePhoneSetCallForwardingStatus);
       
  3303 	CleanupStack::PushL(setCallForwardStatus);
       
  3304 	mobilePhone.SetCallForwardingStatus(setCallForwardStatus, RMobilePhone::ECallForwardingAllCases, newSetting);
       
  3305 	CHECK_EQUALS_L(WaitForRequestWithTimeOut(setCallForwardStatus, ETimeMedium), KErrNone, _L("RMobilePhone::SetCallForwardingStatus timed-out"));
       
  3306 	CHECK_EQUALS_L(setCallForwardStatus.Int(), KErrNone, _L("RMobilePhone::SetCallForwardingStatus setCallForwardStatus completed with incorrect error"));
       
  3307 
       
  3308 	//
       
  3309 	// SET UP END
       
  3310 	//
       
  3311 	
       
  3312 	StartTest();
       
  3313 	
       
  3314 	//
       
  3315 	// TEST START
       
  3316 	//
       
  3317 		
       
  3318 	// ===  Activate/Register call forwarding unconditional for voice ===
       
  3319 	RMobilePhone::TMobilePhoneNetworkInfoV1 info;
       
  3320 	RMobilePhone::TMobilePhoneNetworkInfoV1Pckg infopckg(info);
       
  3321 	RMobilePhone::TMobilePhoneLocationAreaV1 area;
       
  3322 	TOperatorName operatorName = EOperatorUnknown;
       
  3323 	ASSERT_EQUALS(iNetworkTestHelper.GetCurrentNetworkL(mobilePhone, infopckg, area, operatorName), KErrNone, _L("RMobilePhone::GetCurrentNetwork failed to get current network id (1)"));
       
  3324 	
       
  3325 	newSetting.iServiceGroup=RMobilePhone::EVoiceService;
       
  3326 	newSetting.iNumber.iTelNumber=number;
       
  3327 	newSetting.iNumber.iNumberPlan=RMobilePhone::EIsdnNumberPlan;
       
  3328 	newSetting.iNumber.iTypeOfNumber=RMobilePhone::ENationalNumber;
       
  3329 
       
  3330 	if(operatorName==EOperatorVodafone)
       
  3331 		{
       
  3332 		newSetting.iAction=RMobilePhone::EServiceActionActivate;
       
  3333 		// Activate call forwarding using RMobilePhone::SetCallForwardingStatus with aCondition=ECallForwardingUnconditional and aInfo.iAction=RMobilePhone::EServiceActionActivate and aInfo.iServiceGroup=RMobilePhone::EVoiceService and aInfo.iNumber.iNumberPlan=EIsdnNumberPlan, aInfo.iNumber.iTelNumber=valid number, aInfo.iNumber.iTypeOfNumber=ENationalNumber, aInfo.iTimeout=-1 
       
  3334 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionActivate ECallForwardingUnconditional for EVoiceService"));
       
  3335 		ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional), _L("SetCallForwardingStatusUtil with EServiceActionActivate ECallForwardingUnconditional for EVoiceService failed"));
       
  3336 		}
       
  3337 	else if(operatorName==EOperatorO2 || operatorName==EOperatorOrange || operatorName==EOperatorTMobile)
       
  3338 		{
       
  3339 		newSetting.iAction=RMobilePhone::EServiceActionRegister;
       
  3340 		// Register call forwarding using RMobilePhone::SetCallForwardingStatus with aCondition=ECallForwardingUnconditional and aInfo.iAction=RMobilePhone::EServiceActionRegister and aInfo.iServiceGroup=RMobilePhone::EVoiceService and aInfo.iNumber.iNumberPlan=EIsdnNumberPlan, aInfo.iNumber.iTelNumber=valid number, aInfo.iNumber.iTypeOfNumber=ENationalNumber, aInfo.iTimeout=-1 
       
  3341 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionRegister ECallForwardingUnconditional for EVoiceService"));
       
  3342 		ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional), _L("SetCallForwardingStatusUtil with EServiceActionRegister ECallForwardingUnconditional for EVoiceService failed"));
       
  3343 		}
       
  3344 	else
       
  3345 		{	
       
  3346 		ASSERT_EQUALS(1,0,_L("Failed to identify current network"));
       
  3347 		TEST_CHECK_POINT_L(_L("Failed to identify current network."));
       
  3348 		}
       
  3349 		
       
  3350 	// ===  Get call forwarding indicator ===
       
  3351 
       
  3352 	// Check RMobilePhone::GetCallForwardingIndicator returns KErrNotSupported
       
  3353 	RMobilePhone::TMobilePhoneCFUIndicatorV6 cfuIndicator;
       
  3354     RMobilePhone::TMobilePhoneCFUIndicatorV6Pckg cfuIndicatorPackg(cfuIndicator);
       
  3355     
       
  3356 	TExtEtelRequestStatus getCallForwardingStatus(mobilePhone, EMobilePhoneGetCallForwardingIndicator);
       
  3357 	CleanupStack::PushL(getCallForwardingStatus);
       
  3358 	mobilePhone.GetCallForwardingIndicator(getCallForwardingStatus, cfuIndicatorPackg);
       
  3359 	
       
  3360 	ASSERT_EQUALS(WaitForRequestWithTimeOut(getCallForwardingStatus, ETimeMedium), KErrNone, _L("RMobilePhone::GetCallForwardingIndicator timed-out"));
       
  3361 	ASSERT_EQUALS(getCallForwardingStatus.Int(), KErrNotSupported, _L("RMobilePhone::GetCallForwardingStatus getCallForwardStatus completed with incorrect error"));
       
  3362 	
       
  3363 	expectedServiceCaps = 0;
       
  3364 	
       
  3365 	ASSERT_BITS_SET(cfuIndicator.iIndicator, expectedServiceCaps, KNoUnwantedBits, _L("RMobilePhone::GetCallForwardingIndicator returned wrong caps"));
       
  3366 
       
  3367 	// === Activate/Register call forwarding unconditional for circuit switch data ===	
       
  3368 	newSetting.iServiceGroup=RMobilePhone::ECircuitDataService;
       
  3369 	
       
  3370 	if(operatorName==EOperatorVodafone)
       
  3371 		{
       
  3372 		// Activate call forwarding using RMobilePhone::SetCallForwardingStatus with aCondition=ECallForwardingUnconditional and aInfo.iAction=RMobilePhone::EServiceActionActivate and aInfo.iServiceGroup=RMobilePhone::ECircuitDataService and aInfo.iNumber.iNumberPlan=EIsdnNumberPlan, aInfo.iNumber.iTelNumber=valid number, aInfo.iNumber.iTypeOfNumber=ENationalNumber, aInfo.iTimeout=-1 
       
  3373 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionActivate ECallForwardingUnconditional for ECircuitDataService"));	
       
  3374 		ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional), _L("SetCallForwardingStatusUtil with EServiceActionActivate ECallForwardingUnconditional for ECircuitDataService failed"));
       
  3375 		}
       
  3376 	else if(operatorName==EOperatorO2 || operatorName==EOperatorOrange || operatorName==EOperatorTMobile)
       
  3377 		{
       
  3378 		// Register call forwarding using RMobilePhone::SetCallForwardingStatus with aCondition=ECallForwardingUnconditional and aInfo.iAction=RMobilePhone::EServiceActionRegister and aInfo.iServiceGroup=RMobilePhone::ECircuitDataService and aInfo.iNumber.iNumberPlan=EIsdnNumberPlan, aInfo.iNumber.iTelNumber=valid number, aInfo.iNumber.iTypeOfNumber=ENationalNumber, aInfo.iTimeout=-1 
       
  3379 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionRegister ECallForwardingUnconditional for ECircuitDataService"));	
       
  3380 		ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional), _L("SetCallForwardingStatusUtil with EServiceActionRegister ECallForwardingUnconditional for ECircuitDataService failed"));
       
  3381 		}
       
  3382 
       
  3383 	// ===  Get call forwarding indicator ===
       
  3384 
       
  3385 	// Check RMobilePhone::GetCallForwardingIndicator returns KErrNotSupported
       
  3386 	mobilePhone.GetCallForwardingIndicator(getCallForwardingStatus, cfuIndicatorPackg);
       
  3387 	
       
  3388 	ASSERT_EQUALS(WaitForRequestWithTimeOut(getCallForwardingStatus, ETimeMedium), KErrNone, _L("RMobilePhone::GetCallForwardingIndicator timed-out."));
       
  3389 	ASSERT_EQUALS(getCallForwardingStatus.Int(), KErrNotSupported, _L("RMobilePhone::GetCallForwardingStatus getCallForwardStatus completed with incorrect error"));	
       
  3390 	
       
  3391 	expectedServiceCaps = 0;
       
  3392 	
       
  3393 	ASSERT_BITS_SET(cfuIndicator.iIndicator, expectedServiceCaps, KNoUnwantedBits, _L("RMobilePhone::GetCallForwardingIndicator returned wrong caps"));
       
  3394 
       
  3395 	// ===  Activate/Register call forwarding unconditional for circuit switch data ===
       
  3396 	newSetting.iServiceGroup=RMobilePhone::ECircuitDataService;
       
  3397 	
       
  3398 	if(operatorName==EOperatorVodafone)
       
  3399 		{
       
  3400 		// Activate call forwarding using RMobilePhone::SetCallForwardingStatus with aCondition=ECallForwardingUnconditional and aInfo.iAction=RMobilePhone::EServiceActionActivate and aInfo.iServiceGroup=RMobilePhone::ECircuitDataService and aInfo.iNumber.iNumberPlan=EIsdnNumberPlan, aInfo.iNumber.iTelNumber=valid number, aInfo.iNumber.iTypeOfNumber=ENationalNumber, aInfo.iTimeout=-1 
       
  3401 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionActivate ECallForwardingUnconditional for ECircuitDataService"));
       
  3402 		ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional), _L("SetCallForwardingStatusUtil with EServiceActionActivate ECallForwardingUnconditional for ECircuitDataService failed"));
       
  3403 		}
       
  3404 	else if(operatorName==EOperatorO2 || operatorName==EOperatorOrange || operatorName==EOperatorTMobile)
       
  3405 		{
       
  3406 		// Register call forwarding using RMobilePhone::SetCallForwardingStatus with aCondition=ECallForwardingUnconditional and aInfo.iAction=RMobilePhone::EServiceActionRegister and aInfo.iServiceGroup=RMobilePhone::ECircuitDataService and aInfo.iNumber.iNumberPlan=EIsdnNumberPlan, aInfo.iNumber.iTelNumber=valid number, aInfo.iNumber.iTypeOfNumber=ENationalNumber, aInfo.iTimeout=-1 
       
  3407 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionRegister ECallForwardingUnconditional for ECircuitDataService"));
       
  3408 		ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional), _L("SetCallForwardingStatusUtil with EServiceActionRegister ECallForwardingUnconditional for ECircuitDataService failed"));		
       
  3409 		}
       
  3410 	
       
  3411 	// ===  Get call forwarding indicator ===
       
  3412 
       
  3413 	// Check RMobilePhone::GetCallForwardingIndicator returns KErrNotSupported
       
  3414 	mobilePhone.GetCallForwardingIndicator(getCallForwardingStatus, cfuIndicatorPackg);
       
  3415 	
       
  3416 	ASSERT_EQUALS(WaitForRequestWithTimeOut(getCallForwardingStatus, ETimeMedium), KErrNone, _L("RMobilePhone::GetCallForwardingIndicator timed-out"));
       
  3417 	ASSERT_EQUALS(getCallForwardingStatus.Int(), KErrNotSupported, _L("RMobilePhone::GetCallForwardingStatus getCallForwardStatus completed with incorrect error"));
       
  3418 
       
  3419 	expectedServiceCaps = 0;
       
  3420 	
       
  3421 	ASSERT_BITS_SET(cfuIndicator.iIndicator, expectedServiceCaps, KNoUnwantedBits, _L("RMobilePhone::GetCallForwardingIndicator returned wrong caps"));
       
  3422 
       
  3423 	// ===  Activate/Register call forwarding unconditional for circuit switch data ===
       
  3424 	newSetting.iServiceGroup=RMobilePhone::ECircuitDataService;
       
  3425 	
       
  3426 	if(operatorName==EOperatorVodafone)
       
  3427 		{
       
  3428 		// Activate call forwarding using RMobilePhone::SetCallForwardingStatus with aCondition=ECallForwardingUnconditional and aInfo.iAction=RMobilePhone::EServiceActionActivate and aInfo.iServiceGroup=RMobilePhone::EPacketDataService and aInfo.iNumber.iNumberPlan=EIsdnNumberPlan, aInfo.iNumber.iTelNumber=valid number, aInfo.iNumber.iTypeOfNumber=ENationalNumber, aInfo.iTimeout=-1 	
       
  3429 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionActivate ECallForwardingUnconditional for ECircuitDataService"));
       
  3430 		ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional), _L("SetCallForwardingStatusUtil with EServiceActionActivate ECallForwardingUnconditional for ECircuitDataService failed"));
       
  3431 		}
       
  3432 	else if(operatorName==EOperatorO2 || operatorName==EOperatorOrange || operatorName==EOperatorTMobile)
       
  3433 		{
       
  3434 		// Register call forwarding using RMobilePhone::SetCallForwardingStatus with aCondition=ECallForwardingUnconditional and aInfo.iAction=RMobilePhone::EServiceActionRegister and aInfo.iServiceGroup=RMobilePhone::EPacketDataService and aInfo.iNumber.iNumberPlan=EIsdnNumberPlan, aInfo.iNumber.iTelNumber=valid number, aInfo.iNumber.iTypeOfNumber=ENationalNumber, aInfo.iTimeout=-1 	
       
  3435 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionRegister ECallForwardingUnconditional for ECircuitDataService"));
       
  3436 		ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional), _L("SetCallForwardingStatusUtil with EServiceActionRegister ECallForwardingUnconditional for ECircuitDataService failed"));
       
  3437 		}
       
  3438 	
       
  3439 	// ===  Get call forwarding indicator ===
       
  3440 
       
  3441 	// Check RMobilePhone::GetCallForwardingIndicator returns KErrNotSupported
       
  3442 	mobilePhone.GetCallForwardingIndicator(getCallForwardingStatus, cfuIndicatorPackg);
       
  3443 	
       
  3444 	ASSERT_EQUALS(WaitForRequestWithTimeOut(getCallForwardingStatus, ETimeMedium), KErrNone, _L("RMobilePhone::GetCallForwardingIndicator timed-out."));
       
  3445 	ASSERT_EQUALS(getCallForwardingStatus.Int(), KErrNotSupported, _L("RMobilePhone::GetCallForwardingStatus getCallForwardStatus completed with incorrect error"));
       
  3446 	
       
  3447 	expectedServiceCaps = 0;
       
  3448 	
       
  3449 	ASSERT_BITS_SET(cfuIndicator.iIndicator, expectedServiceCaps, KNoUnwantedBits, _L("RMobilePhone::GetCallForwardingIndicator returned wrong caps"));
       
  3450 	
       
  3451 	// ===  Activate/Register call forwarding unconditional for Telephony ===
       
  3452 	
       
  3453 	newSetting.iServiceGroup=RMobilePhone::ETelephony;
       
  3454 	
       
  3455 	if(operatorName==EOperatorVodafone)
       
  3456 		{
       
  3457 		// Activate call forwarding using RMobilePhone::SetCallForwardingStatus with aCondition=ECallForwardingUnconditional and aInfo.iAction=RMobilePhone::EServiceActionActivate and aInfo.iServiceGroup=RMobilePhone::ETelephony and aInfo.iNumber.iNumberPlan=EIsdnNumberPlan, aInfo.iNumber.iTelNumber=valid number, aInfo.iNumber.iTypeOfNumber=ENationalNumber, aInfo.iTimeout=-1
       
  3458 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionActivate ECallForwardingUnconditional for ETelephony"));
       
  3459 		ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional), _L("SetCallForwardingStatusUtil with EServiceActionActivate ECallForwardingUnconditional for ETelephony failed"));
       
  3460 		}
       
  3461 	else if(operatorName==EOperatorO2 || operatorName==EOperatorOrange || operatorName==EOperatorTMobile)
       
  3462 		{
       
  3463 		// Register call forwarding using RMobilePhone::SetCallForwardingStatus with aCondition=ECallForwardingUnconditional and aInfo.iAction=RMobilePhone::EServiceActionRegister and aInfo.iServiceGroup=RMobilePhone::ETelephony and aInfo.iNumber.iNumberPlan=EIsdnNumberPlan, aInfo.iNumber.iTelNumber=valid number, aInfo.iNumber.iTypeOfNumber=ENationalNumber, aInfo.iTimeout=-1
       
  3464 		DEBUG_PRINTF1(_L("Setting call forward EServiceActionRegister ECallForwardingUnconditional for ETelephony"));
       
  3465 		ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional), _L("SetCallForwardingStatusUtil with EServiceActionRegister ECallForwardingUnconditional for ETelephony failed"));
       
  3466 		}
       
  3467 	
       
  3468 	// ===  Get call forwarding indicator ===
       
  3469 
       
  3470 	// Check RMobilePhone::GetCallForwardingIndicator returns KErrNotSupported
       
  3471 	mobilePhone.GetCallForwardingIndicator(getCallForwardingStatus, cfuIndicatorPackg);
       
  3472 	
       
  3473 	ASSERT_EQUALS(WaitForRequestWithTimeOut(getCallForwardingStatus, ETimeMedium), KErrNone, _L("RMobilePhone::GetCallForwardingIndicator timed-out."));
       
  3474 	ASSERT_EQUALS(getCallForwardingStatus.Int(), KErrNotSupported, _L("RMobilePhone::GetCallForwardingStatus getCallForwardStatus completed with incorrect error"));
       
  3475     	
       
  3476 	expectedServiceCaps = 0;
       
  3477 	
       
  3478 	ASSERT_BITS_SET(cfuIndicator.iIndicator, expectedServiceCaps, KNoUnwantedBits, _L("RMobilePhone::GetCallForwardingIndicator returned wrong caps"));
       
  3479 
       
  3480 	//
       
  3481 	// TEST END
       
  3482 	//
       
  3483 	
       
  3484     StartCleanup();
       
  3485 	
       
  3486 	// Ensure all call forwarding setting are erased
       
  3487 	newSetting.iServiceGroup=RMobilePhone::EAllServices;
       
  3488 	newSetting.iAction=RMobilePhone::EServiceActionErase;
       
  3489 	
       
  3490 	mobilePhone.SetCallForwardingStatus(setCallForwardStatus, RMobilePhone::ECallForwardingAllCases, newSetting);
       
  3491 	ASSERT_EQUALS(WaitForRequestWithTimeOut(setCallForwardStatus, ETimeMedium), KErrNone, _L("RMobilePhone::SetCallForwardingStatus timed-out"));
       
  3492 	ASSERT_EQUALS(setCallForwardStatus.Int(), KErrNone, _L("RMobilePhone::SetCallForwardingStatus setCallForwardStatus completed with incorrect error"));
       
  3493 		
       
  3494 	CleanupStack::PopAndDestroy(&getCallForwardingStatus);
       
  3495 	CleanupStack::PopAndDestroy(&setCallForwardStatus);
       
  3496 	
       
  3497 	return TestStepResult();
       
  3498 	}
       
  3499 
       
  3500 TPtrC CCTSYIntegrationTestCallForwarding0015::GetTestStepName()
       
  3501 /**
       
  3502  * @return The test step name.
       
  3503  */
       
  3504 	{
       
  3505 	return _L("CCTSYIntegrationTestCallForwarding0015");
       
  3506 	}
       
  3507 
       
  3508 
       
  3509 
       
  3510 CCTSYIntegrationTestCallForwarding0016::CCTSYIntegrationTestCallForwarding0016(CEtelSessionMgr& aEtelSessionMgr)
       
  3511 	: CCTSYIntegrationTestCallForwardingBase(aEtelSessionMgr)
       
  3512 /**
       
  3513  * Constructor.
       
  3514  */
       
  3515 	{
       
  3516 	SetTestStepName(CCTSYIntegrationTestCallForwarding0016::GetTestStepName());
       
  3517 	}
       
  3518 
       
  3519 CCTSYIntegrationTestCallForwarding0016::~CCTSYIntegrationTestCallForwarding0016()
       
  3520 /**
       
  3521  * Destructor.
       
  3522  */
       
  3523 	{
       
  3524 	}
       
  3525 
       
  3526 TVerdict CCTSYIntegrationTestCallForwarding0016::doTestStepL()
       
  3527 /**
       
  3528  * @SYMTestCaseID BA-CTSY-INT-CFOR-0016
       
  3529  * @SYMFssID BA/CTSY/CFOR-0016
       
  3530  * @SYMTestCaseDesc Invoke call forwarding
       
  3531  * @SYMTestPriority High
       
  3532  * @SYMTestActions 
       
  3533  * @SYMTestExpectedResults Pass - KErrArgument returned.
       
  3534  * @SYMTestType CIT
       
  3535  * @SYMTestCaseDependencies live/automatic
       
  3536  *
       
  3537  * Reason for test: Verify KErrArgument is returned.
       
  3538  *
       
  3539  * @return - TVerdict code
       
  3540  */
       
  3541 	{
       
  3542 
       
  3543 	//
       
  3544 	// SET UP
       
  3545 	//
       
  3546 	
       
  3547 	// Ensure RMobilePhone::GetCallServiceCaps returns caps in set of KCapsSetCFStatus
       
  3548 	RMobilePhone& mobilePhone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone);	
       
  3549 	
       
  3550 	// Call TNetworkTsyTestHelper::WaitForRegisteredOnHomeNetworkL		
       
  3551 	CHECK_EQUALS_L(iNetworkTestHelper.WaitForRegisteredOnHomeNetworkL(mobilePhone), KErrNone, _L("TNetworkTsyTestHelper::WaitForRegisteredOnHomeNetworkL returned with an error"));
       
  3552 	
       
  3553 	TUint32 callServiceCaps = 0;
       
  3554 	CHECK_EQUALS_L(mobilePhone.GetCallServiceCaps(callServiceCaps), KErrNone, _L("RMobilePhone::GetCallServiceCaps return value is not KErrNone"));
       
  3555 	TUint32 expectedServiceCaps = RMobilePhone::KCapsSetCFStatus;
       
  3556 	CHECK_BITS_SET_L(callServiceCaps, expectedServiceCaps, KNoUnwantedBits, _L("RMobilePhone::GetCallServiceCaps returned wrong caps"));
       
  3557 
       
  3558 	TPtrC number; 
       
  3559 	CHECK_TRUE_L(GetStringFromConfig(KIniVoiceNumSection, KIniVoiceNumber1, number) != EFalse, _L("GetStringFromConfig did not complete as expected"));
       
  3560 	DEBUG_PRINTF2(_L("Number obtained: %S"), &number);
       
  3561 
       
  3562 	//
       
  3563 	// SET UP END
       
  3564 	//
       
  3565 	
       
  3566 	StartTest();
       
  3567 	
       
  3568 	//
       
  3569 	// TEST START
       
  3570 	//
       
  3571 		
       
  3572 	// Invoke call forwarding using RMobilePhone::SetCallForwardingStatus with aCondition=ECallForwardingUnconditional and aInfo.iAction=RMobilePhone::EServiceActionInvoke and aInfo.iServiceGroup=RMobilePhone::EVoiceService and aInfo.iNumber.iNumberPlan=EIsdnNumberPlan, aInfo.iNumber.iTelNumber=valid number, aInfo.iNumber.iTypeOfNumber=ENationalNumber, aInfo.iTimeout=-1 
       
  3573 	// Check KErrArgument is returned.
       
  3574 	RMobilePhone::TMobilePhoneCFChangeV1 newSetting;
       
  3575 	newSetting.iServiceGroup=RMobilePhone::EVoiceService;
       
  3576 	newSetting.iAction=RMobilePhone::EServiceActionInvoke;
       
  3577 	newSetting.iNumber.iTelNumber=number;
       
  3578 	newSetting.iNumber.iNumberPlan=RMobilePhone::EIsdnNumberPlan;
       
  3579 	newSetting.iNumber.iTypeOfNumber=RMobilePhone::ENationalNumber;
       
  3580 	newSetting.iTimeout=-1;
       
  3581 	
       
  3582 	DEBUG_PRINTF1(_L("Setting call forward EServiceActionInvoke ECallForwardingUnconditional for EVoiceService"));	
       
  3583 	ASSERT_TRUE(SetCallForwardingStatusUtilL(mobilePhone, newSetting, RMobilePhone::ECallForwardingUnconditional, KErrArgument), _L("SetCallForwardingStatusUtil with EServiceActionInvoke ECallForwardingUnconditional for EVoiceService failed"));
       
  3584 	
       
  3585 	//
       
  3586 	// TEST END
       
  3587 	//
       
  3588 
       
  3589     StartCleanup();
       
  3590 	
       
  3591 	return TestStepResult();
       
  3592 	}
       
  3593 
       
  3594 TPtrC CCTSYIntegrationTestCallForwarding0016::GetTestStepName()
       
  3595 /**
       
  3596  * @return The test step name.
       
  3597  */
       
  3598 	{
       
  3599 	return _L("CCTSYIntegrationTestCallForwarding0016");
       
  3600 	}