os/ossrv/genericservices/httputils/Test/t_wspcodec/t_main.cpp
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
sl@0
     1
// Copyright (c) 2002-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
// t_main
sl@0
    15
// Main test harness for t_wspcodec
sl@0
    16
// 
sl@0
    17
//
sl@0
    18
sl@0
    19
sl@0
    20
sl@0
    21
// MEMORY LEAK TESTING - Change and recompile to enable memory leak testing
sl@0
    22
// #define __MEMORY_LEAK_TESTING_ENABLED
sl@0
    23
sl@0
    24
sl@0
    25
sl@0
    26
#include <e32base.h>
sl@0
    27
#include "IpuTestUtils.h"
sl@0
    28
sl@0
    29
#include "cwspdecodetest.h"
sl@0
    30
#include "cwspencodetest.h"
sl@0
    31
sl@0
    32
_LIT(KTestPanic, "WSPCodec");
sl@0
    33
_LIT(KTestTitle, "T_WSPCodec");
sl@0
    34
sl@0
    35
GLDEF_C void Panic(TInt aPanic);
sl@0
    36
sl@0
    37
sl@0
    38
GLDEF_C void Panic(TInt aPanic)
sl@0
    39
	{
sl@0
    40
	User::Panic(KTestPanic,aPanic);
sl@0
    41
	}
sl@0
    42
sl@0
    43
GLDEF_C void TestL()
sl@0
    44
	{
sl@0
    45
	CIpuTestHarness* testHarness = CIpuTestHarness::NewL(KTestTitle);
sl@0
    46
	CleanupStack::PushL(testHarness);
sl@0
    47
	testHarness->DoResourceLeakTest(ETrue);
sl@0
    48
sl@0
    49
	testHarness->LogIt(_L ("@SYMTestCaseID IWS-APPPROTOCOLS-INETPROTUTIL-T_WSPCODEC-0001 "));
sl@0
    50
sl@0
    51
	CWSPDecodeTest* decodeTest = CWSPDecodeTest::NewLC(testHarness);
sl@0
    52
#ifdef __MEMORY_LEAK_TESTING_ENABLED
sl@0
    53
	CTestBase::MemoryLeakTestL(*decodeTest,*testHarness);
sl@0
    54
#endif
sl@0
    55
	decodeTest->DoTestsL();
sl@0
    56
sl@0
    57
	CWSPEncodeTest* encodeTest = CWSPEncodeTest::NewLC(testHarness);
sl@0
    58
#ifdef __MEMORY_LEAK_TESTING_ENABLED
sl@0
    59
	CTestBase::MemoryLeakTestL(*encodeTest,*testHarness);
sl@0
    60
#endif
sl@0
    61
	encodeTest->DoTestsL();
sl@0
    62
sl@0
    63
	CleanupStack::PopAndDestroy(3, testHarness);
sl@0
    64
	}
sl@0
    65
sl@0
    66
GLDEF_C TInt E32Main()
sl@0
    67
//
sl@0
    68
// Main function
sl@0
    69
	{
sl@0
    70
	__UHEAP_MARK;
sl@0
    71
	CTrapCleanup* tc=CTrapCleanup::New();
sl@0
    72
	TRAPD(err,TestL());
sl@0
    73
	if (err!=KErrNone)
sl@0
    74
		User::Panic(_L("Test Fail"),err);
sl@0
    75
	delete tc;
sl@0
    76
	__UHEAP_MARKEND;
sl@0
    77
	return KErrNone;
sl@0
    78
	}
sl@0
    79