os/ossrv/genericservices/httputils/Test/t_uriparser/CEscapeUtilsTest.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/ossrv/genericservices/httputils/Test/t_uriparser/CEscapeUtilsTest.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,115 @@
     1.4 +// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +//
    1.18 +
    1.19 +#ifndef __CESCAPEUTILSTEST_H__
    1.20 +#define __CESCAPEUTILSTEST_H__
    1.21 +
    1.22 +#include <e32base.h>
    1.23 +#include <escapeutils.h>
    1.24 +
    1.25 +#include "ctestbase.h"
    1.26 +
    1.27 +class CEscapeUtilsTest : public CTestBase
    1.28 +	{
    1.29 +public:
    1.30 + 
    1.31 +	// Static factory c'tor.
    1.32 +	//
    1.33 +	// Rtn: pointer to newly created object - ownership transfered to caller.
    1.34 +	//
    1.35 +	static CEscapeUtilsTest* NewLC(CIpuTestHarness* aTestHarness);
    1.36 +
    1.37 +	// Static factory c'tor.
    1.38 +	//
    1.39 +	// Rtn: pointer to newly created object - ownership transfered to caller.
    1.40 +	//
    1.41 +	static CEscapeUtilsTest* NewL(CIpuTestHarness* aTestHarness);
    1.42 +
    1.43 +	// D'tor
    1.44 +	//
    1.45 +	~CEscapeUtilsTest();
    1.46 +
    1.47 +	// Does the tests
    1.48 +	//
    1.49 +	void DoTestsL();
    1.50 +
    1.51 +private:
    1.52 +
    1.53 +	// C'tor
    1.54 +	//
    1.55 +	CEscapeUtilsTest(CIpuTestHarness* aTestHarness);
    1.56 +
    1.57 +	// 2nd phase construction
    1.58 +	//
    1.59 +	void ConstructL();
    1.60 +
    1.61 +	// Tests EscapeEncodeL functions
    1.62 +	//
    1.63 +	// In:
    1.64 +	// aData		- the data to escape
    1.65 +	// aExpected	- the expected escaped result
    1.66 +	//
    1.67 +	void TestEscapeUtilsEscapeEncodeL(const TDesC& aData, const TDesC& aExpected, EscapeUtils::TEscapeMode aEscapeMode);
    1.68 +
    1.69 +	// Tests EscapeDecodeL functions
    1.70 +	//
    1.71 +	// In:
    1.72 +	// aData		- the data to escape
    1.73 +	// aExpected	- the expected escaped result
    1.74 +	//
    1.75 +	void TestEscapeUtilsEscapeDecodeL(const TDesC& aData, const TDesC& aExpected);
    1.76 +
    1.77 +	// Tests unicode/utf8 conversions - NOTE the utf8 version is escaped encoded.
    1.78 +	//
    1.79 +	// In:
    1.80 +	// aUnicode	- the unicode data
    1.81 +	// aUtf8	- the utf8 data (escape encoded)
    1.82 +	//
    1.83 +	void TestEscapeUtilsUnicodeUtf8ConversionsL(const TDesC& aUnicode, const TDesC& aUtf8);
    1.84 +
    1.85 +	// Tests IsExcludedChar
    1.86 +	//
    1.87 +	// In:
    1.88 +	// aChar		- the test char
    1.89 +	// aIsExcluded	- the expected result
    1.90 +	//
    1.91 +	void TestEscapeUtilsIsExcludedCharL(TChar aChar, TBool aIsExcluded);
    1.92 +
    1.93 +	// Tests IsEscapeTriple
    1.94 +	//
    1.95 +	// In:
    1.96 +	// aData		- the data to check
    1.97 +	// aIsTriple	- the expected result
    1.98 +	// aValue		- the value of the triple (set to anything if aIsTriple is EFalse)
    1.99 +	//
   1.100 +	void TestEscapeUtilsIsEscapeTripleL(const TDesC& aData, TBool aIsTriple, TInt aValue);
   1.101 +	
   1.102 +	// Tests Base64 Encoding and Decoding
   1.103 +	//
   1.104 +	// In:
   1.105 +	// aData		- the data to check
   1.106 +	//
   1.107 +	void TestEscapeUtilsBase64ConversionL(const TDesC& aData);
   1.108 +
   1.109 +private:	// Attributes
   1.110 +
   1.111 +	// Test harness
   1.112 +	//
   1.113 +	CIpuTestHarness*	iTestHarness;
   1.114 +
   1.115 +	};
   1.116 +
   1.117 +#endif	// __CESCAPEUTILSTEST_H__
   1.118 +