os/ossrv/genericservices/httputils/Test/t_uriparser/T_UriParserMain.cpp
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
sl@0
     1
// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     2
// All rights reserved.
sl@0
     3
// This component and the accompanying materials are made available
sl@0
     4
// under the terms of "Eclipse Public License v1.0"
sl@0
     5
// which accompanies this distribution, and is available
sl@0
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     7
//
sl@0
     8
// Initial Contributors:
sl@0
     9
// Nokia Corporation - initial contribution.
sl@0
    10
//
sl@0
    11
// Contributors:
sl@0
    12
//
sl@0
    13
// Description:
sl@0
    14
//
sl@0
    15
sl@0
    16
// MEMORY LEAK TESTING - Change and recompile to enable memory leak testing
sl@0
    17
// #define __MEMORY_LEAK_TESTING_ENABLED
sl@0
    18
sl@0
    19
sl@0
    20
// System includes
sl@0
    21
//
sl@0
    22
#include <e32base.h>
sl@0
    23
sl@0
    24
// Local include
sl@0
    25
//
sl@0
    26
#include "IpuTestUtils.h"
sl@0
    27
#include "CUriAndAuthorityTest.h"
sl@0
    28
#include "CDelimitedPathTest.h"
sl@0
    29
#include "CDelimitedPathSegmentTest.h"
sl@0
    30
#include "CDelimitedQueryTest.h"
sl@0
    31
#include "CEscapeUtilsTest.h"
sl@0
    32
#include "CTextUtilsTest.h"
sl@0
    33
#include "CUriUtilsTest.h"
sl@0
    34
#include "CSipUriAndAuthorityTest.h"
sl@0
    35
sl@0
    36
sl@0
    37
// Constants and definions
sl@0
    38
//
sl@0
    39
_LIT(KUriParserTestPanic, "T_Uri");
sl@0
    40
_LIT(KUriTestTitle, "T_Uri Test Harness");
sl@0
    41
sl@0
    42
GLDEF_C void Panic(TInt aPanic);
sl@0
    43
sl@0
    44
//	Local/Global function implementations
sl@0
    45
//
sl@0
    46
GLDEF_C void Panic(TInt aPanic)
sl@0
    47
//
sl@0
    48
//	Panic the client program.
sl@0
    49
	{
sl@0
    50
	User::Panic(KUriParserTestPanic,aPanic);
sl@0
    51
	}
sl@0
    52
sl@0
    53
GLDEF_C void TestL()
sl@0
    54
	{
sl@0
    55
	CIpuTestHarness* testHarness = CIpuTestHarness::NewL(KUriTestTitle);
sl@0
    56
	CleanupStack::PushL(testHarness);
sl@0
    57
	testHarness->DoResourceLeakTest(ETrue);
sl@0
    58
sl@0
    59
	testHarness->LogIt(_L ("@SYMTestCaseID IWS-APPPROTOCOLS-INETPROTUTIL-T_URIPARSERMAIN-0001 "));
sl@0
    60
sl@0
    61
	CEscapeUtilsTest* escapeUtilsTest = CEscapeUtilsTest::NewLC(testHarness);
sl@0
    62
#ifdef __MEMORY_LEAK_TESTING_ENABLED
sl@0
    63
	CTestBase::MemoryLeakTestL(*escapeUtilsTest,*testHarness);
sl@0
    64
#endif
sl@0
    65
	escapeUtilsTest->DoTestsL();
sl@0
    66
sl@0
    67
	CTextUtilsTest* textUtilsTest = CTextUtilsTest::NewLC(testHarness);
sl@0
    68
#ifdef __MEMORY_LEAK_TESTING_ENABLED
sl@0
    69
	CTestBase::MemoryLeakTestL(*textUtilsTest,*testHarness);
sl@0
    70
#endif
sl@0
    71
	textUtilsTest->DoTestsL();
sl@0
    72
sl@0
    73
	CUriUtilsTest* uriUtilsTest = CUriUtilsTest::NewLC(testHarness);
sl@0
    74
#ifdef __MEMORY_LEAK_TESTING_ENABLED
sl@0
    75
	CTestBase::MemoryLeakTestL(*uriUtilsTest,*testHarness);
sl@0
    76
#endif
sl@0
    77
	uriUtilsTest->DoTestsL();
sl@0
    78
sl@0
    79
	CUriAndAuthorityTest* uriAndAuthorityTest = CUriAndAuthorityTest::NewLC(testHarness);
sl@0
    80
#ifdef __MEMORY_LEAK_TESTING_ENABLED
sl@0
    81
	CTestBase::MemoryLeakTestL(*uriAndAuthorityTest,*testHarness);
sl@0
    82
#endif
sl@0
    83
	uriAndAuthorityTest->DoTestsL();
sl@0
    84
	
sl@0
    85
	CDelimitedPathTest* delimitedPathTest = CDelimitedPathTest::NewLC(testHarness);
sl@0
    86
#ifdef __MEMORY_LEAK_TESTING_ENABLED
sl@0
    87
	CTestBase::MemoryLeakTestL(*delimitedPathTest,*testHarness);
sl@0
    88
#endif
sl@0
    89
	delimitedPathTest->DoTestsL();
sl@0
    90
sl@0
    91
	CDelimitedPathSegmentTest* delimitedPathSegmentTest = CDelimitedPathSegmentTest::NewLC(testHarness);
sl@0
    92
#ifdef __MEMORY_LEAK_TESTING_ENABLED
sl@0
    93
	CTestBase::MemoryLeakTestL(*delimitedPathSegmentTest,*testHarness);
sl@0
    94
#endif
sl@0
    95
	delimitedPathSegmentTest->DoTestsL();
sl@0
    96
sl@0
    97
	CDelimitedQueryTest* delimitedQueryTest = CDelimitedQueryTest::NewLC(testHarness);
sl@0
    98
#ifdef __MEMORY_LEAK_TESTING_ENABLED
sl@0
    99
	CTestBase::MemoryLeakTestL(*delimitedQueryTest,*testHarness);
sl@0
   100
#endif
sl@0
   101
	delimitedQueryTest->DoTestsL();
sl@0
   102
sl@0
   103
	CSipUriAndAuthorityTest* sipUriAndAuthorityTest = CSipUriAndAuthorityTest::NewLC(testHarness);
sl@0
   104
#ifdef __MEMORY_LEAK_TESTING_ENABLED
sl@0
   105
	CTestBase::MemoryLeakTestL(*sipUriAndAuthorityTest,*testHarness);
sl@0
   106
#endif
sl@0
   107
	sipUriAndAuthorityTest->DoTestsL();
sl@0
   108
sl@0
   109
	CleanupStack::PopAndDestroy(9, testHarness);	//	lots!
sl@0
   110
	}
sl@0
   111
sl@0
   112
GLDEF_C TInt E32Main()
sl@0
   113
//
sl@0
   114
// Main function
sl@0
   115
	{
sl@0
   116
	__UHEAP_MARK;
sl@0
   117
	CTrapCleanup* tc=CTrapCleanup::New();
sl@0
   118
	TRAPD(err,TestL());
sl@0
   119
	if (err!=KErrNone)
sl@0
   120
		User::Panic(_L("Failed to complete test"),err);
sl@0
   121
	delete tc;
sl@0
   122
	__UHEAP_MARKEND;
sl@0
   123
	return KErrNone;
sl@0
   124
	}