os/security/cryptomgmtlibs/securitytestfw/test/testutil/server/testutilstartup.cpp
Update contrib.
2 * Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of the License "Eclipse Public License v1.0"
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
15 * TestUtil - entry point
29 #include "testutilserver.h"
30 #include "testutilclientserver.h"
33 // Perform server initialisation, in particular creation of the scheduler and
34 // server and then run the scheduler
36 static void RunServerL()
38 // Perform all server initialisation, in particular creation of the
39 // scheduler and server and then run the scheduler
42 // naming the server thread after the server helps to debug panics
43 User::LeaveIfError(RThread().RenameMe(KTestUtilServerName));
45 // create and install the active scheduler we need
46 CActiveScheduler* s=new(ELeave) CActiveScheduler;
47 CleanupStack::PushL(s);
48 CActiveScheduler::Install(s);
50 // create the server (leave it on the cleanup stack)
51 CTestUtilServer::NewLC();
53 // Initialisation complete, now signal the client
55 RProcess::Rendezvous(KErrNone);
59 CActiveScheduler::Start();
61 // Cleanup the server and scheduler
62 CleanupStack::PopAndDestroy(2);
66 // Server process entry-point
72 CTrapCleanup* cleanup=CTrapCleanup::New();
85 void PanicClient(const RMessagePtr2& aMessage,TTestUtilPanic aPanic)
87 // RMessagePtr2::Panic() also completes the message. This is:
88 // (a) important for efficient cleanup within the kernel
89 // (b) a problem if the message is completed a second time
92 _LIT(KPanic,"TestUtilServer");
93 aMessage.Panic(KPanic,aPanic);