sl@0: // Copyright (c) 2002-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: // t_main
sl@0: // Main test harness for t_wspcodec
sl@0: // 
sl@0: //
sl@0: 
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: 
sl@0: #include <e32base.h>
sl@0: #include "IpuTestUtils.h"
sl@0: 
sl@0: #include "cwspdecodetest.h"
sl@0: #include "cwspencodetest.h"
sl@0: 
sl@0: _LIT(KTestPanic, "WSPCodec");
sl@0: _LIT(KTestTitle, "T_WSPCodec");
sl@0: 
sl@0: GLDEF_C void Panic(TInt aPanic);
sl@0: 
sl@0: 
sl@0: GLDEF_C void Panic(TInt aPanic)
sl@0: 	{
sl@0: 	User::Panic(KTestPanic,aPanic);
sl@0: 	}
sl@0: 
sl@0: GLDEF_C void TestL()
sl@0: 	{
sl@0: 	CIpuTestHarness* testHarness = CIpuTestHarness::NewL(KTestTitle);
sl@0: 	CleanupStack::PushL(testHarness);
sl@0: 	testHarness->DoResourceLeakTest(ETrue);
sl@0: 
sl@0: 	testHarness->LogIt(_L ("@SYMTestCaseID IWS-APPPROTOCOLS-INETPROTUTIL-T_WSPCODEC-0001 "));
sl@0: 
sl@0: 	CWSPDecodeTest* decodeTest = CWSPDecodeTest::NewLC(testHarness);
sl@0: #ifdef __MEMORY_LEAK_TESTING_ENABLED
sl@0: 	CTestBase::MemoryLeakTestL(*decodeTest,*testHarness);
sl@0: #endif
sl@0: 	decodeTest->DoTestsL();
sl@0: 
sl@0: 	CWSPEncodeTest* encodeTest = CWSPEncodeTest::NewLC(testHarness);
sl@0: #ifdef __MEMORY_LEAK_TESTING_ENABLED
sl@0: 	CTestBase::MemoryLeakTestL(*encodeTest,*testHarness);
sl@0: #endif
sl@0: 	encodeTest->DoTestsL();
sl@0: 
sl@0: 	CleanupStack::PopAndDestroy(3, testHarness);
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("Test Fail"),err);
sl@0: 	delete tc;
sl@0: 	__UHEAP_MARKEND;
sl@0: 	return KErrNone;
sl@0: 	}
sl@0: