First public contribution.
1 // Copyright (c) 2001-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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
16 // MEMORY LEAK TESTING - Change and recompile to enable memory leak testing
17 // #define __MEMORY_LEAK_TESTING_ENABLED
26 #include "IpuTestUtils.h"
27 #include "CUriAndAuthorityTest.h"
28 #include "CDelimitedPathTest.h"
29 #include "CDelimitedPathSegmentTest.h"
30 #include "CDelimitedQueryTest.h"
31 #include "CEscapeUtilsTest.h"
32 #include "CTextUtilsTest.h"
33 #include "CUriUtilsTest.h"
34 #include "CSipUriAndAuthorityTest.h"
37 // Constants and definions
39 _LIT(KUriParserTestPanic, "T_Uri");
40 _LIT(KUriTestTitle, "T_Uri Test Harness");
42 GLDEF_C void Panic(TInt aPanic);
44 // Local/Global function implementations
46 GLDEF_C void Panic(TInt aPanic)
48 // Panic the client program.
50 User::Panic(KUriParserTestPanic,aPanic);
55 CIpuTestHarness* testHarness = CIpuTestHarness::NewL(KUriTestTitle);
56 CleanupStack::PushL(testHarness);
57 testHarness->DoResourceLeakTest(ETrue);
59 testHarness->LogIt(_L ("@SYMTestCaseID IWS-APPPROTOCOLS-INETPROTUTIL-T_URIPARSERMAIN-0001 "));
61 CEscapeUtilsTest* escapeUtilsTest = CEscapeUtilsTest::NewLC(testHarness);
62 #ifdef __MEMORY_LEAK_TESTING_ENABLED
63 CTestBase::MemoryLeakTestL(*escapeUtilsTest,*testHarness);
65 escapeUtilsTest->DoTestsL();
67 CTextUtilsTest* textUtilsTest = CTextUtilsTest::NewLC(testHarness);
68 #ifdef __MEMORY_LEAK_TESTING_ENABLED
69 CTestBase::MemoryLeakTestL(*textUtilsTest,*testHarness);
71 textUtilsTest->DoTestsL();
73 CUriUtilsTest* uriUtilsTest = CUriUtilsTest::NewLC(testHarness);
74 #ifdef __MEMORY_LEAK_TESTING_ENABLED
75 CTestBase::MemoryLeakTestL(*uriUtilsTest,*testHarness);
77 uriUtilsTest->DoTestsL();
79 CUriAndAuthorityTest* uriAndAuthorityTest = CUriAndAuthorityTest::NewLC(testHarness);
80 #ifdef __MEMORY_LEAK_TESTING_ENABLED
81 CTestBase::MemoryLeakTestL(*uriAndAuthorityTest,*testHarness);
83 uriAndAuthorityTest->DoTestsL();
85 CDelimitedPathTest* delimitedPathTest = CDelimitedPathTest::NewLC(testHarness);
86 #ifdef __MEMORY_LEAK_TESTING_ENABLED
87 CTestBase::MemoryLeakTestL(*delimitedPathTest,*testHarness);
89 delimitedPathTest->DoTestsL();
91 CDelimitedPathSegmentTest* delimitedPathSegmentTest = CDelimitedPathSegmentTest::NewLC(testHarness);
92 #ifdef __MEMORY_LEAK_TESTING_ENABLED
93 CTestBase::MemoryLeakTestL(*delimitedPathSegmentTest,*testHarness);
95 delimitedPathSegmentTest->DoTestsL();
97 CDelimitedQueryTest* delimitedQueryTest = CDelimitedQueryTest::NewLC(testHarness);
98 #ifdef __MEMORY_LEAK_TESTING_ENABLED
99 CTestBase::MemoryLeakTestL(*delimitedQueryTest,*testHarness);
101 delimitedQueryTest->DoTestsL();
103 CSipUriAndAuthorityTest* sipUriAndAuthorityTest = CSipUriAndAuthorityTest::NewLC(testHarness);
104 #ifdef __MEMORY_LEAK_TESTING_ENABLED
105 CTestBase::MemoryLeakTestL(*sipUriAndAuthorityTest,*testHarness);
107 sipUriAndAuthorityTest->DoTestsL();
109 CleanupStack::PopAndDestroy(9, testHarness); // lots!
112 GLDEF_C TInt E32Main()
117 CTrapCleanup* tc=CTrapCleanup::New();
120 User::Panic(_L("Failed to complete test"),err);