os/ossrv/genericservices/httputils/Test/t_uriparser/CDelimitedPathTest.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 __CDELIMITEDPATHTEST_H__
    17 #define __CDELIMITEDPATHTEST_H__
    18 
    19 #include <e32base.h>
    20 
    21 #include "ctestbase.h"
    22 
    23 class CDelimitedPathTest : public CTestBase
    24 	{
    25 public:
    26 
    27 	// Static factory c'tor.
    28 	//
    29 	// Rtn: pointer to newly created object - ownership transfered to caller.
    30 	//
    31 	static CDelimitedPathTest* NewLC(CIpuTestHarness* aTestHarness);
    32 
    33 	// Static factory c'tor.
    34 	//
    35 	// Rtn: pointer to newly created object - ownership transfered to caller.
    36 	//
    37 	static CDelimitedPathTest* NewL(CIpuTestHarness* aTestHarness);
    38 
    39 	// D'tor
    40 	//
    41 	~CDelimitedPathTest();
    42 
    43 	// Does the tests
    44 	//
    45 	void DoTestsL();
    46 
    47 private:
    48 
    49 	// C'tor
    50 	//
    51 	CDelimitedPathTest(CIpuTestHarness* aTestHarness);
    52 
    53 	// 2nd phase construction
    54 	//
    55 	void ConstructL();
    56 
    57 //
    58 //
    59 //	DelimitedPath Tests
    60 //
    61 //
    62 
    63 	// Tests extraction of path segments from left to right.
    64 	//
    65 	// In:
    66 	// aPath	- descriptor with path
    67 	// ...		- list of one or more segments
    68 	//
    69 	void TestDelimitedPathExtractionL(TRefByValue<const TDesC> aPath, ...) const;
    70 
    71 	// Tests extraction of path segments from right to left.
    72 	//
    73 	// In:
    74 	// aPath	- descriptor with path
    75 	// ...		- list of one or more segments
    76 	//
    77 	void TestDelimitedPathReverseExtractionL(TRefByValue<const TDesC> aPath, ...) const;
    78 
    79 	// Tests for presence of front and back delimiters
    80 	//
    81 	// In:
    82 	// aPath		- the path
    83 	// aFrontDelim	- indicated whethere there is a front delimiter or not
    84 	// aBackDelim	- indicated whethere there is a back delimiter or not
    85 	//
    86 	void TestDelimitedPathDelimiterPresenceL(const TDesC& aPath, TBool aFrontDelim, TBool aBackDelim) const;
    87 
    88 	// Tests remainder functionality for forward parsing
    89 	//
    90 	// In:
    91 	// aPath	- the path
    92 	// ...		- list of the expected remainders
    93 	//
    94 	void TestDelimitedPathRemainderL(TRefByValue<const TDesC> aPath, ...) const;
    95 
    96 	// Tests remainder functionality for reverse parsing
    97 	//
    98 	// In:
    99 	// aPath	- the path
   100 	// ...		- list of the expected remainders
   101 	//
   102 	void TestDelimitedPathRemainderReverseL(TRefByValue<const TDesC> aPath, ...) const;
   103 
   104 	// Tests Des() function
   105 	//
   106 	// In:
   107 	// aPath	- the path
   108 	//
   109 	void TestDelimitedPathDesL(const TDesC& aPath) const;
   110 
   111 	// Tests PushFront(), NewL() and NewLC()
   112 	//
   113 	// In:
   114 	// aPath	- the path
   115 	// ...		- list of the path segments and expected full path for each push
   116 	//
   117 	void TestDelimitedPathPushFrontL(TRefByValue<const TDesC> aPath, ...) const;
   118 
   119 	// Tests PushBack(), NewL() and NewLC()
   120 	//
   121 	// In:
   122 	// aPath	- the path
   123 	// ...		- list of the path segments and expected full path for each push
   124 	//
   125 	void TestDelimitedPathPushBackL(TRefByValue<const TDesC> aPath, ...) const;
   126 
   127 	// Tests PopFront(), NewL() and NewLC()
   128 	//
   129 	// In:
   130 	// aPath	- the path
   131 	// ...		- list of the expected full path for each pop
   132 	//
   133 	void TestDelimitedPathPopFrontL(TRefByValue<const TDesC> aPath, ...) const;
   134 
   135 	// Tests PopBack(), NewL() and NewLC()
   136 	//
   137 	// In:
   138 	// aPath	- the path
   139 	// ...		- list of the expected full path for each pop
   140 	//
   141 	void TestDelimitedPathPopBackL(TRefByValue<const TDesC> aPath, ...) const;
   142 
   143 	// Tests adding and triming of fromt and back delimiters
   144 	//
   145 	// In:
   146 	// aPath	- the path
   147 	//
   148 	void TestDelimitedPathAddAndTrimFrontAndBackDelimiterL(const TDesC& aPath) const;
   149 
   150 	// Tests InsertCurrent(), Parse()
   151 	//
   152 	// In:
   153 	// aStartPos	- position from the start of parsing of where to insert
   154 	// aPath		- the path
   155 	// ...			- list of the path segments and expected full path for each insert
   156 	//
   157 	void TestDelimitedPathInsertAndParseL(TInt aStartPos, TRefByValue<const TDesC> aPath, ...) const;
   158 
   159 	// Tests RemoveCurrent(), Parse()
   160 	//
   161 	// In:
   162 	// aStartPos	- position from the start of parsing of where to insert
   163 	// aPath		- the path
   164 	// ...			- list of the expected full path for each remove
   165 	//
   166 	void TestDelimitedPathRemoveAndParseL(TInt aStartPos, TRefByValue<const TDesC> aPath, ...) const;
   167 
   168 	// Tests InsertCurrent(), ParseReverse()
   169 	//
   170 	// In:
   171 	// aStartPos	- position from the start of parsing of where to insert
   172 	// aPath		- the path
   173 	// ...			- list of the path segments and expected full path for each insert
   174 	//
   175 	void TestDelimitedPathInsertAndParseReverseL(TInt aStartPos, TRefByValue<const TDesC> aPath, ...) const;
   176 
   177 	// Tests RemoveCurrent(), ParseReverse()
   178 	//
   179 	// In:
   180 	// aStartPos	- position from the start of parsing of where to insert
   181 	// aPath		- the path
   182 	// ...			- list of the expected full path for each remove
   183 	//
   184 	void TestDelimitedPathRemoveAndParseReverseL(TInt aStartPos, TRefByValue<const TDesC> aPath, ...) const;
   185 
   186 	// Tests InsertAndEscapeCurrent(), Parse()
   187 	//
   188 	// In:
   189 	// aStartPos	- position from the start of parsing of where to insert
   190 	// aPath		- the path
   191 	// ...			- list of the path segments and expected full path for each insert
   192 	//
   193 	void TestDelimitedPathInsertEscapeAndParseL(TInt aStartPos, TRefByValue<const TDesC> aPath, ...) const;
   194 
   195 	// Tests InsertAndEscapeCurrent(), ParseReverse()
   196 	//
   197 	// In:
   198 	// aStartPos	- position from the start of parsing of where to insert
   199 	// aPath		- the path
   200 	// ...			- list of the path segments and expected full path for each insert
   201 	//
   202 	void TestDelimitedPathInsertEscapeAndParseReverseL(TInt aStartPos, TRefByValue<const TDesC> aPath, ...) const;
   203 
   204 	// Tests PushAndEscapeFront(), NewL() and NewLC()
   205 	//
   206 	// In:
   207 	// aPath	- the path
   208 	// ...		- list of the path segments and expected full path for each push
   209 	//
   210 	void TestDelimitedPathPushAndEscapeFrontL(TRefByValue<const TDesC> aPath, ...) const;
   211 
   212 	// Tests PushAndEscapeBack(), NewL() and NewLC()
   213 	//
   214 	// In:
   215 	// aPath	- the path
   216 	// ...		- list of the path segments and expected full path for each push
   217 	//
   218 	void TestDelimitedPathPushAndEscapeBackL(TRefByValue<const TDesC> aPath, ...) const;
   219 
   220 private:	// Attributes
   221 
   222 	// Test harness
   223 	//
   224 	CIpuTestHarness*	iTestHarness;
   225 
   226 	};
   227 
   228 #endif	// __CDELIMITEDPATHTEST_H__