1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/kernelhwsrv/kerneltest/e32test/dll/oe/t_oeexport2.cpp Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,58 @@
1.4 +// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of the License "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +// e32test\dll\t_oeexport2.cpp
1.18 +// Test loader copes with already loaded OE dlls by running T_OEEXPORT after
1.19 +// we have already loaded a DLL which it depends on (T_OEDLL1.DLL).
1.20 +//
1.21 +//
1.22 +
1.23 +#include <e32test.h>
1.24 +#include <e32ldr.h>
1.25 +#include <e32ldr_private.h>
1.26 +
1.27 +RTest test(_L("T_OEEXPORT2"));
1.28 +
1.29 +TInt E32Main()
1.30 + {
1.31 + test.Title();
1.32 +
1.33 + // Turn off evil lazy dll unloading
1.34 + RLoader l;
1.35 + test(l.Connect()==KErrNone);
1.36 + test(l.CancelLazyDllUnload()==KErrNone);
1.37 + l.Close();
1.38 +
1.39 + test.Start(_L("Preload t_oedll1.dll"));
1.40 + RLibrary library;
1.41 + test(library.Load(_L("t_oedll1.dll")) == KErrNone);
1.42 +
1.43 + test.Next(_L("Run T_OEEXPORT.EXE..."));
1.44 + RProcess p;
1.45 + TInt r=p.Create(_L("T_OEEXPORT.EXE"), _L("2"));
1.46 + test(r==KErrNone);
1.47 + TRequestStatus s;
1.48 + p.Logon(s);
1.49 + p.Resume();
1.50 + User::WaitForRequest(s);
1.51 + TExitCategoryName aExitCategory = p.ExitCategory();
1.52 + test.Printf(_L("Second test exits with: %d,%d,%S\n"),p.ExitType(),p.ExitReason(),&aExitCategory);
1.53 + test(p.ExitType()==EExitKill);
1.54 + test(p.ExitReason()==0);
1.55 + p.Close();
1.56 +
1.57 + library.Close();
1.58 +
1.59 + test.End();
1.60 + return KErrNone;
1.61 + }