os/kernelhwsrv/kerneltest/e32test/dll/oe/t_oeexport2.cpp
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
     1 // Copyright (c) 2006-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 the License "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".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 // e32test\dll\t_oeexport2.cpp
    15 // Test loader copes with already loaded OE dlls by running T_OEEXPORT after
    16 // we have already loaded a DLL which it depends on (T_OEDLL1.DLL).
    17 // 
    18 //
    19 
    20 #include <e32test.h>
    21 #include <e32ldr.h>
    22 #include <e32ldr_private.h>
    23 
    24 RTest test(_L("T_OEEXPORT2"));
    25 
    26 TInt E32Main()
    27 	{
    28 	test.Title();
    29 
    30 	// Turn off evil lazy dll unloading
    31 	RLoader l;
    32 	test(l.Connect()==KErrNone);
    33 	test(l.CancelLazyDllUnload()==KErrNone);
    34 	l.Close();
    35 
    36 	test.Start(_L("Preload t_oedll1.dll"));
    37 	RLibrary library;
    38 	test(library.Load(_L("t_oedll1.dll")) == KErrNone);
    39 
    40 	test.Next(_L("Run T_OEEXPORT.EXE..."));
    41 	RProcess p;
    42 	TInt r=p.Create(_L("T_OEEXPORT.EXE"), _L("2"));
    43 	test(r==KErrNone);
    44 	TRequestStatus s;
    45 	p.Logon(s);
    46 	p.Resume();
    47 	User::WaitForRequest(s);
    48 	TExitCategoryName aExitCategory = p.ExitCategory();
    49 	test.Printf(_L("Second test exits with: %d,%d,%S\n"),p.ExitType(),p.ExitReason(),&aExitCategory);
    50 	test(p.ExitType()==EExitKill);
    51 	test(p.ExitReason()==0);
    52 	p.Close();
    53 
    54 	library.Close();
    55 
    56 	test.End();
    57 	return KErrNone;
    58 	}