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