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