|
1 // Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // t_main |
|
15 // Main test harness for t_wspcodec |
|
16 // |
|
17 // |
|
18 |
|
19 |
|
20 |
|
21 // MEMORY LEAK TESTING - Change and recompile to enable memory leak testing |
|
22 // #define __MEMORY_LEAK_TESTING_ENABLED |
|
23 |
|
24 |
|
25 |
|
26 #include <e32base.h> |
|
27 #include "IpuTestUtils.h" |
|
28 |
|
29 #include "cwspdecodetest.h" |
|
30 #include "cwspencodetest.h" |
|
31 |
|
32 _LIT(KTestPanic, "WSPCodec"); |
|
33 _LIT(KTestTitle, "T_WSPCodec"); |
|
34 |
|
35 GLDEF_C void Panic(TInt aPanic); |
|
36 |
|
37 |
|
38 GLDEF_C void Panic(TInt aPanic) |
|
39 { |
|
40 User::Panic(KTestPanic,aPanic); |
|
41 } |
|
42 |
|
43 GLDEF_C void TestL() |
|
44 { |
|
45 CIpuTestHarness* testHarness = CIpuTestHarness::NewL(KTestTitle); |
|
46 CleanupStack::PushL(testHarness); |
|
47 testHarness->DoResourceLeakTest(ETrue); |
|
48 |
|
49 testHarness->LogIt(_L ("@SYMTestCaseID IWS-APPPROTOCOLS-INETPROTUTIL-T_WSPCODEC-0001 ")); |
|
50 |
|
51 CWSPDecodeTest* decodeTest = CWSPDecodeTest::NewLC(testHarness); |
|
52 #ifdef __MEMORY_LEAK_TESTING_ENABLED |
|
53 CTestBase::MemoryLeakTestL(*decodeTest,*testHarness); |
|
54 #endif |
|
55 decodeTest->DoTestsL(); |
|
56 |
|
57 CWSPEncodeTest* encodeTest = CWSPEncodeTest::NewLC(testHarness); |
|
58 #ifdef __MEMORY_LEAK_TESTING_ENABLED |
|
59 CTestBase::MemoryLeakTestL(*encodeTest,*testHarness); |
|
60 #endif |
|
61 encodeTest->DoTestsL(); |
|
62 |
|
63 CleanupStack::PopAndDestroy(3, testHarness); |
|
64 } |
|
65 |
|
66 GLDEF_C TInt E32Main() |
|
67 // |
|
68 // Main function |
|
69 { |
|
70 __UHEAP_MARK; |
|
71 CTrapCleanup* tc=CTrapCleanup::New(); |
|
72 TRAPD(err,TestL()); |
|
73 if (err!=KErrNone) |
|
74 User::Panic(_L("Test Fail"),err); |
|
75 delete tc; |
|
76 __UHEAP_MARKEND; |
|
77 return KErrNone; |
|
78 } |
|
79 |