|
1 // Copyright (c) 2004-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 // |
|
15 |
|
16 // MEMORY LEAK TESTING - Change and recompile to enable memory leak testing |
|
17 // #define __MEMORY_LEAK_TESTING_ENABLED |
|
18 |
|
19 |
|
20 // System includes |
|
21 // |
|
22 #include <e32base.h> |
|
23 |
|
24 // Local include |
|
25 // |
|
26 #include "IpuTestUtils.h" |
|
27 #include "CFileUriTest.h" |
|
28 |
|
29 |
|
30 // Constants and definions |
|
31 // |
|
32 _LIT(KUriParserTestPanic, "T_FileUri"); |
|
33 _LIT(KUriTestTitle, "T_FileUri Test Harness"); |
|
34 |
|
35 GLDEF_C void Panic(TInt aPanic); |
|
36 |
|
37 // Local/Global function implementations |
|
38 // |
|
39 GLDEF_C void Panic(TInt aPanic) |
|
40 // |
|
41 // Panic the client program. |
|
42 { |
|
43 User::Panic(KUriParserTestPanic,aPanic); |
|
44 } |
|
45 |
|
46 GLDEF_C void TestL() |
|
47 { |
|
48 CIpuTestHarness* testHarness = CIpuTestHarness::NewL(KUriTestTitle); |
|
49 CleanupStack::PushL(testHarness); |
|
50 testHarness->DoResourceLeakTest(ETrue); |
|
51 |
|
52 testHarness->LogIt(_L ("@SYMTestCaseID IWS-APPPROTOCOLS-INETPROTUTIL-T_FILEURIMAIN-0001 ")); |
|
53 |
|
54 CFileUriTest* fileUriTest = CFileUriTest::NewLC(testHarness); |
|
55 #ifdef __MEMORY_LEAK_TESTING_ENABLED |
|
56 CTestBase::MemoryLeakTestL(*fileUriTest,*testHarness); |
|
57 #endif |
|
58 fileUriTest->DoTestsL(); |
|
59 |
|
60 CleanupStack::PopAndDestroy(2, testHarness); //testHarness, fileUriTest |
|
61 } |
|
62 |
|
63 GLDEF_C TInt E32Main() |
|
64 // |
|
65 // Main function |
|
66 { |
|
67 __UHEAP_MARK; |
|
68 CTrapCleanup* tc=CTrapCleanup::New(); |
|
69 TRAPD(err,TestL()); |
|
70 if (err!=KErrNone) |
|
71 User::Panic(_L("Failed to complete test"),err); |
|
72 delete tc; |
|
73 __UHEAP_MARKEND; |
|
74 return KErrNone; |
|
75 } |