1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/ossrv/genericservices/httputils/Test/t_uriparser/CUriUtilsTest.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,118 @@
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 __CURIUTILSTEST_H__
1.20 +#define __CURIUTILSTEST_H__
1.21 +
1.22 +// System includes
1.23 +//
1.24 +#include <e32base.h>
1.25 +#include <uriutils.h>
1.26 +// Local includes
1.27 +//
1.28 +#include "IpuTestUtils.h"
1.29 +#include "ctestbase.h"
1.30 +
1.31 +class CUriUtilsTest : public CTestBase
1.32 + {
1.33 +public:
1.34 +
1.35 + // Static factory c'tor.
1.36 + //
1.37 + // Rtn: pointer to newly created object - ownership transfered to caller.
1.38 + //
1.39 + static CUriUtilsTest* NewLC(CIpuTestHarness* aTestHarness);
1.40 +
1.41 + // Static factory c'tor.
1.42 + //
1.43 + // Rtn: pointer to newly created object - ownership transfered to caller.
1.44 + //
1.45 + static CUriUtilsTest* NewL(CIpuTestHarness* aTestHarness);
1.46 +
1.47 + // D'tor
1.48 + //
1.49 + ~CUriUtilsTest();
1.50 +
1.51 + // Does the tests
1.52 + //
1.53 + void DoTestsL();
1.54 +
1.55 +private:
1.56 +
1.57 + // C'tor
1.58 + //
1.59 + CUriUtilsTest(CIpuTestHarness* aTestHarness);
1.60 +
1.61 + // 2nd phase construction
1.62 + //
1.63 + void ConstructL();
1.64 +
1.65 + // Tests ConvertToInternetForm
1.66 + //
1.67 + // In:
1.68 + // aData - the display uri
1.69 + // aExpected - the internet form
1.70 + //
1.71 + void TestUriUtilsConvertToInternetFormL(const TDesC& aData, const TDesC& aExpected);
1.72 + void TestUriUtilsConvertToInternetFormDeprecatedL(const TDesC& aData, const TDesC& aExpected);
1.73 +
1.74 + // Tests ConvertToDisplayForm
1.75 + //
1.76 + // In:
1.77 + // aData - the internet uri
1.78 + // aExpected - the display form
1.79 + //
1.80 + void TestUriUtilsConvertToDisplayFormL(const TDesC& aData, const TDesC& aExpected);
1.81 + void TestUriUtilsConvertToDisplayFormDeprecatedL(const TDesC& aData, const TDesC& aExpected);
1.82 + // Tests HasInvalidChars (16-Bit)
1.83 + //
1.84 + // In:
1.85 + // aData - the data
1.86 + // aHadInvalidChars - expected result
1.87 + //
1.88 + void TestUriUtilsHasInvalidCharsL(const TDesC16& aData, TBool aHasInvalidChars);
1.89 +
1.90 + // Tests HasInvalidChars (8-Bit)
1.91 + //
1.92 + // In:
1.93 + // aData - the data
1.94 + // aHadInvalidChars - expected result
1.95 + //
1.96 + void TestUriUtilsHasInvalidCharsL(const TDesC8& aData, TBool aHasInvalidChars);
1.97 +
1.98 + // Tests HostType (16-bit)
1.99 + //
1.100 + // In:
1.101 + // aData - the data
1.102 + // aHostType - expected host type
1.103 + void TestUriUtilsHostTypeL(const TDesC16& aData, UriUtils::TUriHostType aHostType);
1.104 +
1.105 + // Tests HostType (8-bit)
1.106 + //
1.107 + // In:
1.108 + // aData - the data
1.109 + // aHostType - expected host type
1.110 + void TestUriUtilsHostTypeL(const TDesC8& aData, UriUtils::TUriHostType aHostType);
1.111 +
1.112 +private: // Attributes
1.113 +
1.114 + // Test harness
1.115 + //
1.116 + CIpuTestHarness* iTestHarness;
1.117 +
1.118 + };
1.119 +
1.120 +#endif // __CURIUTILSTEST_H__
1.121 +