os/ossrv/genericservices/httputils/Test/t_uriparser/CUriUtilsTest.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 __CURIUTILSTEST_H__
sl@0
    17
#define __CURIUTILSTEST_H__
sl@0
    18
sl@0
    19
// System includes
sl@0
    20
//
sl@0
    21
#include <e32base.h>
sl@0
    22
#include <uriutils.h>
sl@0
    23
// Local includes
sl@0
    24
//
sl@0
    25
#include "IpuTestUtils.h"
sl@0
    26
#include "ctestbase.h"
sl@0
    27
sl@0
    28
class CUriUtilsTest : public CTestBase
sl@0
    29
	{
sl@0
    30
public:
sl@0
    31
sl@0
    32
	// Static factory c'tor.
sl@0
    33
	//
sl@0
    34
	// Rtn: pointer to newly created object - ownership transfered to caller.
sl@0
    35
	//
sl@0
    36
	static CUriUtilsTest* NewLC(CIpuTestHarness* aTestHarness);
sl@0
    37
sl@0
    38
	// Static factory c'tor.
sl@0
    39
	//
sl@0
    40
	// Rtn: pointer to newly created object - ownership transfered to caller.
sl@0
    41
	//
sl@0
    42
	static CUriUtilsTest* NewL(CIpuTestHarness* aTestHarness);
sl@0
    43
sl@0
    44
	// D'tor
sl@0
    45
	//
sl@0
    46
	~CUriUtilsTest();
sl@0
    47
sl@0
    48
	// Does the tests
sl@0
    49
	//
sl@0
    50
	void DoTestsL();
sl@0
    51
sl@0
    52
private:
sl@0
    53
sl@0
    54
	// C'tor
sl@0
    55
	//
sl@0
    56
	CUriUtilsTest(CIpuTestHarness* aTestHarness);
sl@0
    57
sl@0
    58
	// 2nd phase construction
sl@0
    59
	//
sl@0
    60
	void ConstructL();
sl@0
    61
sl@0
    62
	// Tests ConvertToInternetForm
sl@0
    63
	//
sl@0
    64
	// In:
sl@0
    65
	// aData		- the display uri
sl@0
    66
	// aExpected	- the internet form
sl@0
    67
	//
sl@0
    68
	void TestUriUtilsConvertToInternetFormL(const TDesC& aData, const TDesC& aExpected);
sl@0
    69
	void TestUriUtilsConvertToInternetFormDeprecatedL(const TDesC& aData, const TDesC& aExpected);
sl@0
    70
sl@0
    71
	// Tests ConvertToDisplayForm
sl@0
    72
	//
sl@0
    73
	// In:
sl@0
    74
	// aData		- the internet uri
sl@0
    75
	// aExpected	- the display form
sl@0
    76
	//
sl@0
    77
	void TestUriUtilsConvertToDisplayFormL(const TDesC& aData, const TDesC& aExpected);
sl@0
    78
	void TestUriUtilsConvertToDisplayFormDeprecatedL(const TDesC& aData, const TDesC& aExpected);
sl@0
    79
	// Tests HasInvalidChars (16-Bit)
sl@0
    80
	//
sl@0
    81
	// In:
sl@0
    82
	// aData			- the data
sl@0
    83
	// aHadInvalidChars - expected result
sl@0
    84
	//
sl@0
    85
	void TestUriUtilsHasInvalidCharsL(const TDesC16& aData, TBool aHasInvalidChars);
sl@0
    86
sl@0
    87
	// Tests HasInvalidChars (8-Bit)
sl@0
    88
	//
sl@0
    89
	// In:
sl@0
    90
	// aData			- the data
sl@0
    91
	// aHadInvalidChars - expected result
sl@0
    92
	//
sl@0
    93
	void TestUriUtilsHasInvalidCharsL(const TDesC8& aData, TBool aHasInvalidChars);
sl@0
    94
sl@0
    95
	// Tests HostType (16-bit)
sl@0
    96
	//
sl@0
    97
	// In:
sl@0
    98
	// aData			- the data
sl@0
    99
	// aHostType		- expected host type
sl@0
   100
	void TestUriUtilsHostTypeL(const TDesC16& aData, UriUtils::TUriHostType aHostType);
sl@0
   101
sl@0
   102
	// Tests HostType (8-bit)
sl@0
   103
	//
sl@0
   104
	// In:
sl@0
   105
	// aData			- the data
sl@0
   106
	// aHostType		- expected host type
sl@0
   107
	void TestUriUtilsHostTypeL(const TDesC8& aData, UriUtils::TUriHostType aHostType);
sl@0
   108
sl@0
   109
private:	// Attributes
sl@0
   110
sl@0
   111
	// Test harness
sl@0
   112
	//
sl@0
   113
	CIpuTestHarness*	iTestHarness;
sl@0
   114
sl@0
   115
	};
sl@0
   116
sl@0
   117
#endif	// __CURIUTILSTEST_H__
sl@0
   118