os/persistentdata/traceservices/tracefw/ulogger/unit_test/te-server/te_uloggerservertestsuiteserver.cpp
Update contrib.
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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // Example file/test code to demonstrate how to develop a TestExecute Server
15 // Developers should take this project as a template and substitute their own
16 // for (WINS && !EKA2) versions will be xxxServer.Dll and require a thread to be started
17 // in the process of the client. The client initialises the server by calling the
18 // one and only ordinal.
23 @file Te_UloggerServerTestSuiteServer.cpp
27 #include "te_uloggerservertestsuiteserver.h"
28 #include "uloggerservertest0step.h"
29 #include "uloggerservertest1step.h"
30 #include "uloggerservertest2step.h"
31 #include "uloggerservertest3step.h"
32 #include "uloggerservertest4step.h"
33 #include "uloggerservertest5step.h"
34 #include "uloggerservertest6step.h"
36 using namespace Ulogger;
37 _LIT(KServerNameTest,"Te_UloggerServerTestSuite");
38 CTe_UloggerServerTestSuite* CTe_UloggerServerTestSuite::NewL()
40 * @return - Instance of the test server
41 * Same code for Secure and non-secure variants
42 * Called inside the MainL() function to create and start the
43 * CTestServer derived server.
46 CTe_UloggerServerTestSuite * server = new (ELeave) CTe_UloggerServerTestSuite();
47 CleanupStack::PushL(server);
49 server->ConstructL(KServerNameTest);
50 CleanupStack::Pop(server);
55 // Secure variants much simpler
56 // For EKA2, just an E32Main and a MainL()
60 // Leave the hooks in for platform security
61 #if (defined __DATA_CAGING__)
62 RProcess().DataCaging(RProcess::EDataCagingOn);
63 RProcess().DataCaging(RProcess::ESecureApiOn);
65 CActiveScheduler* sched=NULL;
66 sched=new(ELeave) CActiveScheduler;
67 CActiveScheduler::Install(sched);
68 CTe_UloggerServerTestSuite* server = NULL;
69 // Create the CTestServer derived server
70 TRAPD(err,server = CTe_UloggerServerTestSuite::NewL());
73 // Sync with the client and enter the active scheduler
74 RProcess::Rendezvous(KErrNone);
83 GLDEF_C TInt E32Main()
86 CTrapCleanup* cleanup = CTrapCleanup::New();
98 CTestStep* CTe_UloggerServerTestSuite::CreateTestStep(const TDesC& aStepName)
100 * @return - A CTestStep derived instance
101 * Secure and non-secure variants
102 * Implementation of CTestServer pure virtual
105 CTestStep* testStep = NULL;
107 if(aStepName == KUloggerServerTest0Step)
108 testStep = new CUloggerServerTest0Step();
109 else if(aStepName == KUloggerServerTest1Step)
110 testStep = new CUloggerServerTest1Step();
111 else if(aStepName == KUloggerServerTest2Step)
112 testStep = new CUloggerServerTest2Step();
113 else if(aStepName == KUloggerServerTest3Step)
114 testStep = new CUloggerServerTest3Step();
115 else if(aStepName == KUloggerServerTest4Step)
116 testStep = new CUloggerServerTest4Step();
117 else if(aStepName == KUloggerServerTest5Step)
118 testStep = new CUloggerServerTest5Step();
119 else if(aStepName == KUloggerServerTest6Step)
120 testStep = new CUloggerServerTest6Step();