os/persistentdata/loggingservices/eventlogger/test/tef/teflogengbur/src/backuprestoreserver.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 // Tests for log engine backup and restore
15 // for (WINS && !EKA2) versions will be xxxServer.Dll and require a thread to be started
16 // in the process of the client. The client initialises the server by calling the
17 // one and only ordinal.
26 #include "backuprestoreserver.h"
27 #include "backuprestorestep.h"
29 _LIT(KServerName,"teflogengbur");
30 CLogEngTestExecuteServer* CLogEngTestExecuteServer::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 CLogEngTestExecuteServer *server = new (ELeave) CLogEngTestExecuteServer();
39 CleanupStack::PushL(server);
40 // CServer base class call which can be either StartL or ConstructL,
41 // the later will permit Server Logging.
43 server->StartL(KServerName);
44 CleanupStack::Pop(server);
50 CActiveScheduler* sched=NULL;
51 sched=new(ELeave) CActiveScheduler;
52 CActiveScheduler::Install(sched);
53 CLogEngTestExecuteServer *server = NULL;
54 // Create the CTestServer derived server
55 TRAPD(err,server = CLogEngTestExecuteServer::NewL());
58 // Sync with the client and enter the active scheduler
59 RProcess::Rendezvous(KErrNone);
66 GLDEF_C TInt E32Main()
68 @return - Standard Epoc error code on process exit
69 Process entry point. Called by client using RProcess API
73 CTrapCleanup* cleanup = CTrapCleanup::New();
87 CTestStep* CLogEngTestExecuteServer::CreateTestStep(const TDesC& aStepName)
89 @return - A CTestStep derived instance
90 Implementation of CTestServer pure virtual
93 CTestStep* testStep = NULL;
94 // They are created "just in time" when the worker thread is created
95 // More test steps can be added below
96 if(aStepName == KBackupRestoreInitializeStep)
97 testStep = new CBackupRestoreInitializeStep();
98 if(aStepName == KStopLogServerStep)
99 testStep = new CStopLogServerStep();
100 if(aStepName == KBackupRestoreVerifyStep)
101 testStep = new CBackupRestoreVerifyStep();