smsprotocols/smsstack/smsprot/Test/TE_Smsprt/TE_SendSMS.cpp
changeset 20 244d7c5f118e
parent 0 3553901f7fa8
child 24 6638e7f4bd8f
equal deleted inserted replaced
19:1f776524b15c 20:244d7c5f118e
    22 CSendSMS::CSendSMS(RSocketServ &aSocketServer)
    22 CSendSMS::CSendSMS(RSocketServ &aSocketServer)
    23 /** 
    23 /** 
    24 	Each test step initialises it's own name
    24 	Each test step initialises it's own name
    25 */
    25 */
    26 	{
    26 	{
    27 	iSocketServer = &aSocketServer;
    27     iSharedSocketServer = &aSocketServer;
       
    28 	iPartOfMultiStepTestCase = ETrue;
    28 	}
    29 	}
    29 
    30 
    30 /**
    31 /**
    31   Send SMS Message
    32   Send SMS Message
    32 */
    33 */
    33 TVerdict CSendSMS::doTestStepL()
    34 TVerdict CSendSMS::doTestStepL()
    34 	{
    35 	{
    35 #ifndef _DEBUG
    36 #ifndef _DEBUG
    36     INFO_PRINTF1(_L("This test can only be run when the SMS Stack is in debug mode."));
    37     INFO_PRINTF1(_L("This test can only be run when the SMS Stack is in debug mode."));
    37 #else   	
    38 #else
    38 	//Open the socket for sending messages
    39 	//Open the socket for sending messages
    39 	RSocket socket;
    40 	RSocket socket;
    40 	INFO_PRINTF1(_L("Opening socket and loading SMS Protocol"));
    41 	OpenSmsSocketL(*iSharedSocketServer, socket, ESmsAddrSendOnly);
    41 	OpenSmsSocketL(*iSocketServer, socket, ESmsAddrSendOnly);
    42     CleanupClosePushL(socket);
    42 	
    43     
    43 	//Create SMS
    44 	//Create SMS
    44 	CSmsMessage* iSms=CreateSMSL();
    45 	CSmsMessage* sms=CreateSMSL();
    45 	CleanupStack::PushL(iSms);
    46     CleanupStack::PushL(sms);
    46 
    47 
    47 	if( iSms )
    48 	if( sms )
    48 		{
    49 		{
    49 		INFO_PRINTF1(_L("Sending SMS...") );
    50 		SendSmsL(sms,socket);				
    50 		PrintMessageL(iSms);
       
    51 		SendSmsL(iSms,socket);				
       
    52 		}
    51 		}
    53 	else
    52 	else
    54 		{
    53 		{
    55 		INFO_PRINTF1(_L("Error creating SMS.") );
    54 		INFO_PRINTF1(_L("Error creating SMS") );
    56 		TEST(EFalse);
    55 		SetTestStepResult(EFail);
    57 		}
    56 		}
    58 	
    57 
    59 	CleanupStack::PopAndDestroy(iSms);
    58     CleanupStack::PopAndDestroy(sms);
    60 	socket.Close();
    59 	CleanupStack::PopAndDestroy(&socket);
    61 #endif	
    60 #endif	
    62 	return TestStepResult();
    61 	return TestStepResult();
    63 	}
    62 	}
    64 //-----------------------------------------------------------------------------
       
    65 
       
    66 
       
    67 
       
    68 
       
    69 
       
    70 
       
    71