|
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 // Class CWSPDecodeTest |
|
15 // |
|
16 // |
|
17 |
|
18 #ifndef __CWSPDECODETEST_H__ |
|
19 #define __CWSPDECODETEST_H__ |
|
20 |
|
21 #include <e32base.h> |
|
22 |
|
23 #include "IpuTestUtils.h" |
|
24 #include "ctestbase.h" |
|
25 #include <wspdecoder.h> |
|
26 |
|
27 class CWSPDecodeTest: public CTestBase |
|
28 { |
|
29 public: |
|
30 static CWSPDecodeTest* NewLC(CIpuTestHarness* aTestHarness); |
|
31 ~CWSPDecodeTest(); |
|
32 void DoTestsL(); |
|
33 |
|
34 private: |
|
35 CWSPDecodeTest(CIpuTestHarness* aTestHarness); |
|
36 |
|
37 void VarTypesTestL(); |
|
38 void TestVarTypesL(); |
|
39 TBool VarType(TPtrC8 aBuf, TWspPrimitiveDecoder::TWspHeaderType aShouldBeType); |
|
40 |
|
41 void LengthValsTestL(); |
|
42 void TestLengthValsL(); |
|
43 TBool LenVal(TPtrC8 aBuf, TInt aShouldBeVal); |
|
44 |
|
45 void StringTestL(); |
|
46 void TestStringL(); |
|
47 TBool String(TPtrC8 aBuf, TPtrC8 aShouldBe, TInt aErr = KErrNone); |
|
48 |
|
49 void TokensTestL(); |
|
50 void TestTokensL(); |
|
51 TBool Token(TPtrC8 aBuf, TUint8 aShouldBe, TInt aErr= KErrNone); |
|
52 |
|
53 void IntegersTestL(); |
|
54 void TestIntegersL(); |
|
55 TBool Integer(TPtrC8 aBuf, TUint32 aShouldBe, TInt aErr = KErrNone); |
|
56 |
|
57 void LongIntTestL(); |
|
58 void TestLongIntL(); |
|
59 TBool LongInt(TPtrC8 aBuf, TUint32 aShouldBe, TInt aErr = KErrNone); |
|
60 |
|
61 void UintVarsTestL(); |
|
62 void TestUintVarsL(); |
|
63 TBool UintVar(TPtrC8 aBuf, TUint32 aShouldBe, TInt aErr = KErrNone); |
|
64 |
|
65 void VersionTestL(); |
|
66 void TestVersionL(); |
|
67 TBool VersionL(RStringPool aPool, TPtrC8 aBuf, TPtrC8 aShouldBe, TInt aErr = KErrNone); |
|
68 |
|
69 void DateTestL(); |
|
70 void TestDateL(); |
|
71 TBool Date(TPtrC8 aBuf, TTime aShouldBe, TInt aErr = KErrNone); |
|
72 |
|
73 void SegmenterTestL(); |
|
74 void TestSegmenterL(); |
|
75 TInt SegmenterCommonL(RStringPool aPool, TPtrC8 aHdr); |
|
76 TBool SegmenterL(RStringPool aPool, TPtrC8 aHdr); |
|
77 TBool SegmenterExpectCorruptL(RStringPool aPool, TPtrC8 aHdr); |
|
78 |
|
79 private: |
|
80 CIpuTestHarness* iTestHarness; |
|
81 }; |
|
82 |
|
83 |
|
84 |
|
85 #endif // __CWSPDECODETEST_H__ |