telephonyserverplugins/common_tsy/test/integration/src/cctsyintegrationtestsmsmessaging.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 SmsMessaging functional unit.
       
    15 // 
       
    16 //
       
    17 
       
    18 /**
       
    19  @internalTechnology
       
    20 */
       
    21 
       
    22 #include "cctsyintegrationtestsmsmessaging.h"
       
    23 #include "pcktcs.h"
       
    24 #include "cctsyinidata.h"
       
    25 
       
    26 
       
    27 	
       
    28 CCTSYIntegrationTestSmsMessagingBase::CCTSYIntegrationTestSmsMessagingBase(CEtelSessionMgr& aEtelSessionMgr)
       
    29 	: CCTSYIntegrationTestSuiteStepBase(aEtelSessionMgr),
       
    30 	iSmsMessagingTsyTestHelper(*this), iSmsStoreTsyTestHelper(*this), iNetworkTsyTestHelper(*this),
       
    31 	iPacketServiceTsyTestHelper(*this), iSimTsyTestHelper(*this), iCallControlTestHelper(*this)
       
    32 /**
       
    33  * Constructor
       
    34  */
       
    35 	{
       
    36 	}
       
    37 
       
    38 CCTSYIntegrationTestSmsMessagingBase::~CCTSYIntegrationTestSmsMessagingBase()
       
    39 /*
       
    40  * Destructor
       
    41  */
       
    42 	{
       
    43 	}
       
    44 	
       
    45 void CCTSYIntegrationTestSmsMessagingBase::GetSmsServiceCentreAddressL(TPtrC &aServiceCentreAddress)
       
    46 /*
       
    47  * Gets the service centre address
       
    48  * 
       
    49  * @param aServiceCentreAddress a reference to an descriptor that will hold the service address
       
    50  */
       
    51 	{
       
    52 	DEBUG_PRINTF1(_L("Attempting to get Service Centre Address"));
       
    53 	
       
    54 	RMobilePhone &phone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone);
       
    55 	
       
    56 	// wait until we are on the network
       
    57 	CHECK_EQUALS_L( iNetworkTsyTestHelper.WaitForRegisteredOnHomeNetworkL( phone ), KErrNone, 
       
    58 			_L("Network is unavailable") );
       
    59 			
       
    60 	// Determine the network we are on
       
    61 	RMobilePhone::TMobilePhoneNetworkInfoV1 netInfo;
       
    62 	RMobilePhone::TMobilePhoneNetworkInfoV1Pckg netInfoPkg(netInfo);
       
    63 	RMobilePhone::TMobilePhoneLocationAreaV1 area;
       
    64 	TOperatorName operatorName = EOperatorUnknown;
       
    65 	TInt err = iNetworkTsyTestHelper.GetCurrentNetworkL( phone, netInfoPkg, area, operatorName );
       
    66 	
       
    67 	CHECK_EQUALS_L( err, KErrNone, _L("RMobilePhone::GetCurrentNetwork failed to get current network id (1)"));
       
    68 	
       
    69 	// Identify the network from the short name, read the service centre number from ini file
       
    70 	const TDesC* network = NULL;
       
    71 	switch ( operatorName )
       
    72 	{
       
    73 	case EOperatorO2: 
       
    74 		network = &KNetworkO2;
       
    75 		break;
       
    76 	case EOperatorVodafone:
       
    77 		network = &KNetworkVodafone;
       
    78 		break;
       
    79 	case EOperatorOrange:
       
    80 		network = &KNetworkOrange;
       
    81 		break;
       
    82 	case EOperatorTMobile:
       
    83 		network = &KNetworkTMobile;
       
    84 		break;
       
    85 	case EOperatorUnknown:
       
    86 	default:
       
    87 		CHECK_TRUE_L( EFail, _L("Failed to identify current network"));
       
    88 		break;
       
    89 	}	
       
    90 	
       
    91 	// Get the service centre from the ini file
       
    92 	TBool gotServiceCentre = GetStringFromConfig( KServiceCentreSection, *network, aServiceCentreAddress );
       
    93 	
       
    94 	CHECK_TRUE_L( gotServiceCentre, _L("Failed to read service centre from INI file"));
       
    95 	}
       
    96 
       
    97 
       
    98 void CCTSYIntegrationTestSmsMessagingBase::SetSmsBearerL(RMobileSmsMessaging &aSmsMessaging, RMobileSmsMessaging::TMobileSmsBearer aBearer)
       
    99 /**
       
   100  * Ensure the SMS Bearer is set to the specified bearer.
       
   101  * CTSY does not support Getting the Sms Bearer.  Neither does it support being notified of a change
       
   102  * in the Sms Bearer.
       
   103  * 
       
   104  * @param aSmsMessaging a reference to the messeging session
       
   105  * @param aBearer the bearer
       
   106  */
       
   107 	{
       
   108 	
       
   109 	TExtEtelRequestStatus setBearerStatus(aSmsMessaging, EMobileSmsMessagingSetMoSmsBearer);
       
   110 	CleanupStack::PushL(setBearerStatus);
       
   111 	aSmsMessaging.SetMoSmsBearer(setBearerStatus, aBearer);
       
   112 	CHECK_EQUALS_L(WaitForRequestWithTimeOut(setBearerStatus, ETimeLong), KErrNone, 
       
   113 		_L("RMobileSmsMessaging::SetMoSmsBearer timed-out"));
       
   114 
       
   115 	//setBearerStatus
       
   116 	CleanupStack::PopAndDestroy(&setBearerStatus);
       
   117 	}
       
   118 
       
   119 
       
   120 void CCTSYIntegrationTestSmsMessagingBase::GetSmsSendAttributesL(RMobileSmsMessaging::TMobileSmsSendAttributesV1 &aSendSmsAttributes,TBool aCallToSelf)
       
   121 /**
       
   122  * Get the attributes for sending an Sms Message
       
   123  * 
       
   124  * @param aSendSmsAttributes the message attribute.
       
   125  * @param aCallToSelf ETrue if the calling number will be the ONStore number, EFalse if the number will be the SmsReceptor in the ini file.
       
   126  *
       
   127  */
       
   128 	{
       
   129 	RMobilePhone::TMobileAddress destinationNumber;
       
   130 	if(aCallToSelf)
       
   131 		{
       
   132 		destinationNumber.iTelNumber = iOwnNumbersCache.OwnNumbers().OwnVoiceNumber();
       
   133 		if(destinationNumber.iTelNumber.Length()==0)
       
   134 			{
       
   135 			DEBUG_PRINTF1(_L("Since ONStore fails, we read this from the ini file."));
       
   136 			TPtrC mobileNumber;
       
   137 			GetStringFromConfig(KIniOwnNumSection, KIniOwnVoiceNumber1, mobileNumber);
       
   138 			destinationNumber.iTelNumber=mobileNumber;
       
   139 			}
       
   140 		}
       
   141 	else
       
   142 		{
       
   143 		//Read the destination and number from ini file	
       
   144 		TPtrC mobileNumber;
       
   145 		GetStringFromConfig(ConfigSection(), _L("SmsReceptor"), mobileNumber);
       
   146 		destinationNumber.iTelNumber=mobileNumber;
       
   147 		}
       
   148 	
       
   149 	DEBUG_PRINTF2(_L("Calling to %S"),&destinationNumber.iTelNumber);
       
   150 	destinationNumber.iTypeOfNumber = RMobilePhone::EInternationalNumber;
       
   151 	destinationNumber.iNumberPlan = RMobilePhone::EIsdnNumberPlan;
       
   152 	aSendSmsAttributes.iDestination = destinationNumber;
       
   153 		
       
   154 	//Read the Service Centre from ini file based on network 
       
   155 	RMobilePhone::TMobileAddress serviceCentre;
       
   156 	TPtrC serviceCentreNumber;
       
   157 	GetSmsServiceCentreAddressL(serviceCentreNumber);
       
   158 	serviceCentre.iTelNumber = serviceCentreNumber;
       
   159 	serviceCentre.iTypeOfNumber = RMobilePhone::EInternationalNumber;
       
   160 	serviceCentre.iNumberPlan = RMobilePhone::EIsdnNumberPlan;
       
   161 	aSendSmsAttributes.iGsmServiceCentre = serviceCentre;
       
   162 	aSendSmsAttributes.iMore = EFalse;
       
   163 	aSendSmsAttributes.iDataFormat = RMobileSmsMessaging::EFormatGsmTpdu;
       
   164 	aSendSmsAttributes.iSubmitReport.SetLength(0);
       
   165 	
       
   166 	//Set iFlags to show which attributes are pressent
       
   167 	aSendSmsAttributes.iFlags = RMobileSmsMessaging::KGsmServiceCentre | RMobileSmsMessaging::KSmsDataFormat | RMobileSmsMessaging::KRemotePartyInfo | RMobileSmsMessaging::KMoreToSend;
       
   168 	
       
   169 	}
       
   170 
       
   171 
       
   172 RMobileSmsMessaging::TMobileSmsGsmTpdu CCTSYIntegrationTestSmsMessagingBase::CreateValidSmsMessageL(TDes8 &aText, 
       
   173 		RMobileSmsMessaging::TMobileSmsSendAttributesV1& aSendSmsAttributes, 
       
   174 		TSmsStoreTsyTestHelper::TDataCodingScheme aDataCodingScheme,
       
   175 		TBool aIsToSelf,
       
   176 		TBool aStatusReportRequest)
       
   177 /**
       
   178  * Create an SMS PDU from a string
       
   179  * 
       
   180  * @param aText the message body.
       
   181  * @param aSendSmsAttributes the message attribute.
       
   182  * @param aDataCodingScheme the data coding scheme
       
   183  * @param aIsToSelf ETrue if the message should be sent into the own sim number, EFalse will be send to a ini file specific number
       
   184  * @param aStatusReportRequest will be true if the TP-SRI bit (status request indicator) should be on.
       
   185  *
       
   186  * @return - The constructed message PDU.
       
   187  * 
       
   188  */
       
   189 	{
       
   190 
       
   191 	GetSmsSendAttributesL(aSendSmsAttributes,aIsToSelf);
       
   192 
       
   193 	RMobileSmsMessaging::TMobileSmsGsmTpdu pdu;
       
   194 	TPtrC16 pNumber = aSendSmsAttributes.iDestination.iTelNumber;
       
   195 	iSmsStoreTsyTestHelper.CreateValidSmsPdu(aText, pNumber, pdu, aDataCodingScheme, aStatusReportRequest);
       
   196 
       
   197 	return pdu;
       
   198 	}
       
   199 
       
   200 
       
   201 TBool CCTSYIntegrationTestSmsMessagingBase::ComparePDUs(RMobileSmsMessaging::TMobileSmsGsmTpdu &aRecieved, RMobileSmsMessaging::TMobileSmsGsmTpdu &aSent)
       
   202 /*
       
   203  * Helper function, which will compare two PDU's, a Deliver and submit and return false if they are not the same
       
   204  * It compare the message length, the message class and the message text.
       
   205  * 
       
   206  * @param aRecieved the PDU that was recieved.
       
   207  * @param aSent the PDU that was sent.
       
   208  *
       
   209  * @return - Returns ETrue iff both PDU contains the same information.
       
   210  * 
       
   211  */
       
   212 	{
       
   213 	TUint recivedSize = aRecieved.Length();
       
   214 	TUint sentSize = aSent.Length();
       
   215 	ASSERT_TRUE(recivedSize>3,_L("CCTSYIntegrationTestSmsMessagingBase::ComparePDUs illeagal PDU length"));
       
   216 	ASSERT_TRUE(sentSize>2,_L("CCTSYIntegrationTestSmsMessagingBase::ComparePDUs illeagal PDU length"));
       
   217 	if((recivedSize<=3)||(sentSize<=2))
       
   218 		{
       
   219 		return EFalse;
       
   220 		}
       
   221 	TUint sizeOfRecvTPOA = (TUint)aRecieved[1]/2 + 2; //number is given in 4 bits, another bit is for the length and another is for the type
       
   222 	TUint sizeOfSentTPOA = (TUint)aSent[2]/2 + 2; //number is given in 4 bits, another bit is for the length and another is for the type
       
   223 	
       
   224 	ASSERT_TRUE(recivedSize>sizeOfRecvTPOA+12,_L("CCTSYIntegrationTestSmsMessagingBase::ComparePDUs illeagal PDU length"));
       
   225 	ASSERT_TRUE(sentSize>sizeOfSentTPOA+7,_L("CCTSYIntegrationTestSmsMessagingBase::ComparePDUs illeagal PDU length"));
       
   226 	if((recivedSize<=sizeOfRecvTPOA+12)||(sentSize<=sizeOfSentTPOA+7))
       
   227 		{
       
   228 		return EFalse;
       
   229 		}
       
   230 	ASSERT_EQUALS(aRecieved[sizeOfRecvTPOA+2],aSent[sizeOfSentTPOA+3],_L("RMobileSmsMessaging::ReceiveMessage did not returned the correct class message"));
       
   231 	ASSERT_EQUALS(aRecieved[sizeOfRecvTPOA+10],aSent[sizeOfSentTPOA+5],_L("RMobileSmsMessaging::ReceiveMessage did not returned the same message length"));
       
   232 	if((aRecieved[sizeOfRecvTPOA+2]!=aSent[sizeOfSentTPOA+3])||(aRecieved[sizeOfRecvTPOA+10]!=aSent[sizeOfSentTPOA+5]))
       
   233 		{
       
   234 		return EFalse;
       
   235 		}
       
   236 	TInt offset= 5-sizeOfSentTPOA+sizeOfRecvTPOA;
       
   237 	TBuf<200> sentext;
       
   238 	ASSERT_TRUE(iSmsStoreTsyTestHelper.ToText(sentext,aSent,EFalse),_L("RMobileSmsMessaging::ReceiveMessage sent unreadable text"));
       
   239 	TBuf<200> rectext;
       
   240 	ASSERT_TRUE(iSmsStoreTsyTestHelper.ToText(rectext,aRecieved,ETrue),_L("RMobileSmsMessaging::ReceiveMessage got unreadable text"));
       
   241 	ASSERT_EQUALS(recivedSize,sentSize+offset,_L("RMobileSmsMessaging::ReceiveMessage got the wrong message length"));
       
   242 	ASSERT_EQUALS_DES16(rectext,sentext,_L("RMobileSmsMessaging::ReceiveMessage did not returned the same text"));
       
   243 	if(rectext!=sentext)
       
   244 		{
       
   245 		return EFalse;
       
   246 		}
       
   247 	return ETrue;
       
   248 	}
       
   249 
       
   250 CCTSYIntegrationTestSmsMessaging0001::CCTSYIntegrationTestSmsMessaging0001(CEtelSessionMgr& aEtelSessionMgr)
       
   251 	: CCTSYIntegrationTestSmsMessagingBase(aEtelSessionMgr)
       
   252 /**
       
   253  * Constructor.
       
   254  */
       
   255 	{
       
   256 	SetTestStepName(CCTSYIntegrationTestSmsMessaging0001::GetTestStepName());
       
   257 	}
       
   258 
       
   259 CCTSYIntegrationTestSmsMessaging0001::~CCTSYIntegrationTestSmsMessaging0001()
       
   260 /**
       
   261  * Destructor.
       
   262  */
       
   263 	{
       
   264 	}
       
   265 
       
   266 TVerdict CCTSYIntegrationTestSmsMessaging0001::doTestStepL()
       
   267 /**
       
   268  * @SYMTestCaseID BA-CTSY-INT-SMSM-0001
       
   269  * @SYMFssID BA/CTSY/SMSM-0001
       
   270  * @SYMTestCaseDesc Get message store information.
       
   271  * @SYMTestPriority High
       
   272  * @SYMTestActions RMobileSmsMessaging::GetMessageStoreInfo
       
   273  * @SYMTestExpectedResults Pass - Number of message stores and message store info. returned are correct.
       
   274  * @SYMTestType CIT
       
   275  * @SYMTestCaseDependencies live/automatic
       
   276  *
       
   277  * Reason for test: Verify number of message stores and message store details are correct.
       
   278  *
       
   279  * @return - TVerdict code
       
   280  */
       
   281 	{
       
   282 
       
   283 	//
       
   284 	// SET UP
       
   285 	//
       
   286 
       
   287 	RMobileSmsMessaging &smsMessaging = iEtelSessionMgr.GetSmsMessagingL( KMainServer, KMainPhone, KMainSmsMessaging);
       
   288 
       
   289 	//
       
   290 	// SET UP END
       
   291 	//
       
   292 	
       
   293 	StartTest();
       
   294 	
       
   295 	//
       
   296 	// TEST START
       
   297 	//
       
   298 	
       
   299 	
       
   300 	// Check RMobileSmsMessaging::EnumerateMessageStores returns aCount=1
       
   301 	TInt numOfMessages = 0;
       
   302 	smsMessaging.EnumerateMessageStores(numOfMessages);
       
   303 	ASSERT_TRUE(numOfMessages > 0,_L("RMobileSmsMessaging::EnumerateMessageStores returned with error."));
       
   304 
       
   305 	// Check RMobileSmsMessaging::GetMessageStoreInfo with aIndex=0 returns 
       
   306 	// TMobilePhoneStoreInfoV1::iCaps of 
       
   307 	//	RMobilePhoneStore::KCapsIndividualEntry 
       
   308 	//     | RMobilePhoneStore::KCapsDeleteAll 
       
   309 	//     | RMobilePhoneStore::KCapsReadAccess 
       
   310 	//     | RMobilePhoneStore::KCapsWriteAccess 
       
   311 	//     | RMobilePhoneStore::KCapsNotifyEvent 
       
   312 	//     | RMobilePhoneStore::KCapsWholeStore 
       
   313 	TInt index = 0;
       
   314 	TExtEtelRequestStatus smsStoreInfoRequest(smsMessaging,EMobilePhoneGetPhoneStoreInfo);
       
   315 	CleanupStack::PushL(smsStoreInfoRequest);
       
   316 	RMobilePhoneStore::TMobilePhoneStoreInfoV1 smsStoreInfo;
       
   317 	RMobilePhoneStore::TMobilePhoneStoreInfoV1Pckg smsStorePkg(smsStoreInfo);
       
   318 	smsMessaging.GetMessageStoreInfo(smsStoreInfoRequest, index, smsStorePkg);
       
   319 	ASSERT_EQUALS(WaitForRequestWithTimeOut(smsStoreInfoRequest, ETimeLong),
       
   320 				KErrNone, _L("RMobilePhone::GetPhoneStoreInfo timed out."));
       
   321 	TUint32 expectedCaps = RMobilePhoneStore::KCapsIndividualEntry | RMobilePhoneStore::KCapsDeleteAll 
       
   322 							   | RMobilePhoneStore::KCapsReadAccess | RMobilePhoneStore::KCapsWriteAccess 
       
   323 							   | RMobilePhoneStore::KCapsNotifyEvent | RMobilePhoneStore::KCapsWholeStore;
       
   324 	ASSERT_BITS_SET(smsStoreInfo.iCaps, expectedCaps, KNoUnwantedBits, _L("RMobilePhone::GetSecurityCaps completed with incorrect caps."));
       
   325 
       
   326 
       
   327 	// Check RMobileSmsMessaging::GetMessageStoreInfo with aIndex=0 returns TMobilePhoneStoreInfoV1::iName = KETelIccSmsStore
       
   328 	// Check RMobileSmsMessaging::GetMessageStoreInfo with aIndex=0 returns TMobilePhoneStoreInfoV1::iTotalEntries > 0
       
   329 	// Check RMobileSmsMessaging::GetMessageStoreInfo with aIndex=0 returns TMobilePhoneStoreInfoV1::iType = RMobilePhoneStore::EShortMessageStore
       
   330 	// Check RMobileSmsMessaging::GetMessageStoreInfo with aIndex=0 returns TMobilePhoneStoreInfoV1::iUsedEntries >= 0
       
   331 	DEBUG_PRINTF2(_L("SMS store name is %S"), &smsStoreInfo.iName);
       
   332 	ASSERT_EQUALS_DES16(smsStoreInfo.iName, KETelIccSmsStore, _L("RMobileSmsMessaging::GetMessageStoreInfo returned with incorrect name."));
       
   333 	ASSERT_TRUE(smsStoreInfo.iTotalEntries > 0, _L("RMobileSmsMessaging::GetMessageStoreInfo returned with incorrect total entries."));
       
   334 	ASSERT_EQUALS(smsStoreInfo.iType, RMobilePhoneStore::EShortMessageStore, _L("RMobileSmsMessaging::GetMessageStoreInfo returned with incorrect type."));
       
   335 	ASSERT_TRUE(smsStoreInfo.iUsedEntries >= 0, _L("RMobileSmsMessaging::GetMessageStoreInfo returned with incorrect used entries."));
       
   336 
       
   337 
       
   338 	// Check RMobileSmsMessaging::GetMessageStoreInfo with aIndex=1 returns KErrArgument
       
   339 	index = 1;
       
   340 	TExtEtelRequestStatus smsStoreInfoRequest2(smsMessaging,EMobilePhoneGetPhoneStoreInfo);
       
   341 	CleanupStack::PushL(smsStoreInfoRequest2);
       
   342 	smsMessaging.GetMessageStoreInfo(smsStoreInfoRequest2, index, smsStorePkg);
       
   343 	ASSERT_EQUALS(WaitForRequestWithTimeOut(smsStoreInfoRequest2, ETimeLong),
       
   344 		KErrNone, _L("RMobilePhone::GetPhoneStoreInfo timed out."));
       
   345 	ASSERT_EQUALS(smsStoreInfoRequest2.Int(), KErrArgument, 
       
   346 		_L("RMobilePhone::GetPhoneStoreInfo returned with error."));			
       
   347 
       
   348 	//
       
   349 	// TEST END
       
   350 	//
       
   351 
       
   352     StartCleanup();
       
   353 	
       
   354 	// smsStoreInfoRequest
       
   355 	// smsStoreInfoRequest2
       
   356 	CleanupStack::PopAndDestroy(2, &smsStoreInfoRequest);
       
   357 	
       
   358 	return TestStepResult();
       
   359 	}
       
   360 
       
   361 TPtrC CCTSYIntegrationTestSmsMessaging0001::GetTestStepName()
       
   362 /**
       
   363  * @return The test step name.
       
   364  */
       
   365 	{
       
   366 	return _L("CCTSYIntegrationTestSmsMessaging0001");
       
   367 	}
       
   368 
       
   369 
       
   370 
       
   371 CCTSYIntegrationTestSmsMessaging0002::CCTSYIntegrationTestSmsMessaging0002(CEtelSessionMgr& aEtelSessionMgr)
       
   372 	: CCTSYIntegrationTestSmsMessagingBase(aEtelSessionMgr)
       
   373 /**
       
   374  * Constructor.
       
   375  */
       
   376 	{
       
   377 	SetTestStepName(CCTSYIntegrationTestSmsMessaging0002::GetTestStepName());
       
   378 	}
       
   379 
       
   380 CCTSYIntegrationTestSmsMessaging0002::~CCTSYIntegrationTestSmsMessaging0002()
       
   381 /**
       
   382  * Destructor.
       
   383  */
       
   384 	{
       
   385 	}
       
   386 
       
   387 TVerdict CCTSYIntegrationTestSmsMessaging0002::doTestStepL()
       
   388 /**
       
   389  * @SYMTestCaseID BA-CTSY-INT-SMSM-0002
       
   390  * @SYMFssID BA/CTSY/SMSM-0002
       
   391  * @SYMTestCaseDesc Set the SMS receive mode.
       
   392  * @SYMTestPriority High
       
   393  * @SYMTestActions RMobileSmsMessaging::SetReceiveMode, RMobileSmsMessaging::NotifyReceiveModeChange
       
   394  * @SYMTestExpectedResults Pass - Receive mode is set when the mode is supported. KErrNotSupported is returned otherwise.
       
   395  * @SYMTestType CIT
       
   396  * @SYMTestCaseDependencies live/automatic
       
   397  *
       
   398  * Reason for test: Verify receive mode change notification completes and receive mode is set correctly.
       
   399  *
       
   400  * @return - TVerdict code
       
   401  * 
       
   402  * $CTSYKnownFailure - When changing the receive mode AND a notification is requested of  its change 
       
   403  * (CTSY only supports nofifications when setting the receive mode to EReceiveUnstoredClientAck) 
       
   404  * a panic is raised and the board reboots. Adding logging into
       
   405  * the CSY it was found that line 617 of cmmsmstsy.cpp when
       
   406  * It was found that the panic is not caused when this line is executed, but a
       
   407  * little while after.
       
   408  */
       
   409 	{
       
   410 
       
   411 	//
       
   412 	// SET UP
       
   413 	//
       
   414 	RMobileSmsMessaging &smsMessaging = iEtelSessionMgr.GetSmsMessagingL( KMainServer, KMainPhone, KMainSmsMessaging);
       
   415 	
       
   416 
       
   417 	//
       
   418 	// SET UP END
       
   419 	//
       
   420 	
       
   421 	StartTest();
       
   422 	
       
   423 	//
       
   424 	// TEST START
       
   425 	//
       
   426 
       
   427 
       
   428 	// ===  Check default receive mode ===
       
   429 
       
   430 	// Check RMobileSmsMessaging::GetReceiveMode returns aReceiveMode=RMobileSmsMessaging::EReceiveUnstoredClientAck
       
   431 	DEBUG_PRINTF1(_L("Checking RMobileSmsMessaging::GetReceiveMode returns aReceiveMode=RMobileSmsMessaging::EReceiveUnstoredClientAck"));
       
   432 	RMobileSmsMessaging::TMobileSmsReceiveMode receiveMode;	
       
   433 	RMobileSmsMessaging::TMobileSmsReceiveMode getReceiveMode;	
       
   434 	ASSERT_EQUALS(smsMessaging.GetReceiveMode(receiveMode), KErrNone,
       
   435 		_L("RMobileSmsMessaging::GetReceiveMode returned with an error."));
       
   436 	ASSERT_EQUALS(receiveMode, RMobileSmsMessaging::EReceiveUnstoredClientAck,
       
   437 		_L("RMobileSmsMessaging::GetReceiveMode returned with incorrect mode."));
       
   438 	
       
   439 
       
   440 	// ===  Set receive mode to unsupported modes and check receive mode not changed ==
       
   441 
       
   442 	// Set receive mode to EReceiveModeUnspecified with RMobileSmsMessaging::SetReceiveMode with aReceiveMode=EReceiveModeUnspecified 
       
   443 	DEBUG_PRINTF1(_L("Setting receive mode to EReceiveModeUnspecified"));
       
   444 	TExtEtelRequestStatus receiveModeRequest(smsMessaging,EMobileSmsMessagingSetReceiveMode);
       
   445 	CleanupStack::PushL(receiveModeRequest);
       
   446 	receiveMode = RMobileSmsMessaging::EReceiveModeUnspecified;
       
   447 	smsMessaging.SetReceiveMode(receiveModeRequest, receiveMode);
       
   448 	ASSERT_EQUALS(WaitForRequestWithTimeOut(receiveModeRequest, ETimeMedium),
       
   449 		KErrNone, _L("RMobileSmsMessaging::SetReceiveMode timed out."));
       
   450 
       
   451 	// Check KErrNotSupported is returned
       
   452 	ASSERT_EQUALS(receiveModeRequest.Int(), KErrNotSupported, 
       
   453 		_L("RMobilePhone::GetPhoneStoreInfo completed with incorrect status."));
       
   454 
       
   455 	// Check RMobileSmsMessaging::GetReceiveMode returns aReceiveMode=EReceiveUnstoredClientAck
       
   456 	ASSERT_EQUALS(smsMessaging.GetReceiveMode(getReceiveMode), KErrNone,
       
   457 		_L("RMobileSmsMessaging::GetReceiveMode returned with an error."));
       
   458 	ASSERT_EQUALS(getReceiveMode, RMobileSmsMessaging::EReceiveUnstoredClientAck,
       
   459 		_L("RMobileSmsMessaging::GetReceiveMode returned with incorrect mode."));
       
   460 
       
   461 	
       
   462 	
       
   463 	
       
   464 	
       
   465 	
       
   466 
       
   467 	// Set receive mode to EReceiveUnstoredPhoneAck with RMobileSmsMessaging::SetReceiveMode with aReceiveMode=EReceiveUnstoredPhoneAck 
       
   468 	DEBUG_PRINTF1(_L("Setting receive mode to EReceiveUnstoredPhoneAck"));
       
   469 	TExtEtelRequestStatus receiveModeRequest2(smsMessaging,EMobileSmsMessagingSetReceiveMode);
       
   470 	CleanupStack::PushL(receiveModeRequest2);
       
   471 	receiveMode = RMobileSmsMessaging::EReceiveUnstoredPhoneAck;
       
   472 	smsMessaging.SetReceiveMode( receiveModeRequest2, receiveMode);
       
   473 	ASSERT_EQUALS(WaitForRequestWithTimeOut(receiveModeRequest2, ETimeMedium),
       
   474 		KErrNone, _L("RMobileSmsMessaging::SetReceiveMode timed out."));
       
   475 
       
   476 	// Check KErrNotSupported is returned
       
   477 	ASSERT_EQUALS(receiveModeRequest2.Int(), KErrNotSupported, 
       
   478 		_L("RMobilePhone::GetPhoneStoreInfo completed with incorrect status."));
       
   479 		
       
   480 	// Check RMobileSmsMessaging::GetReceiveMode returns aReceiveMode=EReceiveUnstoredClientAck
       
   481 	ASSERT_EQUALS(smsMessaging.GetReceiveMode(getReceiveMode), KErrNone,
       
   482 		_L("RMobileSmsMessaging::GetReceiveMode returned with an error."));
       
   483 	ASSERT_EQUALS(getReceiveMode, RMobileSmsMessaging::EReceiveUnstoredClientAck,
       
   484 		_L("RMobileSmsMessaging::GetReceiveMode returned with incorrect mode."));
       
   485 
       
   486 		
       
   487 	
       
   488 	
       
   489 	
       
   490 
       
   491 	
       
   492 	// Set receive mode to EReceiveStored with RMobileSmsMessaging::SetReceiveMode with aReceiveMode=EReceiveStored 
       
   493 	DEBUG_PRINTF1(_L("Setting receive mode to EReceiveStored"));
       
   494 	TExtEtelRequestStatus receiveModeRequest3(smsMessaging,EMobileSmsMessagingSetReceiveMode);
       
   495 	CleanupStack::PushL(receiveModeRequest3);
       
   496 	receiveMode = RMobileSmsMessaging::EReceiveStored;
       
   497 	smsMessaging.SetReceiveMode( receiveModeRequest3, receiveMode);
       
   498 	ASSERT_EQUALS(WaitForRequestWithTimeOut(receiveModeRequest3, ETimeMedium),
       
   499 		KErrNone, _L("RMobileSmsMessaging::SetReceiveMode timed out."));
       
   500 	
       
   501 	// Check KErrNotSupported is returned
       
   502 	ASSERT_EQUALS(receiveModeRequest3.Int(), KErrNotSupported, 
       
   503 		_L("RMobilePhone::GetPhoneStoreInfo completed with incorrect status."));
       
   504 
       
   505 	// Check RMobileSmsMessaging::GetReceiveMode returns aReceiveMode=EReceiveUnstoredClientAck
       
   506 	ASSERT_EQUALS(smsMessaging.GetReceiveMode(getReceiveMode), KErrNone,
       
   507 		_L("RMobileSmsMessaging::GetReceiveMode returned with an error."));
       
   508 	ASSERT_EQUALS(getReceiveMode, RMobileSmsMessaging::EReceiveUnstoredClientAck,
       
   509 		_L("RMobileSmsMessaging::GetReceiveMode returned with incorrect mode."));
       
   510 
       
   511 
       
   512 	
       
   513 	
       
   514 	
       
   515 	
       
   516 	
       
   517 	// Set receive mode to EReceiveEither with RMobileSmsMessaging::SetReceiveMode with aReceiveMode=EReceiveEither 
       
   518 	DEBUG_PRINTF1(_L("Setting receive mode to EReceiveEither"));
       
   519 	TExtEtelRequestStatus receiveModeRequest4(smsMessaging,EMobileSmsMessagingSetReceiveMode);
       
   520 	CleanupStack::PushL(receiveModeRequest4);
       
   521 	receiveMode = RMobileSmsMessaging::EReceiveEither;
       
   522 	smsMessaging.SetReceiveMode( receiveModeRequest4, receiveMode);
       
   523 	ASSERT_EQUALS(WaitForRequestWithTimeOut(receiveModeRequest4, ETimeMedium),
       
   524 		KErrNone, _L("RMobileSmsMessaging::SetReceiveMode timed out."));
       
   525 
       
   526 	// Check KErrNotSupported is returned
       
   527 	ASSERT_EQUALS(receiveModeRequest4.Int(), KErrNotSupported, 
       
   528 		_L("RMobilePhone::GetPhoneStoreInfo completed with incorrect status."));
       
   529 
       
   530 	// Check RMobileSmsMessaging::GetReceiveMode returns aReceiveMode=EReceiveUnstoredClientAck
       
   531 	ASSERT_EQUALS(smsMessaging.GetReceiveMode(getReceiveMode), 
       
   532 		KErrNone, _L("RMobileSmsMessaging::GetReceiveMode returned with an error."));
       
   533 	ASSERT_EQUALS(getReceiveMode, RMobileSmsMessaging::EReceiveUnstoredClientAck,
       
   534 		_L("RMobileSmsMessaging::GetReceiveMode returned with incorrect mode."));
       
   535 
       
   536 
       
   537 
       
   538 	
       
   539 	
       
   540 	
       
   541 	// ===  Set receive mode to EReceiveUnstoredClientAck ===
       
   542 
       
   543 	// ===  CTSY always completes notification even though the receive mode hasn't changed, we have to assume this is correct behaviour for now. ===
       
   544 	DEBUG_PRINTF1(_L("Checking for Notification"));
       
   545 	RMobileSmsMessaging::TMobileSmsReceiveMode notifyReceiveMode;	
       
   546 	TExtEtelRequestStatus notifyRequestStatus(smsMessaging, EMobileSmsMessagingNotifyReceiveModeChange);
       
   547 	CleanupStack::PushL(notifyRequestStatus); 
       
   548 	smsMessaging.NotifyReceiveModeChange(notifyRequestStatus, notifyReceiveMode);
       
   549 
       
   550 	// Set receive mode to  with RMobileSmsMessaging::SetReceiveMode with aReceiveMode=EReceiveUnstoredClientAck 
       
   551 	DEBUG_PRINTF1(_L("Setting receive mode to EReceiveUnstoredClientAck"));
       
   552 	TExtEtelRequestStatus receiveModeRequest5(smsMessaging,EMobileSmsMessagingSetReceiveMode);
       
   553 	CleanupStack::PushL(receiveModeRequest5);
       
   554 	receiveMode = RMobileSmsMessaging::EReceiveUnstoredClientAck;
       
   555 	smsMessaging.SetReceiveMode( receiveModeRequest5, receiveMode);
       
   556 	ASSERT_EQUALS(WaitForRequestWithTimeOut(receiveModeRequest5, ETimeMedium),
       
   557 		KErrNone, _L("RMobileSmsMessaging::SetReceiveMode timed out."));
       
   558 	
       
   559 	// Check RMobileSmsMessaging::NotifyReceiveModeChange completes wtih aReceiveMode=EReceiveUnstoredClientAck
       
   560 	iSmsMessagingTsyTestHelper.WaitForMobileSmsMessagingNotifyReceiveModeChange( smsMessaging, 
       
   561 				notifyRequestStatus,
       
   562 				notifyReceiveMode, 
       
   563 				RMobileSmsMessaging::EReceiveUnstoredClientAck,
       
   564 				KErrNone );	
       
   565 
       
   566 	// Check RMobileSmsMessaging::GetReceiveMode returns aReceiveMode=EReceiveUnstoredClientAck
       
   567 	ASSERT_EQUALS(smsMessaging.GetReceiveMode(getReceiveMode), KErrNone,
       
   568 					_L("RMobileSmsMessaging::GetReceiveMode returned with an error."));
       
   569 	ASSERT_EQUALS(getReceiveMode, RMobileSmsMessaging::EReceiveUnstoredClientAck,
       
   570 					_L("RMobileSmsMessaging::GetReceiveMode returned with incorrect mode."));
       
   571 
       
   572 	
       
   573 	
       
   574 	
       
   575 	
       
   576 	// ===  Cancel setting the receive mode ===
       
   577 	ERR_PRINTF2(_L("<font color=Orange>$CTSYKnownFailure: defect id = %d</font>"), 10013);	
       
   578 	ASSERT_EQUALS(1,0, _L("Test leaving because it will cause TSY crash, remove this when defect is fixed"));
       
   579 	TEST_CHECK_POINT_L(_L("test leaving..."));
       
   580 	
       
   581 	// Set receive mode to  with RMobileSmsMessaging:: with aReceiveMode=EReceiveUnstoredClientAck 
       
   582 	DEBUG_PRINTF1(_L("Setting receive mode to EReceiveUnstoredClientAck"));
       
   583 	TExtEtelRequestStatus receiveModeRequest6(smsMessaging,EMobileSmsMessagingSetReceiveMode);
       
   584 	CleanupStack::PushL(receiveModeRequest6);
       
   585 	receiveMode = RMobileSmsMessaging::EReceiveUnstoredClientAck;
       
   586 	smsMessaging.SetReceiveMode(receiveModeRequest6, receiveMode);
       
   587 
       
   588 
       
   589 	// Cancel the request with CancelAsyncRequest(EMobileSmsMessagingSetReceiveMode)
       
   590  	DEBUG_PRINTF1(_L("Cancel EMobileSmsMessagingSetReceiveMode"));
       
   591 	smsMessaging.CancelAsyncRequest(EMobileSmsMessagingSetReceiveMode);
       
   592 	ASSERT_EQUALS(WaitForRequestWithTimeOut(receiveModeRequest6, ETimeMedium),
       
   593 		KErrNone, _L("RMobileSmsMessaging::SetReceiveMode returned with error."));
       
   594 	ASSERT_TRUE(receiveModeRequest6.Int() == KErrNone || receiveModeRequest6.Int() == KErrCancel, 
       
   595 			_L("RMobileSmsMessaging::SetReceiveMode request completed with error."));
       
   596 
       
   597 
       
   598 	// Check RMobileSmsMessaging::GetReceiveMode returns aReceiveMode=EReceiveUnstoredClientAck
       
   599 	ASSERT_EQUALS(smsMessaging.GetReceiveMode(getReceiveMode), KErrNone,
       
   600 		_L("RMobileSmsMessaging::GetReceiveMode returned with an error."));
       
   601 	ASSERT_EQUALS(getReceiveMode, RMobileSmsMessaging::EReceiveUnstoredClientAck,
       
   602 		_L("RMobileSmsMessaging::GetReceiveMode returned with incorrect mode."));
       
   603 	
       
   604 
       
   605 	//
       
   606 	// TEST END
       
   607 	//
       
   608 
       
   609     StartCleanup();
       
   610 	
       
   611 	//receiveModeRequest
       
   612 	//receiveModeRequest2
       
   613 	//receiveModeRequest3
       
   614 	//receiveModeRequest4
       
   615 	//notifyRequestStatus	
       
   616 	//receiveModeRequest5
       
   617 	//receiveModeRequest6
       
   618 	CleanupStack::PopAndDestroy(7);				
       
   619 	
       
   620 	return TestStepResult();
       
   621 	}
       
   622 
       
   623 TPtrC CCTSYIntegrationTestSmsMessaging0002::GetTestStepName()
       
   624 /**
       
   625  * @return The test step name.
       
   626  */
       
   627 	{
       
   628 	return _L("CCTSYIntegrationTestSmsMessaging0002");
       
   629 	}
       
   630 
       
   631 
       
   632 
       
   633 CCTSYIntegrationTestSmsMessaging0003::CCTSYIntegrationTestSmsMessaging0003(CEtelSessionMgr& aEtelSessionMgr)
       
   634 	: CCTSYIntegrationTestSmsMessagingBase(aEtelSessionMgr)
       
   635 /**
       
   636  * Constructor.
       
   637  */
       
   638 	{
       
   639 	SetTestStepName(CCTSYIntegrationTestSmsMessaging0003::GetTestStepName());
       
   640 	}
       
   641 
       
   642 CCTSYIntegrationTestSmsMessaging0003::~CCTSYIntegrationTestSmsMessaging0003()
       
   643 /**
       
   644  * Destructor.
       
   645  */
       
   646 	{
       
   647 	}
       
   648 
       
   649 TVerdict CCTSYIntegrationTestSmsMessaging0003::doTestStepL()
       
   650 /**
       
   651  * @SYMTestCaseID BA-CTSY-INT-SMSM-0003
       
   652  * @SYMFssID BA/CTSY/SMSM-0003
       
   653  * @SYMTestCaseDesc Send an SMS message in each bearer mode.
       
   654  * @SYMTestPriority High
       
   655  * @SYMTestActions RMobileSmsMessaging::SendMessage, RMobileSmsMessaging::GetMoSmsBearer, RMobileSmsMessaging::NotifyMoSmsBearerChange
       
   656  * @SYMTestExpectedResults Pass - SMS sent successfully using all supported bearers.
       
   657  * @SYMTestType CIT
       
   658  * @SYMTestCaseDependencies live/automatic
       
   659  *
       
   660  * Reason for test: Verify bearer can be set and SMS can be sent.
       
   661  *
       
   662  * @return - TVerdict code
       
   663  * 
       
   664  */
       
   665 	{
       
   666 
       
   667 	//
       
   668 	// SET UP
       
   669 	//
       
   670 	RMobileSmsMessaging &smsMessaging = iEtelSessionMgr.GetSmsMessagingL(KMainServer, KMainPhone, KMainSmsMessaging);
       
   671 
       
   672     RMobilePhone& phone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone);
       
   673     iNetworkTsyTestHelper.WaitForRegisteredOnHomeNetworkL(phone);
       
   674 
       
   675 	// Ensure RMobileSmsMessaging::GetMoSmsBearer returns aBearer= ESmsBearerCircuitOnly 
       
   676 	RMobileSmsMessaging::TMobileSmsBearer bearer = RMobileSmsMessaging::ESmsBearerCircuitOnly;
       
   677 	SetSmsBearerL(smsMessaging, bearer);
       
   678 
       
   679 
       
   680 	//
       
   681 	// SET UP END
       
   682 	//
       
   683 
       
   684 	StartTest();
       
   685 	
       
   686 	//
       
   687 	// TEST START
       
   688 	//
       
   689 	
       
   690 	
       
   691 	// Send an SMS message with RMobileSmsMessaging::SendMessage. Check no error is returned in aMsgAttributes.iSubmitReport 
       
   692 	TBuf8<140> text(_L8("Hello from CTSY"));
       
   693 	RMobileSmsMessaging::TMobileSmsSendAttributesV1 sendSmsAttributes;
       
   694 	RMobileSmsMessaging::TMobileSmsSendAttributesV1Pckg sendSmsAttributesPckg(sendSmsAttributes);
       
   695 	RMobileSmsMessaging::TMobileSmsGsmTpdu pdu = CreateValidSmsMessageL(text, sendSmsAttributes);	
       
   696 
       
   697 	
       
   698 	// Send an SMS message with RMobileSmsMessaging::SendMessage. Check no error is returned in aMsgAttributes.iSubmitReport 
       
   699 	TExtEtelRequestStatus sendSmsRequestStatus(smsMessaging, EMobileSmsMessagingSendMessage);
       
   700 	CleanupStack::PushL(sendSmsRequestStatus);
       
   701 	smsMessaging.SendMessage(sendSmsRequestStatus, pdu, sendSmsAttributesPckg);
       
   702 	ASSERT_EQUALS(WaitForRequestWithTimeOut(sendSmsRequestStatus, ETimeMedium),
       
   703 		KErrNone, _L("RMobileSmsMessaging::SendMessage timed out."));
       
   704 	ASSERT_EQUALS(sendSmsRequestStatus.Int(), KErrNone, 
       
   705 		_L("RMobileSmsMessaging::SendMessage completed with incorrect status"));
       
   706 	
       
   707 		
       
   708 	//Check no error is returned in aMsgAttributes.iSubmitReport
       
   709 	ASSERT_TRUE(sendSmsAttributes.iSubmitReport.Length() > 0, 
       
   710 		_L("RMobileSmsMessaging::TMobileSmsSendAttributesV1.iSubmitReport has zero length."));
       
   711 	TUint wantedBits = RMobileSmsMessaging::KGsmSubmitReport; 
       
   712 	ASSERT_BITS_SET(sendSmsAttributes.iFlags,wantedBits,KNoUnwantedBits, 
       
   713 		_L("RMobileSmsMessaging::TMobileSmsSendAttributesV1 has no submit report in iFlags."));			
       
   714 
       
   715 	
       
   716 		
       
   717 
       
   718 	
       
   719 	
       
   720 	// Set the MO SMS bearer to ESmsBearerPacketOnly with RMobileSmsMessaging::SetMoSmsBearer
       
   721 	DEBUG_PRINTF1(_L("Set the MO SMS bearer to ESmsBearerPacketOnly"));
       
   722 	bearer = RMobileSmsMessaging::ESmsBearerPacketOnly;
       
   723 	SetSmsBearerL(smsMessaging, bearer);
       
   724 	
       
   725 	
       
   726 	//Check the status of the registration
       
   727 	DEBUG_PRINTF1(_L("Checking the state of the packet service"));
       
   728 	RPacketService &packetService = iEtelSessionMgr.GetPacketServiceL(KMainServer, KMainPhone, KMainPacketService);
       
   729 	TExtEtelRequestStatus getNtwkRegStatus(packetService, EPacketGetNtwkRegStatus);
       
   730 	CleanupStack::PushL(getNtwkRegStatus);	
       
   731 	RPacketService::TRegistrationStatus registrationStatus;
       
   732 	packetService.GetNtwkRegStatus(getNtwkRegStatus, registrationStatus);
       
   733 	ASSERT_EQUALS(WaitForRequestWithTimeOut(getNtwkRegStatus, ETimeMedium),
       
   734 			KErrNone, _L("RPacketService::GetNtwkRegStatus timed out."));
       
   735 	DEBUG_PRINTF2(_L("NETWORK REGISTRATION STATUS = %d"), registrationStatus);
       
   736 
       
   737 	//Lets get the status of the packet service
       
   738 	TExtEtelRequestStatus statusRequestStatus(packetService, EPacketGetStatus);
       
   739 	CleanupStack::PushL(statusRequestStatus);
       
   740 	RPacketService::TStatus packetStatus;
       
   741 	TInt err=packetService.GetStatus(packetStatus);
       
   742 	ASSERT_EQUALS(err, KErrNone, _L("RPacketService::GetStatus returned error."));
       
   743 	DEBUG_PRINTF2(_L("Packet status returned %d"), packetStatus);
       
   744 	
       
   745 	// Attach a packet service here: 
       
   746 	DEBUG_PRINTF1(_L("Set attatch mode to RPacketService::EAttachWhenNeeded"));
       
   747 	TExtEtelRequestStatus setAttachModeStatus(packetService, EPacketSetAttachMode);
       
   748 	CleanupStack::PushL(setAttachModeStatus);	
       
   749 	packetService.SetAttachMode(setAttachModeStatus, RPacketService::EAttachWhenNeeded);	
       
   750 	ASSERT_EQUALS(WaitForRequestWithTimeOut(setAttachModeStatus, ETimeLong), 
       
   751 		KErrNone, _L("RPacketService::SetAttachMode timed-out"));
       
   752 	ASSERT_EQUALS(setAttachModeStatus.Int(), KErrNone, 
       
   753 		_L("RPacketService::SetAttachMode returned with an error"));
       
   754 
       
   755 	
       
   756 	//Setup a notifier to be notified of a change in packet service status change
       
   757 	TExtEtelRequestStatus notifyStatusChange(packetService, EPacketNotifyStatusChange);
       
   758 	CleanupStack::PushL(notifyStatusChange);
       
   759 	RPacketService::TStatus notifiedPacketStatus;
       
   760 	packetService.NotifyStatusChange(notifyStatusChange, notifiedPacketStatus);
       
   761 	
       
   762 	
       
   763 	//Attach
       
   764 	TExtEtelRequestStatus attachModeStatus(packetService, EPacketSetAttachMode);
       
   765 	CleanupStack::PushL(attachModeStatus);	
       
   766 	packetService.Attach(attachModeStatus);	
       
   767 	ASSERT_EQUALS(WaitForRequestWithTimeOut(attachModeStatus, ETimeLong), 
       
   768 		KErrNone, _L("RPacketService::Attach timed-out"));
       
   769 	ASSERT_EQUALS(attachModeStatus.Int(), KErrNone, 
       
   770 		_L("RPacketService::Attach returned with an error"));
       
   771 
       
   772 	
       
   773 	// Check RPacketService::NotifyStatusChange() completes wtih aStatus=EStatusAttached
       
   774 	RPacketService::TStatus expectedStatus=RPacketService::EStatusAttached;
       
   775 	iPacketServiceTsyTestHelper.WaitForPacketServiceNotifyStatusChange( 
       
   776 			packetService, 
       
   777 			notifyStatusChange,
       
   778 			notifiedPacketStatus, 
       
   779 			expectedStatus,
       
   780 			KErrNone );	
       
   781 	
       
   782 	//Send SMS
       
   783 	RMobileSmsMessaging::TMobileSmsSendAttributesV1 sendSmsAttributes2;
       
   784 	RMobileSmsMessaging::TMobileSmsSendAttributesV1Pckg sendSmsAttributesPckg2(sendSmsAttributes2);
       
   785 	GetSmsSendAttributesL(sendSmsAttributes2);
       
   786 	TExtEtelRequestStatus sendSmsRequestStatus2(smsMessaging, EMobileSmsMessagingSendMessage);
       
   787 	CleanupStack::PushL(sendSmsRequestStatus2);
       
   788 	smsMessaging.SendMessage(sendSmsRequestStatus2, pdu, sendSmsAttributesPckg2);
       
   789     // $CTSYProblem - Sending a SMS message over packetService times out.
       
   790     //  	- The message is sent from CTSY to LTSY.  From the logs it is apparent
       
   791     //      - that the message is trying to be sent three times.  The sending is
       
   792     // 		- unsuccessful.
       
   793 	ASSERT_EQUALS(WaitForRequestWithTimeOut(sendSmsRequestStatus2, ETimeMedium),
       
   794 			KErrNone, _L("RMobileSmsMessaging::SendMessage timed out."));
       
   795 	ASSERT_EQUALS(sendSmsRequestStatus2.Int(), KErrGeneral,
       
   796 		_L("RMobileSmsMessaging::SendMessage completed with incorrect status"));
       
   797 
       
   798 	// Detach from the packet service
       
   799 	TExtEtelRequestStatus detatchPacketStatus(packetService, EPacketContextDeactivate);
       
   800 	CleanupStack::PushL(detatchPacketStatus);	
       
   801 	packetService.Detach(detatchPacketStatus);
       
   802 	ASSERT_EQUALS(WaitForRequestWithTimeOut(detatchPacketStatus, ETimeLong), 
       
   803 			KErrNone, _L("RPacketService::Detach timed-out"));
       
   804 	ASSERT_EQUALS(detatchPacketStatus.Int(), KErrNone, 
       
   805 			_L("RPacketService::Detach returned with an error"));
       
   806 
       
   807 
       
   808 	
       
   809 	
       
   810 	// Set the MO SMS bearer to ESmsBearerPacketPreferred with RMobileSmsMessaging::SetMoSmsBearer 
       
   811 	DEBUG_PRINTF1(_L("Set the MO SMS bearer to ESmsBearerPacketPreferred"));
       
   812 	bearer = RMobileSmsMessaging::ESmsBearerPacketPreferred;
       
   813 	SetSmsBearerL(smsMessaging, bearer);
       
   814 
       
   815 	// Send an SMS message with RMobileSmsMessaging::SendMessage. Check no error is returned in aMsgAttributes.iSubmitReport
       
   816 	RMobileSmsMessaging::TMobileSmsSendAttributesV1 sendSmsAttributes3;
       
   817 	RMobileSmsMessaging::TMobileSmsSendAttributesV1Pckg sendSmsAttributesPckg3(sendSmsAttributes3);
       
   818 	GetSmsSendAttributesL(sendSmsAttributes3);
       
   819 	TExtEtelRequestStatus sendSmsRequestStatus3(smsMessaging, EMobileSmsMessagingSendMessage);
       
   820 	CleanupStack::PushL(sendSmsRequestStatus3);
       
   821 	smsMessaging.SendMessage(sendSmsRequestStatus3, pdu, sendSmsAttributesPckg3);
       
   822 	ASSERT_EQUALS(WaitForRequestWithTimeOut(sendSmsRequestStatus3, ETimeMedium),
       
   823                   KErrNone, _L("RMobileSmsMessaging::SendMessage timed out."));
       
   824 	ASSERT_EQUALS(sendSmsRequestStatus3.Int(), KErrNone, 
       
   825                   _L("RMobileSmsMessaging::SendMessage completed with incorrect status"));
       
   826 	
       
   827 	//Check no error is returned in aMsgAttributes.iSubmitReport
       
   828 	ASSERT_TRUE(sendSmsAttributes3.iSubmitReport.Length() > 0, 
       
   829 		_L("RMobileSmsMessaging::TMobileSmsSendAttributesV1.iSubmitReport has zero length."));
       
   830 	wantedBits = RMobileSmsMessaging::KGsmSubmitReport; 
       
   831 	ASSERT_BITS_SET(sendSmsAttributes3.iFlags,wantedBits,KNoUnwantedBits, 
       
   832 		_L("RMobileSmsMessaging::TMobileSmsSendAttributesV1 has no submit report in iFlags."));		
       
   833 	
       
   834 
       
   835 
       
   836 
       
   837 
       
   838 
       
   839 
       
   840 	// Set the MO SMS bearer to ESmsBearerCircuitPreferred with RMobileSmsMessaging::SetMoSmsBearer 
       
   841 	DEBUG_PRINTF1(_L("Set the MO SMS bearer to ESmsBearerCircuitPreferred"));
       
   842 	bearer = RMobileSmsMessaging::ESmsBearerCircuitPreferred;
       
   843 	SetSmsBearerL(smsMessaging, bearer);
       
   844 
       
   845 	// Send an SMS message with RMobileSmsMessaging::SendMessage. Check no error is returned in aMsgAttributes.iSubmitReport 
       
   846 	RMobileSmsMessaging::TMobileSmsSendAttributesV1 sendSmsAttributes4;
       
   847 	RMobileSmsMessaging::TMobileSmsSendAttributesV1Pckg sendSmsAttributesPckg4(sendSmsAttributes4);
       
   848 	GetSmsSendAttributesL(sendSmsAttributes4);
       
   849 	TExtEtelRequestStatus sendSmsRequestStatus4(smsMessaging, EMobileSmsMessagingSendMessage);
       
   850 	CleanupStack::PushL(sendSmsRequestStatus4);
       
   851 	smsMessaging.SendMessage(sendSmsRequestStatus4, pdu, sendSmsAttributesPckg4);
       
   852 	ASSERT_EQUALS(WaitForRequestWithTimeOut(sendSmsRequestStatus4, ETimeMedium),
       
   853                   KErrNone, _L("RMobileSmsMessaging::SendMessage timed out."));
       
   854 	ASSERT_EQUALS(sendSmsRequestStatus4.Int(), KErrNone, 
       
   855                   _L("RMobileSmsMessaging::SendMessage completed with incorrect status"));
       
   856 
       
   857 	//Check no error is returned in aMsgAttributes.iSubmitReport
       
   858 	ASSERT_TRUE(sendSmsAttributes4.iSubmitReport.Length() > 0, 
       
   859 		_L("RMobileSmsMessaging::TMobileSmsSendAttributesV1.iSubmitReport has zero length."));
       
   860 	wantedBits = RMobileSmsMessaging::KGsmSubmitReport; 
       
   861 	ASSERT_BITS_SET(sendSmsAttributes4.iFlags,wantedBits,KNoUnwantedBits, 
       
   862 		_L("RMobileSmsMessaging::TMobileSmsSendAttributesV1 has no submit report in iFlags."));
       
   863 
       
   864 	//
       
   865 	// TEST END
       
   866 	//
       
   867 
       
   868     //StartCleanup();
       
   869 	/*	sendSmsRequestStatus
       
   870 	   	getNtwkRegStatus
       
   871 	   	statusRequestStatus
       
   872     	setAttachModeStatus
       
   873     	notifyStatusChange
       
   874     	attachModeStatus
       
   875     	sendSmsRequestStatus2
       
   876     	detatchPacketStatus
       
   877     	sendSmsRequestStatus3
       
   878     	sendSmsRequestStatus4 */
       
   879 	
       
   880     CleanupStack::PopAndDestroy(10, &sendSmsRequestStatus);
       
   881 	
       
   882 	return TestStepResult();
       
   883 	}
       
   884 
       
   885 TPtrC CCTSYIntegrationTestSmsMessaging0003::GetTestStepName()
       
   886 /**
       
   887  * @return The test step name.
       
   888  */
       
   889 	{
       
   890 	return _L("CCTSYIntegrationTestSmsMessaging0003");
       
   891 	}
       
   892 
       
   893 
       
   894 
       
   895 CCTSYIntegrationTestSmsMessaging0004::CCTSYIntegrationTestSmsMessaging0004(CEtelSessionMgr& aEtelSessionMgr)
       
   896 	: CCTSYIntegrationTestSmsMessagingBase(aEtelSessionMgr)
       
   897 /**
       
   898  * Constructor.
       
   899  */
       
   900 	{
       
   901 	SetTestStepName(CCTSYIntegrationTestSmsMessaging0004::GetTestStepName());
       
   902 	}
       
   903 
       
   904 CCTSYIntegrationTestSmsMessaging0004::~CCTSYIntegrationTestSmsMessaging0004()
       
   905 /**
       
   906  * Destructor.
       
   907  */
       
   908 	{
       
   909 	}
       
   910 
       
   911 TVerdict CCTSYIntegrationTestSmsMessaging0004::doTestStepL()
       
   912 /**
       
   913  * @SYMTestCaseID BA-CTSY-INT-SMSM-0004
       
   914  * @SYMFssID BA/CTSY/SMSM-0004
       
   915  * @SYMTestCaseDesc Store a valid service centre address and send message using that service centre.
       
   916  * @SYMTestPriority High
       
   917  * @SYMTestActions 
       
   918  * @SYMTestExpectedResults Pass - SMS sent successfully.
       
   919  * @SYMTestType CIT
       
   920  * @SYMTestCaseDependencies live/automatic
       
   921  *
       
   922  * Reason for test: Verify service centre address stored and message sent successfully.
       
   923  *
       
   924  * @return - TVerdict code
       
   925  */
       
   926 	{
       
   927 
       
   928 	//
       
   929 	// SET UP
       
   930 	//
       
   931 
       
   932 	RMobilePhone& phone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone);
       
   933     iNetworkTsyTestHelper.WaitForRegisteredOnHomeNetworkL(phone);
       
   934 
       
   935 	//
       
   936 	// SET UP END
       
   937 	//
       
   938 	
       
   939 	StartTest();
       
   940 	
       
   941 	//
       
   942 	// TEST START
       
   943 	//
       
   944 	
       
   945 	
       
   946 	// Send an SMS message using RMobileSmsMessaging::SendMessage with a valid service centre number in TMobileSmsAttributesV1::iGsmServiceCentre (ensure TMobileSmsAttributeFlags is set correctly). Check no error is returned in aMsgAttributes.iSubmitReport 
       
   947 
       
   948 	
       
   949 	//
       
   950 	// TEST END
       
   951 	//
       
   952 
       
   953     StartCleanup();
       
   954 	
       
   955 	// Put any required test clean up here, then remove this comment
       
   956 	
       
   957 	return TestStepResult();
       
   958 	}
       
   959 
       
   960 TPtrC CCTSYIntegrationTestSmsMessaging0004::GetTestStepName()
       
   961 /**
       
   962  * @return The test step name.
       
   963  */
       
   964 	{
       
   965 	return _L("CCTSYIntegrationTestSmsMessaging0004");
       
   966 	}
       
   967 
       
   968 
       
   969 
       
   970 CCTSYIntegrationTestSmsMessaging0005::CCTSYIntegrationTestSmsMessaging0005(CEtelSessionMgr& aEtelSessionMgr)
       
   971 	: CCTSYIntegrationTestSmsMessagingBase(aEtelSessionMgr)
       
   972 /**
       
   973  * Constructor.
       
   974  */
       
   975 	{
       
   976 	SetTestStepName(CCTSYIntegrationTestSmsMessaging0005::GetTestStepName());
       
   977 	}
       
   978 
       
   979 CCTSYIntegrationTestSmsMessaging0005::~CCTSYIntegrationTestSmsMessaging0005()
       
   980 /**
       
   981  * Destructor.
       
   982  */
       
   983 	{
       
   984 	}
       
   985 
       
   986 TVerdict CCTSYIntegrationTestSmsMessaging0005::doTestStepL()
       
   987 /**
       
   988  * @SYMTestCaseID BA-CTSY-INT-SMSM-0005
       
   989  * @SYMFssID BA/CTSY/SMSM-0005
       
   990  * @SYMTestCaseDesc Send message with different validity periods
       
   991  * @SYMTestPriority High
       
   992  * @SYMTestActions RMobileSmsMessaging::StoreSmspListL
       
   993  * @SYMTestExpectedResults Pass - SMS sent successfully.
       
   994  * @SYMTestType CIT
       
   995  * @SYMTestCaseDependencies live/automatic
       
   996  *
       
   997  * Reason for test: Verify message sent.
       
   998  *
       
   999  * @return - TVerdict code
       
  1000  */
       
  1001 	{
       
  1002 
       
  1003 	//
       
  1004 	// SET UP
       
  1005 	//
       
  1006 
       
  1007 	
       
  1008 
       
  1009 	//
       
  1010 	// SET UP END
       
  1011 	//
       
  1012 	
       
  1013 	StartTest();
       
  1014 	
       
  1015 	//
       
  1016 	// TEST START
       
  1017 	//
       
  1018 	
       
  1019 	
       
  1020 	// Store SMS parameters with RMobileSmsMessaging::StoreSmspListL with one entry with TMobileSmspEntryV1::iValidityPeriod of 1 day 
       
  1021 
       
  1022 	// Send an SMS message with RMobileSmsMessaging::SendMessage. Check no error is returned in aMsgAttributes.iSubmitReport 
       
  1023 
       
  1024 	// Store SMS parameters with RMobileSmsMessaging::StoreSmspListL with one entry with TMobileSmspEntryV1::iValidityPeriod of 3 days 
       
  1025 
       
  1026 	// Send an SMS message with RMobileSmsMessaging::SendMessage. Check no error is returned in aMsgAttributes.iSubmitReport 
       
  1027 
       
  1028 	
       
  1029 	//
       
  1030 	// TEST END
       
  1031 	//
       
  1032 
       
  1033     StartCleanup();
       
  1034 	
       
  1035 	// Put any required test clean up here, then remove this comment
       
  1036 	
       
  1037 	return TestStepResult();
       
  1038 	}
       
  1039 
       
  1040 TPtrC CCTSYIntegrationTestSmsMessaging0005::GetTestStepName()
       
  1041 /**
       
  1042  * @return The test step name.
       
  1043  */
       
  1044 	{
       
  1045 	return _L("CCTSYIntegrationTestSmsMessaging0005");
       
  1046 	}
       
  1047 
       
  1048 
       
  1049 
       
  1050 CCTSYIntegrationTestSmsMessaging0006::CCTSYIntegrationTestSmsMessaging0006(CEtelSessionMgr& aEtelSessionMgr)
       
  1051 	: CCTSYIntegrationTestSmsMessagingBase(aEtelSessionMgr)
       
  1052 /**
       
  1053  * Constructor.
       
  1054  */
       
  1055 	{
       
  1056 	SetTestStepName(CCTSYIntegrationTestSmsMessaging0006::GetTestStepName());
       
  1057 	}
       
  1058 
       
  1059 CCTSYIntegrationTestSmsMessaging0006::~CCTSYIntegrationTestSmsMessaging0006()
       
  1060 /**
       
  1061  * Destructor.
       
  1062  */
       
  1063 	{
       
  1064 	}
       
  1065 
       
  1066 TVerdict CCTSYIntegrationTestSmsMessaging0006::doTestStepL()
       
  1067 /**
       
  1068  * @SYMTestCaseID BA-CTSY-INT-SMSM-0006
       
  1069  * @SYMFssID BA/CTSY/SMSM-0006
       
  1070  * @SYMTestCaseDesc Send SMS with request for status report.
       
  1071  * @SYMTestPriority High
       
  1072  * @SYMTestActions 
       
  1073  * @SYMTestExpectedResults Pass - SMS sent successfully.
       
  1074  * @SYMTestType CIT
       
  1075  * @SYMTestCaseDependencies live/automatic
       
  1076  *
       
  1077  * Reason for test: Verify message sent.
       
  1078  *
       
  1079  * @return - TVerdict code
       
  1080  */
       
  1081 	{
       
  1082 
       
  1083 	//
       
  1084 	// SET UP
       
  1085 	//
       
  1086 
       
  1087 	// wait until we are on the network
       
  1088 	RMobilePhone& phone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone);
       
  1089     iNetworkTsyTestHelper.WaitForRegisteredOnHomeNetworkL(phone);
       
  1090 
       
  1091 	//
       
  1092 	// SET UP END
       
  1093 	//
       
  1094 	
       
  1095 	StartTest();
       
  1096 	
       
  1097 	//
       
  1098 	// TEST START
       
  1099 	//
       
  1100 	
       
  1101 	
       
  1102 	// Send an SMS message containing also a request for a status report with RMobileSmsMessaging::SendMessage.
       
  1103 	TBuf8<140> text(_L8("BA-CTSY-INT-SMSM-0006"));
       
  1104 	RMobileSmsMessaging::TMobileSmsSendAttributesV1 sendSmsAttributes;
       
  1105 	RMobileSmsMessaging::TMobileSmsSendAttributesV1Pckg sendSmsAttributesPckg(sendSmsAttributes);
       
  1106 	RMobileSmsMessaging::TMobileSmsGsmTpdu pdu = CreateValidSmsMessageL(text, sendSmsAttributes, 
       
  1107 			TSmsStoreTsyTestHelper::ENoDataCodingScheme, EFalse, ETrue);	
       
  1108 	RMobileSmsMessaging &smsMessaging = iEtelSessionMgr.GetSmsMessagingL( KMainServer, KMainPhone, KMainSmsMessaging);
       
  1109 	TExtEtelRequestStatus sendSmsRequestStatus(smsMessaging, EMobileSmsMessagingSendMessage);
       
  1110 	CleanupStack::PushL(sendSmsRequestStatus);
       
  1111 	smsMessaging.SendMessage(sendSmsRequestStatus, pdu, sendSmsAttributesPckg);
       
  1112 	ASSERT_EQUALS(WaitForRequestWithTimeOut(sendSmsRequestStatus, ETimeMedium),
       
  1113 		KErrNone, _L("RMobileSmsMessaging::SendMessage timed out."));
       
  1114 	ASSERT_EQUALS(sendSmsRequestStatus.Int(), KErrNone, 
       
  1115 		_L("RMobileSmsMessaging::SendMessage completed with incorrect status"));
       
  1116 
       
  1117     // Check no error is returned in aMsgAttributes.iSubmitReport 
       
  1118 	ASSERT_TRUE(sendSmsAttributes.iSubmitReport.Length() > 0, 
       
  1119 		_L("RMobileSmsMessaging::TMobileSmsSendAttributesV1.iSubmitReport has zero length."));
       
  1120 	TUint wantedBits = RMobileSmsMessaging::KGsmSubmitReport; 
       
  1121 	ASSERT_BITS_SET(sendSmsAttributes.iFlags,wantedBits,KNoUnwantedBits, 
       
  1122 		_L("RMobileSmsMessaging::TMobileSmsSendAttributesV1 has no submit report in iFlags."));			
       
  1123 
       
  1124 	
       
  1125 	//
       
  1126 	// TEST END
       
  1127 	//
       
  1128 
       
  1129     StartCleanup();
       
  1130 	
       
  1131 	// Pop:
       
  1132 	//	sendSmsRequestStatus
       
  1133 	CleanupStack::PopAndDestroy(&sendSmsRequestStatus);
       
  1134 	
       
  1135 	return TestStepResult();
       
  1136 	}
       
  1137 
       
  1138 TPtrC CCTSYIntegrationTestSmsMessaging0006::GetTestStepName()
       
  1139 /**
       
  1140  * @return The test step name.
       
  1141  */
       
  1142 	{
       
  1143 	return _L("CCTSYIntegrationTestSmsMessaging0006");
       
  1144 	}
       
  1145 
       
  1146 
       
  1147 
       
  1148 CCTSYIntegrationTestSmsMessaging0007::CCTSYIntegrationTestSmsMessaging0007(CEtelSessionMgr& aEtelSessionMgr)
       
  1149 	: CCTSYIntegrationTestSmsMessagingBase(aEtelSessionMgr)
       
  1150 /**
       
  1151  * Constructor.
       
  1152  */
       
  1153 	{
       
  1154 	SetTestStepName(CCTSYIntegrationTestSmsMessaging0007::GetTestStepName());
       
  1155 	}
       
  1156 
       
  1157 CCTSYIntegrationTestSmsMessaging0007::~CCTSYIntegrationTestSmsMessaging0007()
       
  1158 /**
       
  1159  * Destructor.
       
  1160  */
       
  1161 	{
       
  1162 	}
       
  1163 
       
  1164 TVerdict CCTSYIntegrationTestSmsMessaging0007::doTestStepL()
       
  1165 /**
       
  1166  * @SYMTestCaseID BA-CTSY-INT-SMSM-0007
       
  1167  * @SYMFssID BA/CTSY/SMSM-0007
       
  1168  * @SYMTestCaseDesc Send an empty SMS message.
       
  1169  * @SYMTestPriority High
       
  1170  * @SYMTestActions 
       
  1171  * @SYMTestExpectedResults Pass - SMS sent successfully.
       
  1172  * @SYMTestType CIT
       
  1173  * @SYMTestCaseDependencies live/automatic
       
  1174  *
       
  1175  * Reason for test: Verify message sent.
       
  1176  *
       
  1177  * @return - TVerdict code
       
  1178  */
       
  1179 	{
       
  1180 
       
  1181 	//
       
  1182 	// SET UP
       
  1183 	//
       
  1184 
       
  1185 	// wait until we are on the network
       
  1186 	RMobilePhone& phone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone);
       
  1187     iNetworkTsyTestHelper.WaitForRegisteredOnHomeNetworkL(phone);
       
  1188 	
       
  1189 
       
  1190 	//
       
  1191 	// SET UP END
       
  1192 	//
       
  1193 	
       
  1194 	StartTest();
       
  1195 	
       
  1196 	//
       
  1197 	// TEST START
       
  1198 	//
       
  1199 	
       
  1200 	
       
  1201 	// Send an empty SMS message with RMobileSmsMessaging::SendMessage.
       
  1202 	TBuf8<140> text(_L8(""));
       
  1203 	RMobileSmsMessaging::TMobileSmsSendAttributesV1 sendSmsAttributes;
       
  1204 	RMobileSmsMessaging::TMobileSmsSendAttributesV1Pckg sendSmsAttributesPckg(sendSmsAttributes);
       
  1205 	RMobileSmsMessaging::TMobileSmsGsmTpdu pdu = CreateValidSmsMessageL(text, sendSmsAttributes);	
       
  1206 	RMobileSmsMessaging &smsMessaging = iEtelSessionMgr.GetSmsMessagingL( KMainServer, KMainPhone, KMainSmsMessaging);
       
  1207 	TExtEtelRequestStatus sendSmsRequestStatus(smsMessaging, EMobileSmsMessagingSendMessage);
       
  1208 	CleanupStack::PushL(sendSmsRequestStatus);
       
  1209 	smsMessaging.SendMessage(sendSmsRequestStatus, pdu, sendSmsAttributesPckg);
       
  1210 	ASSERT_EQUALS(WaitForRequestWithTimeOut(sendSmsRequestStatus, ETimeMedium),
       
  1211 		KErrNone, _L("RMobileSmsMessaging::SendMessage timed out."));
       
  1212 	ASSERT_EQUALS(sendSmsRequestStatus.Int(), KErrNone, 
       
  1213 		_L("RMobileSmsMessaging::SendMessage completed with incorrect status"));
       
  1214     
       
  1215     // Check no error is returned in aMsgAttributes.iSubmitReport 
       
  1216 	ASSERT_TRUE(sendSmsAttributes.iSubmitReport.Length() > 0, 
       
  1217 		_L("RMobileSmsMessaging::TMobileSmsSendAttributesV1.iSubmitReport has zero length."));
       
  1218 	TUint wantedBits = RMobileSmsMessaging::KGsmSubmitReport; 
       
  1219 	ASSERT_BITS_SET(sendSmsAttributes.iFlags,wantedBits,KNoUnwantedBits, 
       
  1220 		_L("RMobileSmsMessaging::TMobileSmsSendAttributesV1 has no submit report in iFlags."));			
       
  1221 
       
  1222 	
       
  1223 	//
       
  1224 	// TEST END
       
  1225 	//
       
  1226 
       
  1227     StartCleanup();
       
  1228 	
       
  1229 	// Pop:
       
  1230 	//	sendSmsRequestStatus
       
  1231 	CleanupStack::PopAndDestroy(&sendSmsRequestStatus);
       
  1232 	
       
  1233 	return TestStepResult();
       
  1234 	}
       
  1235 
       
  1236 TPtrC CCTSYIntegrationTestSmsMessaging0007::GetTestStepName()
       
  1237 /**
       
  1238  * @return The test step name.
       
  1239  */
       
  1240 	{
       
  1241 	return _L("CCTSYIntegrationTestSmsMessaging0007");
       
  1242 	}
       
  1243 
       
  1244 
       
  1245 
       
  1246 CCTSYIntegrationTestSmsMessaging0008::CCTSYIntegrationTestSmsMessaging0008(CEtelSessionMgr& aEtelSessionMgr)
       
  1247 	: CCTSYIntegrationTestSmsMessagingBase(aEtelSessionMgr)
       
  1248 /**
       
  1249  * Constructor.
       
  1250  */
       
  1251 	{
       
  1252 	SetTestStepName(CCTSYIntegrationTestSmsMessaging0008::GetTestStepName());
       
  1253 	}
       
  1254 
       
  1255 CCTSYIntegrationTestSmsMessaging0008::~CCTSYIntegrationTestSmsMessaging0008()
       
  1256 /**
       
  1257  * Destructor.
       
  1258  */
       
  1259 	{
       
  1260 	}
       
  1261 
       
  1262 TVerdict CCTSYIntegrationTestSmsMessaging0008::doTestStepL()
       
  1263 /**
       
  1264  * @SYMTestCaseID BA-CTSY-INT-SMSM-0008
       
  1265  * @SYMFssID BA/CTSY/SMSM-0008
       
  1266  * @SYMTestCaseDesc Send a 160 character SMS when using MMI language of Default 7-bit alphabet
       
  1267  * @SYMTestPriority High
       
  1268  * @SYMTestActions RMobileSmsMessaging::SetMoSmsBearer
       
  1269  * @SYMTestExpectedResults Pass - SMS sent successfully.
       
  1270  * @SYMTestType CIT
       
  1271  * @SYMTestCaseDependencies live/automatic
       
  1272  *
       
  1273  * Reason for test: Verify message sent.
       
  1274  *
       
  1275  * @return - TVerdict code
       
  1276  * 
       
  1277  * $CTSYProblem - There is nothing wrong with the procedure:  I used a notifer to for 
       
  1278  *  a change in the bearer mode.  The notifier is not supported in CTSY: CTSY returns 
       
  1279  *  KErrNotSupported for CMmSmsTsy::NotifyMoSmsBearerChange
       
  1280  */
       
  1281 	{
       
  1282 
       
  1283 	//
       
  1284 	// SET UP
       
  1285 	//
       
  1286 	RMobileSmsMessaging &smsMessaging = iEtelSessionMgr.GetSmsMessagingL( KMainServer, KMainPhone, KMainSmsMessaging);
       
  1287 
       
  1288     RMobilePhone& phone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone);
       
  1289     iNetworkTsyTestHelper.WaitForRegisteredOnHomeNetworkL(phone);
       
  1290 
       
  1291 	//
       
  1292 	// SET UP END
       
  1293 	//
       
  1294 	
       
  1295 	StartTest();
       
  1296 	
       
  1297 	//
       
  1298 	// TEST START
       
  1299 	//
       
  1300 	
       
  1301 	
       
  1302 	// Send a 160 character SMS message with RMobileSmsMessaging::SendMessage encoded using default 7bit alphabet. Check no error is returned in aMsgAttributes.iSubmitReport 
       
  1303 	TBuf8<160> text(_L8("Hello Mobile. This is a 160 Character message.  It is going to fill up the entire length of of a PDU.  XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"));
       
  1304 	RMobileSmsMessaging::TMobileSmsSendAttributesV1 sendSmsAttributes;
       
  1305 	RMobileSmsMessaging::TMobileSmsSendAttributesV1Pckg sendSmsAttributesPckg(sendSmsAttributes);
       
  1306 	RMobileSmsMessaging::TMobileSmsGsmTpdu pdu = CreateValidSmsMessageL(text, sendSmsAttributes);	
       
  1307 
       
  1308 	//Send the PDU
       
  1309 	TExtEtelRequestStatus sendSmsRequestStatus(smsMessaging, EMobileSmsMessagingSendMessage);
       
  1310 	CleanupStack::PushL(sendSmsRequestStatus);
       
  1311 
       
  1312 	smsMessaging.SendMessage(sendSmsRequestStatus, pdu, sendSmsAttributesPckg);
       
  1313 	ASSERT_EQUALS(WaitForRequestWithTimeOut(sendSmsRequestStatus, ETimeMedium),
       
  1314 		KErrNone, _L("RMobileSmsMessaging::SendMessage timed out."));
       
  1315 	ASSERT_EQUALS(sendSmsRequestStatus.Int(), KErrNone, 
       
  1316 		_L("RMobileSmsMessaging::SendMessage completed with incorrect status"));
       
  1317 
       
  1318 	//Check no error is returned in aMsgAttributes.iSubmitReport
       
  1319 	ASSERT_TRUE(sendSmsAttributes.iSubmitReport.Length() > 0, 
       
  1320 		_L("RMobileSmsMessaging::TMobileSmsSendAttributesV1.iSubmitReport has zero length."));
       
  1321 	TUint wantedBits = RMobileSmsMessaging::KGsmSubmitReport; 
       
  1322 	ASSERT_BITS_SET(sendSmsAttributes.iFlags,wantedBits,KNoUnwantedBits, 
       
  1323 		_L("RMobileSmsMessaging::TMobileSmsSendAttributesV1 has no submit report in iFlags."));			
       
  1324 
       
  1325 
       
  1326 
       
  1327 	
       
  1328 	// ===  Send another SMS immediately after ===
       
  1329 
       
  1330 	// Send a 160 character SMS message with RMobileSmsMessaging::SendMessage encoded using default 7bit alphabet.  Check no error is returned in aMsgAttributes.iSubmitReport	
       
  1331 	RMobileSmsMessaging::TMobileSmsSendAttributesV1 sendSmsAttributes2;
       
  1332 	RMobileSmsMessaging::TMobileSmsSendAttributesV1Pckg sendSmsAttributesPckg2(sendSmsAttributes2);
       
  1333 	GetSmsSendAttributesL(sendSmsAttributes2);
       
  1334 	TExtEtelRequestStatus sendSmsRequestStatus2(smsMessaging, EMobileSmsMessagingSendMessage);
       
  1335 	CleanupStack::PushL(sendSmsRequestStatus2);
       
  1336 	sendSmsAttributes.iSubmitReport.SetLength(0);
       
  1337 	smsMessaging.SendMessage(sendSmsRequestStatus2, pdu, sendSmsAttributesPckg2);
       
  1338 	ASSERT_EQUALS(WaitForRequestWithTimeOut(sendSmsRequestStatus2, ETimeMedium),
       
  1339 		KErrNone, _L("RMobileSmsMessaging::SendMessage timed out."));
       
  1340 	ASSERT_EQUALS(sendSmsRequestStatus2.Int(), KErrNone, 
       
  1341 		_L("RMobileSmsMessaging::SendMessage completed with incorrect status"));
       
  1342 	
       
  1343 	//Check no error is returned in aMsgAttributes.iSubmitReport
       
  1344 	ASSERT_TRUE(sendSmsAttributes2.iSubmitReport.Length() > 0, 
       
  1345 		_L("RMobileSmsMessaging::TMobileSmsSendAttributesV1.iSubmitReport has zero length."));
       
  1346 	ASSERT_BITS_SET(sendSmsAttributes2.iFlags,wantedBits,KNoUnwantedBits, 
       
  1347 		_L("RMobileSmsMessaging::TMobileSmsSendAttributesV1 has no submit report in iFlags."));			
       
  1348 
       
  1349 
       
  1350 	// ===  Send an SMS to an international number ===
       
  1351 
       
  1352 	// Send a 160 character SMS message with RMobileSmsMessaging::SendMessage encoded using default 7bit alphabet to an international number. Check no error is returned in aMsgAttributes.iSubmitReport 
       
  1353 	RMobileSmsMessaging::TMobileSmsSendAttributesV1 sendSmsAttributes3;
       
  1354 	RMobileSmsMessaging::TMobileSmsSendAttributesV1Pckg sendSmsAttributesPckg3(sendSmsAttributes3);
       
  1355 	GetSmsSendAttributesL(sendSmsAttributes3);
       
  1356 	sendSmsAttributes3.iDestination.iTypeOfNumber=RMobilePhone::EInternationalNumber;
       
  1357 	TExtEtelRequestStatus sendSmsRequestStatus3(smsMessaging, EMobileSmsMessagingSendMessage);
       
  1358 	CleanupStack::PushL(sendSmsRequestStatus3);
       
  1359 	sendSmsAttributes.iSubmitReport.SetLength(0);
       
  1360 	smsMessaging.SendMessage(sendSmsRequestStatus3, pdu, sendSmsAttributesPckg3);
       
  1361 	ASSERT_EQUALS(WaitForRequestWithTimeOut(sendSmsRequestStatus3, ETimeMedium),
       
  1362 		KErrNone, _L("RMobileSmsMessaging::SendMessage timed out."));
       
  1363 	ASSERT_EQUALS(sendSmsRequestStatus3.Int(), KErrNone, 
       
  1364 		_L("RMobileSmsMessaging::SendMessage completed with incorrect status"));
       
  1365 	
       
  1366 	//Check no error is returned in aMsgAttributes.iSubmitReport
       
  1367 	ASSERT_TRUE(sendSmsAttributes3.iSubmitReport.Length() > 0, 
       
  1368 		_L("RMobileSmsMessaging::TMobileSmsSendAttributesV1.iSubmitReport has zero length."));
       
  1369 	ASSERT_BITS_SET(sendSmsAttributes3.iFlags,wantedBits,KNoUnwantedBits, 
       
  1370 		_L("RMobileSmsMessaging::TMobileSmsSendAttributesV1 has no submit report in iFlags."));			
       
  1371 	
       
  1372 	
       
  1373 	
       
  1374 	// ===  Cancel sending an SMS message ===
       
  1375 
       
  1376 	// Set the bearer to RMobileSmsMessaging::ESmsBearerCircuitPreferred with RMobileSmsMessaging::SetMoSmsBearer 
       
  1377 	RMobileSmsMessaging::TMobileSmsBearer bearer;
       
  1378 	TExtEtelRequestStatus notifyBearerChangeStatus(smsMessaging, EMobileSmsMessagingNotifyMoSmsBearerChange);
       
  1379 	CleanupStack::PushL(notifyBearerChangeStatus);
       
  1380 	smsMessaging.NotifyMoSmsBearerChange(notifyBearerChangeStatus, bearer);
       
  1381 	
       
  1382 	TExtEtelRequestStatus setBearerStatus(smsMessaging, EMobileSmsMessagingSetMoSmsBearer);
       
  1383 	CleanupStack::PushL(setBearerStatus);
       
  1384 	smsMessaging.SetMoSmsBearer(setBearerStatus, RMobileSmsMessaging::ESmsBearerCircuitPreferred);
       
  1385 	ASSERT_EQUALS(WaitForRequestWithTimeOut(setBearerStatus, ETimeLong), KErrNone, 
       
  1386 			_L("RMobileSmsMessaging::SetMoSmsBearer timed-out"));
       
  1387 	
       
  1388 	// Check RMobileSmsMessaging::NotifyMoSmsBearerChange completes with KErrNotSupported
       
  1389 	bearer = RMobileSmsMessaging::ESmsBearerCircuitPreferred;
       
  1390 	iSmsMessagingTsyTestHelper.WaitForMobileSmsMessagingNotifyMoSmsBearerChange(smsMessaging,
       
  1391 			notifyBearerChangeStatus, bearer, RMobileSmsMessaging::ESmsBearerCircuitPreferred, KErrNotSupported);
       
  1392 
       
  1393 
       
  1394 	
       
  1395 	// Send an SMS message with RMobileSmsMessaging::SendMessage 
       
  1396 	RMobileSmsMessaging::TMobileSmsSendAttributesV1 sendSmsAttributes4;
       
  1397 	RMobileSmsMessaging::TMobileSmsSendAttributesV1Pckg sendSmsAttributesPckg4(sendSmsAttributes4);
       
  1398 	GetSmsSendAttributesL(sendSmsAttributes4);	
       
  1399 	TExtEtelRequestStatus sendSmsRequestStatus4(smsMessaging, EMobileSmsMessagingSendMessage);
       
  1400 	CleanupStack::PushL(sendSmsRequestStatus4);
       
  1401 	sendSmsAttributes.iSubmitReport.SetLength(0);
       
  1402 	smsMessaging.SendMessage(sendSmsRequestStatus4, pdu, sendSmsAttributesPckg4);
       
  1403 
       
  1404 	
       
  1405 	// Cancel the request immediately with CancelAsyncRequest(EMobileSmsMessagingSendMessage) 
       
  1406 	smsMessaging.CancelAsyncRequest(EMobileSmsMessagingSendMessage);
       
  1407 	ASSERT_EQUALS(WaitForRequestWithTimeOut(sendSmsRequestStatus4, ETimeMedium), KErrNone, 
       
  1408 			_L("RMobileSmsMessaging::SendMessage timed-out"));
       
  1409 
       
  1410 	
       
  1411 	// Check RMobileSmsMessaging::SendMessage completed with KErrCancel or KErrNone
       
  1412 	ASSERT_TRUE(sendSmsRequestStatus4.Int() == KErrNone || sendSmsRequestStatus4.Int() == KErrCancel, 
       
  1413 			_L("RMobileSmsMessaging::SendMessage completed with incorrect status"));
       
  1414 	
       
  1415 	
       
  1416 	//
       
  1417 	// TEST END
       
  1418 	//
       
  1419 
       
  1420     StartCleanup();
       
  1421 	
       
  1422     // sendSmsRequestStatus
       
  1423     // sendSmsRequestStatus2
       
  1424     // sendSmsRequestStatus3
       
  1425     // notifyBearerChangeStatus
       
  1426     // setBearerStatus
       
  1427     // sendSmsRequestStatus4
       
  1428 
       
  1429 	CleanupStack::PopAndDestroy(6);
       
  1430 		
       
  1431 	return TestStepResult();
       
  1432 	}
       
  1433 
       
  1434 TPtrC CCTSYIntegrationTestSmsMessaging0008::GetTestStepName()
       
  1435 /**
       
  1436  * @return The test step name.
       
  1437  */
       
  1438 	{
       
  1439 	return _L("CCTSYIntegrationTestSmsMessaging0008");
       
  1440 	}
       
  1441 
       
  1442 
       
  1443 
       
  1444 CCTSYIntegrationTestSmsMessaging0009::CCTSYIntegrationTestSmsMessaging0009(CEtelSessionMgr& aEtelSessionMgr)
       
  1445 	: CCTSYIntegrationTestSmsMessagingBase(aEtelSessionMgr)
       
  1446 /**
       
  1447  * Constructor.
       
  1448  */
       
  1449 	{
       
  1450 	SetTestStepName(CCTSYIntegrationTestSmsMessaging0009::GetTestStepName());
       
  1451 	}
       
  1452 
       
  1453 CCTSYIntegrationTestSmsMessaging0009::~CCTSYIntegrationTestSmsMessaging0009()
       
  1454 /**
       
  1455  * Destructor.
       
  1456  */
       
  1457 	{
       
  1458 	}
       
  1459 
       
  1460 TVerdict CCTSYIntegrationTestSmsMessaging0009::doTestStepL()
       
  1461 /**
       
  1462  * @SYMTestCaseID BA-CTSY-INT-SMSM-0009
       
  1463  * @SYMFssID BA/CTSY/SMSM-0009
       
  1464  * @SYMTestCaseDesc Send a 160 character SMS when using MMI language of UCS2 alphabet & message content is default 7-bit alphabet
       
  1465  * @SYMTestPriority High
       
  1466  * @SYMTestActions 
       
  1467  * @SYMTestExpectedResults Pass - SMS sent successfully.
       
  1468  * @SYMTestType CIT
       
  1469  * @SYMTestCaseDependencies live/automatic
       
  1470  *
       
  1471  * Reason for test: Verify message sent.
       
  1472  *
       
  1473  * @return - TVerdict code
       
  1474  */
       
  1475 	{
       
  1476 
       
  1477 	//
       
  1478 	// SET UP
       
  1479 	//
       
  1480 
       
  1481 	
       
  1482 
       
  1483 	//
       
  1484 	// SET UP END
       
  1485 	//
       
  1486 	
       
  1487 	StartTest();
       
  1488 	
       
  1489 	//
       
  1490 	// TEST START
       
  1491 	//
       
  1492 	
       
  1493 	
       
  1494 	// Send a 160 character SMS message with RMobileSmsMessaging::SendMessage encoded using MMI language of UCS2 alphabet & message content is default 7-bit alphabet. Check no error is returned in aMsgAttributes.iSubmitReport 
       
  1495 
       
  1496 	
       
  1497 	//
       
  1498 	// TEST END
       
  1499 	//
       
  1500 
       
  1501     StartCleanup();
       
  1502 	
       
  1503 	// Put any required test clean up here, then remove this comment
       
  1504 	
       
  1505 	return TestStepResult();
       
  1506 	}
       
  1507 
       
  1508 TPtrC CCTSYIntegrationTestSmsMessaging0009::GetTestStepName()
       
  1509 /**
       
  1510  * @return The test step name.
       
  1511  */
       
  1512 	{
       
  1513 	return _L("CCTSYIntegrationTestSmsMessaging0009");
       
  1514 	}
       
  1515 
       
  1516 
       
  1517 
       
  1518 CCTSYIntegrationTestSmsMessaging0010::CCTSYIntegrationTestSmsMessaging0010(CEtelSessionMgr& aEtelSessionMgr)
       
  1519 	: CCTSYIntegrationTestSmsMessagingBase(aEtelSessionMgr)
       
  1520 /**
       
  1521  * Constructor.
       
  1522  */
       
  1523 	{
       
  1524 	SetTestStepName(CCTSYIntegrationTestSmsMessaging0010::GetTestStepName());
       
  1525 	}
       
  1526 
       
  1527 CCTSYIntegrationTestSmsMessaging0010::~CCTSYIntegrationTestSmsMessaging0010()
       
  1528 /**
       
  1529  * Destructor.
       
  1530  */
       
  1531 	{
       
  1532 	}
       
  1533 
       
  1534 TVerdict CCTSYIntegrationTestSmsMessaging0010::doTestStepL()
       
  1535 /**
       
  1536  * @SYMTestCaseID BA-CTSY-INT-SMSM-0010
       
  1537  * @SYMFssID BA/CTSY/SMSM-0010
       
  1538  * @SYMTestCaseDesc Send an SMS of length greater than 160 characters encoded with default 7-bit alphabet
       
  1539  * @SYMTestPriority High
       
  1540  * @SYMTestActions RMobileSmsMessaging::ReceiveMessage
       
  1541  * @SYMTestExpectedResults Pass - SMS sent successfully.
       
  1542  * @SYMTestType CIT
       
  1543  * @SYMTestCaseDependencies live/automatic
       
  1544  *
       
  1545  * Reason for test: Verify message sent.
       
  1546  *
       
  1547  * @return - TVerdict code
       
  1548  */
       
  1549 	{
       
  1550 
       
  1551 	//
       
  1552 	// SET UP
       
  1553 	//
       
  1554 
       
  1555 	
       
  1556 
       
  1557 	//
       
  1558 	// SET UP END
       
  1559 	//
       
  1560 	
       
  1561 	StartTest();
       
  1562 	
       
  1563 	//
       
  1564 	// TEST START
       
  1565 	//
       
  1566 	
       
  1567 	
       
  1568 	// Send a 220 character SMS message with RMobileSmsMessaging::SendMessage encoded using default 7bit alphabet to the board. Check no error is returned in aMsgAttributes.iSubmitReport 
       
  1569 
       
  1570 	// Check the full message is received with RMobileSmsMessaging::ReceiveMessage
       
  1571 
       
  1572 	
       
  1573 	//
       
  1574 	// TEST END
       
  1575 	//
       
  1576 
       
  1577     StartCleanup();
       
  1578 	
       
  1579 	// Put any required test clean up here, then remove this comment
       
  1580 	
       
  1581 	return TestStepResult();
       
  1582 	}
       
  1583 
       
  1584 TPtrC CCTSYIntegrationTestSmsMessaging0010::GetTestStepName()
       
  1585 /**
       
  1586  * @return The test step name.
       
  1587  */
       
  1588 	{
       
  1589 	return _L("CCTSYIntegrationTestSmsMessaging0010");
       
  1590 	}
       
  1591 
       
  1592 
       
  1593 
       
  1594 CCTSYIntegrationTestSmsMessaging0011::CCTSYIntegrationTestSmsMessaging0011(CEtelSessionMgr& aEtelSessionMgr)
       
  1595 	: CCTSYIntegrationTestSmsMessagingBase(aEtelSessionMgr)
       
  1596 /**
       
  1597  * Constructor.
       
  1598  */
       
  1599 	{
       
  1600 	SetTestStepName(CCTSYIntegrationTestSmsMessaging0011::GetTestStepName());
       
  1601 	}
       
  1602 
       
  1603 CCTSYIntegrationTestSmsMessaging0011::~CCTSYIntegrationTestSmsMessaging0011()
       
  1604 /**
       
  1605  * Destructor.
       
  1606  */
       
  1607 	{
       
  1608 	}
       
  1609 
       
  1610 TVerdict CCTSYIntegrationTestSmsMessaging0011::doTestStepL()
       
  1611 /**
       
  1612  * @SYMTestCaseID BA-CTSY-INT-SMSM-0011
       
  1613  * @SYMFssID BA/CTSY/SMSM-0011
       
  1614  * @SYMTestCaseDesc Send an SMS encoded with 7-bit alphabet which is over 140 Bytes
       
  1615  * @SYMTestPriority High
       
  1616  * @SYMTestActions 
       
  1617  * @SYMTestExpectedResults Pass - SMS sent successfully
       
  1618  * @SYMTestType CIT
       
  1619  * @SYMTestCaseDependencies live/automatic
       
  1620  *
       
  1621  * Reason for test: Verify message sent.
       
  1622  *
       
  1623  * @return - TVerdict code
       
  1624  */
       
  1625 	{
       
  1626 
       
  1627 	//
       
  1628 	// SET UP
       
  1629 	//
       
  1630 
       
  1631 	
       
  1632 
       
  1633 	//
       
  1634 	// SET UP END
       
  1635 	//
       
  1636 	
       
  1637 	StartTest();
       
  1638 	
       
  1639 	//
       
  1640 	// TEST START
       
  1641 	//
       
  1642 	
       
  1643 	
       
  1644 	// Send an SMS message that contains over 140 bytes of content encoded with the default 7 bit alphabet with RMobileSmsMessaging::SendMessage 
       
  1645 
       
  1646 	// Check no error is returned in aMsgAttributes.iSubmitReport
       
  1647 
       
  1648 	
       
  1649 	//
       
  1650 	// TEST END
       
  1651 	//
       
  1652 
       
  1653     StartCleanup();
       
  1654 	
       
  1655 	// Put any required test clean up here, then remove this comment
       
  1656 	
       
  1657 	return TestStepResult();
       
  1658 	}
       
  1659 
       
  1660 TPtrC CCTSYIntegrationTestSmsMessaging0011::GetTestStepName()
       
  1661 /**
       
  1662  * @return The test step name.
       
  1663  */
       
  1664 	{
       
  1665 	return _L("CCTSYIntegrationTestSmsMessaging0011");
       
  1666 	}
       
  1667 
       
  1668 
       
  1669 
       
  1670 CCTSYIntegrationTestSmsMessaging0012::CCTSYIntegrationTestSmsMessaging0012(CEtelSessionMgr& aEtelSessionMgr)
       
  1671 	: CCTSYIntegrationTestSmsMessagingBase(aEtelSessionMgr)
       
  1672 /**
       
  1673  * Constructor.
       
  1674  */
       
  1675 	{
       
  1676 	SetTestStepName(CCTSYIntegrationTestSmsMessaging0012::GetTestStepName());
       
  1677 	}
       
  1678 
       
  1679 CCTSYIntegrationTestSmsMessaging0012::~CCTSYIntegrationTestSmsMessaging0012()
       
  1680 /**
       
  1681  * Destructor.
       
  1682  */
       
  1683 	{
       
  1684 	}
       
  1685 
       
  1686 TVerdict CCTSYIntegrationTestSmsMessaging0012::doTestStepL()
       
  1687 /**
       
  1688  * @SYMTestCaseID BA-CTSY-INT-SMSM-0012
       
  1689  * @SYMFssID BA/CTSY/SMSM-0012
       
  1690  * @SYMTestCaseDesc Send an SMS over 70 characters in length encoded with UCS-2 alphabet
       
  1691  * @SYMTestPriority High
       
  1692  * @SYMTestActions 
       
  1693  * @SYMTestExpectedResults Pass - SMS sent successfully.
       
  1694  * @SYMTestType CIT
       
  1695  * @SYMTestCaseDependencies live/automatic
       
  1696  *
       
  1697  * Reason for test: Verify message sent.
       
  1698  *
       
  1699  * @return - TVerdict code
       
  1700  */
       
  1701 	{
       
  1702 
       
  1703 	//
       
  1704 	// SET UP
       
  1705 	//
       
  1706 
       
  1707 	
       
  1708 
       
  1709 	//
       
  1710 	// SET UP END
       
  1711 	//
       
  1712 	
       
  1713 	StartTest();
       
  1714 	
       
  1715 	//
       
  1716 	// TEST START
       
  1717 	//
       
  1718 	
       
  1719 	
       
  1720 	// Send an SMS over 70 characters in length encoded with UCS-2 alphabet with RMobileSmsMessaging::SendMessage 
       
  1721 
       
  1722 	// Check no error is returned in aMsgAttributes.iSubmitReport
       
  1723 
       
  1724 	
       
  1725 	//
       
  1726 	// TEST END
       
  1727 	//
       
  1728 
       
  1729     StartCleanup();
       
  1730 	
       
  1731 	// Put any required test clean up here, then remove this comment
       
  1732 	
       
  1733 	return TestStepResult();
       
  1734 	}
       
  1735 
       
  1736 TPtrC CCTSYIntegrationTestSmsMessaging0012::GetTestStepName()
       
  1737 /**
       
  1738  * @return The test step name.
       
  1739  */
       
  1740 	{
       
  1741 	return _L("CCTSYIntegrationTestSmsMessaging0012");
       
  1742 	}
       
  1743 
       
  1744 
       
  1745 
       
  1746 CCTSYIntegrationTestSmsMessaging0013::CCTSYIntegrationTestSmsMessaging0013(CEtelSessionMgr& aEtelSessionMgr)
       
  1747 	: CCTSYIntegrationTestSmsMessagingBase(aEtelSessionMgr)
       
  1748 /**
       
  1749  * Constructor.
       
  1750  */
       
  1751 	{
       
  1752 	SetTestStepName(CCTSYIntegrationTestSmsMessaging0013::GetTestStepName());
       
  1753 	}
       
  1754 
       
  1755 CCTSYIntegrationTestSmsMessaging0013::~CCTSYIntegrationTestSmsMessaging0013()
       
  1756 /**
       
  1757  * Destructor.
       
  1758  */
       
  1759 	{
       
  1760 	}
       
  1761 
       
  1762 TVerdict CCTSYIntegrationTestSmsMessaging0013::doTestStepL()
       
  1763 /**
       
  1764  * @SYMTestCaseID BA-CTSY-INT-SMSM-0013
       
  1765  * @SYMFssID BA/CTSY/SMSM-0013
       
  1766  * @SYMTestCaseDesc Send an SMS with over 140 bytes of content when UCS-2 alphabet & default & extended default 7-bit alphabet is used to encode it
       
  1767  * @SYMTestPriority High
       
  1768  * @SYMTestActions 
       
  1769  * @SYMTestExpectedResults Pass - SMS sent successfully.
       
  1770  * @SYMTestType CIT
       
  1771  * @SYMTestCaseDependencies live/automatic
       
  1772  *
       
  1773  * Reason for test: Verify message sent.
       
  1774  *
       
  1775  * @return - TVerdict code
       
  1776  */
       
  1777 	{
       
  1778 
       
  1779 	//
       
  1780 	// SET UP
       
  1781 	//
       
  1782 
       
  1783 	
       
  1784 
       
  1785 	//
       
  1786 	// SET UP END
       
  1787 	//
       
  1788 	
       
  1789 	StartTest();
       
  1790 	
       
  1791 	//
       
  1792 	// TEST START
       
  1793 	//
       
  1794 	
       
  1795 	
       
  1796 	// ===  Aim is to send a long message with mixed UCS-2 and default and extended default 7 bit alphabets ===
       
  1797 
       
  1798 	// Send the SMS message with RMobileSmsMessaging::SendMessage 
       
  1799 
       
  1800 	// Check no error is returned in aMsgAttributes.iSubmitReport
       
  1801 
       
  1802 	
       
  1803 	//
       
  1804 	// TEST END
       
  1805 	//
       
  1806 
       
  1807     StartCleanup();
       
  1808 	
       
  1809 	// Put any required test clean up here, then remove this comment
       
  1810 	
       
  1811 	return TestStepResult();
       
  1812 	}
       
  1813 
       
  1814 TPtrC CCTSYIntegrationTestSmsMessaging0013::GetTestStepName()
       
  1815 /**
       
  1816  * @return The test step name.
       
  1817  */
       
  1818 	{
       
  1819 	return _L("CCTSYIntegrationTestSmsMessaging0013");
       
  1820 	}
       
  1821 
       
  1822 
       
  1823 
       
  1824 CCTSYIntegrationTestSmsMessaging0014::CCTSYIntegrationTestSmsMessaging0014(CEtelSessionMgr& aEtelSessionMgr)
       
  1825 	: CCTSYIntegrationTestSmsMessagingBase(aEtelSessionMgr)
       
  1826 /**
       
  1827  * Constructor.
       
  1828  */
       
  1829 	{
       
  1830 	SetTestStepName(CCTSYIntegrationTestSmsMessaging0014::GetTestStepName());
       
  1831 	}
       
  1832 
       
  1833 CCTSYIntegrationTestSmsMessaging0014::~CCTSYIntegrationTestSmsMessaging0014()
       
  1834 /**
       
  1835  * Destructor.
       
  1836  */
       
  1837 	{
       
  1838 	}
       
  1839 
       
  1840 TVerdict CCTSYIntegrationTestSmsMessaging0014::doTestStepL()
       
  1841 /**
       
  1842  * @SYMTestCaseID BA-CTSY-INT-SMSM-0014
       
  1843  * @SYMFssID BA/CTSY/SMSM-0014
       
  1844  * @SYMTestCaseDesc Send an EMS (Enhanced Messaging Service) 
       
  1845  * @SYMTestPriority High
       
  1846  * @SYMTestActions 
       
  1847  * @SYMTestExpectedResults Pass - SMS sent successfully.
       
  1848  * @SYMTestType CIT
       
  1849  * @SYMTestCaseDependencies live/automatic
       
  1850  *
       
  1851  * Reason for test: Verify message sent.
       
  1852  *
       
  1853  * @return - TVerdict code
       
  1854  */
       
  1855 	{
       
  1856 
       
  1857 	//
       
  1858 	// SET UP
       
  1859 	//
       
  1860 
       
  1861 	
       
  1862 
       
  1863 	//
       
  1864 	// SET UP END
       
  1865 	//
       
  1866 	
       
  1867 	StartTest();
       
  1868 	
       
  1869 	//
       
  1870 	// TEST START
       
  1871 	//
       
  1872 	
       
  1873 	
       
  1874 	// ===  For encoding an EMS see spec 3GPP TS 23.040, GSM 04.11 ===
       
  1875 
       
  1876 	// ===  Check the Telephony and STIF code we got to see if someone has already written code ===
       
  1877 
       
  1878 	// ===  to encode an EMS.   (***remove this comment from your test when you have done it) ===
       
  1879 
       
  1880 	// Send an EMS (e.g. one containing formatted text) using RMobileSmsMessaging::SendMessage 
       
  1881 
       
  1882 	// Check no error is returned in aMsgAttributes.iSubmitReport
       
  1883 
       
  1884 	
       
  1885 	//
       
  1886 	// TEST END
       
  1887 	//
       
  1888 
       
  1889     StartCleanup();
       
  1890 	
       
  1891 	// Put any required test clean up here, then remove this comment
       
  1892 	
       
  1893 	return TestStepResult();
       
  1894 	}
       
  1895 
       
  1896 TPtrC CCTSYIntegrationTestSmsMessaging0014::GetTestStepName()
       
  1897 /**
       
  1898  * @return The test step name.
       
  1899  */
       
  1900 	{
       
  1901 	return _L("CCTSYIntegrationTestSmsMessaging0014");
       
  1902 	}
       
  1903 
       
  1904 
       
  1905 
       
  1906 CCTSYIntegrationTestSmsMessaging0015::CCTSYIntegrationTestSmsMessaging0015(CEtelSessionMgr& aEtelSessionMgr)
       
  1907 	: CCTSYIntegrationTestSmsMessagingBase(aEtelSessionMgr)
       
  1908 /**
       
  1909  * Constructor.
       
  1910  */
       
  1911 	{
       
  1912 	SetTestStepName(CCTSYIntegrationTestSmsMessaging0015::GetTestStepName());
       
  1913 	}
       
  1914 
       
  1915 CCTSYIntegrationTestSmsMessaging0015::~CCTSYIntegrationTestSmsMessaging0015()
       
  1916 /**
       
  1917  * Destructor.
       
  1918  */
       
  1919 	{
       
  1920 	}
       
  1921 
       
  1922 TVerdict CCTSYIntegrationTestSmsMessaging0015::doTestStepL()
       
  1923 /**
       
  1924  * @SYMTestCaseID BA-CTSY-INT-SMSM-0015
       
  1925  * @SYMFssID BA/CTSY/SMSM-0015
       
  1926  * @SYMTestCaseDesc Send an SMS during a call and during active packet connection
       
  1927  * @SYMTestPriority High
       
  1928  * @SYMTestActions RCall::NotifyStatusChange, RPacketContext::NotifyStatusChange, RPacketContext::Activate, RCall::HangUp, RPacketContext::Deactivate, RCall::Dial
       
  1929  * @SYMTestExpectedResults Pass - SMS sent successfully.
       
  1930  * @SYMTestType CIT
       
  1931  * @SYMTestCaseDependencies live/automatic
       
  1932  *
       
  1933  * Reason for test: Verify message sent.
       
  1934  *
       
  1935  * @return - TVerdict code
       
  1936  */
       
  1937 	{
       
  1938 
       
  1939 	//
       
  1940 	// SET UP
       
  1941 	//
       
  1942 
       
  1943 	
       
  1944 	// Get voice line 1. 
       
  1945 	RMobileLine& line1 = iEtelSessionMgr.GetLineL(KMainServer,KMainPhone, KVoiceLine);
       
  1946 
       
  1947 	// Get call 1. 
       
  1948 	RMobileCall& call1 = iEtelSessionMgr.GetCallL(KMainServer,KMainPhone, KVoiceLine,KCall1 );	
       
  1949 
       
  1950 	// wait until we are on the network
       
  1951     RMobilePhone& phone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone);
       
  1952     iNetworkTsyTestHelper.WaitForRegisteredOnHomeNetworkL(phone);
       
  1953 
       
  1954 	//
       
  1955 	// SET UP END
       
  1956 	//
       
  1957 	
       
  1958 	StartTest();
       
  1959 	
       
  1960 	//
       
  1961 	// TEST START
       
  1962 	//
       
  1963 	
       
  1964 	
       
  1965 	// ===  Part one - Send SMS during CS call ===
       
  1966 
       
  1967 	// post notifier for RCall::NotifyStatusChange
       
  1968 	RCall::TStatus callStatus;
       
  1969 	TCoreEtelRequestStatus<RCall> notifyStatusChangeStatus (call1,&RCall::NotifyStatusChangeCancel);
       
  1970 	CleanupStack::PushL(notifyStatusChangeStatus);
       
  1971 	call1.NotifyStatusChange(notifyStatusChangeStatus,callStatus);
       
  1972 
       
  1973 	// Dial a number that answers with RCall::Dial 
       
  1974 	TPtrC number; 
       
  1975 	ASSERT_TRUE(GetStringFromConfig(KIniVoiceNumSection, KIniVoiceNumber1, number) != EFalse,			  
       
  1976 			_L("CTestStep::GetStringFromConfig did not complete as expected"));
       
  1977 	TCoreEtelRequestStatus<RCall> dialStatus(call1, &RCall::DialCancel);
       
  1978 	CleanupStack::PushL(dialStatus);
       
  1979 	call1.Dial(dialStatus, number); 
       
  1980 	ASSERT_EQUALS(WaitForRequestWithTimeOut(dialStatus, ETimeMedium), KErrNone, 
       
  1981 			_L("RCall::Dial timed-out"));
       
  1982 	ASSERT_EQUALS(dialStatus.Int(), KErrNone,  
       
  1983 			_L("RCall::Dial returned with an error"));
       
  1984     
       
  1985 	// Check RCall::NotifyStatusChange completes with EStatusConnected.
       
  1986 	const TInt wantedStatus = KErrNone;
       
  1987 	RCall::TStatus expectedCallStatus = RCall::EStatusConnected;
       
  1988 	iCallControlTestHelper.WaitForCallNotifyStatusChange(call1,
       
  1989 														 notifyStatusChangeStatus,
       
  1990 														 callStatus,
       
  1991 														 expectedCallStatus,
       
  1992 														 wantedStatus);
       
  1993 	call1.NotifyStatusChange(notifyStatusChangeStatus,callStatus);
       
  1994     
       
  1995 	// Send the SMS message with RMobileSmsMessaging::SendMessage 
       
  1996 	RMobileSmsMessaging &smsMessaging = iEtelSessionMgr.GetSmsMessagingL(KMainServer, KMainPhone, KMainSmsMessaging);
       
  1997 	TBuf8<140> text(_L8("BA-CTSY-INT-SMSM-0015.1"));
       
  1998 	RMobileSmsMessaging::TMobileSmsSendAttributesV1 sendSmsAttributes;
       
  1999 	RMobileSmsMessaging::TMobileSmsSendAttributesV1Pckg sendSmsAttributesPckg(sendSmsAttributes);
       
  2000 	RMobileSmsMessaging::TMobileSmsGsmTpdu pdu = CreateValidSmsMessageL(text, sendSmsAttributes);	
       
  2001 	TExtEtelRequestStatus sendSmsRequestStatus(smsMessaging, EMobileSmsMessagingSendMessage);
       
  2002 	CleanupStack::PushL(sendSmsRequestStatus);
       
  2003 	smsMessaging.SendMessage(sendSmsRequestStatus, pdu, sendSmsAttributesPckg);
       
  2004 	ASSERT_EQUALS(WaitForRequestWithTimeOut(sendSmsRequestStatus, ETimeMedium),
       
  2005 		KErrNone, _L("RMobileSmsMessaging::SendMessage timed out."));
       
  2006 	ASSERT_EQUALS(sendSmsRequestStatus.Int(), KErrNone, 
       
  2007 		_L("RMobileSmsMessaging::SendMessage completed with incorrect status"));
       
  2008 
       
  2009 	// Check no error is returned in aMsgAttributes.iSubmitReport
       
  2010 	ASSERT_TRUE(sendSmsAttributes.iSubmitReport.Length() > 0, 
       
  2011 		_L("RMobileSmsMessaging::TMobileSmsSendAttributesV1.iSubmitReport has zero length."));
       
  2012 	TUint wantedBits = RMobileSmsMessaging::KGsmSubmitReport; 
       
  2013 	ASSERT_BITS_SET(sendSmsAttributes.iFlags,wantedBits,KNoUnwantedBits, 
       
  2014 		_L("RMobileSmsMessaging::TMobileSmsSendAttributesV1 has no submit report in iFlags."));			
       
  2015 
       
  2016 	// Hang up call with RCall::HangUp 
       
  2017 	TCoreEtelRequestStatus<RCall> hangUpStatus (call1,&RCall::HangUpCancel);	
       
  2018 	CleanupStack::PushL(hangUpStatus);
       
  2019 	call1.HangUp(hangUpStatus);
       
  2020 	ASSERT_EQUALS(WaitForRequestWithTimeOut(hangUpStatus, ETimeMedium), KErrNone,  
       
  2021 			_L("RCall::HangUp timed-out"));
       
  2022 	ASSERT_EQUALS(hangUpStatus.Int(), KErrNone,  
       
  2023 			_L("RCall::HangUp returned an error"));
       
  2024 
       
  2025 	// Check RCall::NotifyStatusChange completes with EStatusIdle.
       
  2026 	expectedCallStatus = RCall::EStatusIdle;
       
  2027 	iCallControlTestHelper.WaitForCallNotifyStatusChange(call1,
       
  2028 														 notifyStatusChangeStatus,
       
  2029 														 callStatus,
       
  2030 														 expectedCallStatus,
       
  2031 														 wantedStatus);
       
  2032 
       
  2033 	// ===  Part two - Send SMS when packet context is active ===
       
  2034 
       
  2035 	// Activate a primary packet context with RPacketContext::Activate 
       
  2036 	// Check RPacketContext::NotifyStatusChange completes with EStatusActive
       
  2037 	RPacketContext& packetContext = iEtelSessionMgr.GetPrimaryPacketContextL(
       
  2038 											KMainServer,
       
  2039 											KMainPhone,
       
  2040 											KMainPacketService,
       
  2041 											KPrimaryPacketContext1);
       
  2042     iPacketServiceTsyTestHelper.ActivatePrimaryPacketContextL(phone,packetContext);
       
  2043 
       
  2044 	// Send the SMS message with RMobileSmsMessaging::SendMessage 
       
  2045 	TBuf8<140> text2(_L8("BA-CTSY-INT-SMSM-0015.2"));
       
  2046 	pdu = CreateValidSmsMessageL(text2, sendSmsAttributes);	
       
  2047 	smsMessaging.SendMessage(sendSmsRequestStatus, pdu, sendSmsAttributesPckg);
       
  2048 	ASSERT_EQUALS(WaitForRequestWithTimeOut(sendSmsRequestStatus, ETimeMedium),
       
  2049 		KErrNone, _L("RMobileSmsMessaging::SendMessage timed out."));
       
  2050 	ASSERT_EQUALS(sendSmsRequestStatus.Int(), KErrNone, 
       
  2051 		_L("RMobileSmsMessaging::SendMessage completed with incorrect status"));
       
  2052 
       
  2053 	// Check no error is returned in aMsgAttributes.iSubmitReport
       
  2054 	ASSERT_TRUE(sendSmsAttributes.iSubmitReport.Length() > 0, 
       
  2055 		_L("RMobileSmsMessaging::TMobileSmsSendAttributesV1.iSubmitReport has zero length."));
       
  2056 	wantedBits = RMobileSmsMessaging::KGsmSubmitReport; 
       
  2057 	ASSERT_BITS_SET(sendSmsAttributes.iFlags,wantedBits,KNoUnwantedBits, 
       
  2058 		_L("RMobileSmsMessaging::TMobileSmsSendAttributesV1 has no submit report in iFlags."));			
       
  2059 
       
  2060 	// Post notification for context's status change
       
  2061 	TExtEtelRequestStatus notifyContextStChStatus(packetContext, EPacketContextNotifyStatusChange);
       
  2062 	CleanupStack::PushL(notifyContextStChStatus);
       
  2063 	RPacketContext::TContextStatus packetContextStatus;
       
  2064 	packetContext.NotifyStatusChange(notifyContextStChStatus, packetContextStatus);
       
  2065 	
       
  2066 	// Deactivate packet context with RPacketContext::Deactivate 
       
  2067 	TExtEtelRequestStatus contextDeactivateStatus(packetContext, EPacketContextDeactivate);
       
  2068 	CleanupStack::PushL(contextDeactivateStatus);
       
  2069 	packetContext.Deactivate(contextDeactivateStatus);
       
  2070 	ASSERT_EQUALS(WaitForRequestWithTimeOut(contextDeactivateStatus, ETimeLong), KErrNone, 
       
  2071 					_L("RPacketContext::Deactivate timed out."));					
       
  2072 	ASSERT_EQUALS(contextDeactivateStatus.Int(), KErrNone,
       
  2073 					_L("RPacketContext::Deactivate returned with error status."));
       
  2074 
       
  2075 	// Check RPacketContext::NotifyStatusChange completes with EStatusInactive
       
  2076 	RPacketContext::TContextStatus expectedPacketContextStatus = RPacketContext::EStatusInactive;
       
  2077 	iPacketServiceTsyTestHelper.WaitForPacketContextNotifyStatusChange(
       
  2078 				packetContext,
       
  2079 				notifyContextStChStatus,
       
  2080 				packetContextStatus, 
       
  2081 				expectedPacketContextStatus,
       
  2082 				KErrNone);
       
  2083 
       
  2084 	
       
  2085 	//
       
  2086 	// TEST END
       
  2087 	//
       
  2088 
       
  2089     StartCleanup();
       
  2090 	
       
  2091 	// Pop:
       
  2092 	//	contextDeactivateStatus
       
  2093 	//	notifyContextStChStatus
       
  2094 	//	hangUpStatus
       
  2095 	//	sendSmsRequestStatus
       
  2096 	//	dialStatus
       
  2097 	//	notifyStatusChangeStatus
       
  2098 	CleanupStack::PopAndDestroy(6,&notifyStatusChangeStatus);
       
  2099 	
       
  2100 	return TestStepResult();
       
  2101 	}
       
  2102 
       
  2103 TPtrC CCTSYIntegrationTestSmsMessaging0015::GetTestStepName()
       
  2104 /**
       
  2105  * @return The test step name.
       
  2106  */
       
  2107 	{
       
  2108 	return _L("CCTSYIntegrationTestSmsMessaging0015");
       
  2109 	}
       
  2110 
       
  2111 
       
  2112 
       
  2113 CCTSYIntegrationTestSmsMessaging0016::CCTSYIntegrationTestSmsMessaging0016(CEtelSessionMgr& aEtelSessionMgr)
       
  2114 	: CCTSYIntegrationTestSmsMessagingBase(aEtelSessionMgr)
       
  2115 /**
       
  2116  * Constructor.
       
  2117  */
       
  2118 	{
       
  2119 	SetTestStepName(CCTSYIntegrationTestSmsMessaging0016::GetTestStepName());
       
  2120 	}
       
  2121 
       
  2122 CCTSYIntegrationTestSmsMessaging0016::~CCTSYIntegrationTestSmsMessaging0016()
       
  2123 /**
       
  2124  * Destructor.
       
  2125  */
       
  2126 	{
       
  2127 	}
       
  2128 
       
  2129 TVerdict CCTSYIntegrationTestSmsMessaging0016::doTestStepL()
       
  2130 /**
       
  2131  * @SYMTestCaseID BA-CTSY-INT-SMSM-0016
       
  2132  * @SYMFssID BA/CTSY/SMSM-0016
       
  2133  * @SYMTestCaseDesc Send SMS when out of coverage
       
  2134  * @SYMTestPriority High
       
  2135  * @SYMTestActions RMobilePhone::NotifyNetworkRegistrationStatusChange
       
  2136  * @SYMTestExpectedResults Pass - SMS sent successfully.
       
  2137  * @SYMTestType CIT
       
  2138  * @SYMTestCaseDependencies simulated/manual
       
  2139  *
       
  2140  * Reason for test: Verify message is not sent.
       
  2141  *
       
  2142  * @return - TVerdict code
       
  2143  */
       
  2144 	{
       
  2145 
       
  2146 	//
       
  2147 	// SET UP
       
  2148 	//
       
  2149 
       
  2150 	
       
  2151 	// Remove the aerial to ensure phone is in a black spot 
       
  2152 	DisplayUserInteractionPromptL(_L("Remove the aerial to ensure phone is in a black spot."), ETimeMedium);
       
  2153 
       
  2154 	// Ensure RMobilePhone::GetNetworkRegistrationStatus returns ERegistrationUnknown | ENotRegisteredNoService | ENotRegisteredSearching 
       
  2155 	RMobilePhone& phone = iEtelSessionMgr.GetPhoneL(KMainServer,KMainPhone);
       
  2156 	TExtEtelRequestStatus getNetworkRegistrationStatusStatus(phone,EMobilePhoneGetNetworkRegistrationStatus);
       
  2157 	CleanupStack::PushL(getNetworkRegistrationStatusStatus);
       
  2158     RMobilePhone::TMobilePhoneRegistrationStatus phoneRegistrationStatus;
       
  2159     phone.GetNetworkRegistrationStatus(getNetworkRegistrationStatusStatus,phoneRegistrationStatus);
       
  2160 	CHECK_EQUALS_L(WaitForRequestWithTimeOut(getNetworkRegistrationStatusStatus, ETimeShort), KErrNone, 
       
  2161 		_L("RMobilePhone::GetNetworkRegistrationStatus timed-out"));
       
  2162     CHECK_TRUE_L(((phoneRegistrationStatus == RMobilePhone::ERegistrationUnknown) ||
       
  2163                   (phoneRegistrationStatus == RMobilePhone::ENotRegisteredNoService) ||
       
  2164                   (phoneRegistrationStatus == RMobilePhone::ENotRegisteredSearching)),
       
  2165                  _L("RMobilePhone::GetNetworkRegistrationStatus returned with incorrect status."));
       
  2166 
       
  2167 	//
       
  2168 	// SET UP END
       
  2169 	//
       
  2170 	
       
  2171 	StartTest();
       
  2172 	
       
  2173 	//
       
  2174 	// TEST START
       
  2175 	//
       
  2176 	
       
  2177 	
       
  2178 	// Attempt to send the SMS message with RMobileSmsMessaging::SendMessage 
       
  2179 	TBuf8<140> text(_L8("BA-CTSY-INT-SMSM-0016.1"));
       
  2180 	RMobileSmsMessaging::TMobileSmsSendAttributesV1 sendSmsAttributes;
       
  2181 	RMobileSmsMessaging::TMobileSmsSendAttributesV1Pckg sendSmsAttributesPckg(sendSmsAttributes);
       
  2182 	RMobileSmsMessaging::TMobileSmsGsmTpdu pdu = CreateValidSmsMessageL(text, sendSmsAttributes);	
       
  2183 	RMobileSmsMessaging &smsMessaging = iEtelSessionMgr.GetSmsMessagingL(KMainServer, KMainPhone, KMainSmsMessaging);
       
  2184 	TExtEtelRequestStatus sendSmsRequestStatus(smsMessaging, EMobileSmsMessagingSendMessage);
       
  2185 	CleanupStack::PushL(sendSmsRequestStatus);
       
  2186 	smsMessaging.SendMessage(sendSmsRequestStatus, pdu, sendSmsAttributesPckg);
       
  2187 	ASSERT_EQUALS(WaitForRequestWithTimeOut(sendSmsRequestStatus, ETimeMedium),
       
  2188 		KErrNone, _L("RMobileSmsMessaging::SendMessage timed out."));
       
  2189 	ASSERT_EQUALS(sendSmsRequestStatus.Int(), KErrNone, 
       
  2190 		_L("RMobileSmsMessaging::SendMessage completed with incorrect status"));
       
  2191 
       
  2192 	// Check an error is returned in aMsgAttributes.iSubmitReport
       
  2193 	ASSERT_TRUE(sendSmsAttributes.iSubmitReport.Length() > 0, 
       
  2194 		_L("RMobileSmsMessaging::TMobileSmsSendAttributesV1.iSubmitReport has zero length."));
       
  2195 	TUint wantedBits = RMobileSmsMessaging::KGsmSubmitReport; 
       
  2196 	ASSERT_BITS_SET(sendSmsAttributes.iFlags,wantedBits,KNoUnwantedBits, 
       
  2197 		_L("RMobileSmsMessaging::TMobileSmsSendAttributesV1 has no submit report in iFlags."));			
       
  2198 
       
  2199     // Post Network status change Notifyer to the network
       
  2200 	RMobilePhone::TMobilePhoneRegistrationStatus registrationStatus;
       
  2201 	TExtEtelRequestStatus reqStatus(phone, EMobilePhoneNotifyNetworkRegistrationStatusChange );
       
  2202 	CleanupStack::PushL(reqStatus);
       
  2203 	phone.NotifyNetworkRegistrationStatusChange(reqStatus, registrationStatus);
       
  2204     
       
  2205     
       
  2206 	// Put the aerial back  
       
  2207 	DisplayUserInteractionPromptL(_L("Put the aerial back."), ETimeMedium);
       
  2208 
       
  2209 	// Check RMobilePhone::NotifyNetworkRegistrationStatusChange completes with aStatus=ERegisteredOnHomeNetwork
       
  2210     iNetworkTsyTestHelper.WaitForMobilePhoneNotifyNetworkRegistrationStatusChange(phone,
       
  2211                                                                                   reqStatus,
       
  2212                                                                                   registrationStatus,
       
  2213                                                                                   RMobilePhone::ERegisteredOnHomeNetwork,
       
  2214                                                                                   KErrNone );
       
  2215 
       
  2216 	// Send the SMS message again with RMobileSmsMessaging::SendMessage 
       
  2217 	TBuf8<140> text2=_L8("BA-CTSY-INT-SMSM-0016.2");
       
  2218 	pdu = CreateValidSmsMessageL(text2, sendSmsAttributes);	
       
  2219 	smsMessaging.SendMessage(sendSmsRequestStatus, pdu, sendSmsAttributesPckg);
       
  2220 	ASSERT_EQUALS(WaitForRequestWithTimeOut(sendSmsRequestStatus, ETimeMedium),
       
  2221 		KErrNone, _L("RMobileSmsMessaging::SendMessage timed out."));
       
  2222 	ASSERT_EQUALS(sendSmsRequestStatus.Int(), KErrNone, 
       
  2223 		_L("RMobileSmsMessaging::SendMessage completed with incorrect status"));
       
  2224 
       
  2225 	// Check no error is returned in aMsgAttributes.iSubmitReport
       
  2226 	ASSERT_TRUE(sendSmsAttributes.iSubmitReport.Length() > 0, 
       
  2227 		_L("RMobileSmsMessaging::TMobileSmsSendAttributesV1.iSubmitReport has zero length."));
       
  2228 	wantedBits = RMobileSmsMessaging::KGsmSubmitReport; 
       
  2229 	ASSERT_BITS_SET(sendSmsAttributes.iFlags,wantedBits,KNoUnwantedBits, 
       
  2230 		_L("RMobileSmsMessaging::TMobileSmsSendAttributesV1 has no submit report in iFlags."));		
       
  2231 
       
  2232 	
       
  2233 	//
       
  2234 	// TEST END
       
  2235 	//
       
  2236 
       
  2237     StartCleanup();
       
  2238 	
       
  2239 	// Pop:
       
  2240 	//	reqStatus
       
  2241 	//	sendSmsRequestStatus
       
  2242 	//	getNetworkRegistrationStatusStatus
       
  2243 	CleanupStack::PopAndDestroy(3,&getNetworkRegistrationStatusStatus);
       
  2244 	
       
  2245 	return TestStepResult();
       
  2246 	}
       
  2247 
       
  2248 TPtrC CCTSYIntegrationTestSmsMessaging0016::GetTestStepName()
       
  2249 /**
       
  2250  * @return The test step name.
       
  2251  */
       
  2252 	{
       
  2253 	return _L("CCTSYIntegrationTestSmsMessaging0016");
       
  2254 	}
       
  2255 
       
  2256 
       
  2257 
       
  2258 CCTSYIntegrationTestSmsMessaging0017::CCTSYIntegrationTestSmsMessaging0017(CEtelSessionMgr& aEtelSessionMgr)
       
  2259 	: CCTSYIntegrationTestSmsMessagingBase(aEtelSessionMgr)
       
  2260 /**
       
  2261  * Constructor.
       
  2262  */
       
  2263 	{
       
  2264 	SetTestStepName(CCTSYIntegrationTestSmsMessaging0017::GetTestStepName());
       
  2265 	}
       
  2266 
       
  2267 CCTSYIntegrationTestSmsMessaging0017::~CCTSYIntegrationTestSmsMessaging0017()
       
  2268 /**
       
  2269  * Destructor.
       
  2270  */
       
  2271 	{
       
  2272 	}
       
  2273 
       
  2274 TVerdict CCTSYIntegrationTestSmsMessaging0017::doTestStepL()
       
  2275 /**
       
  2276  * @SYMTestCaseID BA-CTSY-INT-SMSM-0017
       
  2277  * @SYMFssID BA/CTSY/SMSM-0017
       
  2278  * @SYMTestCaseDesc Receive a class 2 SMS message
       
  2279  * @SYMTestPriority High
       
  2280  * @SYMTestActions RMobileSmsMessaging::ReceiveMessage
       
  2281  * @SYMTestExpectedResults Pass - SMS sent successfully.
       
  2282  * @SYMTestType CIT
       
  2283  * @SYMTestCaseDependencies live/automatic
       
  2284  *
       
  2285  * Reason for test: Verify class 2 message is received.
       
  2286  *
       
  2287  * @return - TVerdict code
       
  2288  */
       
  2289 	{
       
  2290 
       
  2291 	//
       
  2292 	// SET UP
       
  2293 	//
       
  2294 
       
  2295 	
       
  2296 	// Ensure that the SMS store on the SIM is not full 
       
  2297 	RMobilePhone& phone = iEtelSessionMgr.GetPhoneL(KMainServer,KMainPhone);
       
  2298 	RMobileSmsStore& smsStore = iEtelSessionMgr.GetSmsStoreL(KMainServer,KMainPhone,KMainSmsMessaging,KIccSmsStore);
       
  2299 	RMobilePhoneStore::TMobilePhoneStoreInfoV1 storeInfo;
       
  2300 	RMobileSmsMessaging &smsMessaging = iEtelSessionMgr.GetSmsMessagingL( KMainServer, KMainPhone, KMainSmsMessaging);
       
  2301 	CHECK_TRUE_L(iSimTsyTestHelper.EnsureEmptyStoreSpaceL(smsStore,KETelIccSmsStore,storeInfo,phone)>=0,_L("TSimTsyTestHelper::EnsureEmptyStoreSpaceL returned an error"));
       
  2302 
       
  2303 	// Ensure that RMobileSmsMessaging::GetReceiveMode returns aReceiveMode = EReceiveUnstoredClientAck 
       
  2304 	RMobileSmsMessaging::TMobileSmsReceiveMode receiveMode;	
       
  2305 	CHECK_EQUALS_L(smsMessaging.GetReceiveMode(receiveMode), KErrNone,
       
  2306 			_L("RMobileSmsMessaging::GetReceiveMode returned with an error."));
       
  2307 	CHECK_EQUALS_L(receiveMode, RMobileSmsMessaging::EReceiveUnstoredClientAck,
       
  2308 			_L("RMobileSmsMessaging::GetReceiveMode returned with incorrect mode."));
       
  2309 	
       
  2310 
       
  2311 	//
       
  2312 	// SET UP END
       
  2313 	//
       
  2314 	
       
  2315 	StartTest();
       
  2316 	
       
  2317 	//
       
  2318 	// TEST START
       
  2319 	//
       
  2320 	
       
  2321 	
       
  2322 	// Call RMobileSmsMessaging::ReceiveMessage to wait for an incoming SMS 
       
  2323 	TExtEtelRequestStatus receiveSmsRequestStatus(smsMessaging,EMobileSmsMessagingReceiveMessage);
       
  2324 	CleanupStack::PushL(receiveSmsRequestStatus);
       
  2325 	RMobileSmsMessaging::TMobileSmsReceiveAttributesV1 receivedSmsAttributes;
       
  2326 	RMobileSmsMessaging::TMobileSmsReceiveAttributesV1Pckg receivedSmsAttributesPckg(receivedSmsAttributes);
       
  2327 	RMobileSmsMessaging::TMobileSmsGsmTpdu gsmMsg;
       
  2328 	smsMessaging.ReceiveMessage(receiveSmsRequestStatus, gsmMsg, receivedSmsAttributesPckg);
       
  2329 
       
  2330 	// Send a class 2 SMS message with RMobileSmsMessaging::SendMessage to the board 
       
  2331 	TBuf8<140> text(_L8("bAA Hello Mobile AAb"));
       
  2332 	RMobileSmsMessaging::TMobileSmsSendAttributesV1 sendSmsAttributes;
       
  2333 	RMobileSmsMessaging::TMobileSmsSendAttributesV1Pckg sendSmsAttributesPckg(sendSmsAttributes);
       
  2334 	RMobileSmsMessaging::TMobileSmsGsmTpdu pdu = CreateValidSmsMessageL(text, sendSmsAttributes,TSmsStoreTsyTestHelper::EClass2DataCodingScheme,ETrue);	
       
  2335 	TExtEtelRequestStatus sendSmsRequestStatus(smsMessaging, EMobileSmsMessagingSendMessage);
       
  2336 	CleanupStack::PushL(sendSmsRequestStatus);
       
  2337 	smsMessaging.SendMessage(sendSmsRequestStatus, pdu, sendSmsAttributesPckg);
       
  2338 	ASSERT_EQUALS(WaitForRequestWithTimeOut(sendSmsRequestStatus, ETimeMedium),
       
  2339 			KErrNone, _L("RMobileSmsMessaging::SendMessage timed out."));
       
  2340 	ASSERT_EQUALS(sendSmsRequestStatus.Int(), KErrNone, 
       
  2341 			_L("RMobileSmsMessaging::SendMessage completed with incorrect status"));
       
  2342 
       
  2343 	// Check no error is returned in aMsgAttributes.iSubmitReport
       
  2344 	ASSERT_TRUE(sendSmsAttributes.iSubmitReport.Length() > 0, 
       
  2345 			_L("RMobileSmsMessaging::TMobileSmsSendAttributesV1.iSubmitReport has zero length."));
       
  2346 	TUint wantedBits = RMobileSmsMessaging::KGsmSubmitReport; 
       
  2347 	ASSERT_BITS_SET(sendSmsAttributes.iFlags,wantedBits,KNoUnwantedBits, 
       
  2348 			_L("RMobileSmsMessaging::TMobileSmsSendAttributesV1 has no submit report in iFlags."));			
       
  2349 
       
  2350 	// Check RMobileSmsMessaging::ReceiveMessage completes with the correct message data in aMsgData
       
  2351 	ASSERT_EQUALS(WaitForRequestWithTimeOut(receiveSmsRequestStatus, ETimeVeryLong),
       
  2352 			KErrNone, _L("RMobileSmsMessaging::ReceiveMessage returned with error."));	
       
  2353 	ASSERT_EQUALS(receiveSmsRequestStatus.Int(), KErrNone, 
       
  2354 			_L("RMobileSmsMessaging::ReceiveMessage returned with error."));	
       
  2355 	ASSERT_TRUE(ComparePDUs(gsmMsg,pdu),_L("RMobileSmsMessaging::ReceiveMessage return wrong message"));
       
  2356 	
       
  2357 	// Check RMobileSmsMessaging::ReceiveMessage completes with valid store name in aMsgAttributes.iStore
       
  2358 	ASSERT_TRUE(receivedSmsAttributes.iStore.Length()>0,_L("RMobileSmsMessaging::ReceiveMessage returned an invalid store name"));
       
  2359 	
       
  2360 	//
       
  2361 	// TEST END
       
  2362 	//
       
  2363 
       
  2364     StartCleanup();
       
  2365 	
       
  2366 	// Pop:
       
  2367 	//	sendSmsRequestStatus
       
  2368 	//	receiveSmsRequestStatus
       
  2369 	CleanupStack::PopAndDestroy(2,&receiveSmsRequestStatus);
       
  2370 	
       
  2371 	return TestStepResult();
       
  2372 	}
       
  2373 
       
  2374 TPtrC CCTSYIntegrationTestSmsMessaging0017::GetTestStepName()
       
  2375 /**
       
  2376  * @return The test step name.
       
  2377  */
       
  2378 	{
       
  2379 	return _L("CCTSYIntegrationTestSmsMessaging0017");
       
  2380 	}
       
  2381 
       
  2382 
       
  2383 
       
  2384 CCTSYIntegrationTestSmsMessaging0018::CCTSYIntegrationTestSmsMessaging0018(CEtelSessionMgr& aEtelSessionMgr)
       
  2385 	: CCTSYIntegrationTestSmsMessagingBase(aEtelSessionMgr)
       
  2386 /**
       
  2387  * Constructor.
       
  2388  */
       
  2389 	{
       
  2390 	SetTestStepName(CCTSYIntegrationTestSmsMessaging0018::GetTestStepName());
       
  2391 	}
       
  2392 
       
  2393 CCTSYIntegrationTestSmsMessaging0018::~CCTSYIntegrationTestSmsMessaging0018()
       
  2394 /**
       
  2395  * Destructor.
       
  2396  */
       
  2397 	{
       
  2398 	}
       
  2399 
       
  2400 TVerdict CCTSYIntegrationTestSmsMessaging0018::doTestStepL()
       
  2401 /**
       
  2402  * @SYMTestCaseID BA-CTSY-INT-SMSM-0018
       
  2403  * @SYMFssID BA/CTSY/SMSM-0018
       
  2404  * @SYMTestCaseDesc Receive a class 2 EMS message
       
  2405  * @SYMTestPriority High
       
  2406  * @SYMTestActions RMobileSmsMessaging::ReceiveMessage
       
  2407  * @SYMTestExpectedResults Pass - SMS sent successfully.
       
  2408  * @SYMTestType CIT
       
  2409  * @SYMTestCaseDependencies live/automatic
       
  2410  *
       
  2411  * Reason for test: Verify class 2 EMS message is received
       
  2412  *
       
  2413  * @return - TVerdict code
       
  2414  */
       
  2415 	{
       
  2416 
       
  2417 	//
       
  2418 	// SET UP
       
  2419 	//
       
  2420 
       
  2421 	
       
  2422 	// Ensure that the SMS store on the SIM is not full 
       
  2423 
       
  2424 	// Ensure that RMobileSmsMessaging::GetReceiveMode returns aReceiveMode = EReceiveUnstoredClientAck 
       
  2425 
       
  2426 
       
  2427 	//
       
  2428 	// SET UP END
       
  2429 	//
       
  2430 	
       
  2431 	StartTest();
       
  2432 	
       
  2433 	//
       
  2434 	// TEST START
       
  2435 	//
       
  2436 	
       
  2437 	
       
  2438 	// Call RMobileSmsMessaging::ReceiveMessage to wait for an incoming SMS 
       
  2439 
       
  2440 	// ===  Send a class 2 EMS message - See spec 3GPP TS 23.040, GSM 04.11 ===
       
  2441 
       
  2442 	// Send a class 2 EMS message with RMobileSmsMessaging::SendMessage to the board 
       
  2443 
       
  2444 	// Check no error is returned in aMsgAttributes.iSubmitReport
       
  2445 
       
  2446 	// Check RMobileSmsMessaging::ReceiveMessage completes with the correct message data in aMsgData
       
  2447 	// Check RMobileSmsMessaging::ReceiveMessage completes with the correct originator in aMsgAttributes.iOriginator
       
  2448 	// Check RMobileSmsMessaging::ReceiveMessage completes with aMsgAttributes.iStatus=RMobileSmsMessaging::EMtMessageStored
       
  2449 	// Check RMobileSmsMessaging::ReceiveMessage completes with valid store name in aMsgAttributes.iStore
       
  2450 
       
  2451 	
       
  2452 	//
       
  2453 	// TEST END
       
  2454 	//
       
  2455 
       
  2456     StartCleanup();
       
  2457 	
       
  2458 	// Put any required test clean up here, then remove this comment
       
  2459 	
       
  2460 	return TestStepResult();
       
  2461 	}
       
  2462 
       
  2463 TPtrC CCTSYIntegrationTestSmsMessaging0018::GetTestStepName()
       
  2464 /**
       
  2465  * @return The test step name.
       
  2466  */
       
  2467 	{
       
  2468 	return _L("CCTSYIntegrationTestSmsMessaging0018");
       
  2469 	}
       
  2470 
       
  2471 
       
  2472 
       
  2473 CCTSYIntegrationTestSmsMessaging0019::CCTSYIntegrationTestSmsMessaging0019(CEtelSessionMgr& aEtelSessionMgr)
       
  2474 	: CCTSYIntegrationTestSmsMessagingBase(aEtelSessionMgr)
       
  2475 /**
       
  2476  * Constructor.
       
  2477  */
       
  2478 	{
       
  2479 	SetTestStepName(CCTSYIntegrationTestSmsMessaging0019::GetTestStepName());
       
  2480 	}
       
  2481 
       
  2482 CCTSYIntegrationTestSmsMessaging0019::~CCTSYIntegrationTestSmsMessaging0019()
       
  2483 /**
       
  2484  * Destructor.
       
  2485  */
       
  2486 	{
       
  2487 	}
       
  2488 
       
  2489 TVerdict CCTSYIntegrationTestSmsMessaging0019::doTestStepL()
       
  2490 /**
       
  2491  * @SYMTestCaseID BA-CTSY-INT-SMSM-0019
       
  2492  * @SYMFssID BA/CTSY/SMSM-0019
       
  2493  * @SYMTestCaseDesc Receive unsupported and invalid SMS types 
       
  2494  * @SYMTestPriority High
       
  2495  * @SYMTestActions RMobileSmsMessaging::ReceiveMessage
       
  2496  * @SYMTestExpectedResults Pass - SMS sent successfully.
       
  2497  * @SYMTestType CIT
       
  2498  * @SYMTestCaseDependencies live/automatic
       
  2499  *
       
  2500  * Reason for test: Verify phone does not crash
       
  2501  *
       
  2502  * @return - TVerdict code
       
  2503  */
       
  2504 	{
       
  2505 
       
  2506 	//
       
  2507 	// SET UP
       
  2508 	//
       
  2509 
       
  2510 	
       
  2511 	// Ensure that RMobileSmsMessaging::GetReceiveMode returns aReceiveMode = EReceiveUnstoredClientAck 
       
  2512 
       
  2513 
       
  2514 	//
       
  2515 	// SET UP END
       
  2516 	//
       
  2517 	
       
  2518 	StartTest();
       
  2519 	
       
  2520 	//
       
  2521 	// TEST START
       
  2522 	//
       
  2523 	
       
  2524 	
       
  2525 	// Call RMobileSmsMessaging::ReceiveMessage to wait for an incoming SMS 
       
  2526 
       
  2527 	// ===  Send a SMS message with corrupt headers ===
       
  2528 
       
  2529 	// Send a SMS message containing corrupt headers with RMobileSmsMessaging::SendMessage to the board 
       
  2530 
       
  2531 	// Check no error is returned in aMsgAttributes.iSubmitReport
       
  2532 
       
  2533 	// Check RMobileSmsMessaging::ReceiveMessage completes with the correct message data in aMsgData
       
  2534 	// Check RMobileSmsMessaging::ReceiveMessage completes with aMsgAttributes.iStatus=EMtMessageUnstoredPhoneAck
       
  2535 	// Check RMobileSmsMessaging::ReceiveMessage completes with KErrNone
       
  2536 
       
  2537 	
       
  2538 	//
       
  2539 	// TEST END
       
  2540 	//
       
  2541 
       
  2542     StartCleanup();
       
  2543 	
       
  2544 	// Put any required test clean up here, then remove this comment
       
  2545 	
       
  2546 	return TestStepResult();
       
  2547 	}
       
  2548 
       
  2549 TPtrC CCTSYIntegrationTestSmsMessaging0019::GetTestStepName()
       
  2550 /**
       
  2551  * @return The test step name.
       
  2552  */
       
  2553 	{
       
  2554 	return _L("CCTSYIntegrationTestSmsMessaging0019");
       
  2555 	}
       
  2556 
       
  2557 
       
  2558 
       
  2559 CCTSYIntegrationTestSmsMessaging0020::CCTSYIntegrationTestSmsMessaging0020(CEtelSessionMgr& aEtelSessionMgr)
       
  2560 	: CCTSYIntegrationTestSmsMessagingBase(aEtelSessionMgr)
       
  2561 /**
       
  2562  * Constructor.
       
  2563  */
       
  2564 	{
       
  2565 	SetTestStepName(CCTSYIntegrationTestSmsMessaging0020::GetTestStepName());
       
  2566 	}
       
  2567 
       
  2568 CCTSYIntegrationTestSmsMessaging0020::~CCTSYIntegrationTestSmsMessaging0020()
       
  2569 /**
       
  2570  * Destructor.
       
  2571  */
       
  2572 	{
       
  2573 	}
       
  2574 
       
  2575 TVerdict CCTSYIntegrationTestSmsMessaging0020::doTestStepL()
       
  2576 /**
       
  2577  * @SYMTestCaseID BA-CTSY-INT-SMSM-0020
       
  2578  * @SYMFssID BA/CTSY/SMSM-0020
       
  2579  * @SYMTestCaseDesc Receive SMS during CS call and when packet context is active
       
  2580  * @SYMTestPriority High
       
  2581  * @SYMTestActions RCall::HangUp, RPacketContext::Deactivate, RCall::Dial, RCall::NotifyStatusChange, RMobileSmsMessaging::SendMessage, RPacketContext::NotifyStatusChange, RMobileSmsMessaging::ReceiveMessage
       
  2582  * @SYMTestExpectedResults Pass - SMS received
       
  2583  * @SYMTestType CIT
       
  2584  * @SYMTestCaseDependencies live/automatic
       
  2585  *
       
  2586  * Reason for test: Verify message received.
       
  2587  *
       
  2588  * @return - TVerdict code
       
  2589  */
       
  2590 	{
       
  2591 
       
  2592 	//
       
  2593 	// SET UP
       
  2594 	//
       
  2595 
       
  2596 	
       
  2597 	// Get call 1 
       
  2598 	RMobileCall& call1 = iEtelSessionMgr.GetCallL(KMainServer,KMainPhone, KVoiceLine,KCall1 );	
       
  2599 
       
  2600 	// Get voice line 1 
       
  2601 	RMobileLine& line1 = iEtelSessionMgr.GetLineL(KMainServer,KMainPhone, KVoiceLine);
       
  2602 
       
  2603 	// Ensure that RMobileSmsMessaging::GetReceiveMode returns aReceiveMode = EReceiveUnstoredClientAck 
       
  2604 	RMobileSmsMessaging &smsMessaging = iEtelSessionMgr.GetSmsMessagingL(KMainServer, KMainPhone, KMainSmsMessaging);
       
  2605     RMobilePhone& phone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone);
       
  2606     iNetworkTsyTestHelper.WaitForRegisteredOnHomeNetworkL(phone);
       
  2607 	RMobileSmsMessaging::TMobileSmsReceiveMode receiveMode;	
       
  2608 	CHECK_EQUALS_L(smsMessaging.GetReceiveMode(receiveMode), KErrNone,
       
  2609 			_L("RMobileSmsMessaging::GetReceiveMode returned with an error."));
       
  2610 	CHECK_EQUALS_L(receiveMode, RMobileSmsMessaging::EReceiveUnstoredClientAck,
       
  2611 			_L("RMobileSmsMessaging::GetReceiveMode returned with incorrect mode."));
       
  2612 
       
  2613 
       
  2614 	//
       
  2615 	// SET UP END
       
  2616 	//
       
  2617 	
       
  2618 	StartTest();
       
  2619 	
       
  2620 	//
       
  2621 	// TEST START
       
  2622 	//
       
  2623 	
       
  2624 	
       
  2625 	// ===  Part one - Receive SMS during CS call ===
       
  2626 
       
  2627 	// post notifier for RCall::NotifyStatusChange
       
  2628 	RCall::TStatus callStatus;
       
  2629 	TCoreEtelRequestStatus<RCall> notifyStatusChangeStatus (call1,&RCall::NotifyStatusChangeCancel);
       
  2630 	CleanupStack::PushL(notifyStatusChangeStatus);
       
  2631 	call1.NotifyStatusChange(notifyStatusChangeStatus,callStatus);
       
  2632 
       
  2633 	// Dial a number that answers with RCall::Dial 
       
  2634 	TPtrC number; 
       
  2635 	ASSERT_TRUE(GetStringFromConfig(KIniVoiceNumSection, KIniVoiceNumber1, number) != EFalse,			  
       
  2636 			_L("CTestStep::GetStringFromConfig did not complete as expected"));
       
  2637 	TCoreEtelRequestStatus<RCall> dialStatus(call1, &RCall::DialCancel);
       
  2638 	CleanupStack::PushL(dialStatus);
       
  2639 	call1.Dial(dialStatus, number); 
       
  2640 	ASSERT_EQUALS(WaitForRequestWithTimeOut(dialStatus, ETimeMedium), KErrNone, 
       
  2641 			_L("RCall::Dial timed-out"));
       
  2642 	ASSERT_EQUALS(dialStatus.Int(), KErrNone,  
       
  2643 			_L("RCall::Dial returned with an error"));
       
  2644 
       
  2645 	// Check RCall::NotifyStatusChange completes with EStatusConnected.
       
  2646 	const TInt wantedStatus = KErrNone;
       
  2647 	RCall::TStatus expectedCallStatus = RCall::EStatusConnected;
       
  2648 	iCallControlTestHelper.WaitForCallNotifyStatusChange(call1,
       
  2649 			 notifyStatusChangeStatus,
       
  2650 			 callStatus,
       
  2651 			 expectedCallStatus,
       
  2652 			 wantedStatus);
       
  2653 
       
  2654 	// Call RMobileSmsMessaging::ReceiveMessage to wait for an incoming SMS 
       
  2655 	TExtEtelRequestStatus receiveSmsRequestStatus(smsMessaging,EMobileSmsMessagingReceiveMessage);
       
  2656 	CleanupStack::PushL(receiveSmsRequestStatus);
       
  2657 	RMobileSmsMessaging::TMobileSmsReceiveAttributesV1 receivedSmsAttributes;
       
  2658 	RMobileSmsMessaging::TMobileSmsReceiveAttributesV1Pckg receivedSmsAttributesPckg(receivedSmsAttributes);
       
  2659 	RMobileSmsMessaging::TMobileSmsGsmTpdu gsmMsg;
       
  2660 	smsMessaging.ReceiveMessage(receiveSmsRequestStatus, gsmMsg, receivedSmsAttributesPckg);
       
  2661 
       
  2662 	// Send the SMS message with RMobileSmsMessaging::SendMessage 
       
  2663 	TBuf8<140> text(_L8("BA-CTSY-INT-SMSM-0020.1"));
       
  2664 	RMobileSmsMessaging::TMobileSmsSendAttributesV1 sendSmsAttributes;
       
  2665 	RMobileSmsMessaging::TMobileSmsSendAttributesV1Pckg sendSmsAttributesPckg(sendSmsAttributes);
       
  2666 	RMobileSmsMessaging::TMobileSmsGsmTpdu pdu = CreateValidSmsMessageL(text, sendSmsAttributes,TSmsStoreTsyTestHelper::ENoDataCodingScheme,ETrue);	
       
  2667 	TExtEtelRequestStatus sendSmsRequestStatus(smsMessaging, EMobileSmsMessagingSendMessage);
       
  2668 	CleanupStack::PushL(sendSmsRequestStatus);
       
  2669 	smsMessaging.SendMessage(sendSmsRequestStatus, pdu, sendSmsAttributesPckg);
       
  2670 	ASSERT_EQUALS(WaitForRequestWithTimeOut(sendSmsRequestStatus, ETimeMedium),
       
  2671 			KErrNone, _L("RMobileSmsMessaging::SendMessage timed out."));
       
  2672 	ASSERT_EQUALS(sendSmsRequestStatus.Int(), KErrNone, 
       
  2673 			_L("RMobileSmsMessaging::SendMessage completed with incorrect status"));
       
  2674 
       
  2675 	// Check no error is returned in aMsgAttributes.iSubmitReport
       
  2676 	ASSERT_TRUE(sendSmsAttributes.iSubmitReport.Length() > 0, 
       
  2677 			_L("RMobileSmsMessaging::TMobileSmsSendAttributesV1.iSubmitReport has zero length."));
       
  2678 	TUint wantedBits = RMobileSmsMessaging::KGsmSubmitReport; 
       
  2679 	ASSERT_BITS_SET(sendSmsAttributes.iFlags,wantedBits,KNoUnwantedBits, 
       
  2680 			_L("RMobileSmsMessaging::TMobileSmsSendAttributesV1 has no submit report in iFlags."));			
       
  2681 
       
  2682 	// Check RMobileSmsMessaging::ReceiveMessage completes with the correct message data in aMsgData
       
  2683 	ASSERT_EQUALS(WaitForRequestWithTimeOut(receiveSmsRequestStatus, ETimeVeryLong),
       
  2684 			KErrNone, _L("RMobileSmsMessaging::ReceiveMessage returned with error."));	
       
  2685 	ASSERT_EQUALS(receiveSmsRequestStatus.Int(), KErrNone, 
       
  2686 			_L("RMobileSmsMessaging::ReceiveMessage returned with error."));	
       
  2687 	ASSERT_TRUE(ComparePDUs(gsmMsg,pdu),_L("RMobileSmsMessaging::ReceiveMessage return wrong message"));
       
  2688 
       
  2689 	// Hang up call with RCall::HangUp 
       
  2690 	call1.NotifyStatusChange(notifyStatusChangeStatus,callStatus);
       
  2691 	TCoreEtelRequestStatus<RCall> hangUpStatus (call1,&RCall::HangUpCancel);	
       
  2692 	CleanupStack::PushL(hangUpStatus);
       
  2693 	call1.HangUp(hangUpStatus);
       
  2694 	ASSERT_EQUALS(WaitForRequestWithTimeOut(hangUpStatus, ETimeMedium), KErrNone,  
       
  2695 			_L("RCall::HangUp timed-out"));
       
  2696 	ASSERT_EQUALS(hangUpStatus.Int(), KErrNone,  
       
  2697 			_L("RCall::HangUp returned an error"));
       
  2698 
       
  2699 	// Check RCall::NotifyStatusChange completes with EStatusIdle.
       
  2700 	expectedCallStatus = RCall::EStatusIdle;
       
  2701 	iCallControlTestHelper.WaitForCallNotifyStatusChange(call1,
       
  2702 														 notifyStatusChangeStatus,
       
  2703 														 callStatus,
       
  2704 														 expectedCallStatus,
       
  2705 														 wantedStatus);
       
  2706 
       
  2707 	// ===  Part two - Receive SMS when packet context is active ===
       
  2708 
       
  2709 	// Activate a primary packet context with RPacketContext::Activate 
       
  2710 	// Check RPacketContext::NotifyStatusChange completes with EStatusActive
       
  2711 	RPacketContext& packetContext = iEtelSessionMgr.GetPrimaryPacketContextL(
       
  2712 											KMainServer,
       
  2713 											KMainPhone,
       
  2714 											KMainPacketService,
       
  2715 											KPrimaryPacketContext1);
       
  2716     iPacketServiceTsyTestHelper.ActivatePrimaryPacketContextL(phone,packetContext);
       
  2717 
       
  2718 	// Call RMobileSmsMessaging::ReceiveMessage to wait for an incoming SMS 
       
  2719 	smsMessaging.ReceiveMessage(receiveSmsRequestStatus, gsmMsg, receivedSmsAttributesPckg);
       
  2720 
       
  2721 	// Send the SMS message with RMobileSmsMessaging::SendMessage 
       
  2722 	TBuf8<140> text2(_L8("BA-CTSY-INT-SMSM-0020.2"));
       
  2723 	pdu = CreateValidSmsMessageL(text2, sendSmsAttributes,TSmsStoreTsyTestHelper::ENoDataCodingScheme,ETrue);	
       
  2724 	smsMessaging.SendMessage(sendSmsRequestStatus, pdu, sendSmsAttributesPckg);
       
  2725 	ASSERT_EQUALS(WaitForRequestWithTimeOut(sendSmsRequestStatus, ETimeMedium),
       
  2726 			KErrNone, _L("RMobileSmsMessaging::SendMessage timed out."));
       
  2727 	ASSERT_EQUALS(sendSmsRequestStatus.Int(), KErrNone, 
       
  2728 			_L("RMobileSmsMessaging::SendMessage completed with incorrect status"));
       
  2729 
       
  2730 	// Check no error is returned in aMsgAttributes.iSubmitReport
       
  2731 	ASSERT_TRUE(sendSmsAttributes.iSubmitReport.Length() > 0, 
       
  2732 			_L("RMobileSmsMessaging::TMobileSmsSendAttributesV1.iSubmitReport has zero length."));
       
  2733 	wantedBits = RMobileSmsMessaging::KGsmSubmitReport; 
       
  2734 	ASSERT_BITS_SET(sendSmsAttributes.iFlags,wantedBits,KNoUnwantedBits, 
       
  2735 			_L("RMobileSmsMessaging::TMobileSmsSendAttributesV1 has no submit report in iFlags."));			
       
  2736 
       
  2737 	// Check RMobileSmsMessaging::ReceiveMessage completes with the correct message data in aMsgData
       
  2738 	ASSERT_EQUALS(WaitForRequestWithTimeOut(receiveSmsRequestStatus, ETimeVeryLong),
       
  2739 			KErrNone, _L("RMobileSmsMessaging::ReceiveMessage returned with error."));	
       
  2740 	ASSERT_EQUALS(receiveSmsRequestStatus.Int(), KErrNone, 
       
  2741 			_L("RMobileSmsMessaging::ReceiveMessage returned with error."));	
       
  2742 	ASSERT_TRUE(ComparePDUs(gsmMsg,pdu),_L("RMobileSmsMessaging::ReceiveMessage return wrong message"));
       
  2743     
       
  2744 	// Post notification for context's status change
       
  2745 	TExtEtelRequestStatus notifyContextStChStatus(packetContext, EPacketContextNotifyStatusChange);
       
  2746 	CleanupStack::PushL(notifyContextStChStatus);
       
  2747 	RPacketContext::TContextStatus packetContextStatus;
       
  2748 	packetContext.NotifyStatusChange(notifyContextStChStatus, packetContextStatus);
       
  2749 
       
  2750 	// Deactivate packet context with RPacketContext::Deactivate 
       
  2751 	TExtEtelRequestStatus contextDeactivateStatus(packetContext, EPacketContextDeactivate);
       
  2752 	CleanupStack::PushL(contextDeactivateStatus);
       
  2753 	packetContext.Deactivate(contextDeactivateStatus);
       
  2754 	ASSERT_EQUALS(WaitForRequestWithTimeOut(contextDeactivateStatus, ETimeLong), KErrNone, 
       
  2755 					_L("RPacketContext::Deactivate timed out."));					
       
  2756 	ASSERT_EQUALS(contextDeactivateStatus.Int(), KErrNone,
       
  2757 					_L("RPacketContext::Deactivate returned with error status."));
       
  2758 
       
  2759 	// Check RPacketContext::NotifyStatusChange completes with EStatusInactive
       
  2760 	RPacketContext::TContextStatus expectedPacketContextStatus = RPacketContext::EStatusInactive;
       
  2761 	iPacketServiceTsyTestHelper.WaitForPacketContextNotifyStatusChange(
       
  2762 				packetContext,
       
  2763 				notifyContextStChStatus,
       
  2764 				packetContextStatus, 
       
  2765 				expectedPacketContextStatus,
       
  2766 				KErrNone);
       
  2767 
       
  2768 	
       
  2769 	//
       
  2770 	// TEST END
       
  2771 	//
       
  2772 
       
  2773     StartCleanup();
       
  2774 	
       
  2775 	// Pop:
       
  2776 	//	contextDeactivateStatus
       
  2777 	//	notifyContextStChStatus
       
  2778 	//	hangUpStatus
       
  2779 	//	sendSmsRequestStatus
       
  2780 	//	receiveSmsRequestStatus
       
  2781 	//	dialStatus
       
  2782 	//	notifyStatusChangeStatus
       
  2783 	CleanupStack::PopAndDestroy(7,&notifyStatusChangeStatus);
       
  2784 	
       
  2785 	return TestStepResult();
       
  2786 	}
       
  2787 
       
  2788 TPtrC CCTSYIntegrationTestSmsMessaging0020::GetTestStepName()
       
  2789 /**
       
  2790  * @return The test step name.
       
  2791  */
       
  2792 	{
       
  2793 	return _L("CCTSYIntegrationTestSmsMessaging0020");
       
  2794 	}
       
  2795 
       
  2796 
       
  2797 
       
  2798 CCTSYIntegrationTestSmsMessaging0021::CCTSYIntegrationTestSmsMessaging0021(CEtelSessionMgr& aEtelSessionMgr)
       
  2799 	: CCTSYIntegrationTestSmsMessagingBase(aEtelSessionMgr)
       
  2800 /**
       
  2801  * Constructor.
       
  2802  */
       
  2803 	{
       
  2804 	SetTestStepName(CCTSYIntegrationTestSmsMessaging0021::GetTestStepName());
       
  2805 	}
       
  2806 
       
  2807 CCTSYIntegrationTestSmsMessaging0021::~CCTSYIntegrationTestSmsMessaging0021()
       
  2808 /**
       
  2809  * Destructor.
       
  2810  */
       
  2811 	{
       
  2812 	}
       
  2813 
       
  2814 TVerdict CCTSYIntegrationTestSmsMessaging0021::doTestStepL()
       
  2815 /**
       
  2816  * @SYMTestCaseID BA-CTSY-INT-SMSM-0021
       
  2817  * @SYMFssID BA/CTSY/SMSM-0021
       
  2818  * @SYMTestCaseDesc Receive an SMS encoded in default 7-bit alphabet
       
  2819  * @SYMTestPriority High
       
  2820  * @SYMTestActions RMobileSmsMessaging::ReceiveMessage
       
  2821  * @SYMTestExpectedResults Pass - SMS received
       
  2822  * @SYMTestType CIT
       
  2823  * @SYMTestCaseDependencies live/automatic
       
  2824  *
       
  2825  * Reason for test: Verify message received.
       
  2826  *
       
  2827  * @return - TVerdict code
       
  2828  */
       
  2829 	{
       
  2830 
       
  2831 	//
       
  2832 	// SET UP
       
  2833 	//
       
  2834 
       
  2835 	
       
  2836 	// Ensure that RMobileSmsMessaging::GetReceiveMode returns aReceiveMode = EReceiveUnstoredClientAck 
       
  2837 
       
  2838 
       
  2839 	//
       
  2840 	// SET UP END
       
  2841 	//
       
  2842 	
       
  2843 	StartTest();
       
  2844 	
       
  2845 	//
       
  2846 	// TEST START
       
  2847 	//
       
  2848 	
       
  2849 	
       
  2850 	// Call RMobileSmsMessaging::ReceiveMessage to wait for an incoming SMS 
       
  2851 
       
  2852 	// Send an SMS message encoded iwth default 7-bit alphabet with RMobileSmsMessaging::SendMessage to the board 
       
  2853 
       
  2854 	// Check no error is returned in aMsgAttributes.iSubmitReport
       
  2855 
       
  2856 	// Check RMobileSmsMessaging::ReceiveMessage completes with the correct message data in aMsgData
       
  2857 	// Check RMobileSmsMessaging::ReceiveMessage completes with the correct originator in aMsgAttributes.iOriginator
       
  2858 	// Check RMobileSmsMessaging::ReceiveMessage completes with aMsgAttributes.iStatus=EMtMessageUnstoredPhoneAck
       
  2859 
       
  2860 	// Repeat this test sending and receiving an SMS of maximum length. 
       
  2861 
       
  2862 	
       
  2863 	//
       
  2864 	// TEST END
       
  2865 	//
       
  2866 
       
  2867     StartCleanup();
       
  2868 	
       
  2869 	// Put any required test clean up here, then remove this comment
       
  2870 	
       
  2871 	return TestStepResult();
       
  2872 	}
       
  2873 
       
  2874 TPtrC CCTSYIntegrationTestSmsMessaging0021::GetTestStepName()
       
  2875 /**
       
  2876  * @return The test step name.
       
  2877  */
       
  2878 	{
       
  2879 	return _L("CCTSYIntegrationTestSmsMessaging0021");
       
  2880 	}
       
  2881 
       
  2882 
       
  2883 
       
  2884 CCTSYIntegrationTestSmsMessaging0022::CCTSYIntegrationTestSmsMessaging0022(CEtelSessionMgr& aEtelSessionMgr)
       
  2885 	: CCTSYIntegrationTestSmsMessagingBase(aEtelSessionMgr)
       
  2886 /**
       
  2887  * Constructor.
       
  2888  */
       
  2889 	{
       
  2890 	SetTestStepName(CCTSYIntegrationTestSmsMessaging0022::GetTestStepName());
       
  2891 	}
       
  2892 
       
  2893 CCTSYIntegrationTestSmsMessaging0022::~CCTSYIntegrationTestSmsMessaging0022()
       
  2894 /**
       
  2895  * Destructor.
       
  2896  */
       
  2897 	{
       
  2898 	}
       
  2899 
       
  2900 TVerdict CCTSYIntegrationTestSmsMessaging0022::doTestStepL()
       
  2901 /**
       
  2902  * @SYMTestCaseID BA-CTSY-INT-SMSM-0022
       
  2903  * @SYMFssID BA/CTSY/SMSM-0022
       
  2904  * @SYMTestCaseDesc Receive an SMS encoded in UCS2 alphabet
       
  2905  * @SYMTestPriority High
       
  2906  * @SYMTestActions RMobileSmsMessaging::ReceiveMessage
       
  2907  * @SYMTestExpectedResults Pass - SMS received
       
  2908  * @SYMTestType CIT
       
  2909  * @SYMTestCaseDependencies live/automatic
       
  2910  *
       
  2911  * Reason for test: Verify message received.
       
  2912  *
       
  2913  * @return - TVerdict code
       
  2914  */
       
  2915 	{
       
  2916 
       
  2917 	//
       
  2918 	// SET UP
       
  2919 	//
       
  2920 
       
  2921 	
       
  2922 	// Ensure that RMobileSmsMessaging::GetReceiveMode returns aReceiveMode = EReceiveUnstoredClientAck 
       
  2923 
       
  2924 
       
  2925 	//
       
  2926 	// SET UP END
       
  2927 	//
       
  2928 	
       
  2929 	StartTest();
       
  2930 	
       
  2931 	//
       
  2932 	// TEST START
       
  2933 	//
       
  2934 	
       
  2935 	
       
  2936 	// Call RMobileSmsMessaging::ReceiveMessage to wait for an incoming SMS 
       
  2937 
       
  2938 	// Send an SMS message encoded in the UCS2 alphabet with RMobileSmsMessaging::SendMessage to the board 
       
  2939 
       
  2940 	// Check no error is returned in aMsgAttributes.iSubmitReport
       
  2941 
       
  2942 	// Check RMobileSmsMessaging::ReceiveMessage completes with the correct message data in aMsgData
       
  2943 	// Check RMobileSmsMessaging::ReceiveMessage completes with the correct originator in aMsgAttributes.iOriginator
       
  2944 	// Check RMobileSmsMessaging::ReceiveMessage completes with aMsgAttributes.iStatus=EMtMessageUnstoredPhoneAck
       
  2945 
       
  2946 	// Repeat this test sending and receiving an SMS of maximum length. 
       
  2947 
       
  2948 	
       
  2949 	//
       
  2950 	// TEST END
       
  2951 	//
       
  2952 
       
  2953     StartCleanup();
       
  2954 	
       
  2955 	// Put any required test clean up here, then remove this comment
       
  2956 	
       
  2957 	return TestStepResult();
       
  2958 	}
       
  2959 
       
  2960 TPtrC CCTSYIntegrationTestSmsMessaging0022::GetTestStepName()
       
  2961 /**
       
  2962  * @return The test step name.
       
  2963  */
       
  2964 	{
       
  2965 	return _L("CCTSYIntegrationTestSmsMessaging0022");
       
  2966 	}
       
  2967 
       
  2968 
       
  2969 
       
  2970 CCTSYIntegrationTestSmsMessaging0023::CCTSYIntegrationTestSmsMessaging0023(CEtelSessionMgr& aEtelSessionMgr)
       
  2971 	: CCTSYIntegrationTestSmsMessagingBase(aEtelSessionMgr)
       
  2972 /**
       
  2973  * Constructor.
       
  2974  */
       
  2975 	{
       
  2976 	SetTestStepName(CCTSYIntegrationTestSmsMessaging0023::GetTestStepName());
       
  2977 	}
       
  2978 
       
  2979 CCTSYIntegrationTestSmsMessaging0023::~CCTSYIntegrationTestSmsMessaging0023()
       
  2980 /**
       
  2981  * Destructor.
       
  2982  */
       
  2983 	{
       
  2984 	}
       
  2985 
       
  2986 TVerdict CCTSYIntegrationTestSmsMessaging0023::doTestStepL()
       
  2987 /**
       
  2988  * @SYMTestCaseID BA-CTSY-INT-SMSM-0023
       
  2989  * @SYMFssID BA/CTSY/SMSM-0023
       
  2990  * @SYMTestCaseDesc Receive a concatenated SMS
       
  2991  * @SYMTestPriority High
       
  2992  * @SYMTestActions RMobileSmsMessaging::ReceiveMessage
       
  2993  * @SYMTestExpectedResults Pass - SMS received
       
  2994  * @SYMTestType CIT
       
  2995  * @SYMTestCaseDependencies live/automatic
       
  2996  *
       
  2997  * Reason for test: Verify messages are received.
       
  2998  *
       
  2999  * @return - TVerdict code
       
  3000  */
       
  3001 	{
       
  3002 
       
  3003 	//
       
  3004 	// SET UP
       
  3005 	//
       
  3006 
       
  3007 	
       
  3008 	// Ensure that RMobileSmsMessaging::GetReceiveMode returns aReceiveMode = EReceiveUnstoredClientAck 
       
  3009 
       
  3010 
       
  3011 	//
       
  3012 	// SET UP END
       
  3013 	//
       
  3014 	
       
  3015 	StartTest();
       
  3016 	
       
  3017 	//
       
  3018 	// TEST START
       
  3019 	//
       
  3020 	
       
  3021 	
       
  3022 	// Call RMobileSmsMessaging::ReceiveMessage to wait for an incoming SMS 
       
  3023 
       
  3024 	// ===  Send a long SMS message made up of 3 individual SMSs ===
       
  3025 
       
  3026 	// Send first part of the SMS message with RMobileSmsMessaging::SendMessage specifying aMsgAttributes.iMore=ETrue 
       
  3027 
       
  3028 	// Check no error is returned in aMsgAttributes.iSubmitReport
       
  3029 
       
  3030 	// Send second part of the SMS message with RMobileSmsMessaging::SendMessage specifying aMsgAttributes.iMore=ETrue 
       
  3031 
       
  3032 	// Check no error is returned in aMsgAttributes.iSubmitReport
       
  3033 
       
  3034 	// Send third part of the SMS message with RMobileSmsMessaging::SendMessage specifying aMsgAttributes.iMore=EFalse 
       
  3035 
       
  3036 	// Check no error is returned in aMsgAttributes.iSubmitReport
       
  3037 
       
  3038 	// ===  Check that each part is received correctly ===
       
  3039 
       
  3040 	// Check RMobileSmsMessaging::ReceiveMessage completes with the correct message data in aMsgData
       
  3041 	// Check RMobileSmsMessaging::ReceiveMessage completes with aMsgAttributes.iStatus=EMtMessageUnstoredPhoneAck
       
  3042 
       
  3043 	// Repost RMobileSmsMessaging::ReceiveMessage immediately to wait for next incoming SMS 
       
  3044 
       
  3045 	// Check RMobileSmsMessaging::ReceiveMessage completes with the correct message data in aMsgData
       
  3046 	// Check RMobileSmsMessaging::ReceiveMessage completes with aMsgAttributes.iStatus=EMtMessageUnstoredPhoneAck
       
  3047 
       
  3048 	// Repost RMobileSmsMessaging::ReceiveMessage immediately to wait for next incoming SMS 
       
  3049 
       
  3050 	// Check RMobileSmsMessaging::ReceiveMessage completes with the correct message data in aMsgData
       
  3051 	// Check RMobileSmsMessaging::ReceiveMessage completes with aMsgAttributes.iStatus=EMtMessageUnstoredPhoneAck
       
  3052 
       
  3053 	
       
  3054 	//
       
  3055 	// TEST END
       
  3056 	//
       
  3057 
       
  3058     StartCleanup();
       
  3059 	
       
  3060 	// Put any required test clean up here, then remove this comment
       
  3061 	
       
  3062 	return TestStepResult();
       
  3063 	}
       
  3064 
       
  3065 TPtrC CCTSYIntegrationTestSmsMessaging0023::GetTestStepName()
       
  3066 /**
       
  3067  * @return The test step name.
       
  3068  */
       
  3069 	{
       
  3070 	return _L("CCTSYIntegrationTestSmsMessaging0023");
       
  3071 	}
       
  3072 
       
  3073 
       
  3074 
       
  3075 CCTSYIntegrationTestSmsMessaging0024::CCTSYIntegrationTestSmsMessaging0024(CEtelSessionMgr& aEtelSessionMgr)
       
  3076 	: CCTSYIntegrationTestSmsMessagingBase(aEtelSessionMgr)
       
  3077 /**
       
  3078  * Constructor.
       
  3079  */
       
  3080 	{
       
  3081 	SetTestStepName(CCTSYIntegrationTestSmsMessaging0024::GetTestStepName());
       
  3082 	}
       
  3083 
       
  3084 CCTSYIntegrationTestSmsMessaging0024::~CCTSYIntegrationTestSmsMessaging0024()
       
  3085 /**
       
  3086  * Destructor.
       
  3087  */
       
  3088 	{
       
  3089 	}
       
  3090 
       
  3091 TVerdict CCTSYIntegrationTestSmsMessaging0024::doTestStepL()
       
  3092 /**
       
  3093  * @SYMTestCaseID BA-CTSY-INT-SMSM-0024
       
  3094  * @SYMFssID BA/CTSY/SMSM-0024
       
  3095  * @SYMTestCaseDesc Receive a class 0 SMS message
       
  3096  * @SYMTestPriority High
       
  3097  * @SYMTestActions RMobileSmsMessaging::ReceiveMessage
       
  3098  * @SYMTestExpectedResults Pass - SMS received
       
  3099  * @SYMTestType CIT
       
  3100  * @SYMTestCaseDependencies live/automatic
       
  3101  *
       
  3102  * Reason for test: Verify message received.
       
  3103  *
       
  3104  * @return - TVerdict code
       
  3105  */
       
  3106 	{
       
  3107 
       
  3108 	//
       
  3109 	// SET UP
       
  3110 	//
       
  3111 
       
  3112 	
       
  3113 	// Ensure that RMobileSmsMessaging::GetReceiveMode returns aReceiveMode = EReceiveUnstoredClientAck 
       
  3114 	RMobileSmsMessaging &smsMessaging = iEtelSessionMgr.GetSmsMessagingL( KMainServer, KMainPhone, KMainSmsMessaging);
       
  3115 	RMobileSmsMessaging::TMobileSmsReceiveMode receiveMode;	
       
  3116 	ASSERT_EQUALS(smsMessaging.GetReceiveMode(receiveMode), KErrNone,
       
  3117 		_L("RMobileSmsMessaging::GetReceiveMode returned with an error."));
       
  3118 	ASSERT_EQUALS(receiveMode, RMobileSmsMessaging::EReceiveUnstoredClientAck,
       
  3119 		_L("RMobileSmsMessaging::GetReceiveMode returned with incorrect mode."));
       
  3120 
       
  3121 
       
  3122 	//
       
  3123 	// SET UP END
       
  3124 	//
       
  3125 	
       
  3126 	StartTest();
       
  3127 	
       
  3128 	//
       
  3129 	// TEST START
       
  3130 	//
       
  3131 	
       
  3132 	
       
  3133 	// Call RMobileSmsMessaging::ReceiveMessage to wait for an incoming SMS 
       
  3134 	TExtEtelRequestStatus receiveSmsRequestStatus(smsMessaging,EMobileSmsMessagingReceiveMessage);
       
  3135 	CleanupStack::PushL(receiveSmsRequestStatus);
       
  3136 	RMobileSmsMessaging::TMobileSmsReceiveAttributesV1 receivedSmsAttributes;
       
  3137 	RMobileSmsMessaging::TMobileSmsReceiveAttributesV1Pckg receivedSmsAttributesPckg(receivedSmsAttributes);
       
  3138 	RMobileSmsMessaging::TMobileSmsGsmTpdu gsmMsg;
       
  3139 	smsMessaging.ReceiveMessage(receiveSmsRequestStatus, gsmMsg, receivedSmsAttributesPckg);
       
  3140 
       
  3141 	// Send a class 0 SMS message with RMobileSmsMessaging::SendMessage to the board 
       
  3142 	TBuf8<140> text(_L8("cAA Hello Mobile AAc"));
       
  3143 	RMobileSmsMessaging::TMobileSmsSendAttributesV1 sendSmsAttributes;
       
  3144 	RMobileSmsMessaging::TMobileSmsSendAttributesV1Pckg sendSmsAttributesPckg(sendSmsAttributes);
       
  3145 	RMobileSmsMessaging::TMobileSmsGsmTpdu pdu = CreateValidSmsMessageL(text, sendSmsAttributes,TSmsStoreTsyTestHelper::EClass0DataCodingScheme,ETrue);	
       
  3146 	TExtEtelRequestStatus sendSmsRequestStatus(smsMessaging, EMobileSmsMessagingSendMessage);
       
  3147 	CleanupStack::PushL(sendSmsRequestStatus);
       
  3148 	smsMessaging.SendMessage(sendSmsRequestStatus, pdu, sendSmsAttributesPckg);
       
  3149 	ASSERT_EQUALS(WaitForRequestWithTimeOut(sendSmsRequestStatus, ETimeMedium),
       
  3150 			KErrNone, _L("RMobileSmsMessaging::SendMessage timed out."));
       
  3151 	ASSERT_EQUALS(sendSmsRequestStatus.Int(), KErrNone, 
       
  3152 			_L("RMobileSmsMessaging::SendMessage completed with incorrect status"));
       
  3153 
       
  3154 	// Check no error is returned in aMsgAttributes.iSubmitReport
       
  3155 	ASSERT_TRUE(sendSmsAttributes.iSubmitReport.Length() > 0, 
       
  3156 			_L("RMobileSmsMessaging::TMobileSmsSendAttributesV1.iSubmitReport has zero length."));
       
  3157 	TUint wantedBits = RMobileSmsMessaging::KGsmSubmitReport; 
       
  3158 	ASSERT_BITS_SET(sendSmsAttributes.iFlags,wantedBits,KNoUnwantedBits, 
       
  3159 			_L("RMobileSmsMessaging::TMobileSmsSendAttributesV1 has no submit report in iFlags."));			
       
  3160 
       
  3161 	// Check RMobileSmsMessaging::ReceiveMessage completes with the correct message data in aMsgData
       
  3162 	ASSERT_EQUALS(WaitForRequestWithTimeOut(receiveSmsRequestStatus, ETimeVeryLong),
       
  3163 			KErrNone, _L("RMobileSmsMessaging::ReceiveMessage returned with error."));	
       
  3164 	ASSERT_EQUALS(receiveSmsRequestStatus.Int(), KErrNone, 
       
  3165 			_L("RMobileSmsMessaging::ReceiveMessage returned with error."));	
       
  3166 	ASSERT_TRUE(ComparePDUs(gsmMsg,pdu),_L("RMobileSmsMessaging::ReceiveMessage return wrong message"));
       
  3167 
       
  3168 	
       
  3169 	//
       
  3170 	// TEST END
       
  3171 	//
       
  3172 
       
  3173     StartCleanup();
       
  3174 	
       
  3175 	// Pop:
       
  3176 	//	sendSmsRequestStatus
       
  3177 	//	receiveSmsRequestStatus
       
  3178 	CleanupStack::PopAndDestroy(2,&receiveSmsRequestStatus);
       
  3179 	
       
  3180 	return TestStepResult();
       
  3181 	}
       
  3182 
       
  3183 TPtrC CCTSYIntegrationTestSmsMessaging0024::GetTestStepName()
       
  3184 /**
       
  3185  * @return The test step name.
       
  3186  */
       
  3187 	{
       
  3188 	return _L("CCTSYIntegrationTestSmsMessaging0024");
       
  3189 	}
       
  3190 
       
  3191 
       
  3192 
       
  3193 CCTSYIntegrationTestSmsMessaging0025::CCTSYIntegrationTestSmsMessaging0025(CEtelSessionMgr& aEtelSessionMgr)
       
  3194 	: CCTSYIntegrationTestSmsMessagingBase(aEtelSessionMgr)
       
  3195 /**
       
  3196  * Constructor.
       
  3197  */
       
  3198 	{
       
  3199 	SetTestStepName(CCTSYIntegrationTestSmsMessaging0025::GetTestStepName());
       
  3200 	}
       
  3201 
       
  3202 CCTSYIntegrationTestSmsMessaging0025::~CCTSYIntegrationTestSmsMessaging0025()
       
  3203 /**
       
  3204  * Destructor.
       
  3205  */
       
  3206 	{
       
  3207 	}
       
  3208 
       
  3209 TVerdict CCTSYIntegrationTestSmsMessaging0025::doTestStepL()
       
  3210 /**
       
  3211  * @SYMTestCaseID BA-CTSY-INT-SMSM-0025
       
  3212  * @SYMFssID BA/CTSY/SMSM-0025
       
  3213  * @SYMTestCaseDesc Receive and store a class 1 SMS message
       
  3214  * @SYMTestPriority High
       
  3215  * @SYMTestActions RMobileSmsMessaging::AckSmsStored, RMobilePhoneStore::NotifyStoreEvent, RMobilePhoneStore::Write, RMobileSmsMessaging::ReceiveMessage, RMobilePhoneStore::Read
       
  3216  * @SYMTestExpectedResults Pass - SMS message is received and stored.
       
  3217  * @SYMTestType CIT
       
  3218  * @SYMTestCaseDependencies live/automatic
       
  3219  *
       
  3220  * Reason for test: Verify message received and stored in SMS store.
       
  3221  *
       
  3222  * @return - TVerdict code
       
  3223  */
       
  3224 	{
       
  3225 
       
  3226 	//
       
  3227 	// SET UP
       
  3228 	//
       
  3229 
       
  3230 	
       
  3231 	// Ensure RMobilePhoneStore::GetInfo on the SMS store returns iCaps in set of KCapsReadAccess | KCapsWriteAccess 
       
  3232 	RMobileSmsStore& smsStore = iEtelSessionMgr.GetSmsStoreL(KMainServer,KMainPhone,KMainSmsMessaging,KIccSmsStore);
       
  3233 	TExtEtelRequestStatus getInfoStatus (smsStore,EMobilePhoneStoreGetInfo);	
       
  3234 	CleanupStack::PushL(getInfoStatus);
       
  3235 	RMobilePhoneStore::TMobilePhoneStoreInfoV1 storeInfo;
       
  3236 	RMobileSmsStore::TMobilePhoneStoreInfoV1Pckg storeInfoPckg (storeInfo);
       
  3237 	smsStore.GetInfo(getInfoStatus,storeInfoPckg);
       
  3238 	CHECK_EQUALS_L(WaitForRequestWithTimeOut(getInfoStatus, ETimeMedium), KErrNone,_L("RMobileSmsStore::GetInfo timed out"));
       
  3239 	CHECK_EQUALS_L(getInfoStatus.Int(), KErrNone, _L("RMobileSmsStore::GetInfo returned an error"));
       
  3240 	CHECK_BITS_SET_L(storeInfo.iCaps, (RMobilePhoneStore::KCapsReadAccess | RMobilePhoneStore::KCapsWriteAccess) ,KNoUnwantedBits, _L("RMobilePhoneStore::GetInfo returned incorrect store caps"));
       
  3241 
       
  3242 	// Ensure that the SMS store is not full 
       
  3243 	RMobilePhone& phone = iEtelSessionMgr.GetPhoneL(KMainServer,KMainPhone);
       
  3244 	RMobileSmsMessaging &smsMessaging = iEtelSessionMgr.GetSmsMessagingL( KMainServer, KMainPhone, KMainSmsMessaging);
       
  3245 	TInt clearSpace=iSimTsyTestHelper.EnsureEmptyStoreSpaceL(smsStore,KETelIccSmsStore,storeInfo,phone);
       
  3246 	CHECK_TRUE_L(clearSpace>=0,_L("TSimTsyTestHelper::TSimTsyTestHelper::EnsureEmptyStoreSpaceL returned an error"));
       
  3247 
       
  3248 	// Ensure that RMobileSmsMessaging::GetReceiveMode returns aReceiveMode = EReceiveUnstoredClientAck 
       
  3249 	DEBUG_PRINTF1(_L("Checking RMobileSmsMessaging::GetReceiveMode returns aReceiveMode=RMobileSmsMessaging::EReceiveUnstoredClientAck"));
       
  3250 	RMobileSmsMessaging::TMobileSmsReceiveMode receiveMode;	
       
  3251 	ASSERT_EQUALS(smsMessaging.GetReceiveMode(receiveMode), KErrNone,
       
  3252 		_L("RMobileSmsMessaging::GetReceiveMode returned with an error."));
       
  3253 	ASSERT_EQUALS(receiveMode, RMobileSmsMessaging::EReceiveUnstoredClientAck,
       
  3254 		_L("RMobileSmsMessaging::GetReceiveMode returned with incorrect mode."));
       
  3255 
       
  3256 
       
  3257 	//
       
  3258 	// SET UP END
       
  3259 	//
       
  3260 	
       
  3261 	StartTest();
       
  3262 	
       
  3263 	//
       
  3264 	// TEST START
       
  3265 	//
       
  3266 	
       
  3267 	
       
  3268 	// Call RMobileSmsMessaging::ReceiveMessage to wait for an incoming SMS 
       
  3269 	TExtEtelRequestStatus receiveSmsRequestStatus(smsMessaging,EMobileSmsMessagingReceiveMessage);
       
  3270 	CleanupStack::PushL(receiveSmsRequestStatus);
       
  3271 	RMobileSmsMessaging::TMobileSmsReceiveAttributesV1 receivedSmsAttributes;
       
  3272 	RMobileSmsMessaging::TMobileSmsReceiveAttributesV1Pckg receivedSmsAttributesPckg(receivedSmsAttributes);
       
  3273 	RMobileSmsMessaging::TMobileSmsGsmTpdu gsmMsg;
       
  3274 	smsMessaging.ReceiveMessage(receiveSmsRequestStatus, gsmMsg, receivedSmsAttributesPckg);
       
  3275 
       
  3276 	// Send a class 1 SMS message with RMobileSmsMessaging::SendMessage to the board 
       
  3277 	TBuf8<140> text(_L8("eAA Hello Mobile"));
       
  3278 	RMobileSmsMessaging::TMobileSmsSendAttributesV1 sendSmsAttributes;
       
  3279 	RMobileSmsMessaging::TMobileSmsSendAttributesV1Pckg sendSmsAttributesPckg(sendSmsAttributes);
       
  3280 	RMobileSmsMessaging::TMobileSmsGsmTpdu pdu = CreateValidSmsMessageL(text, sendSmsAttributes,TSmsStoreTsyTestHelper::EClass1DataCodingScheme,ETrue);	
       
  3281 	TExtEtelRequestStatus sendSmsRequestStatus(smsMessaging, EMobileSmsMessagingSendMessage);
       
  3282 	CleanupStack::PushL(sendSmsRequestStatus);
       
  3283 	smsMessaging.SendMessage(sendSmsRequestStatus, pdu, sendSmsAttributesPckg);
       
  3284 	ASSERT_EQUALS(WaitForRequestWithTimeOut(sendSmsRequestStatus, ETimeMedium),
       
  3285 			KErrNone, _L("RMobileSmsMessaging::SendMessage timed out."));
       
  3286 	ASSERT_EQUALS(sendSmsRequestStatus.Int(), KErrNone, 
       
  3287 			_L("RMobileSmsMessaging::SendMessage completed with incorrect status"));
       
  3288 
       
  3289 	// Check no error is returned in aMsgAttributes.iSubmitReport
       
  3290 	ASSERT_TRUE(sendSmsAttributes.iSubmitReport.Length() > 0, 
       
  3291 			_L("RMobileSmsMessaging::TMobileSmsSendAttributesV1.iSubmitReport has zero length."));
       
  3292 	TUint wantedBits = RMobileSmsMessaging::KGsmSubmitReport; 
       
  3293 	ASSERT_BITS_SET(sendSmsAttributes.iFlags,wantedBits,KNoUnwantedBits, 
       
  3294 			_L("RMobileSmsMessaging::TMobileSmsSendAttributesV1 has no submit report in iFlags."));			
       
  3295 
       
  3296 	// Check RMobileSmsMessaging::ReceiveMessage completes with the correct message data in aMsgData
       
  3297 	ASSERT_EQUALS(WaitForRequestWithTimeOut(receiveSmsRequestStatus, ETimeVeryLong),
       
  3298 			KErrNone, _L("RMobileSmsMessaging::ReceiveMessage returned with error."));	
       
  3299 	ASSERT_EQUALS(receiveSmsRequestStatus.Int(), KErrNone, 
       
  3300 			_L("RMobileSmsMessaging::ReceiveMessage returned with error."));	
       
  3301 	ASSERT_TRUE(ComparePDUs(gsmMsg,pdu),_L("RMobileSmsMessaging::ReceiveMessage return wrong message"));
       
  3302 
       
  3303 	// post notifier for RMobilePhoneStore::NotifyStoreEvent
       
  3304 	TExtEtelRequestStatus notifyStoreEventStatus (smsStore,EMobilePhoneStoreNotifyStoreEvent);	
       
  3305 	CleanupStack::PushL(notifyStoreEventStatus);
       
  3306 	TUint32 storeEvent;
       
  3307 	TInt index;
       
  3308 	smsStore.NotifyStoreEvent(notifyStoreEventStatus, storeEvent, index);
       
  3309 
       
  3310 	// Write the received SMS message to the SMS store using RMobilePhoneStore::Write 
       
  3311 	RMobileSmsStore::TMobileGsmSmsEntryV1 entry;
       
  3312 	RMobileSmsStore::TMobileGsmSmsEntryV1Pckg pckgEntry(entry);
       
  3313 	
       
  3314  	entry.iServiceCentre.iTypeOfNumber =  receivedSmsAttributes.iGsmServiceCentre.iTypeOfNumber; 
       
  3315  	entry.iServiceCentre.iNumberPlan = receivedSmsAttributes.iGsmServiceCentre.iNumberPlan; 
       
  3316  	entry.iServiceCentre.iTelNumber = receivedSmsAttributes.iGsmServiceCentre.iTelNumber;  
       
  3317 	entry.iMsgStatus = RMobileSmsStore::EStoredMessageUnread;
       
  3318 	entry.iMsgData=gsmMsg;
       
  3319 	entry.iIndex = clearSpace;
       
  3320 	TExtEtelRequestStatus writeStatus(smsStore, EMobilePhoneStoreWrite);	
       
  3321 	CleanupStack::PushL(writeStatus);
       
  3322 	smsStore.Write(writeStatus,pckgEntry);
       
  3323 	ASSERT_EQUALS(WaitForRequestWithTimeOut(writeStatus, ETimeMedium),KErrNone, _L("RMobileSmsStore::Write timed out"));
       
  3324 	ASSERT_EQUALS(writeStatus.Int(), KErrNone, _L("RMobileSmsStore::Write returned an error"));
       
  3325 	
       
  3326 
       
  3327 	// Check RMobilePhoneStore::NotifyStoreEvent completes with RMobilePhoneStore::KStoreEntryAdded
       
  3328 	RMobilePhoneStore::TMobileStoreEvent expectedEvent = RMobilePhoneStore::KStoreEntryAdded ;
       
  3329 	iSmsStoreTsyTestHelper.WaitForSmsStoreNotifyStoreEvent( smsStore,
       
  3330 			notifyStoreEventStatus,
       
  3331 			storeEvent,
       
  3332 			expectedEvent,
       
  3333 			index);
       
  3334 
       
  3335 	// Acknowledge that the SMS has been decoded and stored with RMobileSmsMessaging::AckSmsStored sending the delivery report in aMsgData 
       
  3336 	TExtEtelRequestStatus ackStatus(smsMessaging, EMobileSmsMessagingAckSmsStored);	
       
  3337 	CleanupStack::PushL(ackStatus);
       
  3338 	RMobileSmsMessaging::TMobileSmsGsmTpdu ackPdu;
       
  3339 	ackPdu.SetLength(0);
       
  3340 	TUint8 messageTypeIndicator=0x00; //0 deliver and deliver report; 1 submit and submit report; 2 status report and command
       
  3341 	TUint8 userDataHeaderIndicator=0x00; //0 no header; 0x40 has header
       
  3342 	ackPdu.Append(messageTypeIndicator | userDataHeaderIndicator);
       
  3343 	TUint8 tpParameterIndicator=0x00;
       
  3344 	ackPdu.Append(tpParameterIndicator);
       
  3345 	smsMessaging.AckSmsStored(ackStatus,ackPdu);
       
  3346 	ASSERT_EQUALS(WaitForRequestWithTimeOut(ackStatus, ETimeVeryLong),KErrNone, _L("RMobilePhone::AckSmsStored timed out"));
       
  3347 	ASSERT_EQUALS(ackStatus.Int(), KErrNone, _L("RMobilePhone::AckSmsStored returned an error"));
       
  3348 	
       
  3349 	// Read the SMS message that has just been stored and check that the contents is the same as that received 
       
  3350 	RMobileSmsStore::TMobileGsmSmsEntryV1 readEntry;
       
  3351 	RMobileSmsStore::TMobileGsmSmsEntryV1Pckg readEntryPckg(readEntry);
       
  3352 	readEntry.iIndex = clearSpace;
       
  3353 	readEntry.iMsgData.Zero();
       
  3354 	readEntry.iMsgStatus = RMobileSmsStore::EStoredMessageUnknownStatus;
       
  3355 	TExtEtelRequestStatus readStatus (smsStore,EMobilePhoneStoreRead);	
       
  3356 	CleanupStack::PushL(readStatus);	
       
  3357 	smsStore.Read(readStatus,readEntryPckg);	
       
  3358 	ASSERT_EQUALS(WaitForRequestWithTimeOut(readStatus, ETimeMedium),KErrNone,_L("RMobileSmsStore::Read timed out"));
       
  3359 	ASSERT_EQUALS(readStatus.Int(), KErrNone, _L("RMobileSmsStore::Read returned an error"));
       
  3360 	ASSERT_EQUALS(readEntry.iMsgStatus,RMobileSmsStore::EStoredMessageUnread,_L("RMobileSmsStore::Read returned incorrect data"));
       
  3361 	ASSERT_EQUALS(readEntry.iServiceCentre.iTypeOfNumber,receivedSmsAttributes.iGsmServiceCentre.iTypeOfNumber,_L("RMobileSmsStore::Read returned incorrect data"));
       
  3362 	ASSERT_EQUALS(readEntry.iServiceCentre.iNumberPlan,receivedSmsAttributes.iGsmServiceCentre.iNumberPlan,_L("RMobileSmsStore::Read returned incorrect data"));
       
  3363 	ASSERT_EQUALS_DES16(readEntry.iServiceCentre.iTelNumber,receivedSmsAttributes.iGsmServiceCentre.iTelNumber,_L("RMobileSmsStore::Read returned incorrect data"));
       
  3364 	ASSERT_EQUALS_DES8(readEntry.iMsgData,gsmMsg,_L("RMobileSmsStore::Read returned incorrect data"));
       
  3365 	
       
  3366 	//
       
  3367 	// TEST END
       
  3368 	//
       
  3369 
       
  3370     StartCleanup();
       
  3371 	
       
  3372 	// Pop:
       
  3373 	//	readStatus
       
  3374 	//	ackStatus
       
  3375 	//	writeStatus
       
  3376 	//	notifyStoreEventStatus
       
  3377 	//	sendSmsRequestStatus
       
  3378 	//	receiveSmsRequestStatus
       
  3379 	//	getInfoStatus
       
  3380 	CleanupStack::PopAndDestroy(7,&getInfoStatus);
       
  3381 	
       
  3382 	return TestStepResult();
       
  3383 	}
       
  3384 
       
  3385 TPtrC CCTSYIntegrationTestSmsMessaging0025::GetTestStepName()
       
  3386 /**
       
  3387  * @return The test step name.
       
  3388  */
       
  3389 	{
       
  3390 	return _L("CCTSYIntegrationTestSmsMessaging0025");
       
  3391 	}
       
  3392 
       
  3393 
       
  3394 
       
  3395 CCTSYIntegrationTestSmsMessaging0026::CCTSYIntegrationTestSmsMessaging0026(CEtelSessionMgr& aEtelSessionMgr)
       
  3396 	: CCTSYIntegrationTestSmsMessagingBase(aEtelSessionMgr)
       
  3397 /**
       
  3398  * Constructor.
       
  3399  */
       
  3400 	{
       
  3401 	SetTestStepName(CCTSYIntegrationTestSmsMessaging0026::GetTestStepName());
       
  3402 	}
       
  3403 
       
  3404 CCTSYIntegrationTestSmsMessaging0026::~CCTSYIntegrationTestSmsMessaging0026()
       
  3405 /**
       
  3406  * Destructor.
       
  3407  */
       
  3408 	{
       
  3409 	}
       
  3410 
       
  3411 TVerdict CCTSYIntegrationTestSmsMessaging0026::doTestStepL()
       
  3412 /**
       
  3413  * @SYMTestCaseID BA-CTSY-INT-SMSM-0026
       
  3414  * @SYMFssID BA/CTSY/SMSM-0026
       
  3415  * @SYMTestCaseDesc Receive and store a class 2 SMS message
       
  3416  * @SYMTestPriority High
       
  3417  * @SYMTestActions RMobileSmsMessaging::AckSmsStored, RMobilePhoneStore::NotifyStoreEvent, RMobilePhoneStore::Write, RMobileSmsMessaging::ReceiveMessage, RMobilePhoneStore::Read
       
  3418  * @SYMTestExpectedResults Pass - SMS message is received and stored.
       
  3419  * @SYMTestType CIT
       
  3420  * @SYMTestCaseDependencies live/automatic
       
  3421  *
       
  3422  * Reason for test: Verify message received and stored in SMS store.
       
  3423  *
       
  3424  * @return - TVerdict code
       
  3425  */
       
  3426 	{
       
  3427 
       
  3428 	//
       
  3429 	// SET UP
       
  3430 	//
       
  3431 	
       
  3432 	// Ensure RMobilePhoneStore::GetInfo on the SMS store returns iCaps in set of KCapsReadAccess | KCapsWriteAccess 
       
  3433 	RMobileSmsStore& smsStore = iEtelSessionMgr.GetSmsStoreL(KMainServer,KMainPhone,KMainSmsMessaging,KIccSmsStore);
       
  3434 	TExtEtelRequestStatus getInfoStatus (smsStore,EMobilePhoneStoreGetInfo);	
       
  3435 	CleanupStack::PushL(getInfoStatus);
       
  3436 	RMobilePhoneStore::TMobilePhoneStoreInfoV1 storeInfo;
       
  3437 	RMobileSmsStore::TMobilePhoneStoreInfoV1Pckg storeInfoPckg (storeInfo);
       
  3438 	smsStore.GetInfo(getInfoStatus,storeInfoPckg);
       
  3439 	CHECK_EQUALS_L(WaitForRequestWithTimeOut(getInfoStatus, ETimeMedium), KErrNone,_L("RMobileSmsStore::GetInfo timed out"));
       
  3440 	CHECK_EQUALS_L(getInfoStatus.Int(), KErrNone, _L("RMobileSmsStore::GetInfo returned an error"));
       
  3441 	CHECK_BITS_SET_L(storeInfo.iCaps, (RMobilePhoneStore::KCapsReadAccess | RMobilePhoneStore::KCapsWriteAccess) ,KNoUnwantedBits, _L("RMobilePhoneStore::GetInfo returned incorrect store caps"));
       
  3442 
       
  3443 	// Ensure that the SMS store is not full 
       
  3444 	RMobilePhone& phone = iEtelSessionMgr.GetPhoneL(KMainServer,KMainPhone);
       
  3445 	RMobileSmsMessaging &smsMessaging = iEtelSessionMgr.GetSmsMessagingL( KMainServer, KMainPhone, KMainSmsMessaging);
       
  3446     TInt clearSpace=iSimTsyTestHelper.EnsureEmptyStoreSpaceL(smsStore,KETelIccSmsStore,storeInfo,phone);
       
  3447 	CHECK_TRUE_L(clearSpace>=0,_L("TSimTsyTestHelper::TSimTsyTestHelper::EnsureEmptyStoreSpaceL returned an error"));
       
  3448 
       
  3449 	// Ensure that RMobileSmsMessaging::GetReceiveMode returns aReceiveMode = EReceiveUnstoredClientAck 
       
  3450 	DEBUG_PRINTF1(_L("Checking RMobileSmsMessaging::GetReceiveMode returns aReceiveMode=RMobileSmsMessaging::EReceiveUnstoredClientAck"));
       
  3451 	RMobileSmsMessaging::TMobileSmsReceiveMode receiveMode;	
       
  3452 	ASSERT_EQUALS(smsMessaging.GetReceiveMode(receiveMode), KErrNone,
       
  3453 		_L("RMobileSmsMessaging::GetReceiveMode returned with an error."));
       
  3454 	ASSERT_EQUALS(receiveMode, RMobileSmsMessaging::EReceiveUnstoredClientAck,
       
  3455 		_L("RMobileSmsMessaging::GetReceiveMode returned with incorrect mode."));
       
  3456     iNetworkTsyTestHelper.WaitForRegisteredOnHomeNetworkL(phone);
       
  3457 
       
  3458 	//
       
  3459 	// SET UP END
       
  3460 	//
       
  3461 	
       
  3462 	StartTest();
       
  3463 	
       
  3464 	//
       
  3465 	// TEST START
       
  3466 	//
       
  3467 	
       
  3468 	
       
  3469 	// Call RMobileSmsMessaging::ReceiveMessage to wait for an incoming SMS 
       
  3470 	TExtEtelRequestStatus receiveSmsRequestStatus(smsMessaging,EMobileSmsMessagingReceiveMessage);
       
  3471 	CleanupStack::PushL(receiveSmsRequestStatus);
       
  3472 	RMobileSmsMessaging::TMobileSmsReceiveAttributesV1 receivedSmsAttributes;
       
  3473 	RMobileSmsMessaging::TMobileSmsReceiveAttributesV1Pckg receivedSmsAttributesPckg(receivedSmsAttributes);
       
  3474 	RMobileSmsMessaging::TMobileSmsGsmTpdu gsmMsg;
       
  3475 	smsMessaging.ReceiveMessage(receiveSmsRequestStatus, gsmMsg, receivedSmsAttributesPckg);
       
  3476 
       
  3477 	// Send a class 2 SMS message with RMobileSmsMessaging::SendMessage to the board 
       
  3478 	TBuf8<140> text(_L8("BA-CTSY-INT-SMSM-0026.1"));
       
  3479 	RMobileSmsMessaging::TMobileSmsSendAttributesV1 sendSmsAttributes;
       
  3480 	RMobileSmsMessaging::TMobileSmsSendAttributesV1Pckg sendSmsAttributesPckg(sendSmsAttributes);
       
  3481 	RMobileSmsMessaging::TMobileSmsGsmTpdu pdu = CreateValidSmsMessageL(text, sendSmsAttributes,TSmsStoreTsyTestHelper::EClass2DataCodingScheme,ETrue);	
       
  3482 	TExtEtelRequestStatus sendSmsRequestStatus(smsMessaging, EMobileSmsMessagingSendMessage);
       
  3483 	CleanupStack::PushL(sendSmsRequestStatus);
       
  3484 	smsMessaging.SendMessage(sendSmsRequestStatus, pdu, sendSmsAttributesPckg);
       
  3485 	ASSERT_EQUALS(WaitForRequestWithTimeOut(sendSmsRequestStatus, ETimeMedium),
       
  3486 			KErrNone, _L("RMobileSmsMessaging::SendMessage timed out."));
       
  3487 	ASSERT_EQUALS(sendSmsRequestStatus.Int(), KErrNone, 
       
  3488 			_L("RMobileSmsMessaging::SendMessage completed with incorrect status"));
       
  3489 
       
  3490 	// Check no error is returned in aMsgAttributes.iSubmitReport
       
  3491 	ASSERT_TRUE(sendSmsAttributes.iSubmitReport.Length() > 0, 
       
  3492 			_L("RMobileSmsMessaging::TMobileSmsSendAttributesV1.iSubmitReport has zero length."));
       
  3493 	TUint wantedBits = RMobileSmsMessaging::KGsmSubmitReport; 
       
  3494 	ASSERT_BITS_SET(sendSmsAttributes.iFlags,wantedBits,KNoUnwantedBits, 
       
  3495 			_L("RMobileSmsMessaging::TMobileSmsSendAttributesV1 has no submit report in iFlags."));			
       
  3496 
       
  3497 	// Check RMobileSmsMessaging::ReceiveMessage completes with the correct message data in aMsgData
       
  3498 	ASSERT_EQUALS(WaitForRequestWithTimeOut(receiveSmsRequestStatus, ETimeVeryLong),
       
  3499 			KErrNone, _L("RMobileSmsMessaging::ReceiveMessage returned with error."));	
       
  3500 	ASSERT_EQUALS(receiveSmsRequestStatus.Int(), KErrNone, 
       
  3501 			_L("RMobileSmsMessaging::ReceiveMessage returned with error."));	
       
  3502 	ASSERT_TRUE(ComparePDUs(gsmMsg,pdu),_L("RMobileSmsMessaging::ReceiveMessage return wrong message"));
       
  3503 
       
  3504 
       
  3505 	// post notifier for RMobilePhoneStore::NotifyStoreEvent
       
  3506 	TExtEtelRequestStatus notifyStoreEventStatus (smsStore,EMobilePhoneStoreNotifyStoreEvent);	
       
  3507 	CleanupStack::PushL(notifyStoreEventStatus);
       
  3508 	TUint32 storeEvent;
       
  3509 	TInt index;
       
  3510 	smsStore.NotifyStoreEvent(notifyStoreEventStatus, storeEvent, index);
       
  3511 
       
  3512 	// Write the received SMS message to the SMS store using RMobilePhoneStore::Write 
       
  3513 	RMobileSmsStore::TMobileGsmSmsEntryV1 entry;
       
  3514 	RMobileSmsStore::TMobileGsmSmsEntryV1Pckg pckgEntry(entry);
       
  3515  	entry.iServiceCentre.iTypeOfNumber =  receivedSmsAttributes.iGsmServiceCentre.iTypeOfNumber; 
       
  3516  	entry.iServiceCentre.iNumberPlan = receivedSmsAttributes.iGsmServiceCentre.iNumberPlan; 
       
  3517  	entry.iServiceCentre.iTelNumber = receivedSmsAttributes.iGsmServiceCentre.iTelNumber;  
       
  3518 	entry.iMsgStatus = RMobileSmsStore::EStoredMessageUnread;
       
  3519 	entry.iMsgData=gsmMsg;
       
  3520 	entry.iIndex = clearSpace;
       
  3521 	TExtEtelRequestStatus writeStatus(smsStore, EMobilePhoneStoreWrite);	
       
  3522 	CleanupStack::PushL(writeStatus);
       
  3523 	smsStore.Write(writeStatus,pckgEntry);
       
  3524 	ASSERT_EQUALS(WaitForRequestWithTimeOut(writeStatus, ETimeMedium),KErrNone, _L("RMobileSmsStore::Write timed out"));
       
  3525 	ASSERT_EQUALS(writeStatus.Int(), KErrNone, _L("RMobileSmsStore::Write returned an error"));
       
  3526 
       
  3527 	// Check RMobilePhoneStore::NotifyStoreEvent completes with RMobilePhoneStore::KStoreEntryAdded
       
  3528 	RMobilePhoneStore::TMobileStoreEvent expectedEvent = RMobilePhoneStore::KStoreEntryAdded ;
       
  3529 	iSmsStoreTsyTestHelper.WaitForSmsStoreNotifyStoreEvent( smsStore,
       
  3530 			notifyStoreEventStatus,
       
  3531 			storeEvent,
       
  3532 			expectedEvent,
       
  3533 			index);
       
  3534 
       
  3535 	// Acknowledge that the SMS has been decoded and stored with RMobileSmsMessaging::AckSmsStored sending the delivery report in aMsgData 
       
  3536 	TExtEtelRequestStatus ackStatus(smsMessaging, EMobileSmsMessagingAckSmsStored);	
       
  3537 	CleanupStack::PushL(ackStatus);
       
  3538 	RMobileSmsMessaging::TMobileSmsGsmTpdu ackPdu;
       
  3539 	ackPdu.SetLength(0);
       
  3540 	TUint8 messageTypeIndicator=0x00; //0 deliver and deliver report; 1 submit and submit report; 2 status report and command
       
  3541 	TUint8 userDataHeaderIndicator=0x00; //0 no header; 0x40 has header
       
  3542 	ackPdu.Append(messageTypeIndicator | userDataHeaderIndicator);
       
  3543 	TUint8 tpParameterIndicator=0x00;
       
  3544 	ackPdu.Append(tpParameterIndicator);
       
  3545 	smsMessaging.AckSmsStored(ackStatus,ackPdu);
       
  3546 	ASSERT_EQUALS(WaitForRequestWithTimeOut(ackStatus, ETimeVeryLong),KErrNone, _L("RMobilePhone::AckSmsStored timed out"));
       
  3547 	ASSERT_EQUALS(ackStatus.Int(), KErrNone, _L("RMobilePhone::AckSmsStored returned an error"));
       
  3548 
       
  3549 	// Read the SMS message that has just been stored and check that the contents is the same as that received 
       
  3550 	RMobileSmsStore::TMobileGsmSmsEntryV1 readEntry;
       
  3551 	RMobileSmsStore::TMobileGsmSmsEntryV1Pckg readEntryPckg(readEntry);
       
  3552 	readEntry.iIndex = clearSpace;
       
  3553 	readEntry.iMsgData.Zero();
       
  3554 	readEntry.iMsgStatus = RMobileSmsStore::EStoredMessageUnknownStatus;
       
  3555 	TExtEtelRequestStatus readStatus (smsStore,EMobilePhoneStoreRead);	
       
  3556 	CleanupStack::PushL(readStatus);	
       
  3557 	smsStore.Read(readStatus,readEntryPckg);	
       
  3558 	ASSERT_EQUALS(WaitForRequestWithTimeOut(readStatus, ETimeMedium),KErrNone,_L("RMobileSmsStore::Read timed out"));
       
  3559 	ASSERT_EQUALS(readStatus.Int(), KErrNone, _L("RMobileSmsStore::Read returned an error"));
       
  3560 	ASSERT_EQUALS(readEntry.iMsgStatus,RMobileSmsStore::EStoredMessageUnread,_L("RMobileSmsStore::Read returned incorrect data"));
       
  3561 	ASSERT_EQUALS(readEntry.iServiceCentre.iTypeOfNumber,receivedSmsAttributes.iGsmServiceCentre.iTypeOfNumber,_L("RMobileSmsStore::Read returned incorrect data"));
       
  3562 	ASSERT_EQUALS(readEntry.iServiceCentre.iNumberPlan,receivedSmsAttributes.iGsmServiceCentre.iNumberPlan,_L("RMobileSmsStore::Read returned incorrect data"));
       
  3563 	ASSERT_EQUALS_DES16(readEntry.iServiceCentre.iTelNumber,receivedSmsAttributes.iGsmServiceCentre.iTelNumber,_L("RMobileSmsStore::Read returned incorrect data"));
       
  3564 	ASSERT_EQUALS_DES8(readEntry.iMsgData,gsmMsg,_L("RMobileSmsStore::Read returned incorrect data"));
       
  3565 
       
  3566 	
       
  3567 	//
       
  3568 	// TEST END
       
  3569 	//
       
  3570 
       
  3571     StartCleanup();
       
  3572 	
       
  3573 	// Pop:
       
  3574 	//	readStatus
       
  3575 	//	ackStatus
       
  3576 	//	writeStatus
       
  3577 	//	notifyStoreEventStatus
       
  3578 	//	sendSmsRequestStatus
       
  3579 	//	receiveSmsRequestStatus
       
  3580 	//	getInfoStatus
       
  3581 	CleanupStack::PopAndDestroy(7,&getInfoStatus);
       
  3582 	
       
  3583 	return TestStepResult();
       
  3584 	}
       
  3585 
       
  3586 TPtrC CCTSYIntegrationTestSmsMessaging0026::GetTestStepName()
       
  3587 /**
       
  3588  * @return The test step name.
       
  3589  */
       
  3590 	{
       
  3591 	return _L("CCTSYIntegrationTestSmsMessaging0026");
       
  3592 	}
       
  3593 
       
  3594 
       
  3595 
       
  3596 CCTSYIntegrationTestSmsMessaging0027::CCTSYIntegrationTestSmsMessaging0027(CEtelSessionMgr& aEtelSessionMgr)
       
  3597 	: CCTSYIntegrationTestSmsMessagingBase(aEtelSessionMgr)
       
  3598 /**
       
  3599  * Constructor.
       
  3600  */
       
  3601 	{
       
  3602 	SetTestStepName(CCTSYIntegrationTestSmsMessaging0027::GetTestStepName());
       
  3603 	}
       
  3604 
       
  3605 CCTSYIntegrationTestSmsMessaging0027::~CCTSYIntegrationTestSmsMessaging0027()
       
  3606 /**
       
  3607  * Destructor.
       
  3608  */
       
  3609 	{
       
  3610 	}
       
  3611 
       
  3612 TVerdict CCTSYIntegrationTestSmsMessaging0027::doTestStepL()
       
  3613 /**
       
  3614  * @SYMTestCaseID BA-CTSY-INT-SMSM-0027
       
  3615  * @SYMFssID BA/CTSY/SMSM-0027
       
  3616  * @SYMTestCaseDesc Receive a class 3 SMS message
       
  3617  * @SYMTestPriority High
       
  3618  * @SYMTestActions RMobileSmsMessaging::ReceiveMessage
       
  3619  * @SYMTestExpectedResults Pass - SMS message is received.
       
  3620  * @SYMTestType CIT
       
  3621  * @SYMTestCaseDependencies live/automatic
       
  3622  *
       
  3623  * Reason for test: Verify message received.
       
  3624  *
       
  3625  * @return - TVerdict code
       
  3626  */
       
  3627 	{
       
  3628 
       
  3629 	//
       
  3630 	// SET UP
       
  3631 	//
       
  3632 
       
  3633 	
       
  3634 	// Ensure that RMobileSmsMessaging::GetReceiveMode returns aReceiveMode = EReceiveUnstoredClientAck 
       
  3635 	RMobileSmsMessaging &smsMessaging = iEtelSessionMgr.GetSmsMessagingL( KMainServer, KMainPhone, KMainSmsMessaging);
       
  3636 	RMobileSmsMessaging::TMobileSmsReceiveMode receiveMode;	
       
  3637 	CHECK_EQUALS_L(smsMessaging.GetReceiveMode(receiveMode), KErrNone,
       
  3638 			_L("RMobileSmsMessaging::GetReceiveMode returned with an error."));
       
  3639 	CHECK_EQUALS_L(receiveMode, RMobileSmsMessaging::EReceiveUnstoredClientAck,
       
  3640 			_L("RMobileSmsMessaging::GetReceiveMode returned with incorrect mode."));
       
  3641 
       
  3642 
       
  3643 	//
       
  3644 	// SET UP END
       
  3645 	//
       
  3646 	
       
  3647 	StartTest();
       
  3648 	
       
  3649 	//
       
  3650 	// TEST START
       
  3651 	//
       
  3652 	
       
  3653 	
       
  3654 	// Call RMobileSmsMessaging::ReceiveMessage to wait for an incoming SMS 
       
  3655 	TExtEtelRequestStatus receiveSmsRequestStatus(smsMessaging,EMobileSmsMessagingReceiveMessage);
       
  3656 	CleanupStack::PushL(receiveSmsRequestStatus);
       
  3657 	RMobileSmsMessaging::TMobileSmsReceiveAttributesV1 receivedSmsAttributes;
       
  3658 	RMobileSmsMessaging::TMobileSmsReceiveAttributesV1Pckg receivedSmsAttributesPckg(receivedSmsAttributes);
       
  3659 	RMobileSmsMessaging::TMobileSmsGsmTpdu gsmMsg;
       
  3660 	smsMessaging.ReceiveMessage(receiveSmsRequestStatus, gsmMsg, receivedSmsAttributesPckg);
       
  3661 
       
  3662 	// Send a class 3 SMS message with RMobileSmsMessaging::SendMessage to the board 
       
  3663 	TBuf8<140> text(_L8("bAA Hello Mobile AAb"));
       
  3664 	RMobileSmsMessaging::TMobileSmsSendAttributesV1 sendSmsAttributes;
       
  3665 	RMobileSmsMessaging::TMobileSmsSendAttributesV1Pckg sendSmsAttributesPckg(sendSmsAttributes);
       
  3666 	RMobileSmsMessaging::TMobileSmsGsmTpdu pdu = CreateValidSmsMessageL(text, sendSmsAttributes,TSmsStoreTsyTestHelper::EClass3DataCodingScheme,ETrue);	
       
  3667 	TExtEtelRequestStatus sendSmsRequestStatus(smsMessaging, EMobileSmsMessagingSendMessage);
       
  3668 	CleanupStack::PushL(sendSmsRequestStatus);
       
  3669 	smsMessaging.SendMessage(sendSmsRequestStatus, pdu, sendSmsAttributesPckg);
       
  3670 	ASSERT_EQUALS(WaitForRequestWithTimeOut(sendSmsRequestStatus, ETimeMedium),
       
  3671 			KErrNone, _L("RMobileSmsMessaging::SendMessage timed out."));
       
  3672 	ASSERT_EQUALS(sendSmsRequestStatus.Int(), KErrNone, 
       
  3673 			_L("RMobileSmsMessaging::SendMessage completed with incorrect status"));
       
  3674 
       
  3675 	// Check no error is returned in aMsgAttributes.iSubmitReport
       
  3676 	ASSERT_TRUE(sendSmsAttributes.iSubmitReport.Length() > 0, 
       
  3677 			_L("RMobileSmsMessaging::TMobileSmsSendAttributesV1.iSubmitReport has zero length."));
       
  3678 	TUint wantedBits = RMobileSmsMessaging::KGsmSubmitReport; 
       
  3679 	ASSERT_BITS_SET(sendSmsAttributes.iFlags,wantedBits,KNoUnwantedBits, 
       
  3680 			_L("RMobileSmsMessaging::TMobileSmsSendAttributesV1 has no submit report in iFlags."));			
       
  3681 
       
  3682 	// Check RMobileSmsMessaging::ReceiveMessage completes with the correct message data in aMsgData
       
  3683 	ASSERT_EQUALS(WaitForRequestWithTimeOut(receiveSmsRequestStatus, ETimeVeryLong),
       
  3684 			KErrNone, _L("RMobileSmsMessaging::ReceiveMessage returned with error."));	
       
  3685 	ASSERT_EQUALS(receiveSmsRequestStatus.Int(), KErrNone, 
       
  3686 			_L("RMobileSmsMessaging::ReceiveMessage returned with error."));	
       
  3687 	ASSERT_TRUE(ComparePDUs(gsmMsg,pdu),_L("RMobileSmsMessaging::ReceiveMessage return wrong message"));
       
  3688 
       
  3689 	
       
  3690 	//
       
  3691 	// TEST END
       
  3692 	//
       
  3693 
       
  3694     StartCleanup();
       
  3695 	
       
  3696 	// Pop:
       
  3697 	//	sendSmsRequestStatus
       
  3698 	//	receiveSmsRequestStatus
       
  3699 	CleanupStack::PopAndDestroy(2,&receiveSmsRequestStatus);
       
  3700 	
       
  3701 	return TestStepResult();
       
  3702 	}
       
  3703 
       
  3704 TPtrC CCTSYIntegrationTestSmsMessaging0027::GetTestStepName()
       
  3705 /**
       
  3706  * @return The test step name.
       
  3707  */
       
  3708 	{
       
  3709 	return _L("CCTSYIntegrationTestSmsMessaging0027");
       
  3710 	}
       
  3711 
       
  3712 
       
  3713 
       
  3714 CCTSYIntegrationTestSmsMessaging0028::CCTSYIntegrationTestSmsMessaging0028(CEtelSessionMgr& aEtelSessionMgr)
       
  3715 	: CCTSYIntegrationTestSmsMessagingBase(aEtelSessionMgr)
       
  3716 /**
       
  3717  * Constructor.
       
  3718  */
       
  3719 	{
       
  3720 	SetTestStepName(CCTSYIntegrationTestSmsMessaging0028::GetTestStepName());
       
  3721 	}
       
  3722 
       
  3723 CCTSYIntegrationTestSmsMessaging0028::~CCTSYIntegrationTestSmsMessaging0028()
       
  3724 /**
       
  3725  * Destructor.
       
  3726  */
       
  3727 	{
       
  3728 	}
       
  3729 
       
  3730 TVerdict CCTSYIntegrationTestSmsMessaging0028::doTestStepL()
       
  3731 /**
       
  3732  * @SYMTestCaseID BA-CTSY-INT-SMSM-0028
       
  3733  * @SYMFssID BA/CTSY/SMSM-0028
       
  3734  * @SYMTestCaseDesc Receive a class 0 SMS message when the SMS store is full
       
  3735  * @SYMTestPriority High
       
  3736  * @SYMTestActions RMobileSmsMessaging::ReceiveMessage
       
  3737  * @SYMTestExpectedResults Pass - SMS message is received.
       
  3738  * @SYMTestType CIT
       
  3739  * @SYMTestCaseDependencies live/automatic
       
  3740  *
       
  3741  * Reason for test: Verify message received.
       
  3742  *
       
  3743  * @return - TVerdict code
       
  3744  */
       
  3745 	{
       
  3746 
       
  3747 	//
       
  3748 	// SET UP
       
  3749 	//
       
  3750 
       
  3751 	
       
  3752 	// Ensure that RMobileSmsMessaging::GetReceiveMode returns aReceiveMode = EReceiveUnstoredClientAck 
       
  3753 	RMobilePhone& phone = iEtelSessionMgr.GetPhoneL(KMainServer,KMainPhone);
       
  3754 	RMobileSmsMessaging &smsMessaging = iEtelSessionMgr.GetSmsMessagingL( KMainServer, KMainPhone, KMainSmsMessaging);
       
  3755 	RMobileSmsMessaging::TMobileSmsReceiveMode receiveMode;	
       
  3756 	CHECK_EQUALS_L(smsMessaging.GetReceiveMode(receiveMode), KErrNone,
       
  3757 			_L("RMobileSmsMessaging::GetReceiveMode returned with an error."));
       
  3758 	CHECK_EQUALS_L(receiveMode, RMobileSmsMessaging::EReceiveUnstoredClientAck,
       
  3759 			_L("RMobileSmsMessaging::GetReceiveMode returned with incorrect mode."));
       
  3760 
       
  3761 	// Ensure that the SMS store is full 
       
  3762 	RMobileSmsStore& smsStore = iEtelSessionMgr.GetSmsStoreL(KMainServer,KMainPhone,KMainSmsMessaging,KIccSmsStore);
       
  3763     CHECK_TRUE_L(iSmsStoreTsyTestHelper.EnsureStoreFullL(smsStore),_L("TSmsStoreTsyTestHelper::EnsureStoreFullL returned an error"));
       
  3764 
       
  3765 	//
       
  3766 	// SET UP END
       
  3767 	//
       
  3768 	
       
  3769 	StartTest();
       
  3770 	
       
  3771 	//
       
  3772 	// TEST START
       
  3773 	//
       
  3774 	
       
  3775 	
       
  3776 	// ===  Receive a class 0 message when the SMS store is full ===
       
  3777 
       
  3778 	// Call RMobileSmsMessaging::ReceiveMessage to wait for an incoming SMS 
       
  3779 	TExtEtelRequestStatus receiveSmsRequestStatus(smsMessaging,EMobileSmsMessagingReceiveMessage);
       
  3780 	CleanupStack::PushL(receiveSmsRequestStatus);
       
  3781 	RMobileSmsMessaging::TMobileSmsReceiveAttributesV1 receivedSmsAttributes;
       
  3782 	RMobileSmsMessaging::TMobileSmsReceiveAttributesV1Pckg receivedSmsAttributesPckg(receivedSmsAttributes);
       
  3783 	RMobileSmsMessaging::TMobileSmsGsmTpdu gsmMsg;
       
  3784 	smsMessaging.ReceiveMessage(receiveSmsRequestStatus, gsmMsg, receivedSmsAttributesPckg);
       
  3785 
       
  3786 	// Send a class 0 SMS message with RMobileSmsMessaging::SendMessage to the board 
       
  3787 	TBuf8<140> text1(_L8("BA-CTSY-INT-SMSM-0028.1"));
       
  3788 	RMobileSmsMessaging::TMobileSmsSendAttributesV1 sendSmsAttributes;
       
  3789 	RMobileSmsMessaging::TMobileSmsSendAttributesV1Pckg sendSmsAttributesPckg(sendSmsAttributes);
       
  3790 	RMobileSmsMessaging::TMobileSmsGsmTpdu pdu = CreateValidSmsMessageL(text1, sendSmsAttributes,TSmsStoreTsyTestHelper::EClass0DataCodingScheme,ETrue);	
       
  3791 	TExtEtelRequestStatus sendSmsRequestStatus(smsMessaging, EMobileSmsMessagingSendMessage);
       
  3792 	CleanupStack::PushL(sendSmsRequestStatus);
       
  3793 	smsMessaging.SendMessage(sendSmsRequestStatus, pdu, sendSmsAttributesPckg);
       
  3794 	ASSERT_EQUALS(WaitForRequestWithTimeOut(sendSmsRequestStatus, ETimeMedium),
       
  3795 			KErrNone, _L("RMobileSmsMessaging::SendMessage timed out."));
       
  3796 	ASSERT_EQUALS(sendSmsRequestStatus.Int(), KErrNone, 
       
  3797 			_L("RMobileSmsMessaging::SendMessage completed with incorrect status"));
       
  3798 
       
  3799 	// Check no error is returned in aMsgAttributes.iSubmitReport
       
  3800 	ASSERT_TRUE(sendSmsAttributes.iSubmitReport.Length() > 0, 
       
  3801 			_L("RMobileSmsMessaging::TMobileSmsSendAttributesV1.iSubmitReport has zero length."));
       
  3802 	TUint wantedBits = RMobileSmsMessaging::KGsmSubmitReport; 
       
  3803 	ASSERT_BITS_SET(sendSmsAttributes.iFlags,wantedBits,KNoUnwantedBits, 
       
  3804 			_L("RMobileSmsMessaging::TMobileSmsSendAttributesV1 has no submit report in iFlags."));			
       
  3805 
       
  3806 	// Check RMobileSmsMessaging::ReceiveMessage completes with the correct message data in aMsgData
       
  3807 	ASSERT_EQUALS(WaitForRequestWithTimeOut(receiveSmsRequestStatus, ETimeVeryLong),
       
  3808 			KErrNone, _L("RMobileSmsMessaging::ReceiveMessage returned with error."));	
       
  3809 	ASSERT_EQUALS(receiveSmsRequestStatus.Int(), KErrNone, 
       
  3810 			_L("RMobileSmsMessaging::ReceiveMessage returned with error."));	
       
  3811 	ASSERT_TRUE(ComparePDUs(gsmMsg,pdu),_L("RMobileSmsMessaging::ReceiveMessage return wrong message"));
       
  3812 
       
  3813 	
       
  3814 	//
       
  3815 	// TEST END
       
  3816 	//
       
  3817 
       
  3818     StartCleanup();
       
  3819 	
       
  3820 	// Pop:
       
  3821 	//	sendSmsRequestStatus
       
  3822 	//	receiveSmsRequestStatus
       
  3823 	CleanupStack::PopAndDestroy(2,&receiveSmsRequestStatus);
       
  3824 	
       
  3825 	return TestStepResult();
       
  3826 	}
       
  3827 
       
  3828 TPtrC CCTSYIntegrationTestSmsMessaging0028::GetTestStepName()
       
  3829 /**
       
  3830  * @return The test step name.
       
  3831  */
       
  3832 	{
       
  3833 	return _L("CCTSYIntegrationTestSmsMessaging0028");
       
  3834 	}
       
  3835 
       
  3836 
       
  3837 
       
  3838 CCTSYIntegrationTestSmsMessaging0029::CCTSYIntegrationTestSmsMessaging0029(CEtelSessionMgr& aEtelSessionMgr)
       
  3839 	: CCTSYIntegrationTestSmsMessagingBase(aEtelSessionMgr)
       
  3840 /**
       
  3841  * Constructor.
       
  3842  */
       
  3843 	{
       
  3844 	SetTestStepName(CCTSYIntegrationTestSmsMessaging0029::GetTestStepName());
       
  3845 	}
       
  3846 
       
  3847 CCTSYIntegrationTestSmsMessaging0029::~CCTSYIntegrationTestSmsMessaging0029()
       
  3848 /**
       
  3849  * Destructor.
       
  3850  */
       
  3851 	{
       
  3852 	}
       
  3853 
       
  3854 TVerdict CCTSYIntegrationTestSmsMessaging0029::doTestStepL()
       
  3855 /**
       
  3856  * @SYMTestCaseID BA-CTSY-INT-SMSM-0029
       
  3857  * @SYMFssID BA/CTSY/SMSM-0029
       
  3858  * @SYMTestCaseDesc Receive class 2 SMS when store is full and resume SMS reception
       
  3859  * @SYMTestPriority High
       
  3860  * @SYMTestActions RMobileSmsMessaging::NackSmsStored, RMobileSmsMessaging::AckSmsStored, RMobileSmsMessaging::ResumeSmsReception, RMobileSmsMessaging::ReceiveMessage
       
  3861  * @SYMTestExpectedResults Pass - Acknowledgements can be sent to the network and SMS reception can be resumed.
       
  3862  * @SYMTestType CIT
       
  3863  * @SYMTestCaseDependencies live/automatic
       
  3864  *
       
  3865  * Reason for test: Verify message received.
       
  3866  *
       
  3867  * @return - TVerdict code
       
  3868  */
       
  3869 	{
       
  3870 
       
  3871 	//
       
  3872 	// SET UP
       
  3873 	//
       
  3874 
       
  3875 	// Ensure that the SMS store is not full 
       
  3876 	RMobileSmsStore& smsStore = iEtelSessionMgr.GetSmsStoreL(KMainServer,KMainPhone,KMainSmsMessaging,KIccSmsStore);
       
  3877 	RMobilePhone& phone = iEtelSessionMgr.GetPhoneL(KMainServer,KMainPhone);
       
  3878 	RMobileSmsMessaging &smsMessaging = iEtelSessionMgr.GetSmsMessagingL( KMainServer, KMainPhone, KMainSmsMessaging);
       
  3879 	RMobilePhoneStore::TMobilePhoneStoreInfoV1 storeInfo;
       
  3880 	TInt clearSpace=iSimTsyTestHelper.EnsureEmptyStoreSpaceL(smsStore,KETelIccSmsStore,storeInfo,phone);
       
  3881 	CHECK_TRUE_L(clearSpace>=0,_L("TSimTsyTestHelper::TSimTsyTestHelper::EnsureEmptyStoreSpaceL returned an error"));
       
  3882 	
       
  3883 	// Ensure that RMobileSmsMessaging::GetReceiveMode returns aReceiveMode = EReceiveUnstoredClientAck 
       
  3884 	RMobileSmsMessaging::TMobileSmsReceiveMode receiveMode;	
       
  3885 	CHECK_EQUALS_L(smsMessaging.GetReceiveMode(receiveMode), KErrNone,
       
  3886 		_L("RMobileSmsMessaging::GetReceiveMode returned with an error."));
       
  3887 	CHECK_EQUALS_L(receiveMode, RMobileSmsMessaging::EReceiveUnstoredClientAck,
       
  3888 		_L("RMobileSmsMessaging::GetReceiveMode returned with incorrect mode."));
       
  3889     iNetworkTsyTestHelper.WaitForRegisteredOnHomeNetworkL(phone);
       
  3890 
       
  3891 	//
       
  3892 	// SET UP END
       
  3893 	//
       
  3894 	
       
  3895 	StartTest();
       
  3896 	
       
  3897 	//
       
  3898 	// TEST START
       
  3899 	//
       
  3900 	
       
  3901 	// ===  Part 1 - Receive 1 SMS then tell network that memory is full ===
       
  3902 
       
  3903 	// ===  Receive a class 2 SMS message ===
       
  3904 
       
  3905 	// Call RMobileSmsMessaging::ReceiveMessage to wait for an incoming SMS 
       
  3906 	TExtEtelRequestStatus receiveSmsRequestStatus(smsMessaging,EMobileSmsMessagingReceiveMessage);
       
  3907 	CleanupStack::PushL(receiveSmsRequestStatus);
       
  3908 	RMobileSmsMessaging::TMobileSmsReceiveAttributesV1 receivedSmsAttributes;
       
  3909 	RMobileSmsMessaging::TMobileSmsReceiveAttributesV1Pckg receivedSmsAttributesPckg(receivedSmsAttributes);
       
  3910 	RMobileSmsMessaging::TMobileSmsGsmTpdu gsmMsg;
       
  3911 	smsMessaging.ReceiveMessage(receiveSmsRequestStatus, gsmMsg, receivedSmsAttributesPckg);
       
  3912 
       
  3913 	// Send a class 2 SMS message with RMobileSmsMessaging::SendMessage to the board 
       
  3914 	TBuf8<140> text(_L8("first 29"));
       
  3915 	RMobileSmsMessaging::TMobileSmsSendAttributesV1 sendSmsAttributes;
       
  3916 	RMobileSmsMessaging::TMobileSmsSendAttributesV1Pckg sendSmsAttributesPckg(sendSmsAttributes);
       
  3917 	RMobileSmsMessaging::TMobileSmsGsmTpdu pdu = CreateValidSmsMessageL(text, sendSmsAttributes,TSmsStoreTsyTestHelper::EClass2DataCodingScheme,ETrue);	
       
  3918 	TExtEtelRequestStatus sendSmsRequestStatus(smsMessaging, EMobileSmsMessagingSendMessage);
       
  3919 	CleanupStack::PushL(sendSmsRequestStatus);
       
  3920 	smsMessaging.SendMessage(sendSmsRequestStatus, pdu, sendSmsAttributesPckg);
       
  3921 	ASSERT_EQUALS(WaitForRequestWithTimeOut(sendSmsRequestStatus, ETimeMedium),
       
  3922 			KErrNone, _L("RMobileSmsMessaging::SendMessage timed out."));
       
  3923 	ASSERT_EQUALS(sendSmsRequestStatus.Int(), KErrNone, 
       
  3924 			_L("RMobileSmsMessaging::SendMessage completed with incorrect status"));
       
  3925 
       
  3926 	// Check no error is returned in aMsgAttributes.iSubmitReport
       
  3927 	ASSERT_TRUE(sendSmsAttributes.iSubmitReport.Length() > 0, 
       
  3928 			_L("RMobileSmsMessaging::TMobileSmsSendAttributesV1.iSubmitReport has zero length."));
       
  3929 	TUint wantedBits = RMobileSmsMessaging::KGsmSubmitReport; 
       
  3930 	ASSERT_BITS_SET(sendSmsAttributes.iFlags,wantedBits,KNoUnwantedBits, 
       
  3931 			_L("RMobileSmsMessaging::TMobileSmsSendAttributesV1 has no submit report in iFlags."));			
       
  3932 
       
  3933 	// Check RMobileSmsMessaging::ReceiveMessage completes with the correct message data in aMsgData
       
  3934 	ASSERT_EQUALS(WaitForRequestWithTimeOut(receiveSmsRequestStatus, ETimeVeryLong),
       
  3935 			KErrNone, _L("RMobileSmsMessaging::ReceiveMessage returned with error."));	
       
  3936 	ASSERT_EQUALS(receiveSmsRequestStatus.Int(), KErrNone, 
       
  3937 			_L("RMobileSmsMessaging::ReceiveMessage returned with error."));	
       
  3938 	ASSERT_TRUE(ComparePDUs(gsmMsg,pdu),_L("RMobileSmsMessaging::ReceiveMessage return wrong message"));
       
  3939 	
       
  3940 	// ===  Tell the network that this message has been received and decoded ===
       
  3941 
       
  3942 	// ===  successfully but now the memory is full ===
       
  3943 
       
  3944 	// Acknowledge that the SMS has been decoded and stored with RMobileSmsMessaging::AckSmsStored sending the delivery report in aMsgData and indicating store is full with aFull=ETrue
       
  3945     ERR_PRINTF2(_L("<font color=Orange>$CTSYKnownFailure: defect id = %d</font>"), 10045);
       
  3946 	ASSERT_EQUALS(1,0, _L("Test leaving because it will cause TSY crash, remove this when defect is fixed"));
       
  3947 	TEST_CHECK_POINT_L(_L("test leaving..."));
       
  3948 	TExtEtelRequestStatus ackStatus(smsMessaging, EMobileSmsMessagingAckSmsStored);	
       
  3949 	CleanupStack::PushL(ackStatus);
       
  3950 	RMobileSmsMessaging::TMobileSmsGsmTpdu ackPdu;
       
  3951 	ackPdu.SetLength(0);
       
  3952 	TUint8 messageTypeIndicator=0x00; //0 deliver and deliver report; 1 submit and submit report; 2 status report and command
       
  3953 	TUint8 userDataHeaderIndicator=0x00; //0 no header; 0x40 has header
       
  3954 	ackPdu.Append(messageTypeIndicator | userDataHeaderIndicator);
       
  3955 	TUint8 tpParameterIndicator=0x00;
       
  3956 	ackPdu.Append(tpParameterIndicator);
       
  3957 	smsMessaging.AckSmsStored(ackStatus,ackPdu,ETrue );
       
  3958 	ASSERT_EQUALS(WaitForRequestWithTimeOut(ackStatus, ETimeVeryLong),KErrNone, _L("RMobilePhone::AckSmsStored timed out"));
       
  3959 	ASSERT_EQUALS(ackStatus.Int(), KErrNone, _L("RMobilePhone::AckSmsStored returned an error"));
       
  3960 
       
  3961 	// ===  Send a message to the board but check it is not received until ===
       
  3962 	// ===  SMS reception is resumed ===
       
  3963 
       
  3964 	// Ensure that the SMS store is not full 
       
  3965     ASSERT_TRUE(iSimTsyTestHelper.EnsureEmptyStoreSpaceL(smsStore,KETelIccSmsStore,storeInfo,phone)>=0,_L("TSimTsyTestHelper::EnsureEmptyStoreSpaceL returned an error"));
       
  3966 
       
  3967 	// Call RMobileSmsMessaging::ReceiveMessage to wait for an incoming SMS 
       
  3968 	smsMessaging.ReceiveMessage(receiveSmsRequestStatus, gsmMsg, receivedSmsAttributesPckg);
       
  3969 
       
  3970 	// Send a class 2 SMS message with RMobileSmsMessaging::SendMessage to the board 
       
  3971 	TBuf8<140> text2(_L8("this is the 2nd 29"));
       
  3972 	pdu = CreateValidSmsMessageL(text2, sendSmsAttributes,TSmsStoreTsyTestHelper::EClass2DataCodingScheme,ETrue);
       
  3973     
       
  3974 	smsMessaging.SendMessage(sendSmsRequestStatus, pdu, sendSmsAttributesPckg);
       
  3975 	ASSERT_EQUALS(WaitForRequestWithTimeOut(sendSmsRequestStatus, ETimeMedium),
       
  3976 			KErrNone, _L("RMobileSmsMessaging::SendMessage timed out."));
       
  3977 	ASSERT_EQUALS(sendSmsRequestStatus.Int(), KErrNone, 
       
  3978 			_L("RMobileSmsMessaging::SendMessage completed with incorrect status"));
       
  3979 
       
  3980 	// Check no error is returned in aMsgAttributes.iSubmitReport
       
  3981 	ASSERT_TRUE(sendSmsAttributes.iSubmitReport.Length() > 0, 
       
  3982 			_L("RMobileSmsMessaging::TMobileSmsSendAttributesV1.iSubmitReport has zero length."));
       
  3983 	wantedBits = RMobileSmsMessaging::KGsmSubmitReport; 
       
  3984 	ASSERT_BITS_SET(sendSmsAttributes.iFlags,wantedBits,KNoUnwantedBits, 
       
  3985 			_L("RMobileSmsMessaging::TMobileSmsSendAttributesV1 has no submit report in iFlags."));			
       
  3986 
       
  3987 	// Wait for 1 minute  
       
  3988 	User::After(60*KOneSecond);
       
  3989 	
       
  3990 	// Check RMobileSmsMessaging::ReceiveMessage is still pending
       
  3991 	ASSERT_EQUALS(receiveSmsRequestStatus.Int(),KRequestPending,_L("RMobileSmsMessaging::ReceiveMessage is not pending"));
       
  3992 
       
  3993 	// ===  Resume SMS and check message is received ===
       
  3994     
       
  3995 	// Resume SMS reception with RMobileSmsMessaging::ResumeSmsReception 
       
  3996 	TExtEtelRequestStatus resumeReceptionRequestStatus(smsMessaging, EMobileSmsMessagingResumeSmsReception);
       
  3997 	CleanupStack::PushL(resumeReceptionRequestStatus);
       
  3998 	smsMessaging.ResumeSmsReception(resumeReceptionRequestStatus);
       
  3999 	ASSERT_EQUALS(WaitForRequestWithTimeOut(resumeReceptionRequestStatus, ETimeMedium),
       
  4000 			KErrNone, _L("RMobileSmsMessaging::ResumeSmsReception timed out."));
       
  4001 	ASSERT_EQUALS(resumeReceptionRequestStatus.Int(), KErrNone, 
       
  4002     _L("RMobileSmsMessaging::ResumeSmsReception completed with incorrect status"));
       
  4003     
       
  4004 	// Check RMobileSmsMessaging::ReceiveMessage completes with the correct message data in aMsgData
       
  4005 	ASSERT_EQUALS(WaitForRequestWithTimeOut(receiveSmsRequestStatus, ETimeVeryLong),
       
  4006 			KErrNone, _L("RMobileSmsMessaging::ReceiveMessage returned with error."));	
       
  4007     DEBUG_PRINTF1(_L("BEFORE WAIT"));
       
  4008 	ASSERT_EQUALS(receiveSmsRequestStatus.Int(), KErrNone, 
       
  4009 			_L("RMobileSmsMessaging::ReceiveMessage returned with error."));	
       
  4010 	ASSERT_TRUE(ComparePDUs(gsmMsg,pdu),_L("RMobileSmsMessaging::ReceiveMessage return wrong message"));
       
  4011 
       
  4012 	// ===  Part 2 attempt to receive an SMS but tell the network memory is full. Then resume SMS reception and receive the message again ===
       
  4013 
       
  4014 	// ===  Receive an SMS message ===
       
  4015 
       
  4016 	// Ensure that the SMS store is not full 
       
  4017     ASSERT_TRUE(iSimTsyTestHelper.EnsureEmptyStoreSpaceL(smsStore,KETelIccSmsStore,storeInfo,phone)>=0,_L("TSimTsyTestHelper::EnsureEmptyStoreSpaceL returned an error"));
       
  4018 
       
  4019 	// Call RMobileSmsMessaging::ReceiveMessage to wait for an incoming SMS 
       
  4020 	smsMessaging.ReceiveMessage(receiveSmsRequestStatus, gsmMsg, receivedSmsAttributesPckg);
       
  4021 
       
  4022 	// Send a class 2 SMS message with RMobileSmsMessaging::SendMessage to the board 
       
  4023 	TBuf8<140> text3(_L8("and this is the third 29 sms"));
       
  4024 	pdu = CreateValidSmsMessageL(text3, sendSmsAttributes,TSmsStoreTsyTestHelper::EClass2DataCodingScheme,ETrue);	
       
  4025 	smsMessaging.SendMessage(sendSmsRequestStatus, pdu, sendSmsAttributesPckg);
       
  4026 	ASSERT_EQUALS(WaitForRequestWithTimeOut(sendSmsRequestStatus, ETimeMedium),
       
  4027 			KErrNone, _L("RMobileSmsMessaging::SendMessage timed out."));
       
  4028 	ASSERT_EQUALS(sendSmsRequestStatus.Int(), KErrNone, 
       
  4029 			_L("RMobileSmsMessaging::SendMessage completed with incorrect status"));
       
  4030 
       
  4031 	// Check no error is returned in aMsgAttributes.iSubmitReport
       
  4032 	ASSERT_TRUE(sendSmsAttributes.iSubmitReport.Length() > 0, 
       
  4033 			_L("RMobileSmsMessaging::TMobileSmsSendAttributesV1.iSubmitReport has zero length."));
       
  4034 	wantedBits = RMobileSmsMessaging::KGsmSubmitReport; 
       
  4035 	ASSERT_BITS_SET(sendSmsAttributes.iFlags,wantedBits,KNoUnwantedBits, 
       
  4036 			_L("RMobileSmsMessaging::TMobileSmsSendAttributesV1 has no submit report in iFlags."));			
       
  4037 
       
  4038 	// Check RMobileSmsMessaging::ReceiveMessage is no longer pending
       
  4039 	ASSERT_TRUE(receiveSmsRequestStatus.Int()!=KRequestPending,_L("RMobileSmsMessaging::ReceiveMessage still pending"));
       
  4040 
       
  4041 	// ===  Send negative acknowledgement telling network that memory is full ===
       
  4042 
       
  4043 	// Return a negative acknowledgment with RMobileSmsMessaging::NackSmsStored indicating storage is full 
       
  4044 	TExtEtelRequestStatus nackStatus(smsMessaging, EMobileSmsMessagingNackSmsStored);
       
  4045 	CleanupStack::PushL(nackStatus);
       
  4046 	RMobileSmsMessaging::TMobileSmsGsmTpdu nackPdu;
       
  4047 	nackPdu.SetLength(0);
       
  4048 	messageTypeIndicator=0x00; //0 deliver and deliver report; 1 submit and submit report; 2 status report and command
       
  4049 	userDataHeaderIndicator=0x00; //0 no header; 0x40 has header
       
  4050 	nackPdu.Append(messageTypeIndicator | userDataHeaderIndicator);
       
  4051 	TUint8 failureCause=0xD0; //SIM SMS storage full
       
  4052 	nackPdu.Append(failureCause);
       
  4053 	tpParameterIndicator=0x00;
       
  4054 	nackPdu.Append(tpParameterIndicator);
       
  4055 	smsMessaging.NackSmsStored(nackStatus,nackPdu,KErrGsmSMSSimSMSStorageFull);
       
  4056 
       
  4057 	// Check RMobileSmsMessaging::ReceiveMessage is still pending
       
  4058 	ASSERT_EQUALS(receiveSmsRequestStatus.Int(),KRequestPending,_L("RMobileSmsMessaging::ReceiveMessage is not pending"));
       
  4059 
       
  4060 	// ===  Resume SMS and check message is received ===
       
  4061 
       
  4062 	// Resume SMS reception with RMobileSmsMessaging::ResumeSmsReception 
       
  4063 	smsMessaging.ResumeSmsReception(resumeReceptionRequestStatus);
       
  4064 	ASSERT_EQUALS(WaitForRequestWithTimeOut(resumeReceptionRequestStatus, ETimeMedium),
       
  4065 			KErrNone, _L("RMobileSmsMessaging::ResumeSmsReception timed out."));
       
  4066 	ASSERT_EQUALS(resumeReceptionRequestStatus.Int(), KErrNone, 
       
  4067 		_L("RMobileSmsMessaging::ResumeSmsReception completed with incorrect status"));
       
  4068 
       
  4069 	// Check RMobileSmsMessaging::ReceiveMessage completes with the correct message data in aMsgData
       
  4070 	ASSERT_EQUALS(WaitForRequestWithTimeOut(receiveSmsRequestStatus, ETimeVeryLong),
       
  4071 			KErrNone, _L("RMobileSmsMessaging::ReceiveMessage returned with error."));	
       
  4072 	ASSERT_EQUALS(receiveSmsRequestStatus.Int(), KErrNone, 
       
  4073 			_L("RMobileSmsMessaging::ReceiveMessage returned with error."));	
       
  4074 	ASSERT_TRUE(ComparePDUs(gsmMsg,pdu),_L("RMobileSmsMessaging::ReceiveMessage return wrong message"));
       
  4075 
       
  4076 
       
  4077 	
       
  4078 	//
       
  4079 	// TEST END
       
  4080 	//
       
  4081 
       
  4082     StartCleanup();
       
  4083 	
       
  4084 	// Pop:
       
  4085 	//	nackStatus
       
  4086 	//	resumeReceptionRequestStatus
       
  4087 	//	ackStatus
       
  4088 	//	sendSmsRequestStatus
       
  4089 	//	receiveSmsRequestStatus
       
  4090 	CleanupStack::PopAndDestroy(5,&receiveSmsRequestStatus);
       
  4091 	
       
  4092 	return TestStepResult();
       
  4093 	}
       
  4094 
       
  4095 TPtrC CCTSYIntegrationTestSmsMessaging0029::GetTestStepName()
       
  4096 /**
       
  4097  * @return The test step name.
       
  4098  */
       
  4099 	{
       
  4100 	return _L("CCTSYIntegrationTestSmsMessaging0029");
       
  4101 	}
       
  4102 
       
  4103 
       
  4104 
       
  4105 CCTSYIntegrationTestSmsMessaging0030::CCTSYIntegrationTestSmsMessaging0030(CEtelSessionMgr& aEtelSessionMgr)
       
  4106 	: CCTSYIntegrationTestSmsMessagingBase(aEtelSessionMgr)
       
  4107 /**
       
  4108  * Constructor.
       
  4109  */
       
  4110 	{
       
  4111 	SetTestStepName(CCTSYIntegrationTestSmsMessaging0030::GetTestStepName());
       
  4112 	}
       
  4113 
       
  4114 CCTSYIntegrationTestSmsMessaging0030::~CCTSYIntegrationTestSmsMessaging0030()
       
  4115 /**
       
  4116  * Destructor.
       
  4117  */
       
  4118 	{
       
  4119 	}
       
  4120 
       
  4121 TVerdict CCTSYIntegrationTestSmsMessaging0030::doTestStepL()
       
  4122 /**
       
  4123  * @SYMTestCaseID BA-CTSY-INT-SMSM-0030
       
  4124  * @SYMFssID BA/CTSY/SMSM-0030
       
  4125  * @SYMTestCaseDesc Send an SMS message without FDN check
       
  4126  * @SYMTestPriority High
       
  4127  * @SYMTestActions 
       
  4128  * @SYMTestExpectedResults Pass - Message sent.
       
  4129  * @SYMTestType CIT
       
  4130  * @SYMTestCaseDependencies live/automatic
       
  4131  *
       
  4132  * Reason for test: Verify message received.
       
  4133  *
       
  4134  * @return - TVerdict code
       
  4135  */
       
  4136 	{
       
  4137 
       
  4138 	//
       
  4139 	// SET UP
       
  4140 	//
       
  4141 
       
  4142 	
       
  4143 	// Ensure that RMobileSmsMessaging::GetReceiveMode returns aReceiveMode = EReceiveUnstoredClientAck 
       
  4144 
       
  4145 
       
  4146 	//
       
  4147 	// SET UP END
       
  4148 	//
       
  4149 	
       
  4150 	StartTest();
       
  4151 	
       
  4152 	//
       
  4153 	// TEST START
       
  4154 	//
       
  4155 	
       
  4156 	
       
  4157 	// Send an SMS message using RMobileSmsMessaging::SendMessageNoFdnCheck 
       
  4158 
       
  4159 	// Check no error is returned in aMsgAttributes.iSubmitReport
       
  4160 
       
  4161 	
       
  4162 	//
       
  4163 	// TEST END
       
  4164 	//
       
  4165 
       
  4166     StartCleanup();
       
  4167 	
       
  4168 	// Put any required test clean up here, then remove this comment
       
  4169 	
       
  4170 	return TestStepResult();
       
  4171 	}
       
  4172 
       
  4173 TPtrC CCTSYIntegrationTestSmsMessaging0030::GetTestStepName()
       
  4174 /**
       
  4175  * @return The test step name.
       
  4176  */
       
  4177 	{
       
  4178 	return _L("CCTSYIntegrationTestSmsMessaging0030");
       
  4179 	}
       
  4180 
       
  4181 
       
  4182 
       
  4183 CCTSYIntegrationTestSmsMessaging0031::CCTSYIntegrationTestSmsMessaging0031(CEtelSessionMgr& aEtelSessionMgr)
       
  4184 	: CCTSYIntegrationTestSmsMessagingBase(aEtelSessionMgr)
       
  4185 /**
       
  4186  * Constructor.
       
  4187  */
       
  4188 	{
       
  4189 	SetTestStepName(CCTSYIntegrationTestSmsMessaging0031::GetTestStepName());
       
  4190 	}
       
  4191 
       
  4192 CCTSYIntegrationTestSmsMessaging0031::~CCTSYIntegrationTestSmsMessaging0031()
       
  4193 /**
       
  4194  * Destructor.
       
  4195  */
       
  4196 	{
       
  4197 	}
       
  4198 
       
  4199 TVerdict CCTSYIntegrationTestSmsMessaging0031::doTestStepL()
       
  4200 /**
       
  4201  * @SYMTestCaseID BA-CTSY-INT-SMSM-0031
       
  4202  * @SYMFssID BA/CTSY/SMSM-0031
       
  4203  * @SYMTestCaseDesc Get SMS messaging caps.
       
  4204  * @SYMTestPriority High
       
  4205  * @SYMTestActions 
       
  4206  * @SYMTestExpectedResults Pass - Correct caps returned.
       
  4207  * @SYMTestType CIT
       
  4208  * @SYMTestCaseDependencies live/automatic
       
  4209  *
       
  4210  * Reason for test: Verify caps returned are correct.
       
  4211  *
       
  4212  * @return - TVerdict code
       
  4213  */
       
  4214 	{
       
  4215 
       
  4216 	//
       
  4217 	// SET UP
       
  4218 	//
       
  4219 	RMobileSmsMessaging &smsMessaging = iEtelSessionMgr.GetSmsMessagingL(KMainServer, KMainPhone, KMainSmsMessaging);
       
  4220 	
       
  4221 
       
  4222 	//
       
  4223 	// SET UP END
       
  4224 	//
       
  4225 	
       
  4226 	StartTest();
       
  4227 	
       
  4228 	//
       
  4229 	// TEST START
       
  4230 	//
       
  4231 
       
  4232 	// Check RMobileSmsMessaging::GetCaps returns aCaps.iSmsMode caps in set of RMobileSmsMessaging::KCapsGsmSms
       
  4233 	RMobileSmsMessaging::TMobileSmsCapsV1 smsCaps;
       
  4234 	RMobileSmsMessaging::TMobileSmsCapsV1Pckg smsCapsPkg(smsCaps);
       
  4235 	ASSERT_EQUALS(smsMessaging.GetCaps(smsCapsPkg), KErrNone, 
       
  4236 		_L("RMobileSmsMessaging::GetCaps returned an error."));
       
  4237 	TUint32 expectedMinCaps = RMobileSmsMessaging::KCapsGsmSms;
       
  4238 	ASSERT_BITS_SET(smsCaps.iSmsMode, expectedMinCaps, KNoUnwantedBits,
       
  4239 		_L("RMobileSmsMessaging::GetCaps miniumum capabilites not found:RMobileSmsMessaging::KCapsGsmSms."));
       
  4240 	
       
  4241 	// Check RMobileSmsMessaging::GetCaps returns aCaps.iSmsControl caps in set of RMobileSmsMessaging::KCapsReceiveUnstoredClientAck | RMobileSmsMessaging::KCapsSendWithAck | RMobileSmsMessaging::KCapsGetSmspList | RMobileSmsMessaging::KCapsSetSmspList
       
  4242 	expectedMinCaps = RMobileSmsMessaging::KCapsReceiveUnstoredClientAck | 
       
  4243 					RMobileSmsMessaging::KCapsSendWithAck |
       
  4244 				    RMobileSmsMessaging::KCapsGetSmspList |
       
  4245 				    RMobileSmsMessaging::KCapsSetSmspList;
       
  4246 	ASSERT_BITS_SET(smsCaps.iSmsControl, expectedMinCaps, KNoUnwantedBits, 
       
  4247 		_L("RMobileSmsMessaging::GetCaps returned with incorrect caps."));
       
  4248 		
       
  4249 	//
       
  4250 	// TEST END
       
  4251 	//
       
  4252 
       
  4253     StartCleanup();
       
  4254 	
       
  4255 	return TestStepResult();
       
  4256 	}
       
  4257 
       
  4258 TPtrC CCTSYIntegrationTestSmsMessaging0031::GetTestStepName()
       
  4259 /**
       
  4260  * @return The test step name.
       
  4261  */
       
  4262 	{
       
  4263 	return _L("CCTSYIntegrationTestSmsMessaging0031");
       
  4264 	}
       
  4265 
       
  4266 
       
  4267 
       
  4268 CCTSYIntegrationTestSmsMessaging0032::CCTSYIntegrationTestSmsMessaging0032(CEtelSessionMgr& aEtelSessionMgr)
       
  4269 	: CCTSYIntegrationTestSmsMessagingBase(aEtelSessionMgr)
       
  4270 /**
       
  4271  * Constructor.
       
  4272  */
       
  4273 	{
       
  4274 	SetTestStepName(CCTSYIntegrationTestSmsMessaging0032::GetTestStepName());
       
  4275 	}
       
  4276 
       
  4277 CCTSYIntegrationTestSmsMessaging0032::~CCTSYIntegrationTestSmsMessaging0032()
       
  4278 /**
       
  4279  * Destructor.
       
  4280  */
       
  4281 	{
       
  4282 	}
       
  4283 
       
  4284 TVerdict CCTSYIntegrationTestSmsMessaging0032::doTestStepL()
       
  4285 /**
       
  4286  * @SYMTestCaseID BA-CTSY-INT-SMSM-0032
       
  4287  * @SYMFssID BA/CTSY/SMSM-0032
       
  4288  * @SYMTestCaseDesc Cancel receiving an SMS message.
       
  4289  * @SYMTestPriority High
       
  4290  * @SYMTestActions 
       
  4291  * @SYMTestExpectedResults Pass - 
       
  4292  * @SYMTestType CIT
       
  4293  * @SYMTestCaseDependencies live/automatic
       
  4294  *
       
  4295  * Reason for test: Verify request is cancelled.
       
  4296  *
       
  4297  * @return - TVerdict code
       
  4298  */
       
  4299 	{
       
  4300 
       
  4301 	//
       
  4302 	// SET UP
       
  4303 	//
       
  4304 	RMobileSmsMessaging &smsMessaging = iEtelSessionMgr.GetSmsMessagingL(KMainServer, KMainPhone, KMainSmsMessaging);
       
  4305 	
       
  4306 
       
  4307 	//
       
  4308 	// SET UP END
       
  4309 	//
       
  4310 	
       
  4311 	StartTest();
       
  4312 	
       
  4313 	//
       
  4314 	// TEST START
       
  4315 	//
       
  4316 	
       
  4317 	
       
  4318 	// Request to receive an SMS message with RMobileSmsMessaging::ReceiveMessage
       
  4319 	TExtEtelRequestStatus receiveSmsRequestStatus(smsMessaging,EMobileSmsMessagingReceiveMessage);
       
  4320 	CleanupStack::PushL(receiveSmsRequestStatus);
       
  4321 	RMobileSmsMessaging::TMobileSmsReceiveAttributesV1 receivedSmsAttributes;
       
  4322 	RMobileSmsMessaging::TMobileSmsReceiveAttributesV1Pckg receivedSmsAttributesPckg(receivedSmsAttributes);
       
  4323 	RMobileSmsMessaging::TMobileSmsGsmTpdu gsmMsg;
       
  4324 	smsMessaging.ReceiveMessage(receiveSmsRequestStatus, gsmMsg, receivedSmsAttributesPckg);
       
  4325 	
       
  4326 	// Cancel the request with CancelAsyncRequest( EMobileSmsMessagingReceiveMessage ) 
       
  4327 	smsMessaging.CancelAsyncRequest(EMobileSmsMessagingReceiveMessage);
       
  4328 
       
  4329 	// Check RMobileSmsMessaging::ReceiveMessage completes with KErrCancel
       
  4330 	ASSERT_EQUALS(WaitForRequestWithTimeOut(receiveSmsRequestStatus, ETimeVeryLong),
       
  4331 		KErrNone, _L("RMobilePhone::CancelAsyncRequest returned with error."));	
       
  4332 	ASSERT_TRUE(receiveSmsRequestStatus.Int() == KErrNone || receiveSmsRequestStatus.Int() == KErrCancel, 
       
  4333 		_L("RMobilePhone::CancelAsyncRequest returned with error."));	
       
  4334 	
       
  4335 	
       
  4336 	
       
  4337 	//
       
  4338 	// TEST END
       
  4339 	//
       
  4340 
       
  4341     StartCleanup();
       
  4342 	
       
  4343 	CleanupStack::PopAndDestroy(1);
       
  4344 	
       
  4345 	return TestStepResult();
       
  4346 	}
       
  4347 
       
  4348 TPtrC CCTSYIntegrationTestSmsMessaging0032::GetTestStepName()
       
  4349 /**
       
  4350  * @return The test step name.
       
  4351  */
       
  4352 	{
       
  4353 	return _L("CCTSYIntegrationTestSmsMessaging0032");
       
  4354 	}
       
  4355 
       
  4356 
       
  4357 
       
  4358 CCTSYIntegrationTestSmsMessaging0033::CCTSYIntegrationTestSmsMessaging0033(CEtelSessionMgr& aEtelSessionMgr)
       
  4359 	: CCTSYIntegrationTestSmsMessagingBase(aEtelSessionMgr)
       
  4360 /**
       
  4361  * Constructor.
       
  4362  */
       
  4363 	{
       
  4364 	SetTestStepName(CCTSYIntegrationTestSmsMessaging0033::GetTestStepName());
       
  4365 	}
       
  4366 
       
  4367 CCTSYIntegrationTestSmsMessaging0033::~CCTSYIntegrationTestSmsMessaging0033()
       
  4368 /**
       
  4369  * Destructor.
       
  4370  */
       
  4371 	{
       
  4372 	}
       
  4373 
       
  4374 TVerdict CCTSYIntegrationTestSmsMessaging0033::doTestStepL()
       
  4375 /**
       
  4376  * @SYMTestCaseID BA-CTSY-INT-SMSM-0033
       
  4377  * @SYMFssID BA/CTSY/SMSM-0033
       
  4378  * @SYMTestCaseDesc Attempt to send  an SMS message that is too long.
       
  4379  * @SYMTestPriority High
       
  4380  * @SYMTestActions 
       
  4381  * @SYMTestExpectedResults Pass - Error returned.
       
  4382  * @SYMTestType CIT
       
  4383  * @SYMTestCaseDependencies live/automatic
       
  4384  *
       
  4385  * Reason for test: Verify error is returned.
       
  4386  *
       
  4387  * @return - TVerdict code
       
  4388  * 
       
  4389  * $CTSYProblem - The board resets when passing a messsage to LTSY which is too long.  No checking is done by the CTSY.
       
  4390  * 	No error is returned from LTSY.  The board just reboots.
       
  4391  * 
       
  4392  * 
       
  4393  */
       
  4394 	{
       
  4395 
       
  4396 	//
       
  4397 	// SET UP
       
  4398 	//
       
  4399 	RMobileSmsMessaging &smsMessaging = iEtelSessionMgr.GetSmsMessagingL(KMainServer, KMainPhone, KMainSmsMessaging);
       
  4400 	
       
  4401 	// Ensure SMS bearer is RMobileSmsMessaging::ESmsBearerCircuitPreferred 
       
  4402 	RMobileSmsMessaging::TMobileSmsBearer bearer;
       
  4403 	TExtEtelRequestStatus setBearerStatusRequest(smsMessaging, EMobileSmsMessagingSetMoSmsBearer);
       
  4404 	CleanupStack::PushL(setBearerStatusRequest);
       
  4405 	smsMessaging.SetMoSmsBearer(setBearerStatusRequest, RMobileSmsMessaging::ESmsBearerCircuitPreferred);
       
  4406 	CHECK_EQUALS_L(WaitForRequestWithTimeOut(setBearerStatusRequest, ETimeLong), KErrNone, 
       
  4407 			_L("RMobileSmsMessaging::SetMoSmsBearer timed-out"));
       
  4408 
       
  4409 	// Check RMobileSmsMessaging::GetMoSmsBearer returns KErrNotSupported
       
  4410 	TInt error = smsMessaging.GetMoSmsBearer(bearer);
       
  4411 	CHECK_EQUALS_L(error, KErrNotSupported,_L("RMobileSmsMessaging::GetMoSmsBearer returned with error."));
       
  4412 	
       
  4413 
       
  4414 	
       
  4415 	//
       
  4416 	// SET UP END
       
  4417 	//
       
  4418 	
       
  4419 	StartTest();
       
  4420 	
       
  4421 	//
       
  4422 	// TEST START
       
  4423 	//
       
  4424 	
       
  4425 	
       
  4426 	// Attempt to send an SMS message that is 206 characters with RMobileSmsMessaging::SendMessage 
       
  4427 	TExtEtelRequestStatus sendSmsRequestStatus(smsMessaging, EMobileSmsMessagingSendMessage);
       
  4428 	CleanupStack::PushL(sendSmsRequestStatus);
       
  4429 
       
  4430 	TBuf8<206> text(_L8("This is a 206 character message.  It is going to fill up the space with XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"));
       
  4431 
       
  4432 	//Read the destination and Service Centre numbers from ini file
       
  4433 	RMobileSmsMessaging::TMobileSmsSendAttributesV1 sendSmsAttributes;
       
  4434 	RMobileSmsMessaging::TMobileSmsSendAttributesV1Pckg sendSmsAttributesPckg(sendSmsAttributes);	
       
  4435 	GetSmsSendAttributesL(sendSmsAttributes);
       
  4436 
       
  4437 	// Check error is returned.  
       
  4438     // Due to LTSY crashing when a message of this length is passed, the rest of 
       
  4439     // this test case cannot be executed. If the LTSY is fixed, execute the code below.
       
  4440     /*
       
  4441     smsMessaging.SendMessage(sendSmsRequestStatus, text, sendSmsAttributesPckg);
       
  4442 	ASSERT_EQUALS(WaitForRequestWithTimeOut(sendSmsRequestStatus, ETimeMedium),
       
  4443 		KErrNone, _L("RMobileSmsMessaging::SendMessage timed out."));
       
  4444 	ASSERT_TRUE(sendSmsRequestStatus.Int() != KErrNone, 
       
  4445 		_L("RMobileSmsMessaging::SendMessage completed with incorrect status"));
       
  4446     */
       
  4447 
       
  4448 	//
       
  4449 	// TEST END
       
  4450 	//
       
  4451 
       
  4452     StartCleanup();
       
  4453 	
       
  4454     /* 	setBearerStatusRequest
       
  4455 		sendSmsRequestStatus */
       
  4456     CleanupStack::PopAndDestroy(2,&setBearerStatusRequest);
       
  4457 	
       
  4458 	return TestStepResult();
       
  4459 	}
       
  4460 
       
  4461 TPtrC CCTSYIntegrationTestSmsMessaging0033::GetTestStepName()
       
  4462 /**
       
  4463  * @return The test step name.
       
  4464  */
       
  4465 	{
       
  4466 	return _L("CCTSYIntegrationTestSmsMessaging0033");
       
  4467 	}
       
  4468 
       
  4469 
       
  4470 
       
  4471 CCTSYIntegrationTestSmsMessaging0034::CCTSYIntegrationTestSmsMessaging0034(CEtelSessionMgr& aEtelSessionMgr)
       
  4472 	: CCTSYIntegrationTestSmsMessagingBase(aEtelSessionMgr)
       
  4473 /**
       
  4474  * Constructor.
       
  4475  */
       
  4476 	{
       
  4477 	SetTestStepName(CCTSYIntegrationTestSmsMessaging0034::GetTestStepName());
       
  4478 	}
       
  4479 
       
  4480 CCTSYIntegrationTestSmsMessaging0034::~CCTSYIntegrationTestSmsMessaging0034()
       
  4481 /**
       
  4482  * Destructor.
       
  4483  */
       
  4484 	{
       
  4485 	}
       
  4486 
       
  4487 TVerdict CCTSYIntegrationTestSmsMessaging0034::doTestStepL()
       
  4488 /**
       
  4489  * @SYMTestCaseID BA-CTSY-INT-SMSM-0034
       
  4490  * @SYMFssID BA/CTSY/SMSM-0034
       
  4491  * @SYMTestCaseDesc Resume SMS Reception
       
  4492  * @SYMTestPriority High
       
  4493  * @SYMTestActions 
       
  4494  * @SYMTestExpectedResults Pass - KErrNone is returned.
       
  4495  * @SYMTestType CIT
       
  4496  * @SYMTestCaseDependencies live/automatic
       
  4497  *
       
  4498  * Reason for test: Verify KErrNone is returned
       
  4499  *
       
  4500  * @return - TVerdict code
       
  4501  */
       
  4502 	{
       
  4503 
       
  4504 	//
       
  4505 	// SET UP
       
  4506 	//
       
  4507 	RMobileSmsMessaging &smsMessaging = iEtelSessionMgr.GetSmsMessagingL(KMainServer, KMainPhone, KMainSmsMessaging);
       
  4508 	
       
  4509 
       
  4510 	//
       
  4511 	// SET UP END
       
  4512 	//
       
  4513 	
       
  4514 	StartTest();
       
  4515 	
       
  4516 	//
       
  4517 	// TEST START
       
  4518 	//
       
  4519 	
       
  4520 	
       
  4521 	// Resume SMS reception with RMobileSmsMessaging::ResumeSmsReception 
       
  4522 	TExtEtelRequestStatus resumeReceptionRequestStatus(smsMessaging, EMobileSmsMessagingResumeSmsReception);
       
  4523 	CleanupStack::PushL(resumeReceptionRequestStatus);
       
  4524 	smsMessaging.ResumeSmsReception(resumeReceptionRequestStatus);
       
  4525 	ASSERT_EQUALS(WaitForRequestWithTimeOut(resumeReceptionRequestStatus, ETimeMedium),
       
  4526 			KErrNone, _L("RMobileSmsMessaging::ResumeSmsReception timed out."));
       
  4527 	ASSERT_EQUALS(resumeReceptionRequestStatus.Int(), KErrNone, 
       
  4528 		_L("RMobileSmsMessaging::ResumeSmsReception completed with incorrect status"));
       
  4529 	
       
  4530 	
       
  4531 	//
       
  4532 	// TEST END
       
  4533 	//
       
  4534 
       
  4535     StartCleanup();
       
  4536 	
       
  4537 	// resumeReceptionRequestStatus
       
  4538 	CleanupStack::PopAndDestroy(1);
       
  4539 	
       
  4540 	return TestStepResult();
       
  4541 	}
       
  4542 
       
  4543 TPtrC CCTSYIntegrationTestSmsMessaging0034::GetTestStepName()
       
  4544 /**
       
  4545  * @return The test step name.
       
  4546  */
       
  4547 	{
       
  4548 	return _L("CCTSYIntegrationTestSmsMessaging0034");
       
  4549 	}
       
  4550 
       
  4551 
       
  4552 
       
  4553 CCTSYIntegrationTestSmsMessaging0035::CCTSYIntegrationTestSmsMessaging0035(CEtelSessionMgr& aEtelSessionMgr)
       
  4554 	: CCTSYIntegrationTestSmsMessagingBase(aEtelSessionMgr)
       
  4555 /**
       
  4556  * Constructor.
       
  4557  */
       
  4558 	{
       
  4559 	SetTestStepName(CCTSYIntegrationTestSmsMessaging0035::GetTestStepName());
       
  4560 	}
       
  4561 
       
  4562 CCTSYIntegrationTestSmsMessaging0035::~CCTSYIntegrationTestSmsMessaging0035()
       
  4563 /**
       
  4564  * Destructor.
       
  4565  */
       
  4566 	{
       
  4567 	}
       
  4568 
       
  4569 TVerdict CCTSYIntegrationTestSmsMessaging0035::doTestStepL()
       
  4570 /**
       
  4571  * @SYMTestCaseID BA-CTSY-INT-SMSM-0035
       
  4572  * @SYMFssID BA/CTSY/SMSM-0035
       
  4573  * @SYMTestCaseDesc Cancel resume SMS reception
       
  4574  * @SYMTestPriority High
       
  4575  * @SYMTestActions 
       
  4576  * @SYMTestExpectedResults Pass - KErrNone is returned.
       
  4577  * @SYMTestType CIT
       
  4578  * @SYMTestCaseDependencies live/automatic
       
  4579  *
       
  4580  * Reason for test: Verify KErrNone or KErrCancel returned
       
  4581  *
       
  4582  * @return - TVerdict code
       
  4583  */
       
  4584 	{
       
  4585 
       
  4586 	//
       
  4587 	// SET UP
       
  4588 	//
       
  4589 	RMobileSmsMessaging &smsMessaging = iEtelSessionMgr.GetSmsMessagingL(KMainServer, KMainPhone, KMainSmsMessaging);
       
  4590 	
       
  4591 
       
  4592 	//
       
  4593 	// SET UP END
       
  4594 	//
       
  4595 	
       
  4596 	StartTest();
       
  4597 	
       
  4598 	//
       
  4599 	// TEST START
       
  4600 	//
       
  4601 	
       
  4602 	
       
  4603 	// Resume SMS reception with RMobileSmsMessaging::ResumeSmsReception 
       
  4604 	TExtEtelRequestStatus resumeReceiveSmsRequestStatus(smsMessaging, EMobileSmsMessagingResumeSmsReception);
       
  4605 	CleanupStack::PushL(resumeReceiveSmsRequestStatus);
       
  4606 	smsMessaging.ResumeSmsReception(resumeReceiveSmsRequestStatus);
       
  4607 	
       
  4608 	// Cancel request with RTelSubSessionBase::CancelAsyncRequest(EMobileSmsMessagingResumeSmsReception)  
       
  4609 	smsMessaging.CancelAsyncRequest(EMobileSmsMessagingResumeSmsReception);
       
  4610 	ASSERT_EQUALS(WaitForRequestWithTimeOut(resumeReceiveSmsRequestStatus, ETimeMedium),
       
  4611 			KErrNone, _L("RMobileSmsMessaging::ResumeSmsReception timed out."));
       
  4612 	ASSERT_TRUE(resumeReceiveSmsRequestStatus.Int() == KErrNone || resumeReceiveSmsRequestStatus.Int() == KErrCancel, 
       
  4613 		_L("RMobileSmsMessaging::ResumeSmsReception completed with incorrect status"));
       
  4614 
       
  4615 	
       
  4616 	
       
  4617 	//
       
  4618 	// TEST END
       
  4619 	//
       
  4620 
       
  4621     StartCleanup();
       
  4622 	
       
  4623 	// resumeReceiveSmsRequestStatus
       
  4624 	CleanupStack::PopAndDestroy(1);
       
  4625 	
       
  4626 	return TestStepResult();
       
  4627 	}
       
  4628 
       
  4629 TPtrC CCTSYIntegrationTestSmsMessaging0035::GetTestStepName()
       
  4630 /**
       
  4631  * @return The test step name.
       
  4632  */
       
  4633 	{
       
  4634 	return _L("CCTSYIntegrationTestSmsMessaging0035");
       
  4635 	}