os/ossrv/genericservices/httputils/Test/t_uriparser/CEscapeUtilsTest.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
sl@0
     1
// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     2
// All rights reserved.
sl@0
     3
// This component and the accompanying materials are made available
sl@0
     4
// under the terms of "Eclipse Public License v1.0"
sl@0
     5
// which accompanies this distribution, and is available
sl@0
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     7
//
sl@0
     8
// Initial Contributors:
sl@0
     9
// Nokia Corporation - initial contribution.
sl@0
    10
//
sl@0
    11
// Contributors:
sl@0
    12
//
sl@0
    13
// Description:
sl@0
    14
//
sl@0
    15
sl@0
    16
#ifndef __CESCAPEUTILSTEST_H__
sl@0
    17
#define __CESCAPEUTILSTEST_H__
sl@0
    18
sl@0
    19
#include <e32base.h>
sl@0
    20
#include <escapeutils.h>
sl@0
    21
sl@0
    22
#include "ctestbase.h"
sl@0
    23
sl@0
    24
class CEscapeUtilsTest : public CTestBase
sl@0
    25
	{
sl@0
    26
public:
sl@0
    27
 
sl@0
    28
	// Static factory c'tor.
sl@0
    29
	//
sl@0
    30
	// Rtn: pointer to newly created object - ownership transfered to caller.
sl@0
    31
	//
sl@0
    32
	static CEscapeUtilsTest* NewLC(CIpuTestHarness* aTestHarness);
sl@0
    33
sl@0
    34
	// Static factory c'tor.
sl@0
    35
	//
sl@0
    36
	// Rtn: pointer to newly created object - ownership transfered to caller.
sl@0
    37
	//
sl@0
    38
	static CEscapeUtilsTest* NewL(CIpuTestHarness* aTestHarness);
sl@0
    39
sl@0
    40
	// D'tor
sl@0
    41
	//
sl@0
    42
	~CEscapeUtilsTest();
sl@0
    43
sl@0
    44
	// Does the tests
sl@0
    45
	//
sl@0
    46
	void DoTestsL();
sl@0
    47
sl@0
    48
private:
sl@0
    49
sl@0
    50
	// C'tor
sl@0
    51
	//
sl@0
    52
	CEscapeUtilsTest(CIpuTestHarness* aTestHarness);
sl@0
    53
sl@0
    54
	// 2nd phase construction
sl@0
    55
	//
sl@0
    56
	void ConstructL();
sl@0
    57
sl@0
    58
	// Tests EscapeEncodeL functions
sl@0
    59
	//
sl@0
    60
	// In:
sl@0
    61
	// aData		- the data to escape
sl@0
    62
	// aExpected	- the expected escaped result
sl@0
    63
	//
sl@0
    64
	void TestEscapeUtilsEscapeEncodeL(const TDesC& aData, const TDesC& aExpected, EscapeUtils::TEscapeMode aEscapeMode);
sl@0
    65
sl@0
    66
	// Tests EscapeDecodeL functions
sl@0
    67
	//
sl@0
    68
	// In:
sl@0
    69
	// aData		- the data to escape
sl@0
    70
	// aExpected	- the expected escaped result
sl@0
    71
	//
sl@0
    72
	void TestEscapeUtilsEscapeDecodeL(const TDesC& aData, const TDesC& aExpected);
sl@0
    73
sl@0
    74
	// Tests unicode/utf8 conversions - NOTE the utf8 version is escaped encoded.
sl@0
    75
	//
sl@0
    76
	// In:
sl@0
    77
	// aUnicode	- the unicode data
sl@0
    78
	// aUtf8	- the utf8 data (escape encoded)
sl@0
    79
	//
sl@0
    80
	void TestEscapeUtilsUnicodeUtf8ConversionsL(const TDesC& aUnicode, const TDesC& aUtf8);
sl@0
    81
sl@0
    82
	// Tests IsExcludedChar
sl@0
    83
	//
sl@0
    84
	// In:
sl@0
    85
	// aChar		- the test char
sl@0
    86
	// aIsExcluded	- the expected result
sl@0
    87
	//
sl@0
    88
	void TestEscapeUtilsIsExcludedCharL(TChar aChar, TBool aIsExcluded);
sl@0
    89
sl@0
    90
	// Tests IsEscapeTriple
sl@0
    91
	//
sl@0
    92
	// In:
sl@0
    93
	// aData		- the data to check
sl@0
    94
	// aIsTriple	- the expected result
sl@0
    95
	// aValue		- the value of the triple (set to anything if aIsTriple is EFalse)
sl@0
    96
	//
sl@0
    97
	void TestEscapeUtilsIsEscapeTripleL(const TDesC& aData, TBool aIsTriple, TInt aValue);
sl@0
    98
	
sl@0
    99
	// Tests Base64 Encoding and Decoding
sl@0
   100
	//
sl@0
   101
	// In:
sl@0
   102
	// aData		- the data to check
sl@0
   103
	//
sl@0
   104
	void TestEscapeUtilsBase64ConversionL(const TDesC& aData);
sl@0
   105
sl@0
   106
private:	// Attributes
sl@0
   107
sl@0
   108
	// Test harness
sl@0
   109
	//
sl@0
   110
	CIpuTestHarness*	iTestHarness;
sl@0
   111
sl@0
   112
	};
sl@0
   113
sl@0
   114
#endif	// __CESCAPEUTILSTEST_H__
sl@0
   115