|
1 // Copyright (c) 2003-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 "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 // Actually - it has nothing to do with the heap. |
|
15 // It tests the case when we have a pointer to an interface, implemented |
|
16 // by the dll and dll is upgraded, the pointer needs to point to the upgraded version |
|
17 // |
|
18 // |
|
19 |
|
20 #include <swi/launcher.h> |
|
21 #include <e32test.h> |
|
22 #include <f32file.h> |
|
23 #include <bautils.h> |
|
24 #include <ecom/ecom.h> |
|
25 #include "EComUidCodes.h" |
|
26 #include "HeapTestInterface.h" |
|
27 #include "tui.h" |
|
28 |
|
29 |
|
30 |
|
31 |
|
32 using namespace Swi; |
|
33 |
|
34 LOCAL_D RTest test(_L("t_heaptest.exe")); |
|
35 _LIT(KSisFilePath,"Z:\\HeapTestImpl\\HeapTestImpl.sis"); |
|
36 _LIT(KSisFilePath1,"Z:\\HeapTestImpl\\HeapTestImpl1.sis"); |
|
37 |
|
38 /** |
|
39 @SYMTestCaseID SYSLIB-ECOM-CT-0653 |
|
40 @SYMTestCaseDesc Tests the case when we have a pointer to an interface, implemented |
|
41 by the dll and dll is upgraded, the pointer needs to point to the upgraded version |
|
42 @SYMTestPriority High |
|
43 @SYMTestActions Query the interface,check the implementation UID,change its timestamp |
|
44 replace with newer version(timestamp). |
|
45 @SYMTestExpectedResults The test must not fail. |
|
46 @SYMREQ REQ0000 |
|
47 */ |
|
48 |
|
49 |
|
50 void DoTestsL() |
|
51 { |
|
52 |
|
53 TPtrC str(KSisFilePath); |
|
54 TPtrC str1(KSisFilePath1); |
|
55 TFileName sisfilename; |
|
56 sisfilename.Copy(str); |
|
57 TUI *Ui = new(ELeave) TUI; |
|
58 CleanupStack::PushL(Ui); |
|
59 |
|
60 CInstallPrefs* prefs = CInstallPrefs::NewLC(); |
|
61 |
|
62 |
|
63 REComSession& session = REComSession::OpenL(); |
|
64 TRequestStatus status; |
|
65 session.NotifyOnChange(status); |
|
66 |
|
67 RDebug::Printf("installing sis file base version:"); |
|
68 //install HeapTestImpl.sis |
|
69 TInt err=Launcher::Install(*Ui, sisfilename,*prefs); |
|
70 test(err==KErrNone); |
|
71 User::WaitForRequest(status); |
|
72 |
|
73 |
|
74 //Create the interface |
|
75 CHeapTestInterface* intrf = CHeapTestInterface::NewL(); |
|
76 intrf->DisplayMessage(); |
|
77 RDebug::Printf("installed HeapTestImpl.sis- Base version"); |
|
78 delete intrf; |
|
79 |
|
80 //This API is needed to install the upgraded plugin only on winscw |
|
81 REComSession::FinalClose() ; |
|
82 |
|
83 sisfilename.Copy(str1); |
|
84 RDebug::Printf("installing HeapTestImpl.sis- Upgraded version"); |
|
85 //install HeapTestImpl1.sis which is upgraded plugin |
|
86 err=Launcher::Install(*Ui, sisfilename,*prefs); |
|
87 test(err==KErrNone); |
|
88 |
|
89 CHeapTestInterface* intrf1 = CHeapTestInterface::NewL(); |
|
90 intrf1->DisplayMessage(); |
|
91 RDebug::Printf("installed HeapTestImpl.sis- Upgraded version"); |
|
92 delete intrf1; |
|
93 |
|
94 CleanupStack::PopAndDestroy(2); |
|
95 session.Close(); |
|
96 REComSession::FinalClose() ; |
|
97 } |
|
98 |
|
99 |
|
100 GLDEF_C TInt E32Main() |
|
101 { |
|
102 __UHEAP_MARK; |
|
103 test.Title(); |
|
104 test.Start(_L(" @SYMTestCaseID:SYSLIB-ECOM-CT-0653 HeapTest. ")); |
|
105 CTrapCleanup* cleanup = CTrapCleanup::New(); |
|
106 |
|
107 TRAPD(err, ::DoTestsL()); |
|
108 delete cleanup; |
|
109 test(err==KErrNone); |
|
110 test.End(); |
|
111 test.Close(); |
|
112 __UHEAP_MARKEND; |
|
113 return err; |
|
114 } |
|
115 |