sl@0: // Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // sl@0: sl@0: /** sl@0: @file sl@0: @test sl@0: @internalComponent sl@0: */ sl@0: sl@0: #include "tgraphicsresourceinternalsecondprocessenums.h" sl@0: #include "tsgimagegeneric.h" sl@0: #include "tsgdrawablegeneric.h" sl@0: #include "tgraphicsresourceinternalsecondprocesstesthandler.h" sl@0: sl@0: TInt MainL() sl@0: { sl@0: TInt procHandles1 = 0; sl@0: TInt threadHandles1 = 0; sl@0: RThread().HandleCount(procHandles1, threadHandles1); sl@0: sl@0: TPckgBuf infoPkg; sl@0: User::LeaveIfError(User::GetDesParameter(KSecondProcessParametersSlot, infoPkg)); sl@0: TSgResIntTestInfo& info = infoPkg(); sl@0: TInt result = 0; sl@0: sl@0: CTSgResInternalSecondProcessTestHandler* handler = CTSgResInternalSecondProcessTestHandler::NewLC(); sl@0: handler->OpenDriverL(); sl@0: sl@0: result = handler->RunTestCaseL(info); sl@0: CleanupStack::PopAndDestroy(handler); sl@0: sl@0: // Handle check sl@0: if (!(result < KErrNone)) sl@0: { sl@0: TInt procHandles2 =0; sl@0: TInt threadHandles2=0; sl@0: RThread().HandleCount(procHandles2,threadHandles2); sl@0: if (threadHandles1 != threadHandles2) sl@0: { sl@0: result = KErrBadHandle; // Thread-owned handles not closed sl@0: } sl@0: } sl@0: sl@0: return result; sl@0: } sl@0: sl@0: GLDEF_C TInt E32Main() sl@0: { sl@0: __UHEAP_MARK; sl@0: CTrapCleanup* cleanupStack = CTrapCleanup::New(); sl@0: if(cleanupStack == NULL) sl@0: { sl@0: return KErrNoMemory; sl@0: } sl@0: TInt result = 0; sl@0: TRAPD(ret, result=MainL()); sl@0: sl@0: if (ret != KErrNone) sl@0: User::Panic(_L("SGRESTEST"), 0); sl@0: sl@0: delete cleanupStack; sl@0: __UHEAP_MARKEND; sl@0: return result; sl@0: }