author | sl@SLION-WIN7.fritz.box |
Fri, 15 Jun 2012 03:10:57 +0200 | |
changeset 0 | bde4ae8d615e |
permissions | -rw-r--r-- |
sl@0 | 1 |
// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). |
sl@0 | 2 |
// All rights reserved. |
sl@0 | 3 |
// This component and the accompanying materials are made available |
sl@0 | 4 |
// under the terms of "Eclipse Public License v1.0" |
sl@0 | 5 |
// which accompanies this distribution, and is available |
sl@0 | 6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html". |
sl@0 | 7 |
// |
sl@0 | 8 |
// Initial Contributors: |
sl@0 | 9 |
// Nokia Corporation - initial contribution. |
sl@0 | 10 |
// |
sl@0 | 11 |
// Contributors: |
sl@0 | 12 |
// |
sl@0 | 13 |
// Description: |
sl@0 | 14 |
// |
sl@0 | 15 |
|
sl@0 | 16 |
/** |
sl@0 | 17 |
@file |
sl@0 | 18 |
@test |
sl@0 | 19 |
*/ |
sl@0 | 20 |
|
sl@0 | 21 |
#include <ecom/ecom.h> |
sl@0 | 22 |
|
sl@0 | 23 |
#include "egltestserver.h" |
sl@0 | 24 |
#include "eglteststep.h" |
sl@0 | 25 |
|
sl@0 | 26 |
|
sl@0 | 27 |
_LIT(KEGLTestServerName,"egltestserver"); |
sl@0 | 28 |
|
sl@0 | 29 |
|
sl@0 | 30 |
CTestStep* CTestEGLServer::CreateTestStep(const TDesC& aStepName) |
sl@0 | 31 |
{ |
sl@0 | 32 |
return EglTestStepFactory::GetEglTestStep(aStepName); |
sl@0 | 33 |
} |
sl@0 | 34 |
|
sl@0 | 35 |
CTestEGLServer* CTestEGLServer::NewL() |
sl@0 | 36 |
{ |
sl@0 | 37 |
CTestEGLServer* server = new(ELeave) CTestEGLServer(); |
sl@0 | 38 |
CleanupStack::PushL(server); |
sl@0 | 39 |
// CServer base class call |
sl@0 | 40 |
TParsePtrC serverName(RProcess().FileName()); |
sl@0 | 41 |
server->StartL(serverName.Name()); |
sl@0 | 42 |
CleanupStack::Pop(server); |
sl@0 | 43 |
return server; |
sl@0 | 44 |
} |
sl@0 | 45 |
|
sl@0 | 46 |
static void MainL() |
sl@0 | 47 |
{ |
sl@0 | 48 |
CActiveScheduler* sched=NULL; |
sl@0 | 49 |
sched=new(ELeave) CActiveScheduler; |
sl@0 | 50 |
CActiveScheduler::Install(sched); |
sl@0 | 51 |
|
sl@0 | 52 |
#ifdef __WINS__ |
sl@0 | 53 |
// Construct and destroy a process-wide state object in emulator builds. |
sl@0 | 54 |
// This will cause initialisation of PLS for EGL and SgDriver |
sl@0 | 55 |
// and allow checking for leaks in tests |
sl@0 | 56 |
if(!eglReleaseThread()) |
sl@0 | 57 |
{ |
sl@0 | 58 |
// Call to eglReleaseThread failed |
sl@0 | 59 |
User::Leave(KErrGeneral); |
sl@0 | 60 |
} |
sl@0 | 61 |
#endif //__WINS__ |
sl@0 | 62 |
|
sl@0 | 63 |
CTestEGLServer* server = NULL; |
sl@0 | 64 |
// Create the CTestServer derived server |
sl@0 | 65 |
TRAPD(err, server = CTestEGLServer::NewL()); |
sl@0 | 66 |
if(!err) |
sl@0 | 67 |
{ |
sl@0 | 68 |
// Sync with the client and enter the active scheduler |
sl@0 | 69 |
RProcess::Rendezvous(KErrNone); |
sl@0 | 70 |
sched->Start(); |
sl@0 | 71 |
} |
sl@0 | 72 |
delete server; |
sl@0 | 73 |
delete sched; |
sl@0 | 74 |
} |
sl@0 | 75 |
|
sl@0 | 76 |
/** |
sl@0 | 77 |
@return Standard Epoc error code on process exit |
sl@0 | 78 |
Process entry point. Called by client using RProcess API |
sl@0 | 79 |
*/ |
sl@0 | 80 |
TInt E32Main() |
sl@0 | 81 |
{ |
sl@0 | 82 |
__UHEAP_MARK; |
sl@0 | 83 |
CTrapCleanup* cleanup = CTrapCleanup::New(); |
sl@0 | 84 |
if(cleanup == NULL) |
sl@0 | 85 |
{ |
sl@0 | 86 |
return KErrNoMemory; |
sl@0 | 87 |
} |
sl@0 | 88 |
TRAPD(err,MainL()); |
sl@0 | 89 |
|
sl@0 | 90 |
if (err) |
sl@0 | 91 |
{ |
sl@0 | 92 |
RDebug::Print(_L("CTestEGLServer::MainL - Error: %d"), err); |
sl@0 | 93 |
User::Panic(KEGLTestServerName,err); |
sl@0 | 94 |
} |
sl@0 | 95 |
|
sl@0 | 96 |
delete cleanup; |
sl@0 | 97 |
REComSession::FinalClose(); |
sl@0 | 98 |
__UHEAP_MARKEND; |
sl@0 | 99 |
return KErrNone; |
sl@0 | 100 |
} |