First public contribution.
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 __CESCAPEUTILSTEST_H__
17 #define __CESCAPEUTILSTEST_H__
20 #include <escapeutils.h>
22 #include "ctestbase.h"
24 class CEscapeUtilsTest : public CTestBase
28 // Static factory c'tor.
30 // Rtn: pointer to newly created object - ownership transfered to caller.
32 static CEscapeUtilsTest* NewLC(CIpuTestHarness* aTestHarness);
34 // Static factory c'tor.
36 // Rtn: pointer to newly created object - ownership transfered to caller.
38 static CEscapeUtilsTest* NewL(CIpuTestHarness* aTestHarness);
52 CEscapeUtilsTest(CIpuTestHarness* aTestHarness);
54 // 2nd phase construction
58 // Tests EscapeEncodeL functions
61 // aData - the data to escape
62 // aExpected - the expected escaped result
64 void TestEscapeUtilsEscapeEncodeL(const TDesC& aData, const TDesC& aExpected, EscapeUtils::TEscapeMode aEscapeMode);
66 // Tests EscapeDecodeL functions
69 // aData - the data to escape
70 // aExpected - the expected escaped result
72 void TestEscapeUtilsEscapeDecodeL(const TDesC& aData, const TDesC& aExpected);
74 // Tests unicode/utf8 conversions - NOTE the utf8 version is escaped encoded.
77 // aUnicode - the unicode data
78 // aUtf8 - the utf8 data (escape encoded)
80 void TestEscapeUtilsUnicodeUtf8ConversionsL(const TDesC& aUnicode, const TDesC& aUtf8);
82 // Tests IsExcludedChar
85 // aChar - the test char
86 // aIsExcluded - the expected result
88 void TestEscapeUtilsIsExcludedCharL(TChar aChar, TBool aIsExcluded);
90 // Tests IsEscapeTriple
93 // aData - the data to check
94 // aIsTriple - the expected result
95 // aValue - the value of the triple (set to anything if aIsTriple is EFalse)
97 void TestEscapeUtilsIsEscapeTripleL(const TDesC& aData, TBool aIsTriple, TInt aValue);
99 // Tests Base64 Encoding and Decoding
102 // aData - the data to check
104 void TestEscapeUtilsBase64ConversionL(const TDesC& aData);
106 private: // Attributes
110 CIpuTestHarness* iTestHarness;
114 #endif // __CESCAPEUTILSTEST_H__