telephonyserverplugins/common_tsy/test/integration/src/cctsyintegrationtestsmspstore.cpp
changeset 0 3553901f7fa8
child 24 6638e7f4bd8f
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 SMSPStore functional unit.
       
    15 // 
       
    16 //
       
    17 
       
    18 /**
       
    19  @internalTechnology
       
    20 */
       
    21 
       
    22 #include "cctsyintegrationtestsmspstore.h"
       
    23 #include "listretrievalhelpers.h"
       
    24 
       
    25 	
       
    26 CCTSYIntegrationTestSMSPStoreBase::CCTSYIntegrationTestSMSPStoreBase(CEtelSessionMgr& aEtelSessionMgr)
       
    27 	: CCTSYIntegrationTestSuiteStepBase(aEtelSessionMgr), iSmsMessagingTestHelper(*this)
       
    28 /**
       
    29  * Constructor
       
    30  */
       
    31 	{
       
    32 	}
       
    33 
       
    34 CCTSYIntegrationTestSMSPStoreBase::~CCTSYIntegrationTestSMSPStoreBase()
       
    35 /*
       
    36  * Destructor
       
    37  */
       
    38 	{
       
    39 	}
       
    40 	
       
    41 
       
    42 CCTSYIntegrationTestSMSPStore0001::CCTSYIntegrationTestSMSPStore0001(CEtelSessionMgr& aEtelSessionMgr)
       
    43 	: CCTSYIntegrationTestSMSPStoreBase(aEtelSessionMgr)
       
    44 /**
       
    45  * Constructor.
       
    46  */
       
    47 	{
       
    48 	SetTestStepName(CCTSYIntegrationTestSMSPStore0001::GetTestStepName());
       
    49 	}
       
    50 	
       
    51 	
       
    52 TBool CCTSYIntegrationTestSMSPStoreBase::CompareEntries(const RMobileSmsMessaging::TMobileSmspEntryV1 &aEntry1,
       
    53 		const RMobileSmsMessaging::TMobileSmspEntryV1 &aEntry2)
       
    54 /*
       
    55  * This function copares the previously stored enteries
       
    56  *
       
    57  * @param aEntry1 and aEntry2 reference the stored entries before and after retrival of them.
       
    58  * @return true if the comparison of enteries is successful.
       
    59  *
       
    60  */
       
    61 	{
       
    62 	TBool ret=ETrue;
       
    63 	
       
    64 	// Making Comparison with respect to Valid Parameter returned by the board
       
    65 	if(aEntry2.iValidParams & RMobileSmsMessaging::KSCAIncluded)
       
    66 		{
       
    67 		// Check CRetrieveMobilePhoneSmspList::Start returned correct service centre details
       
    68 		ASSERT_EQUALS_DES16(aEntry1.iServiceCentre.iTelNumber, aEntry2.iServiceCentre.iTelNumber, _L("CRetrieveMobilePhoneSmspList::Start did not return correct service centre telephone number "));
       
    69 		ASSERT_EQUALS(aEntry1.iServiceCentre.iNumberPlan, aEntry2.iServiceCentre.iNumberPlan, _L("CRetrieveMobilePhoneSmspList::Start did not return correct service centre number plan "));
       
    70 		ASSERT_EQUALS(aEntry1.iServiceCentre.iTypeOfNumber, aEntry2.iServiceCentre.iTypeOfNumber, _L("CRetrieveMobilePhoneSmspList::Start did not return correct service centre type of number "));
       
    71 		ASSERT_EQUALS(aEntry1.iIndex, aEntry2.iIndex, _L("Indexes are diffrent "));
       
    72 		if(aEntry1.iServiceCentre.iTelNumber!=aEntry2.iServiceCentre.iTelNumber
       
    73 				|| aEntry1.iServiceCentre.iNumberPlan!=aEntry2.iServiceCentre.iNumberPlan
       
    74 				|| aEntry1.iServiceCentre.iTypeOfNumber!=aEntry2.iServiceCentre.iTypeOfNumber)
       
    75 				ret=EFalse;	
       
    76 		}
       
    77 		
       
    78 	if(aEntry2.iValidParams & RMobileSmsMessaging::KDestinationIncluded)
       
    79 		{
       
    80 		// Check CRetrieveMobilePhoneSmspList::Start returned correct destination details
       
    81 		ASSERT_EQUALS_DES16(aEntry1.iDestination.iTelNumber, aEntry2.iDestination.iTelNumber, _L("CRetrieveMobilePhoneSmspList::Start did not return correct destination telephone number"));
       
    82 		ASSERT_EQUALS(aEntry1.iDestination.iNumberPlan, aEntry2.iDestination.iNumberPlan, _L("CRetrieveMobilePhoneSmspList::Start did not return correct destination number plan"));
       
    83 		ASSERT_EQUALS(aEntry1.iDestination.iTypeOfNumber, aEntry2.iDestination.iTypeOfNumber, _L("CRetrieveMobilePhoneSmspList::Start did not return correct destination type of number"));
       
    84 		if(aEntry1.iDestination.iTelNumber!=aEntry2.iDestination.iTelNumber
       
    85 			|| aEntry1.iDestination.iNumberPlan!=aEntry2.iDestination.iNumberPlan
       
    86 			|| aEntry1.iDestination.iTypeOfNumber!=aEntry2.iDestination.iTypeOfNumber)
       
    87 			ret=EFalse;	
       
    88 		}
       
    89 		
       
    90 	if(aEntry2.iValidParams & RMobileSmsMessaging::KProtocolIdIncluded)
       
    91 		{	
       
    92 		// Check CRetrieveMobilePhoneSmspList::Start returned correct protocolId details
       
    93 		ASSERT_EQUALS(aEntry1.iProtocolId,aEntry2.iProtocolId, _L("CRetrieveMobilePhoneSmspList::Start did not return correct protocolId"));	
       
    94 		if(aEntry1.iProtocolId!=aEntry2.iProtocolId)
       
    95 			ret=EFalse;
       
    96 		}	
       
    97 	
       
    98 	if(aEntry2.iValidParams & RMobileSmsMessaging::KDcsIncluded)
       
    99 		{
       
   100 		// Check CRetrieveMobilePhoneSmspList::Start returned correct Dcs
       
   101 		ASSERT_EQUALS(aEntry1.iDcs,aEntry2.iDcs, _L("CRetrieveMobilePhoneSmspList::Start did not return correct Dcs"));	
       
   102 		if(aEntry1.iDcs!=aEntry2.iDcs)
       
   103 			ret=EFalse;
       
   104 		}
       
   105 	
       
   106 	if(aEntry2.iValidParams & RMobileSmsMessaging::KValidityPeriodIncluded)
       
   107 		{
       
   108 		// Check CRetrieveMobilePhoneSmspList::Start returned correct Validity Period
       
   109 		ASSERT_EQUALS(aEntry1.iValidityPeriod, aEntry2.iValidityPeriod, _L("CRetrieveMobilePhoneSmspList::Start did not return correct validity period"));	
       
   110 		if(aEntry1.iValidityPeriod!=aEntry2.iValidityPeriod)
       
   111 			ret=EFalse;
       
   112 		}	
       
   113 	return ret;
       
   114 	
       
   115 	}
       
   116 
       
   117 
       
   118 CCTSYIntegrationTestSMSPStore0001::~CCTSYIntegrationTestSMSPStore0001()
       
   119 /**
       
   120  * Destructor.
       
   121  */
       
   122 	{
       
   123 	}
       
   124 
       
   125 TVerdict CCTSYIntegrationTestSMSPStore0001::doTestStepL()
       
   126 /**
       
   127  * @SYMTestCaseID BA-CTSY-INT-SMSP-0001
       
   128  * @SYMFssID BA/CTSY/SMSP-0001
       
   129  * @SYMTestCaseDesc Store and retrieve a SMSP list.
       
   130  * @SYMTestPriority High
       
   131  * @SYMTestActions RMobileSmsMessaging::StoreSmspListL, CRetrieveMobilePhoneSmspList::Start, CMobilePhoneSmspList::NewL, CRetrieveMobilePhoneSmspList::NewL, CMobilePhoneSmspList::AddEntryL, RMobileSmsMessaging::NotifySmspListChange
       
   132  * @SYMTestExpectedResults Pass - SMSP list stored and retrieved correctly.
       
   133  * @SYMTestType CIT
       
   134  * @SYMTestCaseDependencies live/automatic
       
   135  *
       
   136  * Reason for test: Verify list can be stored and retrieved list contains correct entries.
       
   137  *
       
   138  * @return - TVerdict code
       
   139  */
       
   140 	{
       
   141 
       
   142 	//
       
   143 	// SET UP
       
   144 	//
       
   145 	
       
   146 	// Get the RMobileSmsMessaging subsession
       
   147 	RMobileSmsMessaging& smsMessaging = iEtelSessionMgr.GetSmsMessagingL(KMainServer,KMainPhone,KMainSmsMessaging);
       
   148 	
       
   149 	// Ensure RMobileSmsMessaging::GetCaps returns aCaps.iSmsControl caps in set of KCapsSetSmspList | KCapsGetSmspList 
       
   150 	RMobileSmsMessaging::TMobileSmsCapsV1  smsCaps;
       
   151 	RMobileSmsMessaging::TMobileSmsCapsV1Pckg smsCapsPckg(smsCaps);
       
   152 	CHECK_EQUALS_L(smsMessaging.GetCaps(smsCapsPckg),KErrNone, _L("RMobileSmsMessaging::GetCaps returned returned with an error"));
       
   153 	TUint32 expectedCaps= RMobileSmsMessaging::KCapsSetSmspList | RMobileSmsMessaging::KCapsGetSmspList;
       
   154 	CHECK_BITS_SET_L(smsCaps.iSmsControl, expectedCaps, KNoUnwantedBits, _L("RMobileSmsMessaging::GetCaps returned with unexpected caps"));
       
   155 	
       
   156 	// Take the backup of the SMSP list. 
       
   157 	TInt listCountAtStart;
       
   158 	TBackupList backup(*this,smsMessaging);
       
   159 	CHECK_TRUE_L(backup.BackupL(listCountAtStart), _L("TBackupList::Backup could not backup"));
       
   160 	CleanupStack::PushL (backup);
       
   161 	
       
   162 	//
       
   163 	// SET UP END
       
   164 	//
       
   165 	
       
   166 	StartTest();
       
   167 	
       
   168 	//
       
   169 	// TEST START
       
   170 	//
       
   171 	
       
   172 	// ===  Store SMSP list ===
       
   173 
       
   174 	// Create a CMobilePhoneSmspList with CMobilePhoneSmspList::NewL 
       
   175    	CMobilePhoneSmspList* smspList = CMobilePhoneSmspList::NewL();
       
   176 	CleanupStack::PushL(smspList); 
       
   177 	
       
   178 	// Create a RMobileSmsMessaging::TMobileSmspEntryV1 entry with the following parameters: 
       
   179 	RMobileSmsMessaging::TMobileSmspEntryV1 smspEntry;
       
   180 
       
   181 	     smspEntry.iText = _L("VODAFONE"); 
       
   182 	 	 
       
   183 	     smspEntry.iValidParams = RMobileSmsMessaging::KSCAIncluded 
       
   184 
       
   185 	         | RMobileSmsMessaging::KProtocolIdIncluded 
       
   186 
       
   187 	         | RMobileSmsMessaging::KDcsIncluded 
       
   188 
       
   189 	         | RMobileSmsMessaging::KValidityPeriodIncluded; 
       
   190 
       
   191 
       
   192 	     smspEntry.iDestination.iTelNumber = _L(""); 
       
   193 		
       
   194 	     smspEntry.iDestination.iNumberPlan = RMobilePhone::EUnknownNumberingPlan; 
       
   195 		
       
   196 	     smspEntry.iDestination.iTypeOfNumber = RMobilePhone::EUnknownNumber; 
       
   197 		
       
   198 	     smspEntry.iValidityPeriod = 183; 
       
   199 	
       
   200 	     smspEntry.iServiceCentre.iTelNumber = _L("+441632960000"); 
       
   201 	
       
   202 	     smspEntry.iServiceCentre.iNumberPlan = RMobilePhone::EIsdnNumberPlan; 
       
   203 	
       
   204 	     smspEntry.iServiceCentre.iTypeOfNumber = RMobilePhone::EInternationalNumber; 
       
   205 
       
   206 	     smspEntry.iProtocolId = 0; 
       
   207 
       
   208 	     smspEntry.iDcs = 0; 
       
   209 
       
   210 	     smspEntry.iIndex = 1; 
       
   211 
       
   212 	// Add the entry to the CMobilePhoneSmspList list with CMobilePhoneSmspList::AddEntryL 
       
   213 	smspList->AddEntryL(smspEntry);
       
   214 	
       
   215 	// Post notification for RMobileSmsMessaging::NotifySmspListChange
       
   216 	TExtEtelRequestStatus notifySmspListChangeStatus(smsMessaging, EMobileSmsMessagingNotifySmspListChange);
       
   217 	CleanupStack::PushL(notifySmspListChangeStatus);
       
   218 	smsMessaging.NotifySmspListChange(notifySmspListChangeStatus);
       
   219 
       
   220 	// This is deliberate action to open a session because the API in Etelmm allocates memory
       
   221 	// The Session Manager should be used in all other places.
       
   222 	RMobilePhone& phone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone);
       
   223 	RMobileSmsMessaging smsMessagingStore;
       
   224 	User::LeaveIfError(smsMessagingStore.Open(phone));
       
   225 	
       
   226 	// Store the empty SMSP list with RMobileSmsMessaging::StoreSmspListL 
       
   227 	TExtEtelRequestStatus storeSmspListStatus(smsMessaging, EMobileSmsMessagingStoreSmspList);
       
   228 	CleanupStack::PushL(storeSmspListStatus);
       
   229 	smsMessagingStore.StoreSmspListL(storeSmspListStatus,smspList);
       
   230 	ASSERT_EQUALS(WaitForRequestWithTimeOut(storeSmspListStatus, ETimeMedium),KErrNone, _L("RMobileSmsMessaging::StoreSmspListL timed out"));
       
   231 	ASSERT_EQUALS(storeSmspListStatus.Int(), KErrNone, _L("RMobileSmsMessaging::StoreSmspListL returned with an error"));		
       
   232 	smsMessagingStore.Close();
       
   233 	
       
   234 	// Check RMobileSmsMessaging::NotifySmspListChange completes with KErrNone		
       
   235 	TInt expectedStatus = KErrNone;
       
   236 	iSmsMessagingTestHelper.WaitForMobileSmsMessagingNotifySmspListChange(notifySmspListChangeStatus,expectedStatus);
       
   237 		
       
   238 	// ===  Retrieve list and check it is the same as the stored list ===
       
   239 
       
   240 	// Use the helper class for CRetrieveMobilePhoneSmspList to retrieve the SMSP list. 
       
   241 	TInt err=0;
       
   242 	CRetrieveMobilePhoneSmspListExec* smspListExec = CRetrieveMobilePhoneSmspListHelper::NewL(smsMessaging);	
       
   243 	CleanupStack::PushL(smspListExec);
       
   244 	CMobilePhoneSmspList* mobileSmspList = smspListExec->DoGetList(err);
       
   245 	ASSERT_EQUALS(err, KErrNone, _L("CRetrieveMobilePhoneSmspList::Start returned with an error"));
       
   246 
       
   247  	//	Check CRetrieveMobilePhoneSmspList::Enumerate returns 1 using the helper class function
       
   248 	TInt listEntries=mobileSmspList->Enumerate();
       
   249 	if(listCountAtStart==0)
       
   250 		{
       
   251 		ASSERT_EQUALS(listEntries, 1, _L("CRetrieveMobilePhoneSmspList::Enumerate did not return one entry as expected"));
       
   252 		}
       
   253    	else
       
   254    		{
       
   255    		ASSERT_EQUALS(listCountAtStart,listEntries, _L("CRetrieveMobilePhoneSmspList::Enumerate did not return number of entries as expected"));
       
   256    		}
       
   257   
       
   258    	// 	Check the entry in the CMobilePhoneSmspList is the same the entry stored
       
   259    	RMobileSmsMessaging::TMobileSmspEntryV1 item;
       
   260    	item=mobileSmspList->GetEntryL(0); // zero is the first index in retrieval list
       
   261    	ASSERT_TRUE(CompareEntries(item,smspEntry),_L("Comparison of stroed enteries failed"));
       
   262 	  	 
       
   263    	//
       
   264 	// TEST END
       
   265 	//
       
   266 		   	
       
   267     StartCleanup();
       
   268    
       
   269     // Pop :
       
   270     // backup
       
   271     // smspList
       
   272     // notifySmspListChangeStatus
       
   273 	// storeSmspListStatus
       
   274 	// smspListExec;
       
   275     CleanupStack::PopAndDestroy(5, &backup);
       
   276       
       
   277     return TestStepResult();
       
   278 	
       
   279 	}
       
   280 
       
   281 TPtrC CCTSYIntegrationTestSMSPStore0001::GetTestStepName()
       
   282 /**
       
   283  * @return The test step name.
       
   284  */
       
   285 	{
       
   286 	return _L("CCTSYIntegrationTestSMSPStore0001");
       
   287 	}
       
   288 
       
   289 
       
   290 
       
   291 CCTSYIntegrationTestSMSPStore0002::CCTSYIntegrationTestSMSPStore0002(CEtelSessionMgr& aEtelSessionMgr)
       
   292 	: CCTSYIntegrationTestSMSPStoreBase(aEtelSessionMgr)
       
   293 /**
       
   294  * Constructor.
       
   295  */
       
   296 	{
       
   297 	SetTestStepName(CCTSYIntegrationTestSMSPStore0002::GetTestStepName());
       
   298 	}
       
   299 
       
   300 CCTSYIntegrationTestSMSPStore0002::~CCTSYIntegrationTestSMSPStore0002()
       
   301 /**
       
   302  * Destructor.
       
   303  */
       
   304 	{
       
   305 	}
       
   306 
       
   307 TVerdict CCTSYIntegrationTestSMSPStore0002::doTestStepL()
       
   308 /**
       
   309  * @SYMTestCaseID BA-CTSY-INT-SMSP-0002
       
   310  * @SYMFssID BA/CTSY/SMSP-0002
       
   311  * @SYMTestCaseDesc Store an SMSP list with multiple entries.
       
   312  * @SYMTestPriority High
       
   313  * @SYMTestActions This requires an O2 SIM or anyother, which can store multiple entries in SMSP List RMobileSmsMessaging::StoreSmspListL, CRetrieveMobilePhoneSmspList::RetrieveListL
       
   314  * @SYMTestExpectedResults Pass - SMSP list stored.
       
   315  * @SYMTestType CIT
       
   316  * @SYMTestCaseDependencies live/manual
       
   317  *
       
   318  * Reason for test: Verify list can be stored and retrieved list contains correct entries.
       
   319  *
       
   320  * @return - TVerdict code
       
   321  */
       
   322 	{
       
   323 
       
   324 	//
       
   325 	// SET UP
       
   326 	//
       
   327 		
       
   328 	// Get the RMobileSmsMessaging subsession
       
   329 	RMobileSmsMessaging& smsMessaging = iEtelSessionMgr.GetSmsMessagingL(KMainServer,KMainPhone,KMainSmsMessaging);
       
   330 	
       
   331 	// Ensure RMobileSmsMessaging::GetCaps returns aCaps.iSmsControl caps in set of KCapsSetSmspList | KCapsGetSmspList 
       
   332 	RMobileSmsMessaging::TMobileSmsCapsV1  smsCaps;
       
   333 	RMobileSmsMessaging::TMobileSmsCapsV1Pckg smsCapsPckg(smsCaps);
       
   334 	CHECK_EQUALS_L(smsMessaging.GetCaps(smsCapsPckg),KErrNone, _L("RMobileSmsMessaging::GetCaps returned returned with an error"));
       
   335 	TUint32 expectedCaps= RMobileSmsMessaging::KCapsSetSmspList | RMobileSmsMessaging::KCapsGetSmspList;
       
   336 	CHECK_BITS_SET_L(smsCaps.iSmsControl, expectedCaps, KNoUnwantedBits, _L("RMobileSmsMessaging::GetCaps returned with unexpected caps"));
       
   337 
       
   338 	// Take the backup of SMSP list. 
       
   339 	TInt listCountAtStart;
       
   340 	TBackupList backup(*this,smsMessaging);
       
   341 	CHECK_TRUE_L(backup.BackupL(listCountAtStart), _L("TBackupList::Backup could not backup"));
       
   342 	CleanupStack::PushL (backup);
       
   343 	
       
   344 	//
       
   345 	// SET UP END
       
   346 	//
       
   347 		
       
   348 	StartTest();
       
   349 	
       
   350 	//
       
   351 	// TEST START
       
   352 	//
       
   353 		
       
   354 	TBuf<130> prompt(_L("You need to insert an O2 SIM before running that test, because O2 SIM can store multiple(3) entries in the list"));
       
   355 	DisplayUserInteractionPromptL(prompt); // 30 seconds
       
   356 
       
   357 	// ===  Store SMSP list ===
       
   358 
       
   359 	// Create a CMobilePhoneSmspList with CMobilePhoneSmspList::NewL 
       
   360 	CMobilePhoneSmspList* smspList = CMobilePhoneSmspList::NewL();
       
   361 	CleanupStack::PushL(smspList);
       
   362 	
       
   363 	// Create a RMobileSmsMessaging::TMobileSmspEntryV1 entry with the following parameters: 
       
   364 	RMobileSmsMessaging::TMobileSmspEntryV1 smspEntry;
       
   365 	     
       
   366 	     smspEntry.iText = _L("ABCD"); 
       
   367 
       
   368 	     smspEntry.iValidParams = RMobileSmsMessaging::KDestinationIncluded 
       
   369 
       
   370 	         | RMobileSmsMessaging::KSCAIncluded 
       
   371 
       
   372 	         | RMobileSmsMessaging::KProtocolIdIncluded 
       
   373 
       
   374 	         | RMobileSmsMessaging::KDcsIncluded 
       
   375 
       
   376 	         | RMobileSmsMessaging::KValidityPeriodIncluded; 
       
   377 
       
   378 	     smspEntry.iDestination.iTelNumber = _L("+1234567890"); 
       
   379 
       
   380 	     smspEntry.iDestination.iNumberPlan = RMobilePhone::EIsdnNumberPlan; 
       
   381 
       
   382 	     smspEntry.iDestination.iTypeOfNumber = RMobilePhone::EInternationalNumber; 
       
   383 
       
   384 	     smspEntry.iValidityPeriod = 0; 
       
   385 
       
   386 	     smspEntry.iServiceCentre.iTelNumber = _L("+123"); 
       
   387 
       
   388 	     smspEntry.iServiceCentre.iNumberPlan = RMobilePhone::EIsdnNumberPlan; 
       
   389 
       
   390 	     smspEntry.iServiceCentre.iTypeOfNumber = RMobilePhone::EInternationalNumber; 
       
   391 
       
   392 	     smspEntry.iProtocolId = 2; 
       
   393 
       
   394 	     smspEntry.iDcs = 4; 
       
   395 
       
   396 	     smspEntry.iIndex = 1; 
       
   397 	
       
   398 	// Add the entry to the CMobilePhoneSmspList list with CMobilePhoneSmspList::AddEntryL 
       
   399 	smspList->AddEntryL(smspEntry);
       
   400 
       
   401 	// Create another RMobileSmsMessaging::TMobileSmspEntryV1 entry with the following parameters: 
       
   402 	RMobileSmsMessaging::TMobileSmspEntryV1 smspEntry2;
       
   403 		
       
   404 		smspEntry2.iText = _L("EFGH");
       
   405 		
       
   406 		smspEntry2.iValidParams = RMobileSmsMessaging::KDestinationIncluded 
       
   407 
       
   408 	         | RMobileSmsMessaging::KSCAIncluded 
       
   409 
       
   410 	         | RMobileSmsMessaging::KProtocolIdIncluded 
       
   411 
       
   412 	         | RMobileSmsMessaging::KDcsIncluded 
       
   413 
       
   414 	         | RMobileSmsMessaging::KValidityPeriodIncluded; 
       
   415 	    
       
   416 	    smspEntry2.iDestination.iTelNumber = _L("+987654"); 
       
   417 
       
   418 	    smspEntry2.iDestination.iNumberPlan = RMobilePhone::EIsdnNumberPlan; 
       
   419 
       
   420 	    smspEntry2.iDestination.iTypeOfNumber = RMobilePhone::EInternationalNumber; 
       
   421 
       
   422 	    smspEntry2.iValidityPeriod = 0; 
       
   423 
       
   424 	  	smspEntry2.iServiceCentre.iTypeOfNumber=RMobilePhone::EInternationalNumber; 
       
   425 
       
   426 	  	smspEntry2.iServiceCentre.iNumberPlan=RMobilePhone:: EIsdnNumberPlan; 
       
   427 
       
   428 	  	smspEntry2.iServiceCentre.iTelNumber=_L("+456"); 
       
   429 	  	
       
   430 	  	smspEntry2.iProtocolId = 2; 
       
   431 
       
   432 	    smspEntry2.iDcs = 4; 
       
   433 
       
   434 	    smspEntry2.iIndex = 2; 
       
   435 
       
   436 	// Add the entry to the CMobilePhoneSmspList list with CMobilePhoneSmspList::AddEntryL 
       
   437 	smspList->AddEntryL(smspEntry2);
       
   438 		
       
   439 	// Create another RMobileSmsMessaging::TMobileSmspEntryV1 entry with the following parameters: 
       
   440 	RMobileSmsMessaging::TMobileSmspEntryV1 smspEntry3;
       
   441 	  	
       
   442 	  	smspEntry3.iText = _L("IJKL"); 
       
   443 
       
   444         smspEntry3.iValidParams = RMobileSmsMessaging::KDestinationIncluded 
       
   445 
       
   446 	         | RMobileSmsMessaging::KSCAIncluded 
       
   447 
       
   448 	         | RMobileSmsMessaging::KProtocolIdIncluded 
       
   449 
       
   450 	         | RMobileSmsMessaging::KDcsIncluded 
       
   451 
       
   452 	         | RMobileSmsMessaging::KValidityPeriodIncluded; 
       
   453 
       
   454         smspEntry3.iDestination.iTelNumber = _L("+12456"); 
       
   455 
       
   456 	    smspEntry3.iDestination.iNumberPlan = RMobilePhone::EIsdnNumberPlan; 
       
   457 
       
   458 	    smspEntry3.iDestination.iTypeOfNumber = RMobilePhone::EInternationalNumber; 
       
   459 
       
   460 	    smspEntry3.iValidityPeriod = 0; 
       
   461 
       
   462 	    smspEntry3.iServiceCentre.iTelNumber = _L("+789"); 
       
   463 
       
   464 	    smspEntry3.iServiceCentre.iNumberPlan = RMobilePhone::EIsdnNumberPlan; 
       
   465 
       
   466 	    smspEntry3.iServiceCentre.iTypeOfNumber = RMobilePhone::EInternationalNumber; 
       
   467 
       
   468 	    smspEntry3.iProtocolId = 2; 
       
   469 
       
   470 	    smspEntry3.iDcs = 4; 
       
   471 
       
   472 	   	smspEntry3.iIndex = 3; 
       
   473 	     
       
   474 	// Add the entry to the CMobilePhoneSmspList list with CMobilePhoneSmspList::AddEntryL 
       
   475 	smspList->AddEntryL(smspEntry3);
       
   476 
       
   477 	// Post notification for RMobileSmsMessaging::NotifySmspListChange
       
   478 	TExtEtelRequestStatus notifySmspListChangeStatus(smsMessaging, EMobileSmsMessagingNotifySmspListChange);
       
   479 	CleanupStack::PushL(notifySmspListChangeStatus);
       
   480 	smsMessaging.NotifySmspListChange(notifySmspListChangeStatus);
       
   481 	
       
   482 	// Store the empty SMSP list with RMobileSmsMessaging::StoreSmspListL 
       
   483 	TExtEtelRequestStatus storeSmspListStatus(smsMessaging, EMobileSmsMessagingStoreSmspList);
       
   484 	CleanupStack::PushL(storeSmspListStatus);
       
   485 	smsMessaging.StoreSmspListL(storeSmspListStatus,smspList);
       
   486 	ASSERT_EQUALS(WaitForRequestWithTimeOut(storeSmspListStatus, ETimeMedium),KErrNone, _L("RMobileSmsMessaging::StoreSmspListL timed out"));
       
   487 	ASSERT_EQUALS(storeSmspListStatus.Int(), KErrNone, _L("RMobileSmsMessaging::StoreSmspListL returned with an error"));		
       
   488 	
       
   489 	// Check RMobileSmsMessaging::NotifySmspListChange completes with KErrNone		
       
   490 	TInt expectedStatus = KErrNone;
       
   491 	iSmsMessagingTestHelper.WaitForMobileSmsMessagingNotifySmspListChange(notifySmspListChangeStatus,expectedStatus);
       
   492 	
       
   493 	// ===  Retrieve list and check it is the same as the stored list ===
       
   494 
       
   495 	// Use the helper class for CRetrieveMobilePhoneSmspList to retrieve the SMSP list. 
       
   496 	TInt err=0;
       
   497 	CRetrieveMobilePhoneSmspListExec* smspListExec = CRetrieveMobilePhoneSmspListHelper::NewL(smsMessaging);	
       
   498 	CleanupStack::PushL(smspListExec);
       
   499 	CMobilePhoneSmspList* mobileSmspList = smspListExec->DoGetList(err);
       
   500 	ASSERT_EQUALS(err, KErrNone, _L("CRetrieveMobilePhoneSmspList::Start returned with an error"));
       
   501 
       
   502 	// Check CRetrieveMobilePhoneSmspList::Enumerate returns 3 using the helper class
       
   503  	TInt listEnteries=mobileSmspList->Enumerate();
       
   504 	ASSERT_EQUALS(listEnteries, 3, _L("CRetrieveMobilePhoneSmspList::Enumerate did not return the correct number of enteries"));
       
   505 	
       
   506 	// Check the entry in the CMobilePhoneSmspList is the same the entry stored
       
   507    	RMobileSmsMessaging::TMobileSmspEntryV1 item;
       
   508    	RMobileSmsMessaging::TMobileSmspEntryV1 tempSmspEntry;
       
   509 	for(TInt i=0;i<listEnteries;i++)
       
   510 		{
       
   511 		item=mobileSmspList->GetEntryL(i);
       
   512 		if(i==0)
       
   513 		tempSmspEntry=smspEntry;
       
   514 		else if(i==1)
       
   515 		tempSmspEntry=smspEntry2;
       
   516 		else
       
   517 		tempSmspEntry=smspEntry3;
       
   518 		ASSERT_TRUE(CompareEntries(tempSmspEntry,item),_L("Comparison of stroed enteries failed"));
       
   519 		}
       
   520 	
       
   521 	//
       
   522 	// TEST END
       
   523 	//
       
   524 
       
   525     StartCleanup();
       
   526     
       
   527     // Pop:
       
   528     // backup
       
   529 	// smspListExec;
       
   530  	// storeSmspListStatus
       
   531 	// notifySmspListChangeStatus);	
       
   532 	// smspList
       
   533     CleanupStack::PopAndDestroy(5, &backup);
       
   534     	
       
   535     return TestStepResult();
       
   536 	}
       
   537 
       
   538 TPtrC CCTSYIntegrationTestSMSPStore0002::GetTestStepName()
       
   539 /**
       
   540  * @return The test step name.
       
   541  */
       
   542 	{
       
   543 	return _L("CCTSYIntegrationTestSMSPStore0002");
       
   544 	}
       
   545 
       
   546 CCTSYIntegrationTestSMSPStore0003::CCTSYIntegrationTestSMSPStore0003(CEtelSessionMgr& aEtelSessionMgr)
       
   547 	: CCTSYIntegrationTestSMSPStoreBase(aEtelSessionMgr)
       
   548 /**
       
   549  * Constructor.
       
   550  */
       
   551 	{
       
   552 	SetTestStepName(CCTSYIntegrationTestSMSPStore0003::GetTestStepName());
       
   553 	}
       
   554 
       
   555 CCTSYIntegrationTestSMSPStore0003::~CCTSYIntegrationTestSMSPStore0003()
       
   556 /**
       
   557  * Destructor.
       
   558  */
       
   559 	{
       
   560 	}
       
   561 
       
   562 TVerdict CCTSYIntegrationTestSMSPStore0003::doTestStepL()
       
   563 /**
       
   564  * @SYMTestCaseID BA-CTSY-INT-SMSP-0003
       
   565  * @SYMFssID BA/CTSY/SMSP-0003
       
   566  * @SYMTestCaseDesc Store an empty SMSP list.
       
   567  * @SYMTestPriority High
       
   568  * @SYMTestActions CMobilePhoneSmspList::NewL, CRetrieveMobilePhoneSmspList::NewL, RMobileSmsMessaging::StoreSmspListL, CRetrieveMobilePhoneSmspList::Start
       
   569  * @SYMTestExpectedResults Pass - Empty SMSP list is not stored and retrieved list is not empty.
       
   570  * @SYMTestType CIT
       
   571  * @SYMTestCaseDependencies live/automatic
       
   572  *
       
   573  * Reason for test: Verify error is returned.
       
   574  *
       
   575  * @return - TVerdict code
       
   576  */
       
   577 	{
       
   578 
       
   579 	//
       
   580 	// SET UP
       
   581 	//
       
   582 	
       
   583 	// Get the RMobileSmsMessaging subsession
       
   584 	RMobileSmsMessaging& smsMessaging = iEtelSessionMgr.GetSmsMessagingL(KMainServer,KMainPhone,KMainSmsMessaging);
       
   585 
       
   586 	// Ensure RMobileSmsMessaging::GetCaps returns aCaps.iSmsControl caps in set of KCapsSetSmspList | KCapsGetSmspList 
       
   587 	RMobileSmsMessaging::TMobileSmsCapsV1  smsCaps;
       
   588 	RMobileSmsMessaging::TMobileSmsCapsV1Pckg smsCapsPckg(smsCaps);
       
   589 	CHECK_EQUALS_L(smsMessaging.GetCaps(smsCapsPckg),KErrNone, _L("RMobileSmsMessaging::GetCaps returned returned with an error"));
       
   590 	TUint32 expectedCaps= RMobileSmsMessaging::KCapsSetSmspList | RMobileSmsMessaging::KCapsGetSmspList;
       
   591 	CHECK_BITS_SET_L(smsCaps.iSmsControl, expectedCaps, KNoUnwantedBits, _L("RMobileSmsMessaging::GetCaps returned with unexpected caps"));
       
   592 		
       
   593 	//
       
   594 	// SET UP END
       
   595 	//
       
   596 
       
   597 	StartTest();
       
   598 	
       
   599 	//
       
   600 	// TEST START
       
   601 	//
       
   602 	
       
   603 	// ===  Store empty list ===
       
   604 	
       
   605 	// Create a CMobilePhoneSmspList with CMobilePhoneSmspList::NewL 
       
   606 	CMobilePhoneSmspList* smspList = CMobilePhoneSmspList::NewL();
       
   607 	CleanupStack::PushL(smspList);
       
   608 		
       
   609 	// Post notification for RMobileSmsMessaging::NotifySmspListChange
       
   610 	TExtEtelRequestStatus notifySmspListChangeStatus(smsMessaging, EMobileSmsMessagingNotifySmspListChange);
       
   611 	CleanupStack::PushL(notifySmspListChangeStatus);
       
   612 	smsMessaging.NotifySmspListChange(notifySmspListChangeStatus);
       
   613 
       
   614 	// This is deliberate action to open a session because the API in Etelmm allocates memory
       
   615 	// The Session Manager should be used in all other places.
       
   616 	RMobilePhone& phone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone);
       
   617 	RMobileSmsMessaging smsMessagingStore;
       
   618  	smsMessagingStore.Open(phone);
       
   619  		
       
   620 	// Store the empty SMSP list with RMobileSmsMessaging::StoreSmspListL cause Error 
       
   621 	TExtEtelRequestStatus storeSmspListStatus(smsMessaging, EMobileSmsMessagingStoreSmspList);
       
   622 	CleanupStack::PushL(storeSmspListStatus);
       
   623 	smsMessaging.StoreSmspListL(storeSmspListStatus,smspList);
       
   624 	ASSERT_EQUALS(WaitForRequestWithTimeOut(storeSmspListStatus, ETimeMedium),KErrNone, _L("RMobileSmsMessaging::StoreSmspListL timed out"));
       
   625 	ASSERT_TRUE(storeSmspListStatus.Int()!= KErrNone, _L("RMobileSmsMessaging::StoreSmspListL did not return an error"))		
       
   626 	ERR_PRINTF2(_L("<font color=Orange>$CTSYKnownFailure: defect id = %d</font>"), 10012);
       
   627 	smsMessagingStore.Close();
       
   628 	
       
   629 	// Check RMobileSmsMessaging::NotifySmspListChange completes with KErrNone
       
   630 	TInt expectedStatus = KErrNone;
       
   631 	iSmsMessagingTestHelper.WaitForMobileSmsMessagingNotifySmspListChange(notifySmspListChangeStatus,expectedStatus);
       
   632 	
       
   633 	// ===  Retrieve list and check it is the same as the stored list ===
       
   634 
       
   635 	// Use the helper class for CRetrieveMobilePhoneSmspList to retrieve the SMSP list. 
       
   636 	TInt err=0;
       
   637 	CRetrieveMobilePhoneSmspListExec* smspListExec = CRetrieveMobilePhoneSmspListHelper::NewL(smsMessaging);	
       
   638 	CleanupStack::PushL(smspListExec);
       
   639 	CMobilePhoneSmspList* mobileSmspList = smspListExec->DoGetList(err);
       
   640 	ASSERT_EQUALS(err, KErrNone, _L("CRetrieveMobilePhoneSmspList::Start returned with an error"));
       
   641 
       
   642 	// Check CMobilePhoneSmspList::Enumerate on the list returned returns value bigger than 0
       
   643 	TInt listEnteries=mobileSmspList->Enumerate();
       
   644 	ASSERT_TRUE(listEnteries> 0, _L("CRetrieveMobilePhoneSmspList::Enumerate returned an empty list"))
       
   645 	
       
   646 	//
       
   647 	// TEST END
       
   648 	//
       
   649 
       
   650     StartCleanup();
       
   651 	
       
   652 	// Pop 
       
   653 	// smspListExec;
       
   654  	// storeSmspListStatus
       
   655 	// notifySmspListChangeStatus);	
       
   656 	// smspList
       
   657 
       
   658     CleanupStack::PopAndDestroy(4, smspList);
       
   659    	return TestStepResult();
       
   660 	}
       
   661 
       
   662 TPtrC CCTSYIntegrationTestSMSPStore0003::GetTestStepName()
       
   663 /**
       
   664  * @return The test step name.
       
   665  */
       
   666 	{
       
   667 	return _L("CCTSYIntegrationTestSMSPStore0003");
       
   668 	}
       
   669 
       
   670 
       
   671 
       
   672 CCTSYIntegrationTestSMSPStore0004::CCTSYIntegrationTestSMSPStore0004(CEtelSessionMgr& aEtelSessionMgr)
       
   673 	: CCTSYIntegrationTestSMSPStoreBase(aEtelSessionMgr)
       
   674 /**
       
   675  * Constructor.
       
   676  */
       
   677 	{
       
   678 	SetTestStepName(CCTSYIntegrationTestSMSPStore0004::GetTestStepName());
       
   679 	}
       
   680 
       
   681 CCTSYIntegrationTestSMSPStore0004::~CCTSYIntegrationTestSMSPStore0004()
       
   682 /**
       
   683  * Destructor.
       
   684  */
       
   685 	{
       
   686 	}
       
   687 
       
   688 TVerdict CCTSYIntegrationTestSMSPStore0004::doTestStepL()
       
   689 /**
       
   690  * @SYMTestCaseID BA-CTSY-INT-SMSP-0004
       
   691  * @SYMFssID BA/CTSY/SMSP-0004
       
   692  * @SYMTestCaseDesc Cancel reading SMSP list entries.
       
   693  * @SYMTestPriority High
       
   694  * @SYMTestActions CRetrieveMobilePhoneSmspList::Start, CRetrieveMobilePhoneSmspList::Cancel
       
   695  * @SYMTestExpectedResults Pass - Request is cancelled.
       
   696  * @SYMTestType CIT
       
   697  * @SYMTestCaseDependencies live/automatic
       
   698  *
       
   699  * Reason for test: Verify request is cancelled.
       
   700  *
       
   701  * @return - TVerdict code
       
   702  */
       
   703 	{
       
   704 
       
   705 	//
       
   706 	// SET UP
       
   707 	//
       
   708 	
       
   709 	// Get the RMobileSmsMessaging subsession
       
   710 	RMobileSmsMessaging& smsMessaging = iEtelSessionMgr.GetSmsMessagingL(KMainServer,KMainPhone,KMainSmsMessaging);
       
   711 	
       
   712 	// Ensure RMobileSmsMessaging::GetCaps returns aCaps.iSmsControl caps in set of KCapsSetSmspList | KCapsGetSmspList 
       
   713 	RMobileSmsMessaging::TMobileSmsCapsV1  smsCaps;
       
   714 	RMobileSmsMessaging::TMobileSmsCapsV1Pckg smsCapsPckg(smsCaps);
       
   715 	CHECK_EQUALS_L(smsMessaging.GetCaps(smsCapsPckg),KErrNone, _L("RMobileSmsMessaging::GetCaps returned returned with an error"));
       
   716 	TUint32 expectedCaps= RMobileSmsMessaging::KCapsSetSmspList | RMobileSmsMessaging::KCapsGetSmspList;
       
   717 	CHECK_BITS_SET_L(smsCaps.iSmsControl, expectedCaps, KNoUnwantedBits, _L("RMobileSmsMessaging::GetCaps returned with unexpected caps"));
       
   718 
       
   719 	//
       
   720 	// SET UP END
       
   721 	//
       
   722 	
       
   723 	StartTest();
       
   724 	
       
   725 	//
       
   726 	// TEST START
       
   727 	//
       
   728 	
       
   729 	// Use helper class for CRetrieveMobilePhoneSmspList to retrieve the SMSP list 
       
   730 	TInt err=0;
       
   731 	CRetrieveMobilePhoneSmspListExec* smspListExec = CRetrieveMobilePhoneSmspListHelper::NewL(smsMessaging);
       
   732 	CleanupStack::PushL(smspListExec);
       
   733 	
       
   734 	// Cancel list retrieval  
       
   735 	CMobilePhoneSmspList* smspList = smspListExec->DoGetList(err,ECancelAfterStart);
       
   736 	
       
   737 	// Check retrieval completes with KErrCancel 
       
   738 	ASSERT_EQUALS(err, KErrCancel, _L("CRetrieveMobilePhoneSmspList::Start Request could not be cancelled properly"));
       
   739 		
       
   740 	//
       
   741 	// TEST END
       
   742 	//
       
   743 
       
   744     StartCleanup();
       
   745     CleanupStack::PopAndDestroy(smspListExec);
       
   746 	
       
   747 	return TestStepResult();
       
   748 	}
       
   749 
       
   750 TPtrC CCTSYIntegrationTestSMSPStore0004::GetTestStepName()
       
   751 /**
       
   752  * @return The test step name.
       
   753  */
       
   754 	{
       
   755 	return _L("CCTSYIntegrationTestSMSPStore0004");
       
   756 	}
       
   757 
       
   758 
       
   759 
       
   760 CCTSYIntegrationTestSMSPStore0005::CCTSYIntegrationTestSMSPStore0005(CEtelSessionMgr& aEtelSessionMgr)
       
   761 	: CCTSYIntegrationTestSMSPStoreBase(aEtelSessionMgr)
       
   762 /**
       
   763  * Constructor.
       
   764  */
       
   765 	{
       
   766 	SetTestStepName(CCTSYIntegrationTestSMSPStore0005::GetTestStepName());
       
   767 	}
       
   768 
       
   769 CCTSYIntegrationTestSMSPStore0005::~CCTSYIntegrationTestSMSPStore0005()
       
   770 /**
       
   771  * Destructor.
       
   772  */
       
   773 	{
       
   774 	}
       
   775 
       
   776 TVerdict CCTSYIntegrationTestSMSPStore0005::doTestStepL()
       
   777 /**
       
   778  * @SYMTestCaseID BA-CTSY-INT-SMSP-0005
       
   779  * @SYMFssID BA/CTSY/SMSP-0005
       
   780  * @SYMTestCaseDesc Cancel writing SMSP list entries.
       
   781  * @SYMTestPriority High
       
   782  * @SYMTestActions 
       
   783  * @SYMTestExpectedResults Pass - Request is cancelled.
       
   784  * @SYMTestType CIT
       
   785  * @SYMTestCaseDependencies live/automatic
       
   786  *
       
   787  * Reason for test: Verify request is cancelled.
       
   788  *
       
   789  * @return - TVerdict code
       
   790  */
       
   791 	{
       
   792 
       
   793 	//
       
   794 	// SET UP
       
   795 	//
       
   796 	RMobilePhone& phone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone);
       
   797 	
       
   798 	// Get the RMobileSmsMessaging subsession
       
   799 	RMobileSmsMessaging& smsMessaging = iEtelSessionMgr.GetSmsMessagingL(KMainServer,KMainPhone,KMainSmsMessaging);
       
   800 	
       
   801 	// Ensure RMobileSmsMessaging::GetCaps returns aCaps.iSmsControl caps in set of KCapsSetSmspList | KCapsGetSmspList 
       
   802 	RMobileSmsMessaging::TMobileSmsCapsV1  smsCaps;
       
   803 	RMobileSmsMessaging::TMobileSmsCapsV1Pckg smsCapsPckg(smsCaps);
       
   804 	CHECK_EQUALS_L(smsMessaging.GetCaps(smsCapsPckg),KErrNone, _L("RMobileSmsMessaging::GetCaps returned returned with an error"));
       
   805 	TUint32 expectedCaps= RMobileSmsMessaging::KCapsSetSmspList | RMobileSmsMessaging::KCapsGetSmspList;
       
   806 	CHECK_BITS_SET_L(smsCaps.iSmsControl, expectedCaps, KNoUnwantedBits, _L("RMobileSmsMessaging::GetCaps returned with unexpected caps"));
       
   807 	
       
   808 	// Take the backup of SMSP list
       
   809 	TInt listCountAtStart;
       
   810 	TBackupList backup(*this,smsMessaging);
       
   811 	CHECK_TRUE_L(backup.BackupL(listCountAtStart), _L("TBackupList::Backup Could not backup"));
       
   812 	CleanupStack::PushL (backup);
       
   813 	
       
   814 	//
       
   815 	// SET UP END
       
   816 	//
       
   817 	
       
   818 	StartTest();
       
   819 	
       
   820 	//
       
   821 	// TEST START
       
   822 	//
       
   823 	
       
   824 	// Create a CMobilePhoneSmspList with CMobilePhoneSmspList::NewL 
       
   825 	CMobilePhoneSmspList* smspList = CMobilePhoneSmspList::NewL();
       
   826 	CleanupStack::PushL(smspList);
       
   827 		
       
   828 	// Find out the network
       
   829 	RMobilePhone::TMobilePhoneNetworkInfoV1 info;
       
   830 	RMobilePhone::TMobilePhoneNetworkInfoV1Pckg infopckg(info);
       
   831 	TExtEtelRequestStatus getNetworkStatus (phone,EMobilePhoneGetCurrentNetwork);
       
   832 	CleanupStack::PushL(getNetworkStatus);
       
   833 	phone.GetCurrentNetwork(getNetworkStatus, infopckg);
       
   834 	ASSERT_EQUALS(WaitForRequestWithTimeOut(getNetworkStatus, ETimeMedium),   KErrNone,
       
   835 	 			_L("MobilePhone::GetCurrentNetwork timed out"))
       
   836 	ASSERT_EQUALS(getNetworkStatus.Int(), KErrNone, 
       
   837 				_L("MobilePhone::GetCurrentNetwork returned an error"))	
       
   838 				
       
   839 	// Create a RMobileSmsMessaging::TMobileSmspEntryV1 entry with the following parameters: 
       
   840 	RMobileSmsMessaging::TMobileSmspEntryV1 smspEntry;
       
   841 	
       
   842 	     smspEntry.iText = _L("ABCD"); 
       
   843 
       
   844 	     smspEntry.iValidParams = RMobileSmsMessaging::KDestinationIncluded 
       
   845 
       
   846 	         | RMobileSmsMessaging::KSCAIncluded 
       
   847 
       
   848 	         | RMobileSmsMessaging::KProtocolIdIncluded 
       
   849 
       
   850 	         | RMobileSmsMessaging::KDcsIncluded 
       
   851 
       
   852 	         | RMobileSmsMessaging::KValidityPeriodIncluded; 
       
   853 
       
   854 	     smspEntry.iDestination.iTelNumber = _L("1234567890"); 
       
   855 
       
   856 	     smspEntry.iDestination.iNumberPlan = RMobilePhone::EIsdnNumberPlan; 
       
   857 
       
   858 	     smspEntry.iDestination.iTypeOfNumber = RMobilePhone::EInternationalNumber; 
       
   859 
       
   860 	     smspEntry.iValidityPeriod = 0; 
       
   861 
       
   862 	     smspEntry.iServiceCentre.iTelNumber = _L("1234567890"); 
       
   863 
       
   864 	     smspEntry.iServiceCentre.iNumberPlan = RMobilePhone::EIsdnNumberPlan; 
       
   865 
       
   866 	     smspEntry.iServiceCentre.iTypeOfNumber = RMobilePhone::EInternationalNumber; 
       
   867 
       
   868 	     smspEntry.iProtocolId = 2; 
       
   869 
       
   870 	     smspEntry.iDcs = 4; 
       
   871 
       
   872 	     smspEntry.iIndex = 1; 
       
   873 	    	     
       
   874 	
       
   875 	// Create another RMobileSmsMessaging::TMobileSmspEntryV1 entry with the following parameters: 
       
   876 	RMobileSmsMessaging::TMobileSmspEntryV1 smspEntry2;
       
   877 
       
   878 	  smspEntry2.iValidParams = RMobileSmsMessaging::KSCAIncluded; 
       
   879 
       
   880 	  smspEntry2.iServiceCentre.iTypeOfNumber=RMobilePhone::EInternationalNumber; 
       
   881 
       
   882 	  smspEntry2.iServiceCentre.iNumberPlan=RMobilePhone:: EIsdnNumberPlan; 
       
   883 
       
   884 	  smspEntry2.iServiceCentre.iTelNumber=_L("441632960000"); 
       
   885 	  
       
   886 	  smspEntry2.iIndex = 2; 
       
   887 
       
   888 	// Create another RMobileSmsMessaging::TMobileSmspEntryV1 entry with the following parameters: 
       
   889 	RMobileSmsMessaging::TMobileSmspEntryV1 smspEntry3;
       
   890 	  
       
   891 	  smspEntry3.iValidParams = RMobileSmsMessaging::KSCAIncluded; 
       
   892 
       
   893 	  smspEntry3.iServiceCentre.iTypeOfNumber=RMobilePhone::EInternationalNumber; 
       
   894 
       
   895 	  smspEntry3.iServiceCentre.iNumberPlan=RMobilePhone:: EIsdnNumberPlan; 
       
   896 
       
   897 	  smspEntry3.iServiceCentre.iTelNumber=_L("441632960000"); 
       
   898 
       
   899 	  smspEntry3.iIndex = 3; 
       
   900 	
       
   901 	
       
   902 	if(info.iShortName.Find(_L("O2")) != KErrNotFound)	//O2
       
   903 		{
       
   904 		DEBUG_PRINTF1(_L("O2 can have three entries in the SMSP list"));
       
   905 		
       
   906 		// Add the entry to the CMobilePhoneSmspList list with CMobilePhoneSmspList::AddEntryL 
       
   907 		smspList->AddEntryL(smspEntry);
       
   908 		smspList->AddEntryL(smspEntry2);
       
   909 		smspList->AddEntryL(smspEntry3);
       
   910 		}
       
   911 	else
       
   912 		{
       
   913 		smspList->AddEntryL(smspEntry);	
       
   914 		}
       
   915 		
       
   916 	// Store the empty SMSP list with RMobileSmsMessaging::StoreSmspListL
       
   917 	TExtEtelRequestStatus storeSmspListStatus(smsMessaging, EMobileSmsMessagingStoreSmspList);
       
   918 	CleanupStack::PushL(storeSmspListStatus);
       
   919 	smsMessaging.StoreSmspListL(storeSmspListStatus,smspList);
       
   920 	
       
   921 	// Cancel request immediately with RTelSubSessionBase::CancelAsyncRequest(EMobileSmsMessagingStoreSmspList) 
       
   922 	smsMessaging.CancelAsyncRequest(EMobileSmsMessagingStoreSmspList);
       
   923 
       
   924 	// Check store request completes with KErrCancel or KErrNone
       
   925 	ASSERT_EQUALS(WaitForRequestWithTimeOut(storeSmspListStatus, ETimeShort),KErrNone, _L("RMobileSmsMessaging::StoreSmspListL timed out"));
       
   926 	ASSERT_TRUE(storeSmspListStatus.Int() == KErrCancel || storeSmspListStatus.Int() == KErrNone, 
       
   927 				_L("RMobileSmsMessaging:: CancelAsyncRequest could not cancel the request EMobileSmsMessagingStoreSmspList"));
       
   928 	
       
   929 	//
       
   930 	// TEST END
       
   931 	//
       
   932 
       
   933 	StartCleanup();
       
   934     // Pop:
       
   935 	// backup
       
   936   	// storeSmspListStatus
       
   937     // getNetworkStatus
       
   938     // smspList
       
   939     CleanupStack::PopAndDestroy(4,&backup);	
       
   940   
       
   941 	return TestStepResult();
       
   942 	}
       
   943 
       
   944 TPtrC CCTSYIntegrationTestSMSPStore0005::GetTestStepName()
       
   945 /**
       
   946  * @return The test step name.
       
   947  */
       
   948 	{
       
   949 	return _L("CCTSYIntegrationTestSMSPStore0005");
       
   950 	}
       
   951 
       
   952 
       
   953 
       
   954 CCTSYIntegrationTestSMSPStore0006::CCTSYIntegrationTestSMSPStore0006(CEtelSessionMgr& aEtelSessionMgr)
       
   955 	: CCTSYIntegrationTestSMSPStoreBase(aEtelSessionMgr)
       
   956 /**
       
   957  * Constructor.
       
   958  */
       
   959 	{
       
   960 	SetTestStepName(CCTSYIntegrationTestSMSPStore0006::GetTestStepName());
       
   961 	}
       
   962 
       
   963 CCTSYIntegrationTestSMSPStore0006::~CCTSYIntegrationTestSMSPStore0006()
       
   964 /**
       
   965  * Destructor.
       
   966  */
       
   967 	{
       
   968 	}
       
   969 
       
   970 TVerdict CCTSYIntegrationTestSMSPStore0006::doTestStepL()
       
   971 /**
       
   972  * @SYMTestCaseID BA-CTSY-INT-SMSP-0006
       
   973  * @SYMFssID BA/CTSY/SMSP-0006
       
   974  * @SYMTestCaseDesc Cancel notification of change in SMSP list entries.
       
   975  * @SYMTestPriority High
       
   976  * @SYMTestActions 
       
   977  * @SYMTestExpectedResults Pass - Request is cancelled.
       
   978  * @SYMTestType CIT
       
   979  * @SYMTestCaseDependencies live/automatic
       
   980  *
       
   981  * Reason for test: Verify request is cancelled.
       
   982  *
       
   983  * @return - TVerdict code
       
   984  */
       
   985 	{
       
   986 
       
   987 	//
       
   988 	// SET UP
       
   989 	//
       
   990 	
       
   991 	// Get the RMobileSmsMessaging subsession 
       
   992 	RMobileSmsMessaging& smsMessaging = iEtelSessionMgr.GetSmsMessagingL(KMainServer,KMainPhone,KMainSmsMessaging);
       
   993 
       
   994 	//
       
   995 	// SET UP END
       
   996 	//
       
   997 	
       
   998 	StartTest();
       
   999 	
       
  1000 	//
       
  1001 	// TEST START
       
  1002 	//
       
  1003 		
       
  1004 	// Register for notification of SMSP list change with RMobileSmsMessaging::NotifySmspListChange 
       
  1005 	TExtEtelRequestStatus notifySmspListChangeStatus(smsMessaging, EMobileSmsMessagingNotifySmspListChange);
       
  1006 	CleanupStack::PushL(notifySmspListChangeStatus);
       
  1007 	smsMessaging.NotifySmspListChange(notifySmspListChangeStatus);
       
  1008 	
       
  1009 	// Cancel request with RTelSubSessionBase::CancelAsyncRequest(EMobileSmsMessagingNotifySmspListChange) 
       
  1010  	smsMessaging.CancelAsyncRequest(EMobileSmsMessagingNotifySmspListChange);
       
  1011  	
       
  1012  	// Check notification request completes with KErrCancel
       
  1013  	TInt expectedStatus = KErrCancel;
       
  1014  	iSmsMessagingTestHelper.WaitForMobileSmsMessagingNotifySmspListChange(notifySmspListChangeStatus,expectedStatus);
       
  1015 	
       
  1016 	//
       
  1017 	// TEST END
       
  1018 	//
       
  1019 
       
  1020     StartCleanup();
       
  1021 	CleanupStack::PopAndDestroy(&notifySmspListChangeStatus);	
       
  1022 
       
  1023 	
       
  1024 	return TestStepResult();
       
  1025 	}
       
  1026 
       
  1027 TPtrC CCTSYIntegrationTestSMSPStore0006::GetTestStepName()
       
  1028 /**
       
  1029  * @return The test step name.
       
  1030  */
       
  1031 	{
       
  1032 	return _L("CCTSYIntegrationTestSMSPStore0006");
       
  1033 	}
       
  1034 
       
  1035 
       
  1036 
       
  1037 CCTSYIntegrationTestSMSPStore0007::CCTSYIntegrationTestSMSPStore0007(CEtelSessionMgr& aEtelSessionMgr)
       
  1038 	: CCTSYIntegrationTestSMSPStoreBase(aEtelSessionMgr)
       
  1039 /**
       
  1040  * Constructor.
       
  1041  */
       
  1042 	{
       
  1043 	SetTestStepName(CCTSYIntegrationTestSMSPStore0007::GetTestStepName());
       
  1044 	}
       
  1045 
       
  1046 CCTSYIntegrationTestSMSPStore0007::~CCTSYIntegrationTestSMSPStore0007()
       
  1047 /**
       
  1048  * Destructor.
       
  1049  */
       
  1050 	{
       
  1051 	}
       
  1052 
       
  1053 TVerdict CCTSYIntegrationTestSMSPStore0007::doTestStepL()
       
  1054 /**
       
  1055  * @SYMTestCaseID BA-CTSY-INT-SMSP-0007
       
  1056  * @SYMFssID BA/CTSY/SMSP-0007
       
  1057  * @SYMTestCaseDesc Store an SMSP list that is too long.
       
  1058  * @SYMTestPriority High
       
  1059  * @SYMTestActions RMobileSmsMessaging::StoreSmspListL, CRetrieveMobilePhoneSmspList::Start, CMobilePhoneSmspList::NewL, CMobilePhoneSmspList::AddEntryL
       
  1060  * @SYMTestExpectedResults Pass - KErrArgument returned.
       
  1061  * @SYMTestType CIT
       
  1062  * @SYMTestCaseDependencies live/automatic
       
  1063  *
       
  1064  * Reason for test: Verify error is returned on storing.
       
  1065  *
       
  1066  * @return - TVerdict code
       
  1067  */
       
  1068 	{
       
  1069 
       
  1070 	//
       
  1071 	// SET UP
       
  1072 	//
       
  1073 
       
  1074 	// Get the RMobileSmsMessaging subsession 
       
  1075 	RMobileSmsMessaging& smsMessaging = iEtelSessionMgr.GetSmsMessagingL(KMainServer,KMainPhone,KMainSmsMessaging);
       
  1076 
       
  1077 	// Ensure RMobileSmsMessaging::GetCaps returns aCaps.iSmsControl caps in set of KCapsSetSmspList | KCapsGetSmspList 
       
  1078 	RMobileSmsMessaging::TMobileSmsCapsV1  smsCaps;
       
  1079 	RMobileSmsMessaging::TMobileSmsCapsV1Pckg smsCapsPckg(smsCaps);
       
  1080 	CHECK_EQUALS_L(smsMessaging.GetCaps(smsCapsPckg),KErrNone, _L("RMobileSmsMessaging::GetCaps returned returned with an error"));
       
  1081 	TUint32 expectedCaps= RMobileSmsMessaging::KCapsSetSmspList | RMobileSmsMessaging::KCapsGetSmspList;
       
  1082 	CHECK_BITS_SET_L(smsCaps.iSmsControl, expectedCaps, KNoUnwantedBits, _L("RMobileSmsMessaging::GetCaps returned with unexpected caps"));
       
  1083 
       
  1084 	// Take the backup of the SMSP list. 
       
  1085 	TInt listCountAtStart;
       
  1086 	TBackupList backup(*this,smsMessaging);
       
  1087 	CHECK_TRUE_L(backup.BackupL(listCountAtStart), _L("TBackupList::Backup Could not backup"));
       
  1088 	CleanupStack::PushL (backup);
       
  1089 	
       
  1090 	//
       
  1091 	// SET UP END
       
  1092 	//
       
  1093 	
       
  1094 	StartTest();
       
  1095 	
       
  1096 	//
       
  1097 	// TEST START
       
  1098 	//
       
  1099 	
       
  1100 	// ===  Store SMSP list ===
       
  1101 
       
  1102 	// Create a CMobilePhoneSmspList with CMobilePhoneSmspList::NewL 
       
  1103 	CMobilePhoneSmspList* smspList = CMobilePhoneSmspList::NewL();
       
  1104 	CleanupStack::PushL(smspList);
       
  1105 	
       
  1106 	// Create a RMobileSmsMessaging::TMobileSmspEntryV1 entry with the following parameters: 
       
  1107 	RMobileSmsMessaging::TMobileSmspEntryV1 smspEntry;
       
  1108 	     
       
  1109 	     smspEntry.iText = _L("ABCD"); 
       
  1110 
       
  1111 	     smspEntry.iValidParams = RMobileSmsMessaging::KDestinationIncluded 
       
  1112 
       
  1113 	         | RMobileSmsMessaging::KSCAIncluded 
       
  1114 
       
  1115 	         | RMobileSmsMessaging::KProtocolIdIncluded 
       
  1116 
       
  1117 	         | RMobileSmsMessaging::KDcsIncluded 
       
  1118 
       
  1119 	         | RMobileSmsMessaging::KValidityPeriodIncluded; 
       
  1120 
       
  1121 	     smspEntry.iDestination.iTelNumber = _L("+1234567890"); 
       
  1122 
       
  1123 	     smspEntry.iDestination.iNumberPlan = RMobilePhone::EIsdnNumberPlan; 
       
  1124 
       
  1125 	     smspEntry.iDestination.iTypeOfNumber = RMobilePhone::EInternationalNumber; 
       
  1126 
       
  1127 	     smspEntry.iValidityPeriod = 0; 
       
  1128 
       
  1129 	     smspEntry.iServiceCentre.iTelNumber = _L("+123"); 
       
  1130 
       
  1131 	     smspEntry.iServiceCentre.iNumberPlan = RMobilePhone::EIsdnNumberPlan; 
       
  1132 
       
  1133 	     smspEntry.iServiceCentre.iTypeOfNumber = RMobilePhone::EInternationalNumber; 
       
  1134 
       
  1135 	     smspEntry.iProtocolId = 2; 
       
  1136 
       
  1137 	     smspEntry.iDcs = 4; 
       
  1138 
       
  1139 	     smspEntry.iIndex = 1; 
       
  1140 	
       
  1141 	// Add the entry to the CMobilePhoneSmspList list with CMobilePhoneSmspList::AddEntryL 
       
  1142 	smspList->AddEntryL(smspEntry);
       
  1143 
       
  1144 	// Create another RMobileSmsMessaging::TMobileSmspEntryV1 entry with the following parameters: 
       
  1145 	RMobileSmsMessaging::TMobileSmspEntryV1 smspEntry2;
       
  1146 		
       
  1147 		smspEntry2.iText = _L("EFGH");
       
  1148 		
       
  1149 		smspEntry2.iValidParams = RMobileSmsMessaging::KDestinationIncluded 
       
  1150 
       
  1151 	         | RMobileSmsMessaging::KSCAIncluded 
       
  1152 
       
  1153 	         | RMobileSmsMessaging::KProtocolIdIncluded 
       
  1154 
       
  1155 	         | RMobileSmsMessaging::KDcsIncluded 
       
  1156 
       
  1157 	         | RMobileSmsMessaging::KValidityPeriodIncluded; 
       
  1158 	    
       
  1159 	    smspEntry2.iDestination.iTelNumber = _L("+987654"); 
       
  1160 
       
  1161 	    smspEntry2.iDestination.iNumberPlan = RMobilePhone::EIsdnNumberPlan; 
       
  1162 
       
  1163 	    smspEntry2.iDestination.iTypeOfNumber = RMobilePhone::EInternationalNumber; 
       
  1164 
       
  1165 	    smspEntry2.iValidityPeriod = 0; 
       
  1166 
       
  1167 	  	smspEntry2.iServiceCentre.iTypeOfNumber=RMobilePhone::EInternationalNumber; 
       
  1168 
       
  1169 	  	smspEntry2.iServiceCentre.iNumberPlan=RMobilePhone:: EIsdnNumberPlan; 
       
  1170 
       
  1171 	  	smspEntry2.iServiceCentre.iTelNumber=_L("+456"); 
       
  1172 	  	
       
  1173 	  	smspEntry2.iProtocolId = 2; 
       
  1174 
       
  1175 	    smspEntry2.iDcs = 4; 
       
  1176 
       
  1177 	    smspEntry2.iIndex = 2; 
       
  1178 
       
  1179 	// Add the entry to the CMobilePhoneSmspList list with CMobilePhoneSmspList::AddEntryL 
       
  1180 	smspList->AddEntryL(smspEntry2);
       
  1181 		
       
  1182 	// Create another RMobileSmsMessaging::TMobileSmspEntryV1 entry with the following parameters: 
       
  1183 	RMobileSmsMessaging::TMobileSmspEntryV1 smspEntry3;
       
  1184 	  	
       
  1185 	  	smspEntry3.iText = _L("IJKL"); 
       
  1186 
       
  1187         smspEntry3.iValidParams = RMobileSmsMessaging::KDestinationIncluded 
       
  1188 
       
  1189 	         | RMobileSmsMessaging::KSCAIncluded 
       
  1190 
       
  1191 	         | RMobileSmsMessaging::KProtocolIdIncluded 
       
  1192 
       
  1193 	         | RMobileSmsMessaging::KDcsIncluded 
       
  1194 
       
  1195 	         | RMobileSmsMessaging::KValidityPeriodIncluded; 
       
  1196 
       
  1197         smspEntry3.iDestination.iTelNumber = _L("+12456"); 
       
  1198 
       
  1199 	    smspEntry3.iDestination.iNumberPlan = RMobilePhone::EIsdnNumberPlan; 
       
  1200 
       
  1201 	    smspEntry3.iDestination.iTypeOfNumber = RMobilePhone::EInternationalNumber; 
       
  1202 
       
  1203 	    smspEntry3.iValidityPeriod = 0; 
       
  1204 
       
  1205 	    smspEntry3.iServiceCentre.iTelNumber = _L("+789"); 
       
  1206 
       
  1207 	    smspEntry3.iServiceCentre.iNumberPlan = RMobilePhone::EIsdnNumberPlan; 
       
  1208 
       
  1209 	    smspEntry3.iServiceCentre.iTypeOfNumber = RMobilePhone::EInternationalNumber; 
       
  1210 
       
  1211 	    smspEntry3.iProtocolId = 2; 
       
  1212 
       
  1213 	    smspEntry3.iDcs = 4; 
       
  1214 
       
  1215 	   	smspEntry3.iIndex = 3; 
       
  1216 	     
       
  1217 	// Add the entry to the CMobilePhoneSmspList list with CMobilePhoneSmspList::AddEntryL 
       
  1218 	smspList->AddEntryL(smspEntry3);
       
  1219 	
       
  1220 	// Create another RMobileSmsMessaging::TMobileSmspEntryV1 entry with the following parameters: 
       
  1221 	RMobileSmsMessaging::TMobileSmspEntryV1 smspEntry4;
       
  1222 	  	
       
  1223 	  	smspEntry4.iText = _L("MNOP"); 
       
  1224 
       
  1225         smspEntry4.iValidParams = RMobileSmsMessaging::KDestinationIncluded 
       
  1226 
       
  1227 	         | RMobileSmsMessaging::KSCAIncluded 
       
  1228 
       
  1229 	         | RMobileSmsMessaging::KProtocolIdIncluded 
       
  1230 
       
  1231 	         | RMobileSmsMessaging::KDcsIncluded 
       
  1232 
       
  1233 	         | RMobileSmsMessaging::KValidityPeriodIncluded; 
       
  1234 
       
  1235         smspEntry4.iDestination.iTelNumber = _L("+12456"); 
       
  1236 
       
  1237 	    smspEntry4.iDestination.iNumberPlan = RMobilePhone::EIsdnNumberPlan; 
       
  1238 
       
  1239 	    smspEntry4.iDestination.iTypeOfNumber = RMobilePhone::EInternationalNumber; 
       
  1240 
       
  1241 	    smspEntry4.iValidityPeriod = 0; 
       
  1242 
       
  1243 	    smspEntry4.iServiceCentre.iTelNumber = _L("+789"); 
       
  1244 
       
  1245 	    smspEntry4.iServiceCentre.iNumberPlan = RMobilePhone::EIsdnNumberPlan; 
       
  1246 
       
  1247 	    smspEntry4.iServiceCentre.iTypeOfNumber = RMobilePhone::EInternationalNumber; 
       
  1248 
       
  1249 	    smspEntry4.iProtocolId = 2; 
       
  1250 
       
  1251 	    smspEntry4.iDcs = 4; 
       
  1252 
       
  1253 	   	smspEntry4.iIndex = 4; 
       
  1254 	     
       
  1255 	// Add the entry to the CMobilePhoneSmspList list with CMobilePhoneSmspList::AddEntryL 
       
  1256 	smspList->AddEntryL(smspEntry4);
       
  1257 
       
  1258 	// Store the empty SMSP list with RMobileSmsMessaging::StoreSmspListL 
       
  1259 	TExtEtelRequestStatus storeSmspListStatus(smsMessaging, EMobileSmsMessagingStoreSmspList);
       
  1260 	CleanupStack::PushL(storeSmspListStatus);
       
  1261 	smsMessaging.StoreSmspListL(storeSmspListStatus,smspList);
       
  1262 	ASSERT_EQUALS(WaitForRequestWithTimeOut(storeSmspListStatus, ETimeMedium),KErrNone, _L("RMobileSmsMessaging::StoreSmspListL timed out"));
       
  1263 	
       
  1264 	// Check KErrArgument is returned
       
  1265 	ASSERT_EQUALS(storeSmspListStatus.Int(), KErrArgument, _L("RMobileSmsMessaging::StoreSmspListL did not return with an error"));		
       
  1266 	
       
  1267 	//
       
  1268 	// TEST END
       
  1269 	//
       
  1270 
       
  1271     StartCleanup();
       
  1272     
       
  1273 	// Pop:
       
  1274 	// backup
       
  1275     // storeSmspListStatus
       
  1276     // smspList
       
  1277 	CleanupStack::PopAndDestroy(3,&backup);
       
  1278 		
       
  1279 	return TestStepResult();
       
  1280 	}
       
  1281 
       
  1282 TPtrC CCTSYIntegrationTestSMSPStore0007::GetTestStepName()
       
  1283 /**
       
  1284  * @return The test step name.
       
  1285  */
       
  1286 	{
       
  1287 	return _L("CCTSYIntegrationTestSMSPStore0007");
       
  1288 	}
       
  1289 
       
  1290 TBackupList::TBackupList(CCTSYIntegrationTestSuiteStepBase &aTestStep,
       
  1291 			RMobileSmsMessaging &aSmsMessaging) : TTsyTestHelperBase(aTestStep) ,iSmsMessaging(aSmsMessaging)
       
  1292 /*
       
  1293  * Constructor
       
  1294  * @param aBase pointer to the test.
       
  1295  * @param aSmsMessaging reference to a SMSP session
       
  1296  *
       
  1297  */
       
  1298 {
       
  1299 }
       
  1300 TBool TBackupList::BackupL(TInt &aListCount)
       
  1301 /*
       
  1302  * This function takes backup of the entries of SMSP list and return false if its fails
       
  1303  * @param aListCount refer to the number of entries in the list at the time of backup
       
  1304  * @return true if the backup was successful
       
  1305  *
       
  1306  */	
       
  1307 	{
       
  1308 	iValid=EFalse;
       
  1309 
       
  1310 	// Enumerater the entries of SMSP List
       
  1311 	TInt err=0;
       
  1312 	CRetrieveMobilePhoneSmspListExec* smspListExec = CRetrieveMobilePhoneSmspListHelper::NewL(iSmsMessaging);	
       
  1313 	CleanupStack::PushL(smspListExec);
       
  1314 	CMobilePhoneSmspList* retrievedSmspList = smspListExec->DoGetList(err);
       
  1315 	if(err== KErrNone)
       
  1316 		{
       
  1317 		iValid=ETrue;
       
  1318 		}
       
  1319 	else
       
  1320 		{
       
  1321 		return iValid;
       
  1322 		}
       
  1323 	iListCount=retrievedSmspList->Enumerate();
       
  1324 	aListCount=iListCount;
       
  1325 	
       
  1326 	// Store the values of APN control list, so that they can be restored later
       
  1327 	for(TInt i=0;i<aListCount;i++)
       
  1328 		{
       
  1329 		RMobileSmsMessaging::TMobileSmspEntryV1 item;
       
  1330 	   	item=retrievedSmspList->GetEntryL(i); // zero is the first index in retrieval list
       
  1331 	   	iEntryArray.Append(item);
       
  1332 		}
       
  1333 	CleanupStack::PopAndDestroy(smspListExec);
       
  1334 	
       
  1335 	return iValid;
       
  1336 	}
       
  1337 void TBackupList::DoCleanupL(TAny* aPtr)
       
  1338 /*
       
  1339  * This function is a static clean up function to be saved in the cleanup stack. Its restore the saved entries.
       
  1340  *
       
  1341  * @param aPtr a pointer to a TBackupList instance.
       
  1342  *
       
  1343  */	
       
  1344 	{
       
  1345 	TBackupList* me = static_cast<TBackupList*>(aPtr);
       
  1346 	me->CleanupL();
       
  1347 	}
       
  1348 void TBackupList::CleanupL()
       
  1349 /*
       
  1350  * This function restore the saved entries to the entries in the phone
       
  1351  *
       
  1352  */	
       
  1353 	{
       
  1354 	CMobilePhoneSmspList* restoreSmspList = CMobilePhoneSmspList::NewL();
       
  1355 	CleanupStack::PushL(restoreSmspList); 
       
  1356 	
       
  1357 	TExtEtelRequestStatus storeSmspListStatus(iSmsMessaging, EMobileSmsMessagingStoreSmspList);
       
  1358 	CleanupStack::PushL(storeSmspListStatus);
       
  1359 	
       
  1360 	for(int j=0; j<iListCount;j++)
       
  1361 		{
       
  1362 		RMobileSmsMessaging::TMobileSmspEntryV1 smspEntry= iEntryArray[j];
       
  1363 		restoreSmspList->AddEntryL(smspEntry);
       
  1364 		}
       
  1365 	iSmsMessaging.StoreSmspListL(storeSmspListStatus,restoreSmspList);
       
  1366 	
       
  1367 	
       
  1368 	if(iTestStep.WaitForRequestWithTimeOut(storeSmspListStatus, ETimeMedium)==KErrNone)
       
  1369 		{
       
  1370 		if (storeSmspListStatus.Int()!= KErrNone)
       
  1371 			{
       
  1372 			DEBUG_PRINTF1(_L("Error- During CleanupStack RMobileSmsMessaging::StoreSmspListL returned with an error"));
       
  1373 			}
       
  1374 		}
       
  1375 	else
       
  1376 		{
       
  1377 		DEBUG_PRINTF1(_L("Error- During CleanupStack RMobileSmsMessaging::StoreSmspListL timed out"));
       
  1378 		}
       
  1379 	
       
  1380 	// Pop:
       
  1381 	// restoreSmspList
       
  1382 	// storeSmspListStatus
       
  1383 	CleanupStack::PopAndDestroy(2,restoreSmspList);
       
  1384 	
       
  1385 	}
       
  1386 TBackupList::operator TCleanupItem()
       
  1387 /*
       
  1388  * This operator create a TCleanupItem to save a pointer to the DoCleanup static function and this in the cleanup stack
       
  1389  *
       
  1390  */	
       
  1391 	{
       
  1392 	return TCleanupItem(DoCleanupL,this);
       
  1393 	}
       
  1394