Update contrib.
1 // Copyright (c) 2002-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 // code at the __EDIT_ME__ tags
17 // for (WINS && !EKA2) versions will be xxxServer.Dll and require a thread to be started
18 // in the process of the client. The client initialises the server by calling the
19 // one and only ordinal.
24 @file CapTestServer.cpp
27 #include <simulprocclient.h>
29 #include "CapTestServer.h"
30 //#include "CapTestStep.h"
31 #include "DevSoundServerTestStep.h"
35 _LIT(KServerName,"DSCapTestServer");
36 // __EDIT_ME__ - Use your own server class name
37 CCapTestServer* CCapTestServer::NewL()
39 * @return - Instance of the test server
40 * Called inside the MainL() function to create and start the
41 * CTestServer derived server.
44 // __EDIT_ME__ new your server class here
45 CCapTestServer * server = new (ELeave) CCapTestServer();
46 CleanupStack::PushL(server);
48 // Either use a StartL or ConstructL, the latter will permit
51 server->StartL(KServerName);
52 //server-> ConstructL(KServerName);
53 CleanupStack::Pop(server);
57 CCapTestServer::CCapTestServer()
61 CCapTestServer::~CCapTestServer()
67 // Just an E32Main and a MainL()
70 * Much simpler, uses the new Rendezvous() call to sync with the client
73 // Leave the hooks in for platform security
74 #if (defined __DATA_CAGING__)
75 RProcess().DataCaging(RProcess::EDataCagingOn);
76 RProcess().SecureApi(RProcess::ESecureApiOn);
78 CActiveScheduler* sched=NULL;
79 sched=new(ELeave) CActiveScheduler;
80 CActiveScheduler::Install(sched);
81 // __EDIT_ME__ Your server name
82 CCapTestServer* server = NULL;
83 // Create the CTestServer derived server
84 // __EDIT_ME__ Your server name
85 TRAPD(err,server = CCapTestServer::NewL());
88 // Sync with the client and enter the active scheduler
89 RProcess::Rendezvous(KErrNone);
97 GLDEF_C TInt E32Main()
99 * @return - Standard Epoc error code on exit
102 CTrapCleanup* cleanup = CTrapCleanup::New();
107 TRAP_IGNORE(MainL());
114 CSimulProcTestStep* CCapTestServer::CreateTestStep(const TDesC& aStepName) const
116 * @return - A CTestStep derived instance
117 * Implementation of CTestServer pure virtual
120 CSimulProcTestStep* testStep = NULL;
121 // __EDIT_ME__ - Create your own test steps here
122 // This server creates just one step but create as many as you want
123 // They are created "just in time" when the worker thread is created
126 //1) SDevSound IntTest: Access DevSoundServer test mm-mmf-sdevsound-i-0016
127 if(aStepName == _L("CSDevSoundTestStep1"))
129 testStep = CSDevSoundTestStep1::NewL();