os/ossrv/genericservices/taskscheduler/Test/Testexecute/src/Te_floating_scheduleSuiteServer.cpp
First public contribution.
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 // for (WINS && !EKA2) versions will be xxxServer.Dll and require a thread to be started
15 // in the process of the client. The client initialises the server by calling the
16 // one and only ordinal.
20 #include "Te_floating_scheduleSuiteServer.h"
21 #include "persist_hometimeStep.h"
22 #include "persist_utcStep.h"
23 #include "persist_mixedStep.h"
24 #include "persist_hometime_floatStep.h"
25 #include "transient_hometimeStep.h"
26 #include "transient_utcStep.h"
27 #include "transient_mixedStep.h"
28 #include "transient_hometime_floatStep.h"
29 #include "hometime_floatStep.h"
30 #include "DEF061595_Step.h"
32 _LIT(KServerName,"Te_floating_scheduleSuite");
33 CTe_floating_scheduleSuite* CTe_floating_scheduleSuite::NewL()
35 * @return - Instance of the test server
36 * Same code for Secure and non-secure variants
37 * Called inside the MainL() function to create and start the
38 * CTestServer derived server.
41 CTe_floating_scheduleSuite * server = new (ELeave) CTe_floating_scheduleSuite();
42 CleanupStack::PushL(server);
43 // CServer base class call which can be either StartL or ConstructL,
44 // the later will permit Server Logging.
46 server->StartL(KServerName);
47 //server->ConstructL(KServerName);
48 CleanupStack::Pop(server);
53 // Secure variants much simpler
54 // For EKA2, just an E32Main and a MainL()
58 * Much simpler, uses the new Rendezvous() call to sync with the client
61 // Leave the hooks in for platform security
62 #if (defined __DATA_CAGING__)
63 RProcess().DataCaging(RProcess::EDataCagingOn);
64 RProcess().DataCaging(RProcess::ESecureApiOn);
66 CActiveScheduler* sched=NULL;
67 sched=new(ELeave) CActiveScheduler;
68 CActiveScheduler::Install(sched);
69 CTe_floating_scheduleSuite* server = NULL;
70 // Create the CTestServer derived server
71 TRAPD(err,server = CTe_floating_scheduleSuite::NewL());
74 // Sync with the client and enter the active scheduler
75 RProcess::Rendezvous(KErrNone);
84 GLDEF_C TInt E32Main()
86 * @return - Standard Epoc error code on process exit
88 * Process entry point. Called by client using RProcess API
92 CTrapCleanup* cleanup = CTrapCleanup::New();
104 CTestStep* CTe_floating_scheduleSuite::CreateTestStep(const TDesC& aStepName)
106 * @return - A CTestStep derived instance
107 * Secure and non-secure variants
108 * Implementation of CTestServer pure virtual
111 CTestStep* testStep = NULL;
112 // They are created "just in time" when the worker thread is created
113 // More test steps can be added below
114 if(aStepName == Kpersist_hometimeStep)
115 testStep = new Cpersist_hometimeStep();
116 else if(aStepName == Kpersist_utcStep)
117 testStep = new Cpersist_utcStep();
118 else if(aStepName == Kpersist_mixedStep)
119 testStep = new Cpersist_mixedStep();
120 else if(aStepName == Kpersist_hometime_floatStep)
121 testStep = new Cpersist_hometime_floatStep();
122 else if(aStepName == Ktransient_hometimeStep)
123 testStep = new Ctransient_hometimeStep();
124 else if(aStepName == Ktransient_utcStep)
125 testStep = new Ctransient_utcStep();
126 else if(aStepName == Ktransient_mixedStep)
127 testStep = new Ctransient_mixedStep();
128 else if(aStepName == Ktransient_hometime_floatStep)
129 testStep = new Ctransient_hometime_floatStep();
130 else if(aStepName == Khometime_floatStep)
131 testStep = new Chometime_floatStep();
132 else if(aStepName == KDEF061595_Step)
133 testStep = new CDEF061595_Step();