messagingappbase/smsmtm/test/src/t_SmsSpecialIndicationsServer.cpp
changeset 25 84d9eb65b26f
parent 23 238255e8b033
child 27 e4592d119491
child 37 518b245aa84c
child 79 2981cb3aa489
equal deleted inserted replaced
23:238255e8b033 25:84d9eb65b26f
     1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #include "t_smsspecialindicationsserver.h"
       
    17 #include "t_smsspecialindicationsstep.h"
       
    18  
       
    19 _LIT(KServerName,"t_SmsSpecialIndicationsServer");
       
    20 
       
    21 CSmsSpecialIndicationsServer* CSmsSpecialIndicationsServer::NewL()
       
    22 	{
       
    23 	CSmsSpecialIndicationsServer * server = new (ELeave) CSmsSpecialIndicationsServer();
       
    24 	CleanupStack::PushL(server);
       
    25 	server-> ConstructL(KServerName);
       
    26 	CleanupStack::Pop(server);
       
    27 	return server;
       
    28 	}
       
    29 	
       
    30 LOCAL_C void MainL()
       
    31 	{
       
    32 	RProcess().DataCaging(RProcess::EDataCagingOn);
       
    33 	RProcess().SecureApi(RProcess::ESecureApiOn);
       
    34 	CActiveScheduler* sched=NULL;
       
    35 	sched=new(ELeave) CActiveScheduler;
       
    36 	CActiveScheduler::Install(sched);
       
    37 	CSmsSpecialIndicationsServer* server = NULL;
       
    38 	// Create the CTestServer derived server
       
    39 	TRAPD(err,server = CSmsSpecialIndicationsServer::NewL());
       
    40 	if(!err)
       
    41 		{
       
    42 		// Sync with the client and enter the active scheduler
       
    43 		RProcess::Rendezvous(KErrNone);
       
    44 		sched->Start();
       
    45 		}
       
    46 	delete server;
       
    47 	server = NULL;
       
    48 	delete sched;
       
    49 	}
       
    50 
       
    51 
       
    52 GLDEF_C TInt E32Main()
       
    53 	{
       
    54 	__UHEAP_MARK;
       
    55 	CTrapCleanup* cleanup = CTrapCleanup::New();
       
    56 	if(cleanup == NULL)
       
    57 		{
       
    58 		return KErrNoMemory;
       
    59 		}
       
    60 	TRAPD(err,MainL());
       
    61 	delete cleanup;
       
    62 	__UHEAP_MARKEND;
       
    63 	return err;
       
    64     }
       
    65     
       
    66 RFs& CSmsSpecialIndicationsServer::Fs()
       
    67 	{
       
    68 	return iFs;
       
    69 	};	
       
    70 
       
    71 CTestStep* CSmsSpecialIndicationsServer::CreateTestStep(const TDesC& aStepName)
       
    72 	{
       
    73 		
       
    74 	CSmsSpecialIndicationsStep* testStep = NULL; 	
       
    75 	
       
    76 	if(aStepName == KSmsSpecialIndicationsStep1)
       
    77 	{
       
    78 		testStep = new CSmsSpecialIndicationsStep();	
       
    79 		testStep->InitialiseSpecialIndicationsStepL();		
       
    80 	}
       
    81 	
       
    82 	return (CTestStep*)testStep;
       
    83 	}