linklayerprotocols/pppnif/te_ppp/src/main.cpp
changeset 0 af10295192d8
equal deleted inserted replaced
-1:000000000000 0:af10295192d8
       
     1 // Copyright (c) 2001-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 // Symbian OS Headers
       
    15 // 
       
    16 //
       
    17 
       
    18 #include <c32comm.h>
       
    19 #include <e32base.h>
       
    20 
       
    21 //Test Framework Header
       
    22 #include <testexecuteserverbase.h>
       
    23 
       
    24 //Test Step Header
       
    25 #include "main.h"
       
    26 #include "TestSteps.h"
       
    27 #include "common.h"
       
    28 
       
    29 _LIT(KServerName, "TE_PPP");
       
    30 
       
    31 LOCAL_C void MainL()
       
    32 {
       
    33 #ifdef __DATA_CAGING__
       
    34 	RProcess().DataCaging(RProcess::EDataCagingOn);
       
    35 	RProcess().DataCaging(RProcess::ESecureApiOn);
       
    36 #endif
       
    37 	CActiveScheduler* sched=NULL;
       
    38 	sched=new(ELeave) CActiveScheduler;
       
    39 	CActiveScheduler::Install(sched);
       
    40 	CPPPAnvlServer* server = NULL;
       
    41 	// Create the CTestServer derived server
       
    42 	TRAPD(err,server = CPPPAnvlServer::NewL());
       
    43 	if(!err)
       
    44 	{
       
    45 		// Sync with the client and enter the active scheduler
       
    46 		RProcess::Rendezvous(KErrNone);
       
    47 		sched->Start();
       
    48 	}
       
    49 	delete server;
       
    50 	delete sched;
       
    51 }
       
    52 
       
    53 GLDEF_C TInt E32Main()
       
    54 {
       
    55 	CTrapCleanup* cleanup = CTrapCleanup::New();
       
    56 	if(cleanup == NULL)
       
    57 	{
       
    58 		return KErrNoMemory;
       
    59 	}
       
    60 	TRAPD(err,MainL());
       
    61 	delete cleanup;
       
    62 	return KErrNone;
       
    63 }
       
    64 
       
    65 CPPPAnvlServer::CPPPAnvlServer()
       
    66 {
       
    67 }
       
    68 
       
    69 CPPPAnvlServer::~CPPPAnvlServer()
       
    70 {
       
    71 	
       
    72 }
       
    73 
       
    74 CPPPAnvlServer* CPPPAnvlServer::NewL()
       
    75 {
       
    76 	CPPPAnvlServer* server = new(ELeave) CPPPAnvlServer();
       
    77 	CleanupStack::PushL(server);
       
    78 	// CServer base class call
       
    79 	// Name the server using the system-wide unique string
       
    80 	// Clients use this to create server sesssions
       
    81 	server->StartL(KServerName);
       
    82 	CleanupStack::Pop();
       
    83 	return server;
       
    84 }
       
    85 
       
    86 CTestStep* CPPPAnvlServer::CreateTestStep(const TDesC &aStepName)
       
    87 {
       
    88 	CTestStep* testStep = NULL;
       
    89 	//  Test step name constant in the test step header file
       
    90 	// Created "just in time"
       
    91 	// Just one created here but create as many as required 
       
    92 	if (aStepName == KPPPANVL) {
       
    93 		testStep = new(ELeave) CPPPANVL();
       
    94 	}
       
    95 	return testStep;
       
    96 }