email/pop3andsmtpmtm/imapservermtm/test/src/T_DecodeServer.cpp
changeset 25 84d9eb65b26f
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_decodeserver.h"
       
    17 #include "t_test_decode_step.h"
       
    18 
       
    19 _LIT(KServerName,"T_DecodeServer");
       
    20 CImapDecodeServer* CImapDecodeServer::NewL()
       
    21 	{
       
    22 	CImapDecodeServer * server = new (ELeave) CImapDecodeServer();
       
    23 	CleanupStack::PushL(server);
       
    24 	server-> ConstructL(KServerName);
       
    25 
       
    26 	CleanupStack::Pop(server);
       
    27 	return server;
       
    28 	}
       
    29 	
       
    30 LOCAL_C void MainL()
       
    31 	{
       
    32 	CActiveScheduler* sched=NULL;
       
    33 	sched=new(ELeave) CActiveScheduler;
       
    34 	CActiveScheduler::Install(sched);
       
    35 	CImapDecodeServer* server = NULL;
       
    36 	// Create the CTestServer derived server
       
    37 	TRAPD(err,server = CImapDecodeServer::NewL());
       
    38 	if(!err)
       
    39 		{
       
    40 		// Sync with the client and enter the active scheduler
       
    41 		RProcess::Rendezvous(KErrNone);
       
    42 		sched->Start();
       
    43 		}
       
    44 	delete server;
       
    45 	delete sched;
       
    46 	}
       
    47 
       
    48 
       
    49 GLDEF_C TInt E32Main()
       
    50 	{
       
    51 	__UHEAP_MARK;
       
    52 	
       
    53 	CTrapCleanup* cleanup = CTrapCleanup::New();
       
    54 	if(cleanup == NULL)
       
    55 		{
       
    56 		return KErrNoMemory;
       
    57 		}
       
    58 	TRAPD(err,MainL());
       
    59 	delete cleanup;
       
    60 	
       
    61 	__UHEAP_MARKEND;
       
    62 	return err;
       
    63     }
       
    64 
       
    65 
       
    66 RFs& CImapDecodeServer::Fs()
       
    67 	{
       
    68 	return iFs;
       
    69 	};	
       
    70 
       
    71 CTestStep* CImapDecodeServer::CreateTestStep(const TDesC& aStepName)
       
    72 	{
       
    73 		
       
    74 	CTestStep* testStep = NULL;
       
    75 	
       
    76 	if(aStepName == KTestDecode)
       
    77 		testStep = new CTestDecode();
       
    78 
       
    79 
       
    80 	return testStep;
       
    81 	}