diff -r 000000000000 -r bde4ae8d615e os/kernelhwsrv/kerneltest/f32test/loader/tld_helper.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/os/kernelhwsrv/kerneltest/f32test/loader/tld_helper.cpp Fri Jun 15 03:10:57 2012 +0200 @@ -0,0 +1,69 @@ +// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of the License "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// \f32test\loader\tld_helper.cpp +// +// + +#include "t_loader_delete.h" +#include +#include +#include + +TInt E32Main() + { +#ifdef __WINS__ + // don't use JIT if running on emulator because don't want to halt + // t_loader_delete test run. + User::SetJustInTime(EFalse); +#endif + + TInt r; + RProcess p; + + RLoader l; + r = l.Connect(); + if (r != KErrNone) + p.Panic(_L("tldh-noconn"), 0); + + + TFileName fn; + User::CommandLine(fn); + + TBuf16<512> aBuf; + aBuf.Copy(fn); + + if (aBuf.FindF(KBadDescriptor) >= 0) + { + const TDesC16 *pBuf = &aBuf; + + ((int*)pBuf)[0] = 0x7554444f; //malformed descriptor + + RDebug::Print(_L("Calling RLoader::Delete passing as an argument a malformed descriptor %S\n"),&fn ); + + r = l.Delete(*pBuf); + + // panic with the reason from RLoader::Delete so t_loader_delete + // can check for the right error code. + p.Panic(KTldPanicCat, r); + + } + + // panic with the reason from RLoader::Delete so t_loader_delete + // can check for the right error code. + r = l.Delete(fn); + p.Panic(KTldPanicCat, r); + + // unused return value - present to prevent compiler warning + return KErrNone; + }