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