os/ossrv/genericservices/httputils/Test/t_uriparser/CDelimitedQueryTest.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/ossrv/genericservices/httputils/Test/t_uriparser/CDelimitedQueryTest.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,228 @@
     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 __CDELIMITEDQUERYTEST_H__
    1.20 +#define __CDELIMITEDQUERYTEST_H__
    1.21 +
    1.22 +#include <e32base.h>
    1.23 +
    1.24 +#include "ctestbase.h"
    1.25 +
    1.26 +class CDelimitedQueryTest : public CTestBase
    1.27 +	{
    1.28 +public:
    1.29 +
    1.30 +	// Static factory c'tor.
    1.31 +	//
    1.32 +	// Rtn: pointer to newly created object - ownership transfered to caller.
    1.33 +	//
    1.34 +	static CDelimitedQueryTest* NewLC(CIpuTestHarness* aTestHarness);
    1.35 +
    1.36 +	// Static factory c'tor.
    1.37 +	//
    1.38 +	// Rtn: pointer to newly created object - ownership transfered to caller.
    1.39 +	//
    1.40 +	static CDelimitedQueryTest* NewL(CIpuTestHarness* aTestHarness);
    1.41 +
    1.42 +	// D'tor
    1.43 +	//
    1.44 +	~CDelimitedQueryTest();
    1.45 +
    1.46 +	// Does the tests
    1.47 +	//
    1.48 +	void DoTestsL();
    1.49 +
    1.50 +private:
    1.51 +
    1.52 +	// C'tor
    1.53 +	//
    1.54 +	CDelimitedQueryTest(CIpuTestHarness* aTestHarness);
    1.55 +
    1.56 +	// 2nd phase construction
    1.57 +	//
    1.58 +	void ConstructL();
    1.59 +
    1.60 +//
    1.61 +//
    1.62 +//	Delimited Query Tests
    1.63 +//
    1.64 +//
    1.65 +
    1.66 +	// Tests extraction of query segments from left to right.
    1.67 +	//
    1.68 +	// In:
    1.69 +	// aQuery	- descriptor with query
    1.70 +	// ...		- list of one or more segments
    1.71 +	//
    1.72 +	void TestDelimitedQueryExtractionL(TRefByValue<const TDesC> aQuery, ...) const;
    1.73 +
    1.74 +	// Tests extraction of query segments from right to left.
    1.75 +	//
    1.76 +	// In:
    1.77 +	// aQuery	- descriptor with query
    1.78 +	// ...		- list of one or more segments
    1.79 +	//
    1.80 +	void TestDelimitedQueryReverseExtractionL(TRefByValue<const TDesC> aQuery, ...) const;
    1.81 +
    1.82 +	// Tests for presence of front and back delimiters
    1.83 +	//
    1.84 +	// In:
    1.85 +	// aQuery		- the query
    1.86 +	// aFrontDelim	- indicated whethere there is a front delimiter or not
    1.87 +	// aBackDelim	- indicated whethere there is a back delimiter or not
    1.88 +	//
    1.89 +	void TestDelimitedQueryDelimiterPresenceL(const TDesC& aQuery, TBool aFrontDelim, TBool aBackDelim) const;
    1.90 +
    1.91 +	// Tests remainder functionality for forward parsing
    1.92 +	//
    1.93 +	// In:
    1.94 +	// aQuery	- the query
    1.95 +	// ...		- list of the expected remainders
    1.96 +	//
    1.97 +	void TestDelimitedQueryRemainderL(TRefByValue<const TDesC> aQuery, ...) const;
    1.98 +
    1.99 +	// Tests remainder functionality for reverse parsing
   1.100 +	//
   1.101 +	// In:
   1.102 +	// aQuery	- the query
   1.103 +	// ...		- list of the expected remainders
   1.104 +	//
   1.105 +	void TestDelimitedQueryRemainderReverseL(TRefByValue<const TDesC> aQuery, ...) const;
   1.106 +
   1.107 +	// Tests Des() function
   1.108 +	//
   1.109 +	// In:
   1.110 +	// aQuery	- the query
   1.111 +	//
   1.112 +	void TestDelimitedQueryDesL(const TDesC& aQuery) const;
   1.113 +
   1.114 +	// Tests PushFront(), NewL() and NewLC()
   1.115 +	//
   1.116 +	// In:
   1.117 +	// aQuery	- the query
   1.118 +	// ...		- list of the query segments and expected full query for each push
   1.119 +	//
   1.120 +	void TestDelimitedQueryPushFrontL(TRefByValue<const TDesC> aQuery, ...) const;
   1.121 +
   1.122 +	// Tests PushBack(), NewL() and NewLC()
   1.123 +	//
   1.124 +	// In:
   1.125 +	// aQuery	- the query
   1.126 +	// ...		- list of the query segments and expected full query for each push
   1.127 +	//
   1.128 +	void TestDelimitedQueryPushBackL(TRefByValue<const TDesC> aQuery, ...) const;
   1.129 +
   1.130 +	// Tests PopFront(), NewL() and NewLC()
   1.131 +	//
   1.132 +	// In:
   1.133 +	// aQuery	- the query
   1.134 +	// ...		- list of the expected full query for each pop
   1.135 +	//
   1.136 +	void TestDelimitedQueryPopFrontL(TRefByValue<const TDesC> aQuery, ...) const;
   1.137 +
   1.138 +	// Tests PopBack(), NewL() and NewLC()
   1.139 +	//
   1.140 +	// In:
   1.141 +	// aQuery	- the query
   1.142 +	// ...		- list of the expected full query for each pop
   1.143 +	//
   1.144 +	void TestDelimitedQueryPopBackL(TRefByValue<const TDesC> aQuery, ...) const;
   1.145 +
   1.146 +	// Tests adding and triming of fromt and back delimiters
   1.147 +	//
   1.148 +	// In:
   1.149 +	// aQuery	- the query
   1.150 +	//
   1.151 +	void TestDelimitedQueryAddAndTrimFrontAndBackDelimiterL(const TDesC& aQuery) const;
   1.152 +
   1.153 +	// Tests InsertCurrent(), Parse()
   1.154 +	//
   1.155 +	// In:
   1.156 +	// aStartPos	- position from the start of parsing of where to insert
   1.157 +	// aQuery		- the query
   1.158 +	// ...			- list of the query segments and expected full query for each insert
   1.159 +	//
   1.160 +	void TestDelimitedQueryInsertAndParseL(TInt aStartPos, TRefByValue<const TDesC> aQuery, ...) const;
   1.161 +
   1.162 +	// Tests RemoveCurrent(), Parse()
   1.163 +	//
   1.164 +	// In:
   1.165 +	// aStartPos	- position from the start of parsing of where to insert
   1.166 +	// aQuery		- the query
   1.167 +	// ...			- list of the expected full query for each remove
   1.168 +	//
   1.169 +	void TestDelimitedQueryRemoveAndParseL(TInt aStartPos, TRefByValue<const TDesC> aQuery, ...) const;
   1.170 +
   1.171 +	// Tests InsertCurrent(), ParseReverse()
   1.172 +	//
   1.173 +	// In:
   1.174 +	// aStartPos	- position from the start of parsing of where to insert
   1.175 +	// aQuery		- the query
   1.176 +	// ...			- list of the query segments and expected full query for each insert
   1.177 +	//
   1.178 +	void TestDelimitedQueryInsertAndParseReverseL(TInt aStartPos, TRefByValue<const TDesC> aQuery, ...) const;
   1.179 +
   1.180 +	// Tests RemoveCurrent(), ParseReverse()
   1.181 +	//
   1.182 +	// In:
   1.183 +	// aStartPos	- position from the start of parsing of where to insert
   1.184 +	// aQuery		- the query
   1.185 +	// ...			- list of the expected full query for each remove
   1.186 +	//
   1.187 +	void TestDelimitedQueryRemoveAndParseReverseL(TInt aStartPos, TRefByValue<const TDesC> aQuery, ...) const;
   1.188 +
   1.189 +	// Tests InsertAndEscapeCurrent(), Parse()
   1.190 +	//
   1.191 +	// In:
   1.192 +	// aStartPos	- position from the start of parsing of where to insert
   1.193 +	// aQuery		- the query
   1.194 +	// ...			- list of the query segments and expected full query for each insert
   1.195 +	//
   1.196 +	void TestDelimitedQueryInsertEscapeAndParseL(TInt aStartPos, TRefByValue<const TDesC> aQuery, ...) const;
   1.197 +
   1.198 +	// Tests InsertAndEscapeCurrent(), ParseReverse()
   1.199 +	//
   1.200 +	// In:
   1.201 +	// aStartPos	- position from the start of parsing of where to insert
   1.202 +	// aQuery		- the query
   1.203 +	// ...			- list of the query segments and expected full query for each insert
   1.204 +	//
   1.205 +	void TestDelimitedQueryInsertEscapeAndParseReverseL(TInt aStartPos, TRefByValue<const TDesC> aQuery, ...) const;
   1.206 +
   1.207 +	// Tests PushAndEscapeFront(), NewL() and NewLC()
   1.208 +	//
   1.209 +	// In:
   1.210 +	// aQuery	- the query
   1.211 +	// ...		- list of the query segments and expected full query for each push
   1.212 +	//
   1.213 +	void TestDelimitedQueryPushAndEscapeFrontL(TRefByValue<const TDesC> aQuery, ...) const;
   1.214 +
   1.215 +	// Tests PushAndEscapeBack(), NewL() and NewLC()
   1.216 +	//
   1.217 +	// In:
   1.218 +	// aQuery	- the query
   1.219 +	// ...		- list of the query segments and expected full query for each push
   1.220 +	//
   1.221 +	void TestDelimitedQueryPushAndEscapeBackL(TRefByValue<const TDesC> aQuery, ...) const;
   1.222 +
   1.223 +private:	// Attributes
   1.224 +
   1.225 +	// Test harness
   1.226 +	//
   1.227 +	CIpuTestHarness*	iTestHarness;
   1.228 +
   1.229 +	};
   1.230 +
   1.231 +#endif	// __CDELIMITEDQUERYTEST_H__