Update contrib.
1 // Copyright (c) 2007-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.
24 #include "egltestcommonprocess.h"
25 #include "egltestcommonstep.h"
28 void EglTestCommonProcess::MainL()
30 TPckgBuf<TProcessInfo> pckgInfo;
31 TInt ret = User::GetDesParameter(EProcSlotParams, pckgInfo);
32 User::LeaveIfError(ret);
33 TProcessInfo& info = pckgInfo();
35 TBuf<200> bufTestDllName;
36 ret = User::GetDesParameter(EProcSlotTestDllName, bufTestDllName);
37 User::LeaveIfError(ret);
39 TBuf<200> bufTestStepName;
40 ret = User::GetDesParameter(EProcSlotTestStepName, bufTestStepName);
41 User::LeaveIfError(ret);
44 // Construct and destroy a process-wide state object in emulator builds.
45 // This will cause initialisation of PLS for EGL and SgDriver
46 // and allow checking for leaks in tests
50 // Create test step and perform CTestStep style initialisation (e.g. logging)
51 CEglTestStep* testStep = NULL;
53 if(library.Load(bufTestDllName) == KErrNone)
55 typedef CEglTestStep* (* TFnPtrGetEglTestStep) (const TDesC&);
56 TFnPtrGetEglTestStep fnGetEglTestStep = reinterpret_cast<TFnPtrGetEglTestStep>(library.Lookup(1));
57 testStep = fnGetEglTestStep(bufTestStepName);
62 User::Leave(KErrNotFound);
64 CleanupStack::PushL(testStep);
66 // perform CTestStep style initialisation (e.g. logging)
67 testStep->PartialInitialiseL(bufTestStepName);
69 User::LeaveIfError(testStep->iSemaphore[0].Open(EProcSlotSemaphore0, EOwnerThread));
70 User::LeaveIfError(testStep->iSemaphore[1].Open(EProcSlotSemaphore1, EOwnerThread));
72 // perform CTestStep pre-amble
73 User::LeaveIfError(testStep->doTestStepPreambleL());
75 #ifdef SYMBIAN_GRAPHICS_EGL_SGIMAGELITE
76 TBool sgIdHasBeenPassed = info.iSgId.iId != TUint64(0);
78 TBool sgIdHasBeenPassed = EFalse;
79 for(TUint i = 0; i < 5; i++)
81 if((info.iSgId).iId[i] != 0)
83 sgIdHasBeenPassed = ETrue;
87 #endif //SYMBIAN_GRAPHICS_EGL_SGIMAGELITE
89 if(!sgIdHasBeenPassed)
91 testStep->doProcessFunctionL(info.iIdx);
95 testStep->doProcessFunctionL(info.iIdx, info.iSgId);
98 // perform CTestStep post-amble
99 User::LeaveIfError(testStep->doTestStepPostambleL());
102 CleanupStack::PopAndDestroy(testStep);
106 GLDEF_C TInt E32Main()
108 //When EGL Logging is enabled this causes a file server session to be allocated
109 //Which needs to be done before any allocation checks otherwise the test will fail
113 CTrapCleanup* cleanup = CTrapCleanup::New();
119 TRAPD(err, EglTestCommonProcess::MainL());