Update contrib.
1 // Copyright (c) 2001-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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
16 #ifndef __CTEXTUTILSTEST_H__
17 #define __CTEXTUTILSTEST_H__
21 #include "IpuTestUtils.h"
22 #include "ctestbase.h"
24 class CTextUtilsTest : public CTestBase
28 // Static factory c'tor.
30 // Rtn: pointer to newly created object - ownership transfered to caller.
32 static CTextUtilsTest* NewLC(CIpuTestHarness* aTestHarness);
34 // Static factory c'tor.
36 // Rtn: pointer to newly created object - ownership transfered to caller.
38 static CTextUtilsTest* NewL(CIpuTestHarness* aTestHarness);
52 CTextUtilsTest(CIpuTestHarness* aTestHarness);
54 // 2nd phase construction
58 // Tests RemoveWhitespace
62 // aExpectedLeft - expected result of removing left-most whitespace
63 // aConsumedLeft - the number of cosumed whitespaces from the left
64 // aExpectedRight - expected result of removing right-most whitespace
65 // aConsumedRight - the number of cosumed whitespaces from the right
66 // aExpectedBoth - expected result of removing left- and right-most whitespace
67 // aConsumedBoth - the number of cosumed whitespaces from the left and right
69 void TestTextUtilsRemoveL(const TDesC& aBase, const TDesC& aRemoveLeft, TInt aConsumedLeft,
70 const TDesC& aRemoveRight, TInt aConsumedRight,
71 const TDesC& aRemoveBoth, TInt aConsumedBoth);
73 // Tests ConvertDescriptorToInt
76 // aDes - the descriptor
77 // aInt - expected int value (any number if aValid is EFalse)
78 // aValid - indicates whether aDes is a valid int representation.
80 void TestTextUtilsDesToIntConversionL(const TDesC& aDes, TInt aInt, TBool aValid);
82 // Tests ConvertIntToDescriptor
85 // aInt - the int value
86 // aDes - the expecteddescriptor
88 void TestTextUtilsIntToDesConversionL(TInt aInt, const TDesC& aDes);
90 void TestTextUtilsDesToHexConversionL(const TDesC& aDes, TInt aHex, TBool aValid);
91 void TestTextUtilsDesToHexConversion8L(const TDesC& aDes, TInt aHex, TBool aValid);
94 void TestTextUtilsHexToDesConversionL(TInt aHex, const TDesC& aDes);
96 void TestTextUtilsExtractQuotedStringL(
99 const TDesC& aRemainder,
103 void TestTextUtilsExtractTokenFromListL(
104 const TDesC& aBuffer,
105 const TDesC& aToken0,
106 const TDesC& aToken1,
107 const TDesC& aToken2,
108 const TDesC& aRemainder,
109 const TDesC& aSeparator
112 void TestTextUtilsExtractTokenFromListL(
113 const TDesC& aBuffer,
114 const TDesC& aToken0,
115 const TDesC& aToken1,
116 const TDesC& aToken2,
117 const TDesC& aRemainder,
121 private: // Attributes
125 CIpuTestHarness* iTestHarness;
129 #endif // __CTEXTUTILSTEST_H__