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.
21 #include "Tef_SSndServer.h"
22 #include "ssndteststep.h"
25 Called inside the MainL() function to create and start the
26 CTestServer derived server.
27 @return - Instance of the test server
29 CSSndTestServer* CSSndTestServer::NewL()
31 CSSndTestServer * server = new (ELeave) CSSndTestServer();
32 CleanupStack::PushL(server);
34 // This test server uses different name after setcap
35 TFileName exename = RProcess().FileName();
36 TParsePtr pathparser(exename);
38 // CServer base class call
39 server->StartL(pathparser.Name());
40 CleanupStack::Pop(server);
46 RProcess().DataCaging(RProcess::EDataCagingOn);
47 RProcess().SecureApi(RProcess::ESecureApiOn);
49 CActiveScheduler* sched=new(ELeave) CActiveScheduler;
50 CActiveScheduler::Install(sched);
51 CSSndTestServer* server = NULL;
52 // Create the CTestServer derived server
53 TRAPD(err,server = CSSndTestServer::NewL());
56 // Sync with the client and enter the active scheduler
57 RProcess::Rendezvous(KErrNone);
65 GLDEF_C TInt E32Main()
67 * @return - Standard Epoc error code on exit
72 CTrapCleanup* cleanup = CTrapCleanup::New();
84 CTestStep* CSSndTestServer::CreateTestStep(const TDesC& aStepName)
86 * @return - A CTestStep derived instance
87 * Implementation of CTestServer pure virtual
90 CTestStep* testStep = NULL;
92 if (aStepName == KResetDb)
94 testStep = new CResetDbStep();
96 else if (aStepName == KGetSound)
98 testStep = new CGetSoundStep();
100 else if (aStepName == KSetSound)
102 testStep = new CSetSoundStep();
104 else if (aStepName == KCorruptSound)
106 testStep = new CCorruptSoundStep();
108 else if (aStepName == KConcurrentSetSound)
110 testStep = new CConcurrentStep();
112 else if (aStepName == KLockoutTest)
114 testStep = new CLockoutTestStep();
116 else if (aStepName == KSystemSoundFileTest)
118 testStep = new CSystemSoundFileTestStep();
120 else if (aStepName == KGapTest)
122 testStep = new CGapTestStep();
124 else if (aStepName == KSoundFileNoPathTest)
126 testStep = new CSoundFileNoPathTestStep();