smsprotocols/smsstack/smsprot/Test/TE_Smsprt/te_smsprt_R6.cpp
changeset 20 244d7c5f118e
parent 0 3553901f7fa8
child 24 6638e7f4bd8f
child 38 b6a16c6baaa3
equal deleted inserted replaced
19:1f776524b15c 20:244d7c5f118e
    16 /**
    16 /**
    17  @file
    17  @file
    18 */
    18 */
    19 
    19 
    20 #include "te_smsprt_R6.h"
    20 #include "te_smsprt_R6.h"
    21 #include "e32def.h"
    21 
    22 #include "gsmunonieoperations.h"
    22 #include <gsmunonieoperations.h>
    23 
    23 #include <gsmubuf.h>
       
    24 #include <gsmuset.h>
       
    25 #include <gsmuieoperations.h>
       
    26 
       
    27 #include "smsstacktestconsts.h"
       
    28 #include "smsstacktestutilities.h"
    24 
    29 
    25 TVerdict CTestSinglePDUHyperLinks::doTestStepL()
    30 TVerdict CTestSinglePDUHyperLinks::doTestStepL()
    26 /**
    31 /**
    27  *  Test a simple Transmit and Receive of a TPDU
    32  *  Test a simple Transmit and Receive of a TPDU
    28  */
    33  */
    29 	{
    34 	{
    30 	INFO_PRINTF1(_L("Test HyperLinks in SMS message"));
    35 	INFO_PRINTF1(_L("Test HyperLinks in SMS message"));
    31 
       
    32 	__UHEAP_MARK;
       
    33 
       
    34 	RSocketServ socketServer;
       
    35 	PrepareRegTestLC(socketServer, 70);
       
    36 
       
    37 	RSocket socket;
    36 	RSocket socket;
    38 	iSmsStackTestUtils->OpenSmsSocketLC(socketServer,socket,ESmsAddrRecvAny);
    37 	iSmsStackTestUtils->OpenSmsSocketLC(iSocketServer,socket,ESmsAddrRecvAny);
    39 
    38 
    40 	//This is a 95 character msg.
    39 	//This is a 95 character msg.
    41 	_LIT(KTestMsg,"HyperLink message, Symbian. http://www.symbian.com Some content Intranet http://web.intra/homes");
    40 	_LIT(KTestMsg,"HyperLink message, Symbian. http://www.symbian.com Some content Intranet http://web.intra/homes");
    42 
    41 
    43 	//Set destination and SC numbers
    42 	//Set destination and SC numbers
    44 	iTelephoneNumber=KPekka;
    43 	iTelephoneNumber=KPekka;
    45 	iServiceCenterNumber=KRadiolinjaSC;
    44 	iServiceCenterNumber=KRadiolinjaSC;
    46 
    45 
    47 	//8 bit coding scheme
    46 	//8 bit coding scheme
    48 	TSmsDataCodingScheme::TSmsAlphabet alphabet=TSmsDataCodingScheme::ESmsAlphabet8Bit;
    47 	TSmsDataCodingScheme::TSmsAlphabet alphabet=TSmsDataCodingScheme::ESmsAlphabet8Bit;
    49 	CSmsMessage* smsMessage=CreateSmsMessageL(KTestMsg,alphabet);
    48 	CSmsMessage* smsMessage=CreateSmsMessageLC(KTestMsg,alphabet);
    50 	CleanupStack::PushL(smsMessage);
       
    51 
    49 
    52 	INFO_PRINTF2(_L("Destination number:..... %S "),&iTelephoneNumber);
    50 	INFO_PRINTF2(_L("Destination number:..... %S "),&iTelephoneNumber);
    53 	INFO_PRINTF2(_L("ServiceCenter number:... %S "),&iServiceCenterNumber);
    51 	INFO_PRINTF2(_L("ServiceCenter number:... %S "),&iServiceCenterNumber);
    54 
    52 
    55 	//Get the operations
    53 	//Get the operations
   174 	//Single Hyperlink SMS
   172 	//Single Hyperlink SMS
   175 	INFO_PRINTF1(_L("waiting for incoming SMS with single hyperlink...") );
   173 	INFO_PRINTF1(_L("waiting for incoming SMS with single hyperlink...") );
   176 	WaitForRecvL(socket);
   174 	WaitForRecvL(socket);
   177 	smsMessage = RecvSmsL(socket);
   175 	smsMessage = RecvSmsL(socket);
   178 	CleanupStack::PushL(smsMessage);
   176 	CleanupStack::PushL(smsMessage);
       
   177 	
   179 	TestSmsContentsL(smsMessage,KTestMsg);
   178 	TestSmsContentsL(smsMessage,KTestMsg);
   180 
   179 
   181 	//Get the operations
   180 	//Get the operations
   182 	CSmsHyperLinkOperations& deliverPDUOperations = static_cast<CSmsHyperLinkOperations&>(smsMessage->GetOperationsForIEL(CSmsInformationElement::ESmsHyperLinkFormat));
   181 	CSmsHyperLinkOperations& deliverPDUOperations = static_cast<CSmsHyperLinkOperations&>(smsMessage->GetOperationsForIEL(CSmsInformationElement::ESmsHyperLinkFormat));
   183 	//NumberOfHyperLinks
   182 	//NumberOfHyperLinks
   194 	//Multiple Hyperlink SMS
   193 	//Multiple Hyperlink SMS
   195 	INFO_PRINTF1(_L("waiting for incoming SMS with two hyperlinks...") );
   194 	INFO_PRINTF1(_L("waiting for incoming SMS with two hyperlinks...") );
   196 	WaitForRecvL(socket);
   195 	WaitForRecvL(socket);
   197 	smsMessage = RecvSmsL(socket);
   196 	smsMessage = RecvSmsL(socket);
   198 	CleanupStack::PushL(smsMessage);
   197 	CleanupStack::PushL(smsMessage);
       
   198 	
   199 	TestSmsContentsL(smsMessage,KTestMsg);
   199 	TestSmsContentsL(smsMessage,KTestMsg);
   200 	//Get the operations
   200 	//Get the operations
   201 	CSmsHyperLinkOperations& multipleHyperLinkOperations = static_cast<CSmsHyperLinkOperations&>(smsMessage->GetOperationsForIEL(CSmsInformationElement::ESmsHyperLinkFormat));
   201 	CSmsHyperLinkOperations& multipleHyperLinkOperations = static_cast<CSmsHyperLinkOperations&>(smsMessage->GetOperationsForIEL(CSmsInformationElement::ESmsHyperLinkFormat));
   202 	//NumberOfHyperLinks
   202 	//NumberOfHyperLinks
   203 	count=multipleHyperLinkOperations.NumberOfHyperLinksL();
   203 	count=multipleHyperLinkOperations.NumberOfHyperLinksL();
   227 	count=noneHyperLinkOperations.NumberOfHyperLinksL();
   227 	count=noneHyperLinkOperations.NumberOfHyperLinksL();
   228 	TEST(count==0);
   228 	TEST(count==0);
   229 	CleanupStack::PopAndDestroy(smsMessage);
   229 	CleanupStack::PopAndDestroy(smsMessage);
   230 
   230 
   231 	CleanupStack::PopAndDestroy(&socket);
   231 	CleanupStack::PopAndDestroy(&socket);
   232     CleanupStack::PopAndDestroy(&socketServer);
       
   233 
       
   234 	__UHEAP_MARKEND;
       
   235 
       
   236 	return TestStepResult() ;
   232 	return TestStepResult() ;
   237 }
   233 }
   238 
       
   239 
       
   240 //Multiple PDU's
       
   241 
   234 
   242 TVerdict CTestMultiplePDUHyperLinks::doTestStepL()
   235 TVerdict CTestMultiplePDUHyperLinks::doTestStepL()
   243 /**
   236 /**
   244  *  Test a simple Transmit and Receive of a TPDU
   237  *  Test a simple Transmit and Receive of a TPDU
   245  */
   238  */
   246 	{
   239 	{
   247 	INFO_PRINTF1(_L("Test multiple PDUs with hyperLinks in SMS message"));
   240 	INFO_PRINTF1(_L("Test multiple PDUs with hyperLinks in SMS message"));
   248 
       
   249 	__UHEAP_MARK;
       
   250 
       
   251 	RSocketServ socketServer;
       
   252 	PrepareRegTestLC(socketServer, 71);
       
   253 
       
   254 	RSocket socket;
   241 	RSocket socket;
   255 	iSmsStackTestUtils->OpenSmsSocketLC(socketServer,socket,ESmsAddrRecvAny);
   242 	iSmsStackTestUtils->OpenSmsSocketLC(iSocketServer,socket,ESmsAddrRecvAny);
   256 
   243 
   257 	_LIT(KLongText,"YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBCCCCCCC");
   244 	_LIT(KLongText,"YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBCCCCCCC");
   258 
   245 
   259 	//Set destination and SC numbers
   246 	//Set destination and SC numbers
   260 	iTelephoneNumber=KPekka;
   247 	iTelephoneNumber=KPekka;
   261 	iServiceCenterNumber=KRadiolinjaSC;
   248 	iServiceCenterNumber=KRadiolinjaSC;
   262 
   249 
   263 	TSmsDataCodingScheme::TSmsAlphabet alphabet=TSmsDataCodingScheme::ESmsAlphabet8Bit;
   250 	TSmsDataCodingScheme::TSmsAlphabet alphabet=TSmsDataCodingScheme::ESmsAlphabet8Bit;
   264 	CSmsMessage* smsMessage=CreateSmsMessageL(KLongText,alphabet);
   251 	CSmsMessage* smsMessage=CreateSmsMessageLC(KLongText,alphabet);
   265 
       
   266 	CleanupStack::PushL(smsMessage);
       
   267 
   252 
   268 	//Check number of hyperlinks
   253 	//Check number of hyperlinks
   269 	//Get the operations
   254 	//Get the operations
   270 	CSmsHyperLinkOperations& operations =
   255 	CSmsHyperLinkOperations& operations =
   271 		static_cast<CSmsHyperLinkOperations&>(smsMessage->GetOperationsForIEL(CSmsInformationElement::ESmsHyperLinkFormat));
   256 		static_cast<CSmsHyperLinkOperations&>(smsMessage->GetOperationsForIEL(CSmsInformationElement::ESmsHyperLinkFormat));
   441 	count=noHyperlinksInFirstPDUOperations.NumberOfHyperLinksL();
   426 	count=noHyperlinksInFirstPDUOperations.NumberOfHyperLinksL();
   442 	TEST(count==9);
   427 	TEST(count==9);
   443 
   428 
   444 	CleanupStack::PopAndDestroy(smsMessage);
   429 	CleanupStack::PopAndDestroy(smsMessage);
   445 	CleanupStack::PopAndDestroy(&socket);
   430 	CleanupStack::PopAndDestroy(&socket);
   446     CleanupStack::PopAndDestroy(&socketServer);
       
   447 
       
   448 	__UHEAP_MARKEND;
       
   449 
       
   450 	return TestStepResult() ;
   431 	return TestStepResult() ;
   451 }
   432 }
   452 
   433 
   453 
   434 
   454 TVerdict CTestSinglePDUReplyAddress::doTestStepL()
   435 TVerdict CTestSinglePDUReplyAddress::doTestStepL()
   455 /**
   436 /**
   456  *  Test reply address can be different to the senders address
   437  *  Test reply address can be different to the senders address
   457  */
   438  */
   458 	{
   439 	{
   459 	__UHEAP_MARK;
       
   460 
       
   461 	INFO_PRINTF1(_L("Test reply address in SMS message"));
   440 	INFO_PRINTF1(_L("Test reply address in SMS message"));
   462 
       
   463 	RSocketServ socketServer;
       
   464 	PrepareRegTestLC(socketServer, 72);
       
   465 
       
   466 	RSocket socket;
   441 	RSocket socket;
   467 	iSmsStackTestUtils->OpenSmsSocketLC(socketServer,socket,ESmsAddrRecvAny);
   442 	iSmsStackTestUtils->OpenSmsSocketLC(iSocketServer,socket,ESmsAddrRecvAny);
   468 
   443 
   469 	//This is character msg
   444 	//This is character msg
   470 	_LIT(KTestMsg,"Reply address message.  Message will be sent to other address than sender");
   445 	_LIT(KTestMsg,"Reply address message.  Message will be sent to other address than sender");
   471 	_LIT(KEmptyMsg,"");
   446 	_LIT(KEmptyMsg,"");
   472 	//Set destination and SC numbers
   447 	//Set destination and SC numbers
   473 	iTelephoneNumber=KPekka;
   448 	iTelephoneNumber=KPekka;
   474 	iServiceCenterNumber=KRadiolinjaSC;
   449 	iServiceCenterNumber=KRadiolinjaSC;
   475 
   450 
   476 	//8 bit coding scheme
   451 	//8 bit coding scheme
   477 	TSmsDataCodingScheme::TSmsAlphabet alphabet=TSmsDataCodingScheme::ESmsAlphabet8Bit;
   452 	TSmsDataCodingScheme::TSmsAlphabet alphabet=TSmsDataCodingScheme::ESmsAlphabet8Bit;
   478 	CSmsMessage* specialMessageAndReplyAddresMessage=CreateSmsMessageL(KEmptyMsg,alphabet);
   453 	CSmsMessage* specialMessageAndReplyAddresMessage=CreateSmsMessageLC(KEmptyMsg,alphabet);
   479 	CleanupStack::PushL(specialMessageAndReplyAddresMessage);
       
   480 
   454 
   481 	//Get the operations
   455 	//Get the operations
   482 	CSmsReplyAddressOperations& replyAddressOperations =
   456 	CSmsReplyAddressOperations& replyAddressOperations =
   483 		static_cast<CSmsReplyAddressOperations&>(specialMessageAndReplyAddresMessage->GetOperationsForIEL(CSmsInformationElement::ESmsReplyAddressFormat));
   457 		static_cast<CSmsReplyAddressOperations&>(specialMessageAndReplyAddresMessage->GetOperationsForIEL(CSmsInformationElement::ESmsReplyAddressFormat));
   484 
   458 
   512 
   486 
   513 	//PDU maximym of 140 octects = C8
   487 	//PDU maximym of 140 octects = C8
   514 	//Each special message is 4 octects.
   488 	//Each special message is 4 octects.
   515 	//Maximum variations on the type of messages for 5 bits is 32
   489 	//Maximum variations on the type of messages for 5 bits is 32
   516 	for(TInt indicationType=EGsmSmsVoiceMessageWaiting; indicationType<=EGsmSmsExtendedMessageTypeWaiting;
   490 	for(TInt indicationType=EGsmSmsVoiceMessageWaiting; indicationType<=EGsmSmsExtendedMessageTypeWaiting;
   517 				indicationType++)
   491 				++indicationType)
   518 	{
   492 	{
   519 		TBool toStore=EFalse;
   493 		TBool toStore=EFalse;
   520 		TSmsMessageProfileType messageProfileType=EGsmSmsProfileId1;
   494 		TSmsMessageProfileType messageProfileType=EGsmSmsProfileId1;
   521 		TUint8 messageCount=5;
   495 		TUint8 messageCount=5;
   522 
   496 
   523 		for(TUint extendedType=EGsmSmsNoExtendedMessageTypeIndication;
   497 		for(TUint extendedType=EGsmSmsNoExtendedMessageTypeIndication;
   524 					extendedType<=EGsmSmsExtendedIndicationType7; extendedType++)
   498 					extendedType<=EGsmSmsExtendedIndicationType7; ++extendedType)
   525 		{
   499 		{
   526 			TRAP(err,specialMessageOperations.AddSpecialMessageIndicationL(toStore,TSmsMessageIndicationType(indicationType),
   500 			TRAP(err,specialMessageOperations.AddSpecialMessageIndicationL(toStore,TSmsMessageIndicationType(indicationType),
   527 									TExtendedSmsIndicationType(extendedType),messageProfileType,messageCount));
   501 									TExtendedSmsIndicationType(extendedType),messageProfileType,messageCount));
   528 			TEST(err==KErrNone);
   502 			TEST(err==KErrNone);
   529 
       
   530 		}
   503 		}
   531 
       
   532 	}
   504 	}
   533 
   505 
   534 	//Add six zero length information elements
   506 	//Add six zero length information elements
   535 	//Get the PDU
   507 	//Get the PDU
   536 	CSmsPDU &pdu=specialMessageAndReplyAddresMessage->SmsPDU();
   508 	CSmsPDU &pdu=specialMessageAndReplyAddresMessage->SmsPDU();
   537 	//Get the UserData
   509 	//Get the UserData
   538 	CSmsUserData &userData=pdu.UserData();
   510 	CSmsUserData &userData=pdu.UserData();
   539 	_LIT8(KEmptyString,"");
   511 	
   540 	//Add the information element
   512 	//Add the information element
   541 	//TSmsId
   513 	//TSmsId
   542 	for(TUint informationElement=CSmsInformationElement::ESmsIEISIMToolkitSecurityHeaders1;
   514 	for(TUint informationElement=CSmsInformationElement::ESmsIEISIMToolkitSecurityHeaders1;
   543 				informationElement<=CSmsInformationElement::ESmsIEISIMToolkitSecurityHeaders5;
   515 		informationElement<=CSmsInformationElement::ESmsIEISIMToolkitSecurityHeaders5;
   544 				informationElement++)
   516 		++informationElement)
   545 	{
   517 	    {
   546 		//CSmsInformationElement::TSmsInformationElementIdentifier informationElement;
       
   547 		TRAP(err,userData.AddInformationElementL(
   518 		TRAP(err,userData.AddInformationElementL(
   548 			CSmsInformationElement::TSmsInformationElementIdentifier(informationElement),KEmptyString()));
   519 			CSmsInformationElement::TSmsInformationElementIdentifier(informationElement),KNullDesC8()));
   549 		TEST(err==KErrNone);
   520 		TEST(err==KErrNone);
   550 	}
   521 	    }
   551 
       
   552 
   522 
   553 	//Add address
   523 	//Add address
   554 	TPtrC replyAddress;
   524 	TPtrC replyAddress;
   555 	GetStringFromConfig(ConfigSection(), _L("replyAddressInternational"), replyAddress);
   525 	GetStringFromConfig(ConfigSection(), _L("replyAddressInternational"), replyAddress);
   556 	TRAP(err,replyAddressOperations.AddReplyAddressL(replyAddress));
   526 	TRAP(err,replyAddressOperations.AddReplyAddressL(replyAddress));
   676 	TEST(!result);
   646 	TEST(!result);
   677 
   647 
   678 	CleanupStack::PopAndDestroy(specialMessageAndReplyAddresMessage);
   648 	CleanupStack::PopAndDestroy(specialMessageAndReplyAddresMessage);
   679 
   649 
   680 	//Create a new message
   650 	//Create a new message
   681 	CSmsMessage* smsMessage=CreateSmsMessageL(KTestMsg,alphabet);
   651 	CSmsMessage* smsMessage=CreateSmsMessageLC(KTestMsg,alphabet);
   682 	CleanupStack::PushL(smsMessage);
       
   683 
   652 
   684 	//Get the operations
   653 	//Get the operations
   685 	CSmsReplyAddressOperations& operations =
   654 	CSmsReplyAddressOperations& operations =
   686 		static_cast<CSmsReplyAddressOperations&>(smsMessage->GetOperationsForIEL(CSmsInformationElement::ESmsReplyAddressFormat));
   655 		static_cast<CSmsReplyAddressOperations&>(smsMessage->GetOperationsForIEL(CSmsInformationElement::ESmsReplyAddressFormat));
   687 
   656 
   819 	//Receive a message with no reply address
   788 	//Receive a message with no reply address
   820 	INFO_PRINTF1(_L("waiting for incoming SMS with no reply address...") );
   789 	INFO_PRINTF1(_L("waiting for incoming SMS with no reply address...") );
   821 	WaitForRecvL(socket);
   790 	WaitForRecvL(socket);
   822 	smsMessage = RecvSmsL(socket);
   791 	smsMessage = RecvSmsL(socket);
   823 
   792 
   824 	INFO_PRINTF1(_L("incoming SMS") );
       
   825 
       
   826 	CleanupStack::PushL(smsMessage);
   793 	CleanupStack::PushL(smsMessage);
   827 	TestSmsContentsL(smsMessage,KTestMsg);
   794 	TestSmsContentsL(smsMessage,KTestMsg);
   828 
   795 
   829 	//Get the operations
   796 	//Get the operations
   830 	CSmsReplyAddressOperations& deliverOperations =
   797 	CSmsReplyAddressOperations& deliverOperations =
   848 	//-------- END Receive with no reply address
   815 	//-------- END Receive with no reply address
   849 
   816 
   850 	INFO_PRINTF1(_L("waiting for incoming SMS with reply address...") );
   817 	INFO_PRINTF1(_L("waiting for incoming SMS with reply address...") );
   851 	WaitForRecvL(socket);
   818 	WaitForRecvL(socket);
   852 	smsMessage = RecvSmsL(socket);
   819 	smsMessage = RecvSmsL(socket);
   853 
   820 	CleanupStack::PushL(smsMessage);
   854 	INFO_PRINTF1(_L("incoming SMS") );
   821 	
   855 
       
   856 	CleanupStack::PushL(smsMessage);
       
   857 	TestSmsContentsL(smsMessage,KTestMsg);
   822 	TestSmsContentsL(smsMessage,KTestMsg);
   858 
   823 
   859 	//Get the operations
   824 	//Get the operations
   860 	CSmsReplyAddressOperations& deliverReplyOperations =
   825 	CSmsReplyAddressOperations& deliverReplyOperations =
   861 		static_cast<CSmsReplyAddressOperations&>(smsMessage->GetOperationsForIEL(CSmsInformationElement::ESmsReplyAddressFormat));
   826 		static_cast<CSmsReplyAddressOperations&>(smsMessage->GetOperationsForIEL(CSmsInformationElement::ESmsReplyAddressFormat));
   877 	//-------- END Receive with reply address
   842 	//-------- END Receive with reply address
   878 
   843 
   879 	INFO_PRINTF1(_L("waiting for incoming SMS with parsed reply address...") );
   844 	INFO_PRINTF1(_L("waiting for incoming SMS with parsed reply address...") );
   880 	WaitForRecvL(socket);
   845 	WaitForRecvL(socket);
   881 	smsMessage = RecvSmsL(socket);
   846 	smsMessage = RecvSmsL(socket);
   882 
   847 	CleanupStack::PushL(smsMessage);
   883 	INFO_PRINTF1(_L("incoming SMS") );
   848 	
   884 
       
   885 	CleanupStack::PushL(smsMessage);
       
   886 	TestSmsContentsL(smsMessage,KTestMsg);
   849 	TestSmsContentsL(smsMessage,KTestMsg);
   887 
   850 
   888 	//Get the operations
   851 	//Get the operations
   889 	CSmsReplyAddressOperations& deliverParsedReplyOperations =
   852 	CSmsReplyAddressOperations& deliverParsedReplyOperations =
   890 		static_cast<CSmsReplyAddressOperations&>(smsMessage->GetOperationsForIEL(CSmsInformationElement::ESmsReplyAddressFormat));
   853 		static_cast<CSmsReplyAddressOperations&>(smsMessage->GetOperationsForIEL(CSmsInformationElement::ESmsReplyAddressFormat));
   905 
   868 
   906 	//This PDU has three reply address in it.  We are looking for the stack to store only the last occurence
   869 	//This PDU has three reply address in it.  We are looking for the stack to store only the last occurence
   907 	INFO_PRINTF1(_L("waiting for incoming SMS with three reply addresses...") );
   870 	INFO_PRINTF1(_L("waiting for incoming SMS with three reply addresses...") );
   908 	WaitForRecvL(socket);
   871 	WaitForRecvL(socket);
   909 	smsMessage = RecvSmsL(socket);
   872 	smsMessage = RecvSmsL(socket);
   910 
       
   911 	INFO_PRINTF1(_L("incoming SMS") );
       
   912 
       
   913 	CleanupStack::PushL(smsMessage);
   873 	CleanupStack::PushL(smsMessage);
   914 	//TestSmsContentsL(smsMessage,KTestMsg);
   874 	//TestSmsContentsL(smsMessage,KTestMsg);
   915 
   875 
   916 	//Get the operations
   876 	//Get the operations
   917 	CSmsReplyAddressOperations& deliverMultipleReplyOperations =
   877 	CSmsReplyAddressOperations& deliverMultipleReplyOperations =
   950 	CleanupStack::PopAndDestroy(smsMessage);
   910 	CleanupStack::PopAndDestroy(smsMessage);
   951 
   911 
   952 	//-------- END receive with corrupt reply address
   912 	//-------- END receive with corrupt reply address
   953 	//-------- END receive
   913 	//-------- END receive
   954 	CleanupStack::PopAndDestroy(&socket);
   914 	CleanupStack::PopAndDestroy(&socket);
   955     CleanupStack::PopAndDestroy(&socketServer);
       
   956 
       
   957 	__UHEAP_MARKEND;
       
   958 
       
   959 	return TestStepResult();
   915 	return TestStepResult();
   960 
       
   961 }
   916 }
   962 
   917 
   963 
   918 
   964 TVerdict CTestMultiplePDUReplyAddress::doTestStepL()
   919 TVerdict CTestMultiplePDUReplyAddress::doTestStepL()
   965 /**
   920 /**
   966  *  Test a simple Transmit and Receive of a TPDU
   921  *  Test a simple Transmit and Receive of a TPDU
   967  */
   922  */
   968 	{
   923 	{
       
   924     // TODO: redundant test case???
   969 	INFO_PRINTF1(_L("Test multiple PDUs with reply address in SMS message"));
   925 	INFO_PRINTF1(_L("Test multiple PDUs with reply address in SMS message"));
   970 
   926 
   971 	return TestStepResult();
   927 	return TestStepResult();
   972 	}
   928 	}
   973 
   929 
   976 /**
   932 /**
   977  *  Test the operations available for special message waiting
   933  *  Test the operations available for special message waiting
   978  */
   934  */
   979 	{
   935 	{
   980 	INFO_PRINTF1(_L("Test special message waiting operations"));
   936 	INFO_PRINTF1(_L("Test special message waiting operations"));
   981 
       
   982 	__UHEAP_MARK;
       
   983 
       
   984 	//This is character msg - 96 characters
   937 	//This is character msg - 96 characters
   985 	_LIT(KTestMsg,"This message is a special message waiting message. You have a special message waiting for you :)");
   938 	_LIT(KTestMsg,"This message is a special message waiting message. You have a special message waiting for you :)");
   986 
   939 
   987 	//8 bit coding scheme
   940 	//8 bit coding scheme
   988 	TSmsDataCodingScheme::TSmsAlphabet alphabet=TSmsDataCodingScheme::ESmsAlphabet8Bit;
   941 	TSmsDataCodingScheme::TSmsAlphabet alphabet=TSmsDataCodingScheme::ESmsAlphabet8Bit;
   989 	CSmsMessage* smsMessage=CreateSmsMessageL(KTestMsg,alphabet);
   942 	CSmsMessage* smsMessage=CreateSmsMessageLC(KTestMsg,alphabet);
   990 	CleanupStack::PushL(smsMessage);
       
   991 
   943 
   992 	//Get the operations for a version 0 message i.e. before operations for IE were added
   944 	//Get the operations for a version 0 message i.e. before operations for IE were added
   993 	smsMessage->SetVersion(CSmsMessage::ESmsMessageV0);
   945 	smsMessage->SetVersion(CSmsMessage::ESmsMessageV0);
   994 	TRAPD(err,smsMessage->GetOperationsForIEL(CSmsInformationElement::ESmsIEISpecialSMSMessageIndication));
   946 	TRAPD(err,smsMessage->GetOperationsForIEL(CSmsInformationElement::ESmsIEISpecialSMSMessageIndication));
   995 	TEST(err==KErrNotSupported);
   947 	TEST(err==KErrNotSupported);
  1297 
  1249 
  1298 	INFO_PRINTF1(_L("Test step end !"));
  1250 	INFO_PRINTF1(_L("Test step end !"));
  1299 
  1251 
  1300 	CleanupStack::PopAndDestroy(smsMessage);
  1252 	CleanupStack::PopAndDestroy(smsMessage);
  1301 	//-------- END API Test for special message operations
  1253 	//-------- END API Test for special message operations
  1302 
       
  1303 	__UHEAP_MARKEND;
       
  1304 
       
  1305 	return TestStepResult();
  1254 	return TestStepResult();
  1306 	}
  1255 	}
  1307 
       
  1308 
  1256 
  1309 TVerdict CTestSinglePDUSpecialMessageWaiting::doTestStepL()
  1257 TVerdict CTestSinglePDUSpecialMessageWaiting::doTestStepL()
  1310 /**
  1258 /**
  1311  *  Test a simple Transmit and Receive of a TPDU
  1259  *  Test a simple Transmit and Receive of a TPDU
  1312  */
  1260  */
  1313 	{
  1261 	{
  1314 	INFO_PRINTF1(_L("Test special message waiting in single PDU SMS message"));
  1262 	INFO_PRINTF1(_L("Test special message waiting in single PDU SMS message"));
  1315 
       
  1316 	__UHEAP_MARK;
       
  1317 
       
  1318 	RSocketServ socketServer;
       
  1319 	PrepareRegTestLC(socketServer, 73);
       
  1320 
       
  1321 	RSocket socket;
  1263 	RSocket socket;
  1322 	iSmsStackTestUtils->OpenSmsSocketLC(socketServer,socket,ESmsAddrRecvAny);
  1264 	iSmsStackTestUtils->OpenSmsSocketLC(iSocketServer,socket,ESmsAddrRecvAny);
  1323 
  1265 
  1324 	//This is a 95 character msg.
  1266 	//This is a 95 character msg.
  1325 	_LIT(KTestMsg,"This message is a special message waiting message. You have a special message waiting for you :)");
  1267 	_LIT(KTestMsg,"This message is a special message waiting message. You have a special message waiting for you :)");
  1326 
  1268 
  1327 	//Set destination and SC numbers
  1269 	//Set destination and SC numbers
  1328 	iTelephoneNumber=KPekka;
  1270 	iTelephoneNumber=KPekka;
  1329 	iServiceCenterNumber=KRadiolinjaSC;
  1271 	iServiceCenterNumber=KRadiolinjaSC;
  1330 
  1272 
  1331 	//8 bit coding scheme
  1273 	//8 bit coding scheme
  1332 	TSmsDataCodingScheme::TSmsAlphabet alphabet=TSmsDataCodingScheme::ESmsAlphabet8Bit;
  1274 	TSmsDataCodingScheme::TSmsAlphabet alphabet=TSmsDataCodingScheme::ESmsAlphabet8Bit;
  1333 	CSmsMessage* smsMessage=CreateSmsMessageL(KTestMsg,alphabet);
  1275 	CSmsMessage* smsMessage=CreateSmsMessageLC(KTestMsg,alphabet);
  1334 	CleanupStack::PushL(smsMessage);
       
  1335 
  1276 
  1336 	INFO_PRINTF2(_L("Destination number:..... %S "),&iTelephoneNumber);
  1277 	INFO_PRINTF2(_L("Destination number:..... %S "),&iTelephoneNumber);
  1337 	INFO_PRINTF2(_L("ServiceCenter number:... %S "),&iServiceCenterNumber);
  1278 	INFO_PRINTF2(_L("ServiceCenter number:... %S "),&iServiceCenterNumber);
  1338 
  1279 
  1339 	//Get the operations
  1280 	//Get the operations
  1410 
  1351 
  1411 	CleanupStack::PopAndDestroy(smsMessage);
  1352 	CleanupStack::PopAndDestroy(smsMessage);
  1412 	//-------- END Sending Single PDU
  1353 	//-------- END Sending Single PDU
  1413 
  1354 
  1414 	//-------- START receiving
  1355 	//-------- START receiving
  1415 	INFO_PRINTF1(_L("waiting for incoming SMS...") );
  1356 	WaitForRecvL(socket);
  1416 	WaitForRecvL(socket);
  1357 	smsMessage = RecvSmsL(socket);
  1417 	smsMessage = RecvSmsL(socket);
       
  1418 
       
  1419 	CleanupStack::PushL(smsMessage);
  1358 	CleanupStack::PushL(smsMessage);
  1420 
  1359 
  1421 	//Get the operations
  1360 	//Get the operations
  1422 	CSmsSpecialSMSMessageOperations& noSpecialMessageOperations = static_cast<CSmsSpecialSMSMessageOperations&>(smsMessage->GetOperationsForIEL(CSmsInformationElement::ESmsIEISpecialSMSMessageIndication));
  1361 	CSmsSpecialSMSMessageOperations& noSpecialMessageOperations = static_cast<CSmsSpecialSMSMessageOperations&>(smsMessage->GetOperationsForIEL(CSmsInformationElement::ESmsIEISpecialSMSMessageIndication));
  1423 	count=noSpecialMessageOperations.GetCountOfSpecialMessageIndicationsL();
  1362 	count=noSpecialMessageOperations.GetCountOfSpecialMessageIndicationsL();
  1595 	CleanupStack::PopAndDestroy(smsMessage);
  1534 	CleanupStack::PopAndDestroy(smsMessage);
  1596 	//-------- END receive multiple instances of enhanced IE
  1535 	//-------- END receive multiple instances of enhanced IE
  1597 
  1536 
  1598 	//-------- END receive
  1537 	//-------- END receive
  1599 	CleanupStack::PopAndDestroy(&socket);
  1538 	CleanupStack::PopAndDestroy(&socket);
  1600     CleanupStack::PopAndDestroy(&socketServer);
       
  1601 
       
  1602 	__UHEAP_MARKEND;
       
  1603 
       
  1604 	return TestStepResult();
  1539 	return TestStepResult();
  1605 	}
  1540 	}
  1606 
       
  1607 
  1541 
  1608 TVerdict CTestMultiplePDUSpecialMessageWaiting::doTestStepL()
  1542 TVerdict CTestMultiplePDUSpecialMessageWaiting::doTestStepL()
  1609 /**
  1543 /**
  1610  *  Test a simple Transmit and Receive of a TPDU
  1544  *  Test a simple Transmit and Receive of a TPDU
  1611  */
  1545  */
  1613 	INFO_PRINTF1(_L("Test special message waiting in multiple PDU SMS message"));
  1547 	INFO_PRINTF1(_L("Test special message waiting in multiple PDU SMS message"));
  1614 
  1548 
  1615 	return TestStepResult();
  1549 	return TestStepResult();
  1616 	}
  1550 	}
  1617 
  1551 
  1618 
       
  1619 TVerdict CTestEnhancedVoiceMailOperations::doTestStepL()
  1552 TVerdict CTestEnhancedVoiceMailOperations::doTestStepL()
  1620 /**
  1553 /**
  1621  *  Test the operations available for special message waiting
  1554  *  Test the operations available for special message waiting
  1622  */
  1555  */
  1623 	{
  1556 	{
  1624 	INFO_PRINTF1(_L("Test enhanced voice mail message operations"));
  1557 	INFO_PRINTF1(_L("Test enhanced voice mail message operations"));
  1625 
       
  1626 	__UHEAP_MARK;
       
  1627 
       
  1628 	//This is character msg - 96 characters
  1558 	//This is character msg - 96 characters
  1629 	_LIT(KTestMsg,"This is a enhanced voice mail information message!");
  1559 	_LIT(KTestMsg,"This is a enhanced voice mail information message!");
  1630 
  1560 
  1631 	//8 bit coding scheme
  1561 	//8 bit coding scheme
  1632 	TSmsDataCodingScheme::TSmsAlphabet alphabet=TSmsDataCodingScheme::ESmsAlphabet8Bit;
  1562 	TSmsDataCodingScheme::TSmsAlphabet alphabet=TSmsDataCodingScheme::ESmsAlphabet8Bit;
  1633 	CSmsMessage* smsMessage=CreateSmsMessageL(KTestMsg,alphabet);
  1563 	CSmsMessage* smsMessage=CreateSmsMessageLC(KTestMsg,alphabet);
  1634 	CleanupStack::PushL(smsMessage);
       
  1635 
  1564 
  1636 	//Get the operations
  1565 	//Get the operations
  1637 	CSmsEnhancedVoiceMailOperations& operations =
  1566 	CSmsEnhancedVoiceMailOperations& operations =
  1638 			static_cast<CSmsEnhancedVoiceMailOperations&>(smsMessage->GetOperationsForIEL(CSmsInformationElement::ESmsEnhanceVoiceMailInformation));
  1567 			static_cast<CSmsEnhancedVoiceMailOperations&>(smsMessage->GetOperationsForIEL(CSmsInformationElement::ESmsEnhanceVoiceMailInformation));
  1639 
  1568 
  1681 	voiceMailNotification->SetPriorityIndication(ETrue);
  1610 	voiceMailNotification->SetPriorityIndication(ETrue);
  1682 
  1611 
  1683 	//Test the boundary values for calling line identity
  1612 	//Test the boundary values for calling line identity
  1684 	TUint count=0;
  1613 	TUint count=0;
  1685 	//Do this test for both parsed address and international numbers
  1614 	//Do this test for both parsed address and international numbers
  1686 	for (TUint addressType=EInternational;addressType<=EParsed;addressType++)
  1615 	for (TUint addressType=EInternational; addressType<=EParsed; ++addressType)
  1687 	{
  1616 	{
  1688 		for(TUint boundaryCheck=EInside; boundaryCheck<=EOutside;boundaryCheck++)
  1617 		for(TUint boundaryCheck=EInside; boundaryCheck<=EOutside; ++boundaryCheck)
  1689 		{
  1618 		{
  1690 			//Just before the boundary
  1619 			//Just before the boundary
  1691 			TPtrC boundaryCallingLineIdentity;
  1620 			TPtrC boundaryCallingLineIdentity;
  1692 			if (boundaryCheck==EInside)
  1621 			if (boundaryCheck==EInside)
  1693 			{
  1622 			{
  1755 				count=notNeededEnhancedVoiceMailNotification->NumberOfVoiceMails();
  1684 				count=notNeededEnhancedVoiceMailNotification->NumberOfVoiceMails();
  1756 				TEST(count==1);
  1685 				TEST(count==1);
  1757 
  1686 
  1758 				delete notNeededEnhancedVoiceMailNotification;
  1687 				delete notNeededEnhancedVoiceMailNotification;
  1759 			}
  1688 			}
  1760 
       
  1761 
       
  1762 		}
  1689 		}
  1763 	}
  1690 	}
  1764 
       
  1765 
  1691 
  1766 	voiceMailNotification->SetParsedCallingLineIdentityL(accessAddressTGsm);
  1692 	voiceMailNotification->SetParsedCallingLineIdentityL(accessAddressTGsm);
  1767 
  1693 
  1768 	//Get the notifications in the enhanced message
  1694 	//Get the notifications in the enhanced message
  1769 	RPointerArray<CVoiceMailNotification>& newNotificationsList=
  1695 	RPointerArray<CVoiceMailNotification>& newNotificationsList=
  1770 					enhancedVoiceMailNotification->GetVoiceMailNotifications();
  1696 					enhancedVoiceMailNotification->GetVoiceMailNotifications();
  1771 
  1697 
  1772 	count=newNotificationsList.Count();
  1698 	count=newNotificationsList.Count();
  1773 	//Remove all pointers to notifications
  1699 	//Remove all pointers to notifications
  1774 	if(count)
  1700 	if(count)
  1775 	{
  1701 	    {
  1776 		newNotificationsList.Reset();
  1702         newNotificationsList.Reset();
  1777 	}
  1703 	    }
  1778 
  1704 
  1779 	result=newNotificationsList.Append(voiceMailNotification);
  1705 	result=newNotificationsList.Append(voiceMailNotification);
  1780 	TEST(result==KErrNone);
  1706 	TEST(result==KErrNone);
  1781 	count=enhancedVoiceMailNotification->NumberOfVoiceMails();
  1707 	count=enhancedVoiceMailNotification->NumberOfVoiceMails();
  1782 	TEST(count==1);
  1708 	TEST(count==1);
  1844 	TEST(!result);
  1770 	TEST(!result);
  1845 
  1771 
  1846 	CleanupStack::PopAndDestroy(retrievedNotification);
  1772 	CleanupStack::PopAndDestroy(retrievedNotification);
  1847 	CleanupStack::PopAndDestroy(enhancedVoiceMailNotification);
  1773 	CleanupStack::PopAndDestroy(enhancedVoiceMailNotification);
  1848 	CleanupStack::PopAndDestroy(smsMessage);
  1774 	CleanupStack::PopAndDestroy(smsMessage);
  1849 
       
  1850 	__UHEAP_MARKEND;
       
  1851 
       
  1852 	return TestStepResult();
  1775 	return TestStepResult();
  1853 	}
  1776 	}
  1854 
       
  1855 
  1777 
  1856 //Helper function:  Adds the address to a notification
  1778 //Helper function:  Adds the address to a notification
  1857 void CTestEnhancedVoiceMailOperations::AddAddressToNotifcationL(
  1779 void CTestEnhancedVoiceMailOperations::AddAddressToNotifcationL(
  1858 			CEnhancedVoiceMailNotification* aEnhancedVoiceMailNotification,
  1780 			CEnhancedVoiceMailNotification* aEnhancedVoiceMailNotification,
  1859 			CVoiceMailNotification* aVoiceMailNotification,
  1781 			CVoiceMailNotification* aVoiceMailNotification,
  1860 			TPtrC aCallingLineIdentity,TUint aAddressType)
  1782 			TPtrC aCallingLineIdentity,TUint aAddressType)
  1861 {
  1783     {
  1862 	//Get the notifications in the enhanced message
  1784 	//Get the notifications in the enhanced message
  1863 	RPointerArray<CVoiceMailNotification>& notificationsList=
  1785 	RPointerArray<CVoiceMailNotification>& notificationsList=
  1864 					aEnhancedVoiceMailNotification->GetVoiceMailNotifications();
  1786 					aEnhancedVoiceMailNotification->GetVoiceMailNotifications();
  1865 
  1787 
  1866 	TUint count=notificationsList.Count();
  1788 	TUint count=notificationsList.Count();
  1867 
  1789 
  1868 	if(count==1)
  1790 	if(count==1)
  1869 	{
  1791 	   {
  1870 		notificationsList.Remove(0);
  1792 		notificationsList.Remove(0);
  1871 	}
  1793 	   }
  1872 
  1794 
  1873 	//Add the address
  1795 	//Add the address
  1874 	if(aAddressType==EParsed)
  1796 	if(aAddressType==EParsed)
  1875 	{
  1797 	   {
  1876 		//Create Calling Line Identity
  1798 		//Create Calling Line Identity
  1877 		TGsmSmsTelNumber callingLineIdentityTGsm;
  1799 		TGsmSmsTelNumber callingLineIdentityTGsm;
  1878 		callingLineIdentityTGsm.iTelNumber=aCallingLineIdentity;
  1800 		callingLineIdentityTGsm.iTelNumber=aCallingLineIdentity;
  1879 		callingLineIdentityTGsm.iTypeOfAddress=EGsmSmsTONAlphaNumeric;
  1801 		callingLineIdentityTGsm.iTypeOfAddress=EGsmSmsTONAlphaNumeric;
  1880 		aVoiceMailNotification->SetParsedCallingLineIdentityL(callingLineIdentityTGsm);
  1802 		aVoiceMailNotification->SetParsedCallingLineIdentityL(callingLineIdentityTGsm);
  1881 	}
  1803     	}
  1882 	else
  1804 	else
  1883 	{
  1805 	    {
  1884 		aVoiceMailNotification->SetCallingLineIdentityL(aCallingLineIdentity);
  1806         aVoiceMailNotification->SetCallingLineIdentityL(aCallingLineIdentity);
  1885 	}
  1807 	    }
  1886 
  1808 
  1887 	//Add the notification to the voice mail
  1809 	//Add the notification to the voice mail
  1888 	TInt result=notificationsList.Append(aVoiceMailNotification);
  1810 	TInt result=notificationsList.Append(aVoiceMailNotification);
  1889 	TEST(result==KErrNone);
  1811 	TEST(result==KErrNone);
  1890 }
  1812 }
  1891 
       
  1892 
  1813 
  1893 TVerdict CTestSinglePDUEnhancedVoiceMailInformation::doTestStepL()
  1814 TVerdict CTestSinglePDUEnhancedVoiceMailInformation::doTestStepL()
  1894 /**
  1815 /**
  1895  *  Test the sending and receiving of enhanced voice mail
  1816  *  Test the sending and receiving of enhanced voice mail
  1896  */
  1817  */
  1897 	{
  1818 	{
  1898 	INFO_PRINTF1(_L("Test enhanced voice mail information with a single PDU message"));
  1819 	INFO_PRINTF1(_L("Test enhanced voice mail information with a single PDU message"));
  1899 
       
  1900 	__UHEAP_MARK;
       
  1901 
       
  1902 	RSocketServ socketServer;
       
  1903 	PrepareRegTestLC(socketServer, 74);
       
  1904 
       
  1905 	RSocket socket;
  1820 	RSocket socket;
  1906 	iSmsStackTestUtils->OpenSmsSocketLC(socketServer,socket,ESmsAddrRecvAny);
  1821 	iSmsStackTestUtils->OpenSmsSocketLC(iSocketServer,socket,ESmsAddrRecvAny);
  1907 
  1822 
  1908 	//This is an enhanced voice mail character msg.
  1823 	//This is an enhanced voice mail character msg.
  1909 	_LIT(KTestMsg,"");
  1824 	_LIT(KTestMsg,"");
  1910 
  1825 
  1911 	//Set destination and SC numbers
  1826 	//Set destination and SC numbers
  1912 	iTelephoneNumber=KPekka;
  1827 	iTelephoneNumber=KPekka;
  1913 	iServiceCenterNumber=KRadiolinjaSC;
  1828 	iServiceCenterNumber=KRadiolinjaSC;
  1914 
  1829 
  1915 	//8 bit coding scheme
  1830 	//8 bit coding scheme
  1916 	TSmsDataCodingScheme::TSmsAlphabet alphabet=TSmsDataCodingScheme::ESmsAlphabet8Bit;
  1831 	TSmsDataCodingScheme::TSmsAlphabet alphabet=TSmsDataCodingScheme::ESmsAlphabet8Bit;
  1917 	CSmsMessage* smsMessage=CreateSmsMessageL(KTestMsg,alphabet);
  1832 	CSmsMessage* smsMessage=CreateSmsMessageLC(KTestMsg,alphabet);
  1918 	CleanupStack::PushL(smsMessage);
       
  1919 
  1833 
  1920 	INFO_PRINTF2(_L("Destination number:..... %S "),&iTelephoneNumber);
  1834 	INFO_PRINTF2(_L("Destination number:..... %S "),&iTelephoneNumber);
  1921 	INFO_PRINTF2(_L("ServiceCenter number:... %S "),&iServiceCenterNumber);
  1835 	INFO_PRINTF2(_L("ServiceCenter number:... %S "),&iServiceCenterNumber);
  1922 
  1836 
  1923 	//Get the operations
  1837 	//Get the operations
  1983 	//-----------------------------------
  1897 	//-----------------------------------
  1984 	//Send message with enhanced voice mail length at boundary values
  1898 	//Send message with enhanced voice mail length at boundary values
  1985 	//Single pdu, max size = 137.  That is 140-2(UDHL) -1(IEId) = 137
  1899 	//Single pdu, max size = 137.  That is 140-2(UDHL) -1(IEId) = 137
  1986 	//User data = 8C
  1900 	//User data = 8C
  1987 	//Make a new message
  1901 	//Make a new message
  1988 	for (TUint i = 0; i < enhancedVoiceMailNotification->NumberOfVoiceMails(); i++)
  1902 	for (TUint i = 0; i < enhancedVoiceMailNotification->NumberOfVoiceMails(); ++i)
  1989 	    {
  1903 	    {
  1990 	    delete notificationsList[i];
  1904 	    delete notificationsList[i];
  1991 	    }
  1905 	    }
  1992 
       
  1993 	notificationsList.Reset();
  1906 	notificationsList.Reset();
  1994 
  1907 
  1995 	CSmsMessage* boundaryValueVoiceMessage=CreateSmsMessageL(KTestMsg,alphabet);
  1908 	CSmsMessage* boundaryValueVoiceMessage=CreateSmsMessageL(KTestMsg,alphabet);
  1996 	CleanupStack::PushL(boundaryValueVoiceMessage);
  1909 	CleanupStack::PushL(boundaryValueVoiceMessage);
  1997 	CleanupStack::PushL(enhancedVoiceMailNotification);
  1910 	CleanupStack::PushL(enhancedVoiceMailNotification);
  2000 	CSmsEnhancedVoiceMailOperations& boundaryValueVoiceMailOperations =
  1913 	CSmsEnhancedVoiceMailOperations& boundaryValueVoiceMailOperations =
  2001 		static_cast<CSmsEnhancedVoiceMailOperations&>(boundaryValueVoiceMessage->GetOperationsForIEL(CSmsInformationElement::ESmsEnhanceVoiceMailInformation));
  1914 		static_cast<CSmsEnhancedVoiceMailOperations&>(boundaryValueVoiceMessage->GetOperationsForIEL(CSmsInformationElement::ESmsEnhanceVoiceMailInformation));
  2002 
  1915 
  2003 	//Add five more notifications
  1916 	//Add five more notifications
  2004 	const TUint KNumNotifications=4;
  1917 	const TUint KNumNotifications=4;
  2005 	for(count=0;count<KNumNotifications; count++)
  1918 	for(count=0; count<KNumNotifications; ++count)
  2006 	{
  1919 	   {
  2007 		CVoiceMailNotification* voiceMailNotification=CreateVoiceMailNotificationL(callingLineIdentityTGsm);
  1920 		CVoiceMailNotification* voiceMailNotification=CreateVoiceMailNotificationL(callingLineIdentityTGsm);
  2008 		result=notificationsList.Append(voiceMailNotification);
  1921 		result=notificationsList.Append(voiceMailNotification);
  2009 		TEST(result==KErrNone);
  1922 		TEST(result==KErrNone);
  2010 	}
  1923 	   }
  2011 
  1924 
  2012 	//Add the number to make the size on the boundary
  1925 	//Add the number to make the size on the boundary
  2013 	TPtrC boundaryCallingLineIdentity;
  1926 	TPtrC boundaryCallingLineIdentity;
  2014 	GetStringFromConfig(ConfigSection(), _L("boundaryAccessAddress"), boundaryCallingLineIdentity);
  1927 	GetStringFromConfig(ConfigSection(), _L("boundaryAccessAddress"), boundaryCallingLineIdentity);
  2015 	callingLineIdentityTGsm.iTelNumber=boundaryCallingLineIdentity;
  1928 	callingLineIdentityTGsm.iTelNumber=boundaryCallingLineIdentity;
  2104 
  2017 
  2105 	CleanupStack::PopAndDestroy(retrievedNotification);
  2018 	CleanupStack::PopAndDestroy(retrievedNotification);
  2106 	CleanupStack::PopAndDestroy(smsMessage);
  2019 	CleanupStack::PopAndDestroy(smsMessage);
  2107 
  2020 
  2108 	//---------- END receiving
  2021 	//---------- END receiving
  2109 
       
  2110 	CleanupStack::PopAndDestroy(&socket);
  2022 	CleanupStack::PopAndDestroy(&socket);
  2111     CleanupStack::PopAndDestroy(&socketServer);
  2023  	return TestStepResult();
  2112 
       
  2113 	__UHEAP_MARKEND;
       
  2114 
       
  2115 	return TestStepResult();
       
  2116 	}
  2024 	}
  2117 
  2025 
  2118 CEnhancedVoiceMailNotification* CTestEnhancedVoiceMail::CreateEnhancedVoiceMailNotificationL(TGsmSmsTelNumber aAccessAddress)
  2026 CEnhancedVoiceMailNotification* CSmsEnhancedVoiceMailTestStep::CreateEnhancedVoiceMailNotificationL(TGsmSmsTelNumber aAccessAddress)
  2119 {
  2027 {
  2120 	CEnhancedVoiceMailNotification* enhancedVoiceMailNotification=CEnhancedVoiceMailNotification::NewL();
  2028 	CEnhancedVoiceMailNotification* enhancedVoiceMailNotification=CEnhancedVoiceMailNotification::NewL();
  2121 
  2029 
  2122 	//Set the properties
  2030 	//Set the properties
  2123 	TSmsMessageProfileType messageProfileType=EGsmSmsProfileId1;
  2031 	TSmsMessageProfileType messageProfileType=EGsmSmsProfileId1;
  2129 	enhancedVoiceMailNotification->SetParsedAccessAddressL(aAccessAddress);
  2037 	enhancedVoiceMailNotification->SetParsedAccessAddressL(aAccessAddress);
  2130 
  2038 
  2131 	return enhancedVoiceMailNotification;
  2039 	return enhancedVoiceMailNotification;
  2132 }
  2040 }
  2133 
  2041 
  2134 
  2042 CVoiceMailNotification*  CSmsEnhancedVoiceMailTestStep::CreateVoiceMailNotificationL(TGsmSmsTelNumber aCallingLineIdentity)
  2135 CVoiceMailNotification*  CTestEnhancedVoiceMail::CreateVoiceMailNotificationL(TGsmSmsTelNumber aCallingLineIdentity)
       
  2136 {
  2043 {
  2137 	CVoiceMailNotification* voiceMailNotification=CVoiceMailNotification::NewL();
  2044 	CVoiceMailNotification* voiceMailNotification=CVoiceMailNotification::NewL();
  2138 
  2045 
  2139 	//Setup the notification
  2046 	//Setup the notification
  2140 	TUint16 messageId=2;
  2047 	TUint16 messageId=2;
  2153 TVerdict CTestMultiplePDUEnhancedVoiceMailInformation::doTestStepL()
  2060 TVerdict CTestMultiplePDUEnhancedVoiceMailInformation::doTestStepL()
  2154 /**
  2061 /**
  2155  *  Test the sending and receiving of enhanced voice mail
  2062  *  Test the sending and receiving of enhanced voice mail
  2156  */
  2063  */
  2157 	{
  2064 	{
       
  2065     // TODO: redundant test case???
  2158 	INFO_PRINTF1(_L("Test enhanced voice mail information with multiple PDU message"));
  2066 	INFO_PRINTF1(_L("Test enhanced voice mail information with multiple PDU message"));
  2159 
  2067 
  2160 	return TestStepResult();
  2068 	return TestStepResult();
  2161 	}
  2069 	}
  2162 
       
  2163 
  2070 
  2164 TVerdict CTestEnhancedVoiceMailDeleteOperations::doTestStepL()
  2071 TVerdict CTestEnhancedVoiceMailDeleteOperations::doTestStepL()
  2165 /**
  2072 /**
  2166  *  Test the enhanced voice mail delete confirmation
  2073  *  Test the enhanced voice mail delete confirmation
  2167  */
  2074  */
  2168 	{
  2075 	{
  2169 	INFO_PRINTF1(_L("Test enhanced voice mail delete confirmation operations"));
  2076 	INFO_PRINTF1(_L("Test enhanced voice mail delete confirmation operations"));
  2170 
       
  2171 	__UHEAP_MARK;
       
  2172 
       
  2173 	//This is character msg - 96 characters
  2077 	//This is character msg - 96 characters
  2174 	_LIT(KTestMsg,"This is a enhanced voice mail information message!");
  2078 	_LIT(KTestMsg,"This is a enhanced voice mail information message!");
  2175 
  2079 
  2176 	//8 bit coding scheme
  2080 	//8 bit coding scheme
  2177 	TSmsDataCodingScheme::TSmsAlphabet alphabet=TSmsDataCodingScheme::ESmsAlphabet8Bit;
  2081 	TSmsDataCodingScheme::TSmsAlphabet alphabet=TSmsDataCodingScheme::ESmsAlphabet8Bit;
  2178 	CSmsMessage* smsMessage=CreateSmsMessageL(KTestMsg,alphabet);
  2082 	CSmsMessage* smsMessage=CreateSmsMessageLC(KTestMsg,alphabet);
  2179 	CleanupStack::PushL(smsMessage);
       
  2180 
  2083 
  2181 	//Get the operations
  2084 	//Get the operations
  2182 	CSmsEnhancedVoiceMailOperations& operations =
  2085 	CSmsEnhancedVoiceMailOperations& operations =
  2183 			static_cast<CSmsEnhancedVoiceMailOperations&>(smsMessage->GetOperationsForIEL(CSmsInformationElement::ESmsEnhanceVoiceMailInformation));
  2086 			static_cast<CSmsEnhancedVoiceMailOperations&>(smsMessage->GetOperationsForIEL(CSmsInformationElement::ESmsEnhanceVoiceMailInformation));
  2184 
  2087 
  2285 	TEST(!result);
  2188 	TEST(!result);
  2286 
  2189 
  2287 	CleanupStack::PopAndDestroy(retrievedDeletion);
  2190 	CleanupStack::PopAndDestroy(retrievedDeletion);
  2288 	CleanupStack::PopAndDestroy(enhancedVoiceMailDeleteConfirmation);
  2191 	CleanupStack::PopAndDestroy(enhancedVoiceMailDeleteConfirmation);
  2289 	CleanupStack::PopAndDestroy(smsMessage);
  2192 	CleanupStack::PopAndDestroy(smsMessage);
  2290 
       
  2291 	__UHEAP_MARKEND;
       
  2292 
       
  2293 	return TestStepResult();
  2193 	return TestStepResult();
  2294 	}
  2194 	}
  2295 
       
  2296 
  2195 
  2297 TVerdict CTestSinglePDUEnhancedVoiceMailDeleteConfirmation::doTestStepL()
  2196 TVerdict CTestSinglePDUEnhancedVoiceMailDeleteConfirmation::doTestStepL()
  2298 /**
  2197 /**
  2299  *  Test the enhanced voice mail delete confirmation
  2198  *  Test the enhanced voice mail delete confirmation
  2300  */
  2199  */
  2301 	{
  2200 	{
  2302 	INFO_PRINTF1(_L("Test enhanced voice mail single PDU message delete confirmation"));
  2201 	INFO_PRINTF1(_L("Test enhanced voice mail single PDU message delete confirmation"));
  2303 
       
  2304 	__UHEAP_MARK;
       
  2305 
       
  2306 	RSocketServ socketServer;
       
  2307 	PrepareRegTestLC(socketServer, 75);
       
  2308 
       
  2309 	RSocket socket;
  2202 	RSocket socket;
  2310 	iSmsStackTestUtils->OpenSmsSocketLC(socketServer,socket,ESmsAddrRecvAny);
  2203 	iSmsStackTestUtils->OpenSmsSocketLC(iSocketServer,socket,ESmsAddrRecvAny);
  2311 
  2204 
  2312 	//This is an enhanced voice mail character msg.
  2205 	//This is an enhanced voice mail character msg.
  2313 	_LIT(KTestMsg,"");
  2206 	_LIT(KTestMsg,"");
  2314 
  2207 
  2315 	//Set destination and SC numbers
  2208 	//Set destination and SC numbers
  2316 	iTelephoneNumber=KPekka;
  2209 	iTelephoneNumber=KPekka;
  2317 	iServiceCenterNumber=KRadiolinjaSC;
  2210 	iServiceCenterNumber=KRadiolinjaSC;
  2318 
  2211 
  2319 	//8 bit coding scheme
  2212 	//8 bit coding scheme
  2320 	TSmsDataCodingScheme::TSmsAlphabet alphabet=TSmsDataCodingScheme::ESmsAlphabet8Bit;
  2213 	TSmsDataCodingScheme::TSmsAlphabet alphabet=TSmsDataCodingScheme::ESmsAlphabet8Bit;
  2321 	CSmsMessage* smsMessage=CreateSmsMessageL(KTestMsg,alphabet);
  2214 	CSmsMessage* smsMessage=CreateSmsMessageLC(KTestMsg,alphabet);
  2322 	CleanupStack::PushL(smsMessage);
       
  2323 
  2215 
  2324 	INFO_PRINTF2(_L("Destination number:..... %S "),&iTelephoneNumber);
  2216 	INFO_PRINTF2(_L("Destination number:..... %S "),&iTelephoneNumber);
  2325 	INFO_PRINTF2(_L("ServiceCenter number:... %S "),&iServiceCenterNumber);
  2217 	INFO_PRINTF2(_L("ServiceCenter number:... %S "),&iServiceCenterNumber);
  2326 
  2218 
  2327 	//Get the operations
  2219 	//Get the operations
  2451 						static_cast<CEnhancedVoiceMailDeleteConfirmations*>(retrievedNotification);
  2343 						static_cast<CEnhancedVoiceMailDeleteConfirmations*>(retrievedNotification);
  2452 	count=retrievedEnhancedVoiceMailDeleteConfirmation->NumberOfDeletes();
  2344 	count=retrievedEnhancedVoiceMailDeleteConfirmation->NumberOfDeletes();
  2453 	TEST(count==1);
  2345 	TEST(count==1);
  2454 
  2346 
  2455 	CleanupStack::PopAndDestroy(retrievedNotification);
  2347 	CleanupStack::PopAndDestroy(retrievedNotification);
  2456 
       
  2457 	CleanupStack::PopAndDestroy(smsMessage);
  2348 	CleanupStack::PopAndDestroy(smsMessage);
  2458 	//---------- END receiving
  2349 	//---------- END receiving
  2459 	CleanupStack::PopAndDestroy(&socket);
  2350 	CleanupStack::PopAndDestroy(&socket);
  2460     CleanupStack::PopAndDestroy(&socketServer);
       
  2461 
       
  2462 	__UHEAP_MARKEND;
       
  2463 
       
  2464 	return TestStepResult();
  2351 	return TestStepResult();
  2465 	}
  2352 	}
  2466 
  2353 
  2467 
  2354 
  2468 TVerdict CTestMultiplePDUEnhancedVoiceMailDeleteConfirmation::doTestStepL()
  2355 TVerdict CTestMultiplePDUEnhancedVoiceMailDeleteConfirmation::doTestStepL()
  2469 /**
  2356 /**
  2470  *  Test the enhanced voice mail delete confirmation
  2357  *  Test the enhanced voice mail delete confirmation
  2471  */
  2358  */
  2472 	{
  2359 	{
       
  2360     // TODO: redundant test case???
  2473 	INFO_PRINTF1(_L("Test enhanced voice mail multiple PDU message delete confirmation"));
  2361 	INFO_PRINTF1(_L("Test enhanced voice mail multiple PDU message delete confirmation"));
  2474 
  2362 
  2475 	return TestStepResult();
  2363 	return TestStepResult();
  2476 	}
  2364 	}
  2477 
       
  2478 
  2365 
  2479 TVerdict CTest7BitDefaultAlphabet::doTestStepL()
  2366 TVerdict CTest7BitDefaultAlphabet::doTestStepL()
  2480 /**
  2367 /**
  2481  *  Test the enhanced voice mail delete confirmation
  2368  *  Test the enhanced voice mail delete confirmation
  2482  */
  2369  */
  2483 	{
  2370 	{
  2484 	INFO_PRINTF1(_L("Test 7 bit default alphabet"));
  2371 	INFO_PRINTF1(_L("Test 7 bit default alphabet"));
  2485 
  2372 
  2486 	__UHEAP_MARK;
       
  2487 
       
  2488 	//Send a message with no alphabet set
  2373 	//Send a message with no alphabet set
  2489 	RSocketServ socketServer;
       
  2490 	PrepareRegTestLC(socketServer, 76);
       
  2491 
       
  2492 	RSocket socket;
  2374 	RSocket socket;
  2493 	iSmsStackTestUtils->OpenSmsSocketLC(socketServer,socket,ESmsAddrRecvAny);
  2375 	iSmsStackTestUtils->OpenSmsSocketLC(iSocketServer,socket,ESmsAddrRecvAny);
  2494 
  2376 
  2495 	//This is a msg.
  2377 	//This is a msg.
  2496 	_LIT(KTestMsg,"This message has no coding scheme set.  Assume 7 bit default.");
  2378 	_LIT(KTestMsg,"This message has no coding scheme set.  Assume 7 bit default.");
  2497 
  2379 
  2498 	//Set destination and SC numbers
  2380 	//Set destination and SC numbers
  2542 	smsMessage->UserDataSettings(smsSettings);
  2424 	smsMessage->UserDataSettings(smsSettings);
  2543 	alphabet=smsSettings.Alphabet();
  2425 	alphabet=smsSettings.Alphabet();
  2544 	TEST(alphabet==TSmsDataCodingScheme::ESmsAlphabet7Bit);
  2426 	TEST(alphabet==TSmsDataCodingScheme::ESmsAlphabet7Bit);
  2545 	CleanupStack::PopAndDestroy(smsMessage);
  2427 	CleanupStack::PopAndDestroy(smsMessage);
  2546 
  2428 
  2547 
       
  2548 	CleanupStack::PopAndDestroy(&socket);
  2429 	CleanupStack::PopAndDestroy(&socket);
  2549     CleanupStack::PopAndDestroy(&socketServer);
       
  2550 
       
  2551 	__UHEAP_MARKEND;
       
  2552 
       
  2553 	return TestStepResult();
  2430 	return TestStepResult();
  2554 	}
  2431 	}
  2555 
       
  2556 
  2432 
  2557 TVerdict CTestZeroLengthIE::doTestStepL()
  2433 TVerdict CTestZeroLengthIE::doTestStepL()
  2558 /**
  2434 /**
  2559  *  Test the enhanced voice mail delete confirmation
  2435  *  Test the enhanced voice mail delete confirmation
  2560  */
  2436  */
  2561 	{
  2437 	{
  2562 	INFO_PRINTF1(_L("Test zero length IE, USIM toolkit IE"));
  2438 	INFO_PRINTF1(_L("Test zero length IE, USIM toolkit IE"));
  2563 
  2439 
  2564 	__UHEAP_MARK;
       
  2565 
       
  2566 	//Send a message with no alphabet set
  2440 	//Send a message with no alphabet set
  2567 	RSocketServ socketServer;
       
  2568 	PrepareRegTestLC(socketServer, 77);
       
  2569 
       
  2570 	RSocket socket;
  2441 	RSocket socket;
  2571 	iSmsStackTestUtils->OpenSmsSocketLC(socketServer,socket,ESmsAddrRecvAny);
  2442 	iSmsStackTestUtils->OpenSmsSocketLC(iSocketServer,socket,ESmsAddrRecvAny);
  2572 
  2443 
  2573 	_LIT(KTestMsg,"This message has a zero length information element.  USIM toolkit security header.");
  2444 	_LIT(KTestMsg,"This message has a zero length information element.  USIM toolkit security header.");
  2574 
  2445 
  2575 	//Set destination and SC numbers
  2446 	//Set destination and SC numbers
  2576 	iTelephoneNumber=KPekka;
  2447 	iTelephoneNumber=KPekka;
  2577 	iServiceCenterNumber=KRadiolinjaSC;
  2448 	iServiceCenterNumber=KRadiolinjaSC;
  2578 
  2449 
  2579 	//Create message
  2450 	//Create message
  2580 	//8 bit coding scheme
  2451 	//8 bit coding scheme
  2581 	TSmsDataCodingScheme::TSmsAlphabet alphabet=TSmsDataCodingScheme::ESmsAlphabet8Bit;
  2452 	TSmsDataCodingScheme::TSmsAlphabet alphabet=TSmsDataCodingScheme::ESmsAlphabet8Bit;
  2582 	CSmsMessage* smsMessage=CreateSmsMessageL(KTestMsg,alphabet);
  2453 	CSmsMessage* smsMessage=CreateSmsMessageLC(KTestMsg,alphabet);
  2583 	CleanupStack::PushL(smsMessage);
       
  2584 
  2454 
  2585 	INFO_PRINTF2(_L("Destination number:..... %S "),&iTelephoneNumber);
  2455 	INFO_PRINTF2(_L("Destination number:..... %S "),&iTelephoneNumber);
  2586 	INFO_PRINTF2(_L("ServiceCenter number:... %S "),&iServiceCenterNumber);
  2456 	INFO_PRINTF2(_L("ServiceCenter number:... %S "),&iServiceCenterNumber);
  2587 
  2457 
  2588 	//Add zero length IE
  2458 	//Add zero length IE
  2630 	TEST(informationElement==CSmsInformationElement::ESmsIEISIMToolkitSecurityHeaders16);
  2500 	TEST(informationElement==CSmsInformationElement::ESmsIEISIMToolkitSecurityHeaders16);
  2631 	CleanupStack::PopAndDestroy(smsMessage);
  2501 	CleanupStack::PopAndDestroy(smsMessage);
  2632 
  2502 
  2633 	//-----------
  2503 	//-----------
  2634 	//Receive message with multiple USIM security headers - 7F and 70, with zero length
  2504 	//Receive message with multiple USIM security headers - 7F and 70, with zero length
  2635 	INFO_PRINTF1(_L("waiting for incoming SMS with multiple USIM security headers, 7F and 70, with zero length...") );
  2505 	INFO_PRINTF1(_L("Receive SMS with multiple USIM security headers, 7F and 70, with zero length...") );
  2636 	WaitForRecvL(socket);
  2506 	WaitForRecvL(socket);
  2637 	smsMessage = RecvSmsL(socket);
  2507 	smsMessage = RecvSmsL(socket);
  2638 
  2508 
  2639 	CleanupStack::PushL(smsMessage);
  2509 	CleanupStack::PushL(smsMessage);
  2640 	TestSmsContentsL(smsMessage,KTestMsg);
  2510 	TestSmsContentsL(smsMessage,KTestMsg);
  2649 	CleanupStack::PopAndDestroy(smsMessage);
  2519 	CleanupStack::PopAndDestroy(smsMessage);
  2650 
  2520 
  2651 	//-----------
  2521 	//-----------
  2652 	//Receive message with multiple USIM security headers - 7F and 7F, with zero length
  2522 	//Receive message with multiple USIM security headers - 7F and 7F, with zero length
  2653 	//This is a duplicate information element
  2523 	//This is a duplicate information element
  2654 	INFO_PRINTF1(_L("waiting for incoming SMS with multiple USIM security headers, 7F and 7F, with zero length...") );
  2524 	INFO_PRINTF1(_L("Receive SMS with multiple USIM security headers, 7F and 7F, with zero length...") );
  2655 	WaitForRecvL(socket);
  2525 	WaitForRecvL(socket);
  2656 	smsMessage = RecvSmsL(socket);
  2526 	smsMessage = RecvSmsL(socket);
  2657 
  2527 
  2658 	CleanupStack::PushL(smsMessage);
  2528 	CleanupStack::PushL(smsMessage);
  2659 	TestSmsContentsL(smsMessage,KTestMsg);
  2529 	TestSmsContentsL(smsMessage,KTestMsg);
  2668 	CleanupStack::PopAndDestroy(smsMessage);
  2538 	CleanupStack::PopAndDestroy(smsMessage);
  2669 	//End receiving
  2539 	//End receiving
  2670 
  2540 
  2671 	//-----Send multiple PDU message with one zero length IE =  0x70
  2541 	//-----Send multiple PDU message with one zero length IE =  0x70
  2672 	 _LIT(KLongMessage,"We might as well use our SMS stack in these phones.  It is by far the most robust, and it performs well under stress.  We have built a stack that is worth being inside a phone, processing messages for the wireless communnity :)");
  2542 	 _LIT(KLongMessage,"We might as well use our SMS stack in these phones.  It is by far the most robust, and it performs well under stress.  We have built a stack that is worth being inside a phone, processing messages for the wireless communnity :)");
  2673 	CSmsMessage *longSmsMessage=CreateSmsMessageL(KLongMessage,alphabet);
  2543 	CSmsMessage *longSmsMessage=CreateSmsMessageLC(KLongMessage,alphabet);
  2674 	CleanupStack::PushL(longSmsMessage);
       
  2675 
  2544 
  2676 	//Get the PDU
  2545 	//Get the PDU
  2677 	CSmsPDU &multiplePdu=longSmsMessage->SmsPDU();
  2546 	CSmsPDU &multiplePdu=longSmsMessage->SmsPDU();
  2678 
  2547 
  2679 	//Get the UserData
  2548 	//Get the UserData
  2795 	informationElement=secondInformationElement.Identifier();
  2664 	informationElement=secondInformationElement.Identifier();
  2796 	TEST(informationElement==CSmsInformationElement::ESmsIEISIMToolkitSecurityHeaders6);
  2665 	TEST(informationElement==CSmsInformationElement::ESmsIEISIMToolkitSecurityHeaders6);
  2797 
  2666 
  2798 	CleanupStack::PopAndDestroy(longSmsMessage);
  2667 	CleanupStack::PopAndDestroy(longSmsMessage);
  2799 	CleanupStack::PopAndDestroy(&socket);
  2668 	CleanupStack::PopAndDestroy(&socket);
  2800     CleanupStack::PopAndDestroy(&socketServer);
       
  2801 
       
  2802 	__UHEAP_MARKEND;
       
  2803 
       
  2804 	return TestStepResult();
  2669 	return TestStepResult();
  2805 	}
  2670 	}
  2806 
       
  2807 
  2671 
  2808 /*
  2672 /*
  2809 	Class 2 Messages are stored on the SIM.  Automatic deletion in the DCS does not delete these messages
  2673 	Class 2 Messages are stored on the SIM.  Automatic deletion in the DCS does not delete these messages
  2810 	from the SIM.  This is the default behaviour.  This behaviour can be changed and it is done in
  2674 	from the SIM.  This is the default behaviour.  This behaviour can be changed and it is done in
  2811 	the esk file.  This is tested in test step CTestAutomaticDeletionInDCSAndInESK.
  2675 	the esk file.  This is tested in test step CTestAutomaticDeletionInDCSAndInESK.
  2814 /**
  2678 /**
  2815  *  Test the enhanced voice mail delete confirmation
  2679  *  Test the enhanced voice mail delete confirmation
  2816  */
  2680  */
  2817 	{
  2681 	{
  2818 	INFO_PRINTF1(_L("Test automatic deletion of messages marked as such in the code data segment(cds)"));
  2682 	INFO_PRINTF1(_L("Test automatic deletion of messages marked as such in the code data segment(cds)"));
  2819 
       
  2820 	__UHEAP_MARK;
       
  2821 
       
  2822 	RSocketServ socketServer;
       
  2823 	PrepareRegTestLC(socketServer, 78);
       
  2824 
       
  2825 	RSocket socket;
  2683 	RSocket socket;
  2826 	iSmsStackTestUtils->OpenSmsSocketLC(socketServer,socket,ESmsAddrRecvAny);
  2684 	iSmsStackTestUtils->OpenSmsSocketLC(iSocketServer,socket,ESmsAddrRecvAny);
  2827 
  2685 
  2828 	_LIT(KTestMsg,"");
  2686 	_LIT(KTestMsg,"");
  2829 
  2687 
  2830 	//Set destination and SC numbers
  2688 	//Set destination and SC numbers
  2831 	iTelephoneNumber=KPekka;
  2689 	iTelephoneNumber=KPekka;
  2832 	iServiceCenterNumber=KRadiolinjaSC;
  2690 	iServiceCenterNumber=KRadiolinjaSC;
  2833 
  2691 
  2834 	//8 bit coding scheme
  2692 	//8 bit coding scheme
  2835 	TSmsDataCodingScheme::TSmsAlphabet alphabet=TSmsDataCodingScheme::ESmsAlphabet8Bit;
  2693 	TSmsDataCodingScheme::TSmsAlphabet alphabet=TSmsDataCodingScheme::ESmsAlphabet8Bit;
  2836 	CSmsMessage* smsMessage=CreateSmsMessageL(KTestMsg,alphabet);
  2694 	CSmsMessage* smsMessage=CreateSmsMessageLC(KTestMsg,alphabet);
  2837 	CleanupStack::PushL(smsMessage);
       
  2838 
  2695 
  2839 	//Set message to class 2
  2696 	//Set message to class 2
  2840 	TSmsDataCodingScheme::TSmsClass pduClass=TSmsDataCodingScheme::ESmsClass2;
  2697 	TSmsDataCodingScheme::TSmsClass pduClass=TSmsDataCodingScheme::ESmsClass2;
  2841 	CSmsPDU& pdu = smsMessage->SmsPDU();
  2698 	CSmsPDU& pdu = smsMessage->SmsPDU();
  2842 	pdu.SetClass(ETrue,pduClass);
  2699 	pdu.SetClass(ETrue,pduClass);
  2865 	//Set message to auto delete
  2722 	//Set message to auto delete
  2866 	TInt autoDeleteHexValue=0x40;
  2723 	TInt autoDeleteHexValue=0x40;
  2867 	pdu.SetBits7To4(TSmsDataCodingScheme::TSmsDCSBits7To4(autoDeleteHexValue));
  2724 	pdu.SetBits7To4(TSmsDataCodingScheme::TSmsDCSBits7To4(autoDeleteHexValue));
  2868 	//Send this message
  2725 	//Send this message
  2869 	SendSmsL(smsMessage,socket);
  2726 	SendSmsL(smsMessage,socket);
  2870 
       
  2871 	CleanupStack::PopAndDestroy(smsMessage);
  2727 	CleanupStack::PopAndDestroy(smsMessage);
  2872 	//----------End Sending
  2728 	//----------End Sending
  2873 
  2729 
  2874 	//Receive a message of class 2 - message will be stored on the SIM
  2730 	INFO_PRINTF1(_L("Receive a message of class 2 - message will be stored on the SIM..."));
  2875 	INFO_PRINTF1(_L("waiting for incoming SMS...") );
  2731 	WaitForRecvL(socket);
  2876 	WaitForRecvL(socket);
  2732 	smsMessage = RecvSmsL(socket);
  2877 	smsMessage = RecvSmsL(socket);
  2733 	CleanupStack::PushL(smsMessage);
  2878 	CleanupStack::PushL(smsMessage);
  2734 	
  2879 	//Get PDU
  2735 	//Get PDU
  2880 	CSmsPDU& classTwoPdu = smsMessage->SmsPDU();
  2736 	CSmsPDU& classTwoPdu = smsMessage->SmsPDU();
  2881 	//Class
  2737 	//Class
  2882 	//TSmsDataCodingScheme::TSmsClass pduClass;
  2738 	//TSmsDataCodingScheme::TSmsClass pduClass;
  2883 	classTwoPdu.Class(pduClass);
  2739 	classTwoPdu.Class(pduClass);
  2888 	//Test the slots
  2744 	//Test the slots
  2889 	count=smsMessage->iSlotArray.Count();
  2745 	count=smsMessage->iSlotArray.Count();
  2890 	TEST(count==1);
  2746 	TEST(count==1);
  2891 	TGsmSmsSlotEntry smsSlot=smsMessage->iSlotArray[0];
  2747 	TGsmSmsSlotEntry smsSlot=smsMessage->iSlotArray[0];
  2892 	TEST(smsSlot.iStore.Compare(_L("S14"))==0);
  2748 	TEST(smsSlot.iStore.Compare(_L("S14"))==0);
  2893 
  2749 	CleanupStack::PopAndDestroy(smsMessage);
  2894 	CleanupStack::PopAndDestroy(smsMessage);
  2750 
  2895 
  2751 	INFO_PRINTF1(_L("Receive a message of class 2 with automatic delete - message will be stored on the SIM..."));
  2896 	//Receive a message of class 2 with automatic delete - message will be stored on the SIM
       
  2897 	INFO_PRINTF1(_L("waiting for incoming SMS class 2 with automatic delete...") );
       
  2898 	WaitForRecvL(socket);
  2752 	WaitForRecvL(socket);
  2899 	smsMessage = RecvSmsL(socket);
  2753 	smsMessage = RecvSmsL(socket);
  2900 	CleanupStack::PushL(smsMessage);
  2754 	CleanupStack::PushL(smsMessage);
  2901 	//Get PDU
  2755 	//Get PDU
  2902 	CSmsPDU& pduClass2 = smsMessage->SmsPDU();
  2756 	CSmsPDU& pduClass2 = smsMessage->SmsPDU();
  2911 	TEST(count==1);
  2765 	TEST(count==1);
  2912 	smsSlot=smsMessage->iSlotArray[0];
  2766 	smsSlot=smsMessage->iSlotArray[0];
  2913 	TEST(smsSlot.iStore.Compare(_L("S14"))==0);
  2767 	TEST(smsSlot.iStore.Compare(_L("S14"))==0);
  2914 	CleanupStack::PopAndDestroy(smsMessage);
  2768 	CleanupStack::PopAndDestroy(smsMessage);
  2915 
  2769 
  2916 	//Receive a message of class 1 with automatic delete
  2770 	INFO_PRINTF1(_L("Receive a message of class 1 with automatic delete...") );
  2917 	INFO_PRINTF1(_L("waiting for incoming SMS class 1 with automatic delete...") );
  2771 	WaitForRecvL(socket);
  2918 	WaitForRecvL(socket);
  2772 	smsMessage = RecvSmsL(socket);
  2919 	smsMessage = RecvSmsL(socket);
  2773 	CleanupStack::PushL(smsMessage);
  2920 	CleanupStack::PushL(smsMessage);
  2774 
  2921 	//Get PDU
  2775 	//Get PDU
  2922 	CSmsPDU& pduClass1 = smsMessage->SmsPDU();
  2776 	CSmsPDU& pduClass1 = smsMessage->SmsPDU();
  2923 	//Class
  2777 	//Class
  2924 	pduClass1.Class(pduClass);
  2778 	pduClass1.Class(pduClass);
  2925 	TEST(pduClass==TSmsDataCodingScheme::ESmsClass1);
  2779 	TEST(pduClass==TSmsDataCodingScheme::ESmsClass1);
       
  2780 	
  2926 	//Test the storage
  2781 	//Test the storage
  2927 	storage=smsMessage->Storage();
  2782 	storage=smsMessage->Storage();
  2928 	TEST(storage==CSmsMessage::ESmsNoStorage);
  2783 	TEST(storage==CSmsMessage::ESmsNoStorage);
  2929 	CleanupStack::PopAndDestroy(smsMessage);
  2784 	CleanupStack::PopAndDestroy(smsMessage);
  2930 
  2785 
  2931 	//Receive a message of class 3 with automatic delete
  2786 	INFO_PRINTF1(_L("Receive a message of class 3 with automatic delete...") );
  2932 	INFO_PRINTF1(_L("waiting for incoming SMS class 3 with automatic delete...") );
  2787 	WaitForRecvL(socket);
  2933 	WaitForRecvL(socket);
  2788 	smsMessage = RecvSmsL(socket);
  2934 	smsMessage = RecvSmsL(socket);
  2789 	CleanupStack::PushL(smsMessage);
  2935 	CleanupStack::PushL(smsMessage);
  2790 	
  2936 	//Get PDU
  2791 	//Get PDU
  2937 	CSmsPDU& pduClass3 = smsMessage->SmsPDU();
  2792 	CSmsPDU& pduClass3 = smsMessage->SmsPDU();
  2938 	//Class
  2793 	//Class
  2939 	pduClass3.Class(pduClass);
  2794 	pduClass3.Class(pduClass);
  2940 	TEST(pduClass==TSmsDataCodingScheme::ESmsClass3);
  2795 	TEST(pduClass==TSmsDataCodingScheme::ESmsClass3);
       
  2796 	
  2941 	//Test the storage
  2797 	//Test the storage
  2942 	storage=smsMessage->Storage();
  2798 	storage=smsMessage->Storage();
  2943 	TEST(storage==CSmsMessage::ESmsNoStorage);
  2799 	TEST(storage==CSmsMessage::ESmsNoStorage);
  2944 	CleanupStack::PopAndDestroy(smsMessage);
  2800 	CleanupStack::PopAndDestroy(smsMessage);
  2945 
  2801 
  2946 	//Receive a message of class 0 with automatic delete
  2802 	INFO_PRINTF1(_L("Receive a message of class 0 with automatic delete...") );
  2947 	INFO_PRINTF1(_L("waiting for incoming SMS class 0 with automatic delete...") );
  2803 	WaitForRecvL(socket);
  2948 	WaitForRecvL(socket);
  2804 	smsMessage = RecvSmsL(socket);
  2949 	smsMessage = RecvSmsL(socket);
  2805 	CleanupStack::PushL(smsMessage);
  2950 	CleanupStack::PushL(smsMessage);
  2806 	
  2951 	//Get PDU
  2807 	//Get PDU
  2952 	CSmsPDU& pduClass0 = smsMessage->SmsPDU();
  2808 	CSmsPDU& pduClass0 = smsMessage->SmsPDU();
  2953 	//Class
  2809 	//Class
  2954 	pduClass0.Class(pduClass);
  2810 	pduClass0.Class(pduClass);
  2955 	TEST(pduClass==TSmsDataCodingScheme::ESmsClass0);
  2811 	TEST(pduClass==TSmsDataCodingScheme::ESmsClass0);
       
  2812 	
  2956 	//Test the storage
  2813 	//Test the storage
  2957 	storage=smsMessage->Storage();
  2814 	storage=smsMessage->Storage();
  2958 	TEST(storage==CSmsMessage::ESmsNoStorage);
  2815 	TEST(storage==CSmsMessage::ESmsNoStorage);
  2959 	CleanupStack::PopAndDestroy(smsMessage);
  2816 	CleanupStack::PopAndDestroy(smsMessage);
  2960 
  2817 
  2980 
  2837 
  2981 	//These are the two class messages received.
  2838 	//These are the two class messages received.
  2982 	TEST(count==2);
  2839 	TEST(count==2);
  2983 
  2840 
  2984 	CleanupStack::PopAndDestroy(&socket);
  2841 	CleanupStack::PopAndDestroy(&socket);
  2985     CleanupStack::PopAndDestroy(&socketServer);
       
  2986 
       
  2987 	__UHEAP_MARKEND;
       
  2988 
       
  2989 	return TestStepResult();
  2842 	return TestStepResult();
  2990 	}
  2843 	}
  2991 
       
  2992 
  2844 
  2993 /*
  2845 /*
  2994 	Class 2 Messages are stored on the SIM.  Automatic deletion in the DCS does not delete these messages
  2846 	Class 2 Messages are stored on the SIM.  Automatic deletion in the DCS does not delete these messages
  2995 	from the SIM.  This is the default behaviour.  This behaviour can be changed and it is done in
  2847 	from the SIM.  This is the default behaviour.  This behaviour can be changed and it is done in
  2996 	the esk file.  This tested in test step CTestAutomaticDeletionInDCSAndInESK.
  2848 	the esk file.  This tested in test step CTestAutomaticDeletionInDCSAndInESK.
  2999 /**
  2851 /**
  3000  *  Test the enhanced voice mail delete confirmation
  2852  *  Test the enhanced voice mail delete confirmation
  3001  */
  2853  */
  3002 	{
  2854 	{
  3003 	INFO_PRINTF1(_L("Test automatic deletion of messages marked in dcs, and set for delete in the ESK file"));
  2855 	INFO_PRINTF1(_L("Test automatic deletion of messages marked in dcs, and set for delete in the ESK file"));
  3004 
       
  3005 	__UHEAP_MARK;
       
  3006 
       
  3007 	RSocketServ socketServer;
       
  3008 	PrepareRegTestLC(socketServer, 79);
       
  3009 
       
  3010 	RSocket socket;
  2856 	RSocket socket;
  3011 	iSmsStackTestUtils->OpenSmsSocketLC(socketServer,socket,ESmsAddrRecvAny);
  2857 	iSmsStackTestUtils->OpenSmsSocketLC(iSocketServer,socket,ESmsAddrRecvAny);
  3012 
  2858 
  3013 	_LIT(KTestMsg,"Esk file has been set to delete class 2 messages marked for automatic deletion");
  2859 	_LIT(KTestMsg,"Esk file has been set to delete class 2 messages marked for automatic deletion");
  3014 
  2860 
  3015 	//Set destination and SC numbers
  2861 	//Set destination and SC numbers
  3016 	iTelephoneNumber=KPekka;
  2862 	iTelephoneNumber=KPekka;
  3017 	iServiceCenterNumber=KRadiolinjaSC;
  2863 	iServiceCenterNumber=KRadiolinjaSC;
  3018 
  2864 
  3019 	//8 bit coding scheme - create message
  2865 	//8 bit coding scheme - create message
  3020 	TSmsDataCodingScheme::TSmsAlphabet alphabet=TSmsDataCodingScheme::ESmsAlphabet8Bit;
  2866 	TSmsDataCodingScheme::TSmsAlphabet alphabet=TSmsDataCodingScheme::ESmsAlphabet8Bit;
  3021 	CSmsMessage* smsMessage=CreateSmsMessageL(KTestMsg,alphabet);
  2867 	CSmsMessage* smsMessage=CreateSmsMessageLC(KTestMsg,alphabet);
  3022 	CleanupStack::PushL(smsMessage);
       
  3023 
  2868 
  3024 	//Set message to class 2
  2869 	//Set message to class 2
  3025 	TSmsDataCodingScheme::TSmsClass pduClass=TSmsDataCodingScheme::ESmsClass2;
  2870 	TSmsDataCodingScheme::TSmsClass pduClass=TSmsDataCodingScheme::ESmsClass2;
  3026 	CSmsPDU& pdu = smsMessage->SmsPDU();
  2871 	CSmsPDU& pdu = smsMessage->SmsPDU();
  3027 	pdu.SetClass(ETrue,pduClass);
  2872 	pdu.SetClass(ETrue,pduClass);
  3126 	count = sbuf();
  2971 	count = sbuf();
  3127 	INFO_PRINTF2(_L("%d enumerated messages after receiving messages"), count);
  2972 	INFO_PRINTF2(_L("%d enumerated messages after receiving messages"), count);
  3128 	TEST(count==0);
  2973 	TEST(count==0);
  3129 
  2974 
  3130 	CleanupStack::PopAndDestroy(&socket);
  2975 	CleanupStack::PopAndDestroy(&socket);
  3131     CleanupStack::PopAndDestroy(&socketServer);
  2976  	return TestStepResult();
  3132 
       
  3133 	__UHEAP_MARKEND;
       
  3134 
       
  3135 	return TestStepResult();
       
  3136 	}
  2977 	}
  3137 
  2978 
  3138 
  2979 
  3139 TVerdict CTestAutomaticDeletionTypeZeroSMS::doTestStepL()
  2980 TVerdict CTestAutomaticDeletionTypeZeroSMS::doTestStepL()
  3140 /**
  2981 /**
  3141  *  Test the enhanced voice mail delete confirmation
  2982  *  Test the enhanced voice mail delete confirmation
  3142  */
  2983  */
  3143 	{
  2984 	{
  3144 	INFO_PRINTF1(_L("Test automatic deletion of messages of type zero"));
  2985 	INFO_PRINTF1(_L("Test automatic deletion of messages of type zero"));
  3145 
       
  3146 	__UHEAP_MARK;
       
  3147 
       
  3148 	RSocketServ socketServer;
       
  3149 	PrepareRegTestLC(socketServer, 80);
       
  3150 	
       
  3151 	RSocket socket;
  2986 	RSocket socket;
  3152 	iSmsStackTestUtils->OpenSmsSocketLC(socketServer,socket,ESmsAddrRecvAny);
  2987 	iSmsStackTestUtils->OpenSmsSocketLC(iSocketServer,socket,ESmsAddrRecvAny);
  3153 
  2988 
  3154 	_LIT(KTestMsg,"Type 0 Sms message");
  2989 	_LIT(KTestMsg,"Type 0 Sms message");
  3155 
  2990 
  3156 	//Set destination and SC numbers
  2991 	//Set destination and SC numbers
  3157 	iTelephoneNumber=KPekka;
  2992 	iTelephoneNumber=KPekka;
  3158 	iServiceCenterNumber=KRadiolinjaSC;
  2993 	iServiceCenterNumber=KRadiolinjaSC;
  3159 
  2994 
  3160 	//8 bit coding scheme - create message
  2995 	//8 bit coding scheme - create message
  3161 	TSmsDataCodingScheme::TSmsAlphabet alphabet=TSmsDataCodingScheme::ESmsAlphabet8Bit;
  2996 	TSmsDataCodingScheme::TSmsAlphabet alphabet=TSmsDataCodingScheme::ESmsAlphabet8Bit;
  3162 	CSmsMessage* smsMessage=CreateSmsMessageL(KTestMsg,alphabet);
  2997 	CSmsMessage* smsMessage=CreateSmsMessageLC(KTestMsg,alphabet);
  3163 	CleanupStack::PushL(smsMessage);
       
  3164 
  2998 
  3165 	//Set message to type 0
  2999 	//Set message to type 0
  3166 	CSmsPDU& pdu = smsMessage->SmsPDU();
  3000 	CSmsPDU& pdu = smsMessage->SmsPDU();
  3167 	//Set the PID type
  3001 	//Set the PID type
  3168 	TSmsProtocolIdentifier::TSmsPIDType pIdType=TSmsProtocolIdentifier::ESmsPIDShortMessageType;
  3002 	TSmsProtocolIdentifier::TSmsPIDType pIdType=TSmsProtocolIdentifier::ESmsPIDShortMessageType;
  3274 	count = sbuf();
  3108 	count = sbuf();
  3275 	INFO_PRINTF2(_L("%d enumerated messages"), count);
  3109 	INFO_PRINTF2(_L("%d enumerated messages"), count);
  3276 	TEST(count==2);
  3110 	TEST(count==2);
  3277 
  3111 
  3278 	CleanupStack::PopAndDestroy(&socket);
  3112 	CleanupStack::PopAndDestroy(&socket);
  3279     CleanupStack::PopAndDestroy(&socketServer);
  3113   	return TestStepResult();
  3280 
       
  3281 	__UHEAP_MARKEND;
       
  3282 
       
  3283 	return TestStepResult();
       
  3284 	}
  3114 	}
  3285 
       
  3286 
       
  3287 
  3115 
  3288 TVerdict CTestAutomaticDeletionTypeZeroAndSetInESK::doTestStepL()
  3116 TVerdict CTestAutomaticDeletionTypeZeroAndSetInESK::doTestStepL()
  3289 /**
  3117 /**
  3290  *  Test the enhanced voice mail delete confirmation
  3118  *  Test the enhanced voice mail delete confirmation
  3291  */
  3119  */
  3292 	{
  3120 	{
  3293 	INFO_PRINTF1(_L("Test automatic deletion of messages of type zero, and set for deletion for Class 0 in ESK file."));
  3121 	INFO_PRINTF1(_L("Test automatic deletion of messages of type zero, and set for deletion for Class 0 in ESK file."));
  3294 
       
  3295 	__UHEAP_MARK;
       
  3296 
       
  3297 	RSocketServ socketServer;
       
  3298 	PrepareRegTestLC(socketServer, 81);
       
  3299 
       
  3300 	RSocket socket;
  3122 	RSocket socket;
  3301 	iSmsStackTestUtils->OpenSmsSocketLC(socketServer,socket,ESmsAddrRecvAny);
  3123 	iSmsStackTestUtils->OpenSmsSocketLC(iSocketServer,socket,ESmsAddrRecvAny);
  3302 
  3124 
  3303 	_LIT(KTestMsg,"Type 0 Sms message");
  3125 	_LIT(KTestMsg,"Type 0 Sms message");
  3304 
  3126 
  3305 	//Set destination and SC numbers
  3127 	//Set destination and SC numbers
  3306 	iTelephoneNumber=KPekka;
  3128 	iTelephoneNumber=KPekka;
  3307 	iServiceCenterNumber=KRadiolinjaSC;
  3129 	iServiceCenterNumber=KRadiolinjaSC;
  3308 
  3130 
  3309 	//8 bit coding scheme - create message
  3131 	//8 bit coding scheme - create message
  3310 	TSmsDataCodingScheme::TSmsAlphabet alphabet=TSmsDataCodingScheme::ESmsAlphabet8Bit;
  3132 	TSmsDataCodingScheme::TSmsAlphabet alphabet=TSmsDataCodingScheme::ESmsAlphabet8Bit;
  3311 	CSmsMessage* smsMessage=CreateSmsMessageL(KTestMsg,alphabet);
  3133 	CSmsMessage* smsMessage=CreateSmsMessageLC(KTestMsg,alphabet);
  3312 	CleanupStack::PushL(smsMessage);
       
  3313 
  3134 
  3314 	//Set message to type 0
  3135 	//Set message to type 0
  3315 	CSmsPDU& pdu = smsMessage->SmsPDU();
  3136 	CSmsPDU& pdu = smsMessage->SmsPDU();
  3316 	//Set the PID type
  3137 	//Set the PID type
  3317 	TSmsProtocolIdentifier::TSmsPIDType pIdType=TSmsProtocolIdentifier::ESmsPIDShortMessageType;
  3138 	TSmsProtocolIdentifier::TSmsPIDType pIdType=TSmsProtocolIdentifier::ESmsPIDShortMessageType;
  3392 	INFO_PRINTF2(_L("%d enumerated messages"), count);
  3213 	INFO_PRINTF2(_L("%d enumerated messages"), count);
  3393 	//This is the class 2 message and the class 1 message with PID=00, i.e. Not type 0
  3214 	//This is the class 2 message and the class 1 message with PID=00, i.e. Not type 0
  3394 	TEST(count==2);
  3215 	TEST(count==2);
  3395 
  3216 
  3396 	CleanupStack::PopAndDestroy(&socket);
  3217 	CleanupStack::PopAndDestroy(&socket);
  3397     CleanupStack::PopAndDestroy(&socketServer);
  3218   	return TestStepResult();
  3398 
       
  3399 	__UHEAP_MARKEND;
       
  3400 
       
  3401 	return TestStepResult();
       
  3402 	}
  3219 	}
  3403 
       
  3404 
  3220 
  3405 TVerdict CTestOOMSendR6Sms::doTestStepL()
  3221 TVerdict CTestOOMSendR6Sms::doTestStepL()
  3406 /**
  3222 /**
  3407  *  Intent:
  3223  *  Intent:
  3408  *  
  3224  *  
  3420  *  4) Repeat the test iteratively, incrementing the counter "i" each time until the message is sent
  3236  *  4) Repeat the test iteratively, incrementing the counter "i" each time until the message is sent
  3421  *  successfully.
  3237  *  successfully.
  3422  */
  3238  */
  3423 	{
  3239 	{
  3424 	INFO_PRINTF1(_L("Test out of memory handling"));
  3240 	INFO_PRINTF1(_L("Test out of memory handling"));
  3425 	RSocketServ socketServer;
       
  3426 	PrepareRegTestLC(socketServer, 82);
       
  3427 
       
  3428 	RSocket socket;
  3241 	RSocket socket;
  3429 	iSmsStackTestUtils->OpenSmsSocketLC(socketServer,socket,ESmsAddrRecvAny);
  3242 	iSmsStackTestUtils->OpenSmsSocketLC(iSocketServer,socket,ESmsAddrRecvAny);
  3430 
  3243 
  3431 	//Set destination and SC numbers
  3244 	//Set destination and SC numbers
  3432 	iTelephoneNumber=KPekka;
  3245 	iTelephoneNumber=KPekka;
  3433 	iServiceCenterNumber=KRadiolinjaSC;
  3246 	iServiceCenterNumber=KRadiolinjaSC;
  3434 
  3247 
  3435 	_LIT(KTestMsg1,"test message, 8bits, length 30");
  3248 	_LIT(KTestMsg1,"test message, 8bits, length 30");
  3436 
  3249 
  3437 	TSmsDataCodingScheme::TSmsAlphabet alphabet=TSmsDataCodingScheme::ESmsAlphabet8Bit;
  3250 	TSmsDataCodingScheme::TSmsAlphabet alphabet=TSmsDataCodingScheme::ESmsAlphabet8Bit;
  3438 	CSmsMessage* smsMessage=CreateSmsMessageL(KTestMsg1,alphabet);
  3251 	CSmsMessage* smsMessage=CreateSmsMessageLC(KTestMsg1,alphabet);
  3439 	CleanupStack::PushL(smsMessage);
       
  3440 
  3252 
  3441 	//Get the operations
  3253 	//Get the operations
  3442 	CSmsHyperLinkOperations& hyperLinkOperations = static_cast<CSmsHyperLinkOperations&>(smsMessage->GetOperationsForIEL(CSmsInformationElement::ESmsHyperLinkFormat));
  3254 	CSmsHyperLinkOperations& hyperLinkOperations = static_cast<CSmsHyperLinkOperations&>(smsMessage->GetOperationsForIEL(CSmsInformationElement::ESmsHyperLinkFormat));
  3443 
  3255 
  3444 	TUint count=hyperLinkOperations.NumberOfHyperLinksL();
  3256 	TUint count=hyperLinkOperations.NumberOfHyperLinksL();
  3552 	count=0;
  3364 	count=0;
  3553 	TInt ret=KErrNoMemory;
  3365 	TInt ret=KErrNoMemory;
  3554 	TInt successfullSends=0;  //maximum expected number of succeeded sends is 2 in TSY config file
  3366 	TInt successfullSends=0;  //maximum expected number of succeeded sends is 2 in TSY config file
  3555 	while (successfullSends<8)
  3367 	while (successfullSends<8)
  3556 		{
  3368 		{
  3557 		socketServer.__DbgFailNext(count);		
  3369 		iSocketServer.__DbgFailNext(count);		
  3558 		socketServer.__DbgMarkHeap();
  3370 		iSocketServer.__DbgMarkHeap();
  3559 		TRAP(ret,SendSmsDontCheckReturnValueL(smsMessage,socket));
  3371 		TRAP(ret,SendSmsDontCheckReturnValueL(smsMessage,socket));
  3560 		socketServer.__DbgMarkEnd(0);
  3372 		iSocketServer.__DbgMarkEnd(0);
  3561 		if(ret==KErrNone)
  3373 		if(ret==KErrNone)
  3562 			successfullSends++;
  3374 		    {
  3563 		count++;
  3375 			++successfullSends;
       
  3376 		    }
       
  3377 		++count;
  3564 		}
  3378 		}
  3565 
  3379 
  3566 	TEST(ret == KErrNone);
  3380 	TEST(ret == KErrNone);
  3567 	socketServer.__DbgFailNext(-1); // Reset heap
  3381 	iSocketServer.__DbgFailNext(-1); // Reset heap
  3568 
  3382 
  3569 	INFO_PRINTF1(_L("TPSRR Scheme"));
  3383 	INFO_PRINTF1(_L("TPSRR Scheme"));
  3570 	
  3384 	
  3571 	// TPSRR Scheme
  3385 	// TPSRR Scheme
  3572 	CSmsTPSRROperations& TPSRROperations = static_cast<CSmsTPSRROperations&>(smsMessage->GetOperationsForNonIEL(ESmsTPSRRParameter));
  3386 	CSmsTPSRROperations& TPSRROperations = static_cast<CSmsTPSRROperations&>(smsMessage->GetOperationsForNonIEL(ESmsTPSRRParameter));
  3576 	count=0;
  3390 	count=0;
  3577 	ret=KErrNoMemory;
  3391 	ret=KErrNoMemory;
  3578 	successfullSends=0;  //maximum expected number of succeeded sends is 2 in TSY config file
  3392 	successfullSends=0;  //maximum expected number of succeeded sends is 2 in TSY config file
  3579 	while (successfullSends<12)
  3393 	while (successfullSends<12)
  3580 		{
  3394 		{
  3581 		socketServer.__DbgFailNext(count);
  3395 		iSocketServer.__DbgFailNext(count);
  3582 		
  3396 		
  3583 		socketServer.__DbgMarkHeap();
  3397 		iSocketServer.__DbgMarkHeap();
  3584 		TRAP(ret,SendSmsDontCheckReturnValueL(smsMessage,socket));
  3398 		TRAP(ret,SendSmsDontCheckReturnValueL(smsMessage,socket));
  3585 		socketServer.__DbgMarkEnd(0);
  3399 		iSocketServer.__DbgMarkEnd(0);
  3586 		if(ret==KErrNone)
  3400 		if(ret==KErrNone)
  3587 			successfullSends++;
  3401 		    {
  3588 		count++;
  3402             ++successfullSends;		
       
  3403 		    }
       
  3404 		++count;
  3589 		}
  3405 		}
  3590 
  3406 
  3591 	TEST(ret == KErrNone);
  3407 	TEST(ret == KErrNone);
  3592 	socketServer.__DbgFailNext(-1); // Reset heap
  3408 	iSocketServer.__DbgFailNext(-1); // Reset heap
  3593 
  3409 
  3594 	CleanupStack::PopAndDestroy(2);	//smsMessage, socket
  3410 	CleanupStack::PopAndDestroy(2, &socket); // socket, smsMessage
  3595 
       
  3596 	//Ensure socket server session is closed to remove cache
       
  3597     CleanupStack::PopAndDestroy(&socketServer);
       
  3598 
       
  3599 	return TestStepResult() ;
  3411 	return TestStepResult() ;
  3600 	}
  3412 	}
  3601 
  3413 
  3602 
  3414 TVerdict CTestEnhancedVoiceMessageBoundary::doTestStepL()
  3603 TVerdict CEnhancedVoiceMessageBoundaryTest::doTestStepL()
       
  3604 {
  3415 {
  3605 	/**
  3416 	/**
  3606 	 *  Create a Enhanced Voice Mail Information Element that occupies 139 bytes.
  3417 	 *  Create a Enhanced Voice Mail Information Element that occupies 139 bytes.
  3607 	 *  139 bytes is the maximum that fit into a single segment message.
  3418 	 *  139 bytes is the maximum that fit into a single segment message.
  3608 	 */
  3419 	 */
  3609 	RSocketServ socketServer;
       
  3610 	PrepareRegTestLC(socketServer, 83);
       
  3611 
       
  3612 	RSocket socket;
  3420 	RSocket socket;
  3613 	iSmsStackTestUtils->OpenSmsSocketLC(socketServer,socket,ESmsAddrRecvAny);
  3421 	iSmsStackTestUtils->OpenSmsSocketLC(iSocketServer,socket,ESmsAddrRecvAny);
  3614 
  3422 
  3615 	CEnhancedVoiceMailNotification* enhancedVoiceMailNotification = CEnhancedVoiceMailNotification::NewL();
  3423 	CEnhancedVoiceMailNotification* enhancedVoiceMailNotification = CEnhancedVoiceMailNotification::NewL();
  3616 
  3424 
  3617 	// Set up base class
  3425 	// Set up base class
  3618 	enhancedVoiceMailNotification->SetProfile(EGsmSmsProfileId3);
  3426 	enhancedVoiceMailNotification->SetProfile(EGsmSmsProfileId3);
  3624 
  3432 
  3625 	enhancedVoiceMailNotification->SetAccessAddressL(KPhoneNumber);
  3433 	enhancedVoiceMailNotification->SetAccessAddressL(KPhoneNumber);
  3626 	enhancedVoiceMailNotification->SetNumberOfVoiceMessages(0xFF);
  3434 	enhancedVoiceMailNotification->SetNumberOfVoiceMessages(0xFF);
  3627 
  3435 
  3628 	RPointerArray<CVoiceMailNotification>& voiceMailNotificationArray = enhancedVoiceMailNotification->GetVoiceMailNotifications();
  3436 	RPointerArray<CVoiceMailNotification>& voiceMailNotificationArray = enhancedVoiceMailNotification->GetVoiceMailNotifications();
  3629 	for (TUint i = 0; i < 8; i++)
  3437 	for (TUint i = 0; i < 8; ++i)
  3630 		{
  3438 		{
  3631 		// Set up notification 1
  3439 		// Set up notification 1
  3632 		CVoiceMailNotification* voiceMailNotification = CVoiceMailNotification::NewL();
  3440 		CVoiceMailNotification* voiceMailNotification = CVoiceMailNotification::NewL();
  3633 
  3441 
  3634 		voiceMailNotification->SetMessageId(0xFFFF);
  3442 		voiceMailNotification->SetMessageId(0xFFFF);
  3645     	voiceMailNotificationArray.Append(voiceMailNotification);
  3453     	voiceMailNotificationArray.Append(voiceMailNotification);
  3646     	}
  3454     	}
  3647 
  3455 
  3648 	_LIT(KTestMsg1,"");
  3456 	_LIT(KTestMsg1,"");
  3649 	TSmsDataCodingScheme::TSmsAlphabet alphabet=TSmsDataCodingScheme::ESmsAlphabet8Bit;
  3457 	TSmsDataCodingScheme::TSmsAlphabet alphabet=TSmsDataCodingScheme::ESmsAlphabet8Bit;
  3650 	CSmsMessage* smsMessage=CreateSmsMessageL(KTestMsg1,alphabet);
  3458 	CSmsMessage* smsMessage=CreateSmsMessageLC(KTestMsg1,alphabet);
  3651 	CleanupStack::PushL(smsMessage);
       
  3652 
  3459 
  3653 	TSmsUserDataSettings userDataSettings;
  3460 	TSmsUserDataSettings userDataSettings;
  3654 	userDataSettings.SetAlphabet(TSmsDataCodingScheme::ESmsAlphabet8Bit);
  3461 	userDataSettings.SetAlphabet(TSmsDataCodingScheme::ESmsAlphabet8Bit);
  3655 	smsMessage->SetUserDataSettingsL(userDataSettings);
  3462 	smsMessage->SetUserDataSettingsL(userDataSettings);
  3656 
  3463 
  3659 	delete enhancedVoiceMailNotification;
  3466 	delete enhancedVoiceMailNotification;
  3660 
  3467 
  3661 	//Send the message
  3468 	//Send the message
  3662 	SendSmsL(smsMessage,socket);
  3469 	SendSmsL(smsMessage,socket);
  3663 
  3470 
  3664 	CleanupStack::PopAndDestroy(smsMessage);
  3471     CleanupStack::PopAndDestroy(2, &socket); // socket, smsMessage
  3665 	CleanupStack::PopAndDestroy(&socket);
  3472   	return TestStepResult();
  3666     CleanupStack::PopAndDestroy(&socketServer);
       
  3667 
       
  3668 	return TestStepResult();
       
  3669 }
  3473 }
  3670 
  3474 
  3671 
  3475 TVerdict CTestEnhancedVoiceMessageBoundary1::doTestStepL()
  3672 TVerdict CEnhancedVoiceMessageBoundaryTest1::doTestStepL()
       
  3673 {
  3476 {
  3674 	/*Creates the maximum size enhanced voice message ie that will fit
  3477 	/*Creates the maximum size enhanced voice message ie that will fit
  3675 	* into a concatenated message, size 134 bytes, allowing 5 bytes for
  3478 	* into a concatenated message, size 134 bytes, allowing 5 bytes for
  3676 	* a concatenation ie in the PDU.
  3479 	* a concatenation ie in the PDU.
  3677 	*/
  3480 	*/
  3678 	RSocketServ socketServer;
       
  3679 	PrepareRegTestLC(socketServer, 84);
       
  3680 
       
  3681 	RSocket socket;
  3481 	RSocket socket;
  3682 	iSmsStackTestUtils->OpenSmsSocketLC(socketServer,socket,ESmsAddrRecvAny);
  3482 	iSmsStackTestUtils->OpenSmsSocketLC(iSocketServer,socket,ESmsAddrRecvAny);
  3683 
  3483 
  3684 	CEnhancedVoiceMailNotification* enhancedVoiceMailNotification = CEnhancedVoiceMailNotification::NewL();
  3484 	CEnhancedVoiceMailNotification* enhancedVoiceMailNotification = CEnhancedVoiceMailNotification::NewL();
  3685 
  3485 
  3686 	// Set up base class
  3486 	// Set up base class
  3687 	enhancedVoiceMailNotification->SetProfile(EGsmSmsProfileId3);
  3487 	enhancedVoiceMailNotification->SetProfile(EGsmSmsProfileId3);
  3693 
  3493 
  3694 	enhancedVoiceMailNotification->SetAccessAddressL(KPhoneNumber);
  3494 	enhancedVoiceMailNotification->SetAccessAddressL(KPhoneNumber);
  3695 	enhancedVoiceMailNotification->SetNumberOfVoiceMessages(0xFF);
  3495 	enhancedVoiceMailNotification->SetNumberOfVoiceMessages(0xFF);
  3696 
  3496 
  3697 	RPointerArray<CVoiceMailNotification>& voiceMailNotificationArray = enhancedVoiceMailNotification->GetVoiceMailNotifications();
  3497 	RPointerArray<CVoiceMailNotification>& voiceMailNotificationArray = enhancedVoiceMailNotification->GetVoiceMailNotifications();
  3698 	for (TUint i = 0; i < 8; i++)
  3498 	for (TUint i = 0; i < 8; ++i)
  3699 	{
  3499 	{
  3700 		// Set up notification 1
  3500 		// Set up notification 1
  3701 		CVoiceMailNotification* voiceMailNotification = CVoiceMailNotification::NewL();
  3501 		CVoiceMailNotification* voiceMailNotification = CVoiceMailNotification::NewL();
  3702 
  3502 
  3703 		voiceMailNotification->SetMessageId(0xFFFF);
  3503 		voiceMailNotification->SetMessageId(0xFFFF);
  3723 			voiceMailNotificationArray.Append(voiceMailNotification);
  3523 			voiceMailNotificationArray.Append(voiceMailNotification);
  3724 	}
  3524 	}
  3725 
  3525 
  3726 	_LIT(KTestMsg1,"Dundee United");
  3526 	_LIT(KTestMsg1,"Dundee United");
  3727 	TSmsDataCodingScheme::TSmsAlphabet alphabet=TSmsDataCodingScheme::ESmsAlphabet8Bit;
  3527 	TSmsDataCodingScheme::TSmsAlphabet alphabet=TSmsDataCodingScheme::ESmsAlphabet8Bit;
  3728 	CSmsMessage* smsMessage=CreateSmsMessageL(KTestMsg1,alphabet);
  3528 	CSmsMessage* smsMessage=CreateSmsMessageLC(KTestMsg1,alphabet);
  3729 	CleanupStack::PushL(smsMessage);
       
  3730 
  3529 
  3731 	TSmsUserDataSettings userDataSettings;
  3530 	TSmsUserDataSettings userDataSettings;
  3732 	userDataSettings.SetAlphabet(TSmsDataCodingScheme::ESmsAlphabet8Bit);
  3531 	userDataSettings.SetAlphabet(TSmsDataCodingScheme::ESmsAlphabet8Bit);
  3733 	smsMessage->SetUserDataSettingsL(userDataSettings);
  3532 	smsMessage->SetUserDataSettingsL(userDataSettings);
  3734 
  3533 
  3737 	delete enhancedVoiceMailNotification;
  3536 	delete enhancedVoiceMailNotification;
  3738 
  3537 
  3739 	//Send the message
  3538 	//Send the message
  3740 	SendSmsL(smsMessage,socket);
  3539 	SendSmsL(smsMessage,socket);
  3741 
  3540 
  3742 	CleanupStack::PopAndDestroy(smsMessage);
  3541     CleanupStack::PopAndDestroy(2, &socket); // socket, smsMessage
  3743 	CleanupStack::PopAndDestroy(&socket);
  3542  	return TestStepResult();
  3744     CleanupStack::PopAndDestroy(&socketServer);
       
  3745 
       
  3746 	return TestStepResult();
       
  3747 }
  3543 }
  3748 
  3544 
  3749 
  3545 TVerdict CTestSubmitReportDefaultsTo7BitDecoding::doTestStepL()
  3750 TVerdict CSubmitReportDefaultsTo7BitDecoding::doTestStepL()
       
  3751 {
  3546 {
  3752 	TBuf8<30> buff;
  3547 	TBuf8<30> buff;
  3753 	buff.SetLength(30);
  3548 	buff.SetLength(30);
  3754 	buff[0]  =   1;
  3549 	buff[0]  =   1;
  3755 	buff[1]  =   5; // Parameter Id
  3550 	buff[1]  =   5; // Parameter Id
  3789 
  3584 
  3790     // Verify that the message has been decoded with the DCS defaulted to 7 Bit
  3585     // Verify that the message has been decoded with the DCS defaulted to 7 Bit
  3791 	_LIT(KTestMsg,"David Narey");
  3586 	_LIT(KTestMsg,"David Narey");
  3792 	TestSmsContentsL(decodedMessage,KTestMsg);
  3587 	TestSmsContentsL(decodedMessage,KTestMsg);
  3793 
  3588 
  3794 
       
  3795 	CleanupStack::PopAndDestroy(decodedMessage);
  3589 	CleanupStack::PopAndDestroy(decodedMessage);
  3796 
       
  3797     return TestStepResult();
  3590     return TestStepResult();
  3798 }
  3591 }
  3799 
  3592 
  3800 
  3593 TVerdict CTestDeliverReportDefaultsTo7BitDecoding::doTestStepL()
  3801 TVerdict CDeliverReportDefaultsTo7BitDecoding::doTestStepL()
       
  3802 {
  3594 {
  3803 	TBuf8<30> buff;
  3595 	TBuf8<30> buff;
  3804 	buff.SetLength(30);
  3596 	buff.SetLength(30);
  3805 	buff[0]  =   0; // change from a 1
  3597 	buff[0]  =   0; // change from a 1
  3806 	buff[1]  =   5; // Parameter Id
  3598 	buff[1]  =   5; // Parameter Id
  3833 
  3625 
  3834     // Verify that the message has been decoded with the DCS defaulted to 7 Bit
  3626     // Verify that the message has been decoded with the DCS defaulted to 7 Bit
  3835 	_LIT(KTestMsg,"David Narey");
  3627 	_LIT(KTestMsg,"David Narey");
  3836 	TestSmsContentsL(decodedMessage,KTestMsg);
  3628 	TestSmsContentsL(decodedMessage,KTestMsg);
  3837 
  3629 
  3838 
       
  3839 	CleanupStack::PopAndDestroy(decodedMessage);
  3630 	CleanupStack::PopAndDestroy(decodedMessage);
  3840 
       
  3841     return TestStepResult();
  3631     return TestStepResult();
  3842 }
  3632 }
  3843 
  3633 
  3844 
  3634 TVerdict CTestStatusReportDefaultsTo7BitDecoding::doTestStepL()
  3845 TVerdict CStatusReportDefaultsTo7BitDecoding::doTestStepL()
       
  3846 {
  3635 {
  3847 	TBuf8<40> buff;
  3636 	TBuf8<40> buff;
  3848 	buff.SetLength(40);
  3637 	buff.SetLength(40);
  3849 
  3638 
  3850 	buff[0]  = 6;
  3639 	buff[0]  = 6;
  3896 
  3685 
  3897     // Verify that the message has been decoded with the DCS defaulted to 7 Bit
  3686     // Verify that the message has been decoded with the DCS defaulted to 7 Bit
  3898 	_LIT(KTestMsg,"David Narey");
  3687 	_LIT(KTestMsg,"David Narey");
  3899 	TestSmsContentsL(decodedMessage,KTestMsg);
  3688 	TestSmsContentsL(decodedMessage,KTestMsg);
  3900 
  3689 
  3901 
       
  3902 	CleanupStack::PopAndDestroy(decodedMessage);
  3690 	CleanupStack::PopAndDestroy(decodedMessage);
  3903 
       
  3904     return TestStepResult();
  3691     return TestStepResult();
  3905 }
  3692 }