sl@0: // Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // sl@0: sl@0: // MEMORY LEAK TESTING - Change and recompile to enable memory leak testing sl@0: // #define __MEMORY_LEAK_TESTING_ENABLED sl@0: sl@0: sl@0: // System includes sl@0: // sl@0: #include sl@0: sl@0: // Local include sl@0: // sl@0: #include "IpuTestUtils.h" sl@0: #include "CUriAndAuthorityTest.h" sl@0: #include "CDelimitedPathTest.h" sl@0: #include "CDelimitedPathSegmentTest.h" sl@0: #include "CDelimitedQueryTest.h" sl@0: #include "CEscapeUtilsTest.h" sl@0: #include "CTextUtilsTest.h" sl@0: #include "CUriUtilsTest.h" sl@0: #include "CSipUriAndAuthorityTest.h" sl@0: sl@0: sl@0: // Constants and definions sl@0: // sl@0: _LIT(KUriParserTestPanic, "T_Uri"); sl@0: _LIT(KUriTestTitle, "T_Uri Test Harness"); sl@0: sl@0: GLDEF_C void Panic(TInt aPanic); sl@0: sl@0: // Local/Global function implementations sl@0: // sl@0: GLDEF_C void Panic(TInt aPanic) sl@0: // sl@0: // Panic the client program. sl@0: { sl@0: User::Panic(KUriParserTestPanic,aPanic); sl@0: } sl@0: sl@0: GLDEF_C void TestL() sl@0: { sl@0: CIpuTestHarness* testHarness = CIpuTestHarness::NewL(KUriTestTitle); sl@0: CleanupStack::PushL(testHarness); sl@0: testHarness->DoResourceLeakTest(ETrue); sl@0: sl@0: testHarness->LogIt(_L ("@SYMTestCaseID IWS-APPPROTOCOLS-INETPROTUTIL-T_URIPARSERMAIN-0001 ")); sl@0: sl@0: CEscapeUtilsTest* escapeUtilsTest = CEscapeUtilsTest::NewLC(testHarness); sl@0: #ifdef __MEMORY_LEAK_TESTING_ENABLED sl@0: CTestBase::MemoryLeakTestL(*escapeUtilsTest,*testHarness); sl@0: #endif sl@0: escapeUtilsTest->DoTestsL(); sl@0: sl@0: CTextUtilsTest* textUtilsTest = CTextUtilsTest::NewLC(testHarness); sl@0: #ifdef __MEMORY_LEAK_TESTING_ENABLED sl@0: CTestBase::MemoryLeakTestL(*textUtilsTest,*testHarness); sl@0: #endif sl@0: textUtilsTest->DoTestsL(); sl@0: sl@0: CUriUtilsTest* uriUtilsTest = CUriUtilsTest::NewLC(testHarness); sl@0: #ifdef __MEMORY_LEAK_TESTING_ENABLED sl@0: CTestBase::MemoryLeakTestL(*uriUtilsTest,*testHarness); sl@0: #endif sl@0: uriUtilsTest->DoTestsL(); sl@0: sl@0: CUriAndAuthorityTest* uriAndAuthorityTest = CUriAndAuthorityTest::NewLC(testHarness); sl@0: #ifdef __MEMORY_LEAK_TESTING_ENABLED sl@0: CTestBase::MemoryLeakTestL(*uriAndAuthorityTest,*testHarness); sl@0: #endif sl@0: uriAndAuthorityTest->DoTestsL(); sl@0: sl@0: CDelimitedPathTest* delimitedPathTest = CDelimitedPathTest::NewLC(testHarness); sl@0: #ifdef __MEMORY_LEAK_TESTING_ENABLED sl@0: CTestBase::MemoryLeakTestL(*delimitedPathTest,*testHarness); sl@0: #endif sl@0: delimitedPathTest->DoTestsL(); sl@0: sl@0: CDelimitedPathSegmentTest* delimitedPathSegmentTest = CDelimitedPathSegmentTest::NewLC(testHarness); sl@0: #ifdef __MEMORY_LEAK_TESTING_ENABLED sl@0: CTestBase::MemoryLeakTestL(*delimitedPathSegmentTest,*testHarness); sl@0: #endif sl@0: delimitedPathSegmentTest->DoTestsL(); sl@0: sl@0: CDelimitedQueryTest* delimitedQueryTest = CDelimitedQueryTest::NewLC(testHarness); sl@0: #ifdef __MEMORY_LEAK_TESTING_ENABLED sl@0: CTestBase::MemoryLeakTestL(*delimitedQueryTest,*testHarness); sl@0: #endif sl@0: delimitedQueryTest->DoTestsL(); sl@0: sl@0: CSipUriAndAuthorityTest* sipUriAndAuthorityTest = CSipUriAndAuthorityTest::NewLC(testHarness); sl@0: #ifdef __MEMORY_LEAK_TESTING_ENABLED sl@0: CTestBase::MemoryLeakTestL(*sipUriAndAuthorityTest,*testHarness); sl@0: #endif sl@0: sipUriAndAuthorityTest->DoTestsL(); sl@0: sl@0: CleanupStack::PopAndDestroy(9, testHarness); // lots! sl@0: } sl@0: sl@0: GLDEF_C TInt E32Main() sl@0: // sl@0: // Main function sl@0: { sl@0: __UHEAP_MARK; sl@0: CTrapCleanup* tc=CTrapCleanup::New(); sl@0: TRAPD(err,TestL()); sl@0: if (err!=KErrNone) sl@0: User::Panic(_L("Failed to complete test"),err); sl@0: delete tc; sl@0: __UHEAP_MARKEND; sl@0: return KErrNone; sl@0: }