smsprotocols/smsstack/smsprot/Test/TE_Smsprt/TE_smsprtserver.cpp
changeset 20 244d7c5f118e
parent 0 3553901f7fa8
child 24 6638e7f4bd8f
equal deleted inserted replaced
19:1f776524b15c 20:244d7c5f118e
    19  @file
    19  @file
    20 */
    20 */
    21 
    21 
    22 #include "TE_smsprtserver.h"
    22 #include "TE_smsprtserver.h"
    23 #include "TE_smsprt.h"
    23 #include "TE_smsprt.h"
    24 #include "Te_smsprttestcase.h"
    24 #include "smsstacktestcase.h"
    25 #include "te_smsprt_R6.h"
    25 #include "te_smsprt_R6.h"
    26 #include "Te_StatusReportSchemeSteps.h"
    26 #include "Te_StatusReportSchemeSteps.h"
    27 #include "Te_SmsTestSteps.h"
    27 #include "Te_SmsTestSteps.h"
    28 #include "TE_smsmondsk.h"
    28 #include "TE_smsmondsk.h"
    29 
    29 
    37  *  CTestServer derived server.
    37  *  CTestServer derived server.
    38  */
    38  */
    39 	{
    39 	{
    40 	CSmsPrtTestServer * server = new (ELeave) CSmsPrtTestServer();
    40 	CSmsPrtTestServer * server = new (ELeave) CSmsPrtTestServer();
    41 	CleanupStack::PushL(server);
    41 	CleanupStack::PushL(server);
       
    42 	// CSmsStackTestServer intermediate base class call
       
    43 	server->InitializeTsyAndPhonesL();
    42 	// CServer base class call
    44 	// CServer base class call
    43 	server->StartL(KServerName);
    45 	server->StartL(KServerName);
    44 	CleanupStack::Pop(server);
    46 	CleanupStack::Pop(server);
    45 	return server;
    47 	return server;
    46 	}
    48 	}
    47 
    49 
    48 /**
       
    49 	Server destructor ensures SocketServer and Socket session and subsession are closed
       
    50 */
       
    51 CSmsPrtTestServer::~CSmsPrtTestServer()
       
    52 	{ 
       
    53 	iSocketServer.Close();
       
    54 
       
    55  	}
       
    56   
       
    57   
       
    58 LOCAL_C void MainL()
    50 LOCAL_C void MainL()
    59 /**
    51 /**
    60  *  Much simpler, uses the new Rendezvous() call to sync with the client
    52  *  Much simpler, uses the new Rendezvous() call to sync with the client
    61  */
    53  */
    62 	{
    54 	{
   184 		}
   176 		}
   185 	else if (aStepName == _L("TestDeleteSms"))
   177 	else if (aStepName == _L("TestDeleteSms"))
   186 		{
   178 		{
   187 		testStep = new CTestDeleteSms ;	
   179 		testStep = new CTestDeleteSms ;	
   188 		}
   180 		}
       
   181     else if (aStepName == _L("TestSmsAddr"))
       
   182         {
       
   183         testStep = new CTestSmsAddr; 
       
   184         }
   189 	else if (aStepName == _L("TestSocketBinding"))
   185 	else if (aStepName == _L("TestSocketBinding"))
   190 		{
   186 		{
   191 		testStep = new CTestSocketBinding ;	
   187 		testStep = new CTestSocketBinding ;	
   192 		}
   188 		}
   193 	else if (aStepName == _L("TestSmsEventLogger"))
   189 	else if (aStepName == _L("TestSmsEventLogger"))
   294 		{
   290 		{
   295 		testStep = new CTestSendAndRecvMsgsWithDifferentPID ;	
   291 		testStep = new CTestSendAndRecvMsgsWithDifferentPID ;	
   296 		}
   292 		}
   297 	else if (aStepName == _L("SmsParamsErrorCases"))
   293 	else if (aStepName == _L("SmsParamsErrorCases"))
   298 		{
   294 		{
   299 		testStep = new CSmsParamsErrorCases ;	
   295 		testStep = new CTestSmsParamsErrorCases ;	
   300 		}
   296 		}
   301 	else if (aStepName == _L("TestResendFailedConcatinatedMessage"))
   297 	else if (aStepName == _L("TestResendFailedConcatinatedMessage"))
   302 		{
   298 		{
   303 		testStep = new CTestResendFailedConcatinatedMessage ;	
   299 		testStep = new CTestResendFailedConcatinatedMessage ;	
   304 		}
   300 		}
   491 	    {
   487 	    {
   492 	    testStep = new CTestOOMSendR6Sms();
   488 	    testStep = new CTestOOMSendR6Sms();
   493 	    }
   489 	    }
   494 	else if (aStepName== _L("EnhancedVoiceMessageBoundaryTest"))
   490 	else if (aStepName== _L("EnhancedVoiceMessageBoundaryTest"))
   495 	    {
   491 	    {
   496 	    testStep = new CEnhancedVoiceMessageBoundaryTest();
   492 	    testStep = new CTestEnhancedVoiceMessageBoundary();
   497 	    }
   493 	    }
   498 	else if (aStepName== _L("EnhancedVoiceMessageBoundaryTest1"))
   494 	else if (aStepName== _L("EnhancedVoiceMessageBoundaryTest1"))
   499 	    {
   495 	    {
   500 	    testStep = new CEnhancedVoiceMessageBoundaryTest1();
   496 	    testStep = new CTestEnhancedVoiceMessageBoundary1();
   501 	    }
   497 	    }
   502 	else if (aStepName== _L("CSubmitReportDefaultsTo7BitDecoding"))
   498 	else if (aStepName== _L("CSubmitReportDefaultsTo7BitDecoding"))
   503 	    {
   499 	    {
   504 	    testStep = new CSubmitReportDefaultsTo7BitDecoding();
   500 	    testStep = new CTestSubmitReportDefaultsTo7BitDecoding();
   505 	    }
   501 	    }
   506 	else if (aStepName== _L("CDeliverReportDefaultsTo7BitDecoding"))
   502 	else if (aStepName== _L("CDeliverReportDefaultsTo7BitDecoding"))
   507 	    {
   503 	    {
   508 	    testStep = new CDeliverReportDefaultsTo7BitDecoding();
   504 	    testStep = new CTestDeliverReportDefaultsTo7BitDecoding();
   509 	    }
   505 	    }
   510 	else if (aStepName== _L("CStatusReportDefaultsTo7BitDecoding"))
   506 	else if (aStepName== _L("CStatusReportDefaultsTo7BitDecoding"))
   511 	    {
   507 	    {
   512 	    testStep = new CStatusReportDefaultsTo7BitDecoding();
   508 	    testStep = new CTestStatusReportDefaultsTo7BitDecoding();
   513 	    }
   509 	    }
   514 	else if (aStepName== _L("TestSendingTPSRRSchemeInAllPDUs"))
   510 	else if (aStepName== _L("TestSendingTPSRRSchemeInAllPDUs"))
   515 	    {
   511 	    {
   516 	    testStep = new CTestSendingTPSRRSchemeInAllPDUs();
   512 	    testStep = new CTestSendingTPSRRSchemeInAllPDUs();
   517 	    }
   513 	    }
   637 	    
   633 	    
   638 	else if (aStepName== _L("EnumerateInOODCondition"))
   634 	else if (aStepName== _L("EnumerateInOODCondition"))
   639 	    {
   635 	    {
   640 	    testStep = new CEnumerateInOODCondition(iSocketServer);
   636 	    testStep = new CEnumerateInOODCondition(iSocketServer);
   641 	    }	      
   637 	    }	      
   642 	else if (aStepName== _L("ESockMemoryLeakTest"))
       
   643 	    {
       
   644 	    testStep = new CESockMemoryLeakTest();
       
   645 	    }	    
       
   646 	else if (aStepName== _L("TestEncodingPDUonBoundary"))
   638 	else if (aStepName== _L("TestEncodingPDUonBoundary"))
   647 		{
   639 		{
   648 		testStep = new CTestEncodingPDUonBoundary();
   640 		testStep = new CTestEncodingPDUonBoundary();
   649 		}
   641 		}
   650 	else if (aStepName== _L("TestReceiveInvalidOrReservedIE"))
   642 	else if (aStepName== _L("TestReceiveInvalidOrReservedIE"))