Update contrib.
1 // Copyright (c) 2006-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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
19 @internalComponent - Internal Symbian test code
22 #include "TPdrStoreServer.h"
28 _LIT(KServerName,"TPdrStoreServer");
30 CTPdrStoreServer* CTPdrStoreServer::NewL()
32 @return - Instance of the test server
33 Same code for Secure and non-secure variants
34 Called inside the MainL() function to create and start the
35 CTestServer derived server.
38 CTPdrStoreServer * server = new (ELeave) CTPdrStoreServer();
39 CleanupStack::PushL(server);
40 // CServer base class call
41 server->StartL(KServerName);
42 CleanupStack::Pop(server);
50 // Much simpler, uses the new Rendezvous() call to sync with the client
53 RProcess().DataCaging(RProcess::EDataCagingOn);
54 RProcess().SecureApi(RProcess::ESecureApiOn);
55 CActiveScheduler* sched=NULL;
56 sched=new(ELeave) CActiveScheduler;
57 CActiveScheduler::Install(sched);
58 CTPdrStoreServer* server = NULL;
59 // Create the CTestServer derived server
60 TRAPD(err,server = CTPdrStoreServer::NewL());
63 // Sync with the client and enter the active scheduler
64 RProcess::Rendezvous(KErrNone);
71 GLDEF_C TInt E32Main()
73 /** @return - Standard Epoc error code on process exit
75 Process entry point. Called by client using RProcess API
79 CTrapCleanup* cleanup = CTrapCleanup::New();
87 RDebug::Print(_L("CTPdrStoreServer::MainL - Error: %d"), err);
88 User::Panic(KServerName,err);
97 CTestStep* CTPdrStoreServer::CreateTestStep(const TDesC& aStepName)
99 @return - A CTestStep derived instance
100 Secure and non-secure variants
101 Implementation of CTestServer pure virtual
104 CTestStep* testStep = NULL;
106 if(aStepName == KTPdrLstStep)
108 testStep = new CTPdrLstStep();
111 else if(aStepName == KTPdrMemStep)
113 testStep = new CTPdrMemStep();
116 else if(aStepName == KTPdrStep)
118 testStep = new CTPdrStep();