|
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 |
|
23 RTest test(_L("T_OEEXPORT2")); |
|
24 |
|
25 TInt E32Main() |
|
26 { |
|
27 test.Title(); |
|
28 |
|
29 // Turn off evil lazy dll unloading |
|
30 RLoader l; |
|
31 test(l.Connect()==KErrNone); |
|
32 test(l.CancelLazyDllUnload()==KErrNone); |
|
33 l.Close(); |
|
34 |
|
35 test.Start(_L("Preload t_oedll1.dll")); |
|
36 RLibrary library; |
|
37 test(library.Load(_L("t_oedll1.dll")) == KErrNone); |
|
38 |
|
39 test.Next(_L("Run T_OEEXPORT.EXE...")); |
|
40 RProcess p; |
|
41 TInt r=p.Create(_L("T_OEEXPORT.EXE"), _L("2")); |
|
42 test(r==KErrNone); |
|
43 TRequestStatus s; |
|
44 p.Logon(s); |
|
45 p.Resume(); |
|
46 User::WaitForRequest(s); |
|
47 TExitCategoryName aExitCategory = p.ExitCategory(); |
|
48 test.Printf(_L("Second test exits with: %d,%d,%S\n"),p.ExitType(),p.ExitReason(),&aExitCategory); |
|
49 test(p.ExitType()==EExitKill); |
|
50 test(p.ExitReason()==0); |
|
51 p.Close(); |
|
52 |
|
53 library.Close(); |
|
54 |
|
55 test.End(); |
|
56 return KErrNone; |
|
57 } |