sl@0: // Copyright (c) 2004-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 "CFileUriTest.h" sl@0: sl@0: sl@0: // Constants and definions sl@0: // sl@0: _LIT(KUriParserTestPanic, "T_FileUri"); sl@0: _LIT(KUriTestTitle, "T_FileUri 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_FILEURIMAIN-0001 ")); sl@0: sl@0: CFileUriTest* fileUriTest = CFileUriTest::NewLC(testHarness); sl@0: #ifdef __MEMORY_LEAK_TESTING_ENABLED sl@0: CTestBase::MemoryLeakTestL(*fileUriTest,*testHarness); sl@0: #endif sl@0: fileUriTest->DoTestsL(); sl@0: sl@0: CleanupStack::PopAndDestroy(2, testHarness); //testHarness, fileUriTest 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: }