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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
16 #ifndef __CDELIMITEDQUERYTEST_H__
17 #define __CDELIMITEDQUERYTEST_H__
21 #include "ctestbase.h"
23 class CDelimitedQueryTest : public CTestBase
27 // Static factory c'tor.
29 // Rtn: pointer to newly created object - ownership transfered to caller.
31 static CDelimitedQueryTest* NewLC(CIpuTestHarness* aTestHarness);
33 // Static factory c'tor.
35 // Rtn: pointer to newly created object - ownership transfered to caller.
37 static CDelimitedQueryTest* NewL(CIpuTestHarness* aTestHarness);
41 ~CDelimitedQueryTest();
51 CDelimitedQueryTest(CIpuTestHarness* aTestHarness);
53 // 2nd phase construction
59 // Delimited Query Tests
63 // Tests extraction of query segments from left to right.
66 // aQuery - descriptor with query
67 // ... - list of one or more segments
69 void TestDelimitedQueryExtractionL(TRefByValue<const TDesC> aQuery, ...) const;
71 // Tests extraction of query segments from right to left.
74 // aQuery - descriptor with query
75 // ... - list of one or more segments
77 void TestDelimitedQueryReverseExtractionL(TRefByValue<const TDesC> aQuery, ...) const;
79 // Tests for presence of front and back delimiters
83 // aFrontDelim - indicated whethere there is a front delimiter or not
84 // aBackDelim - indicated whethere there is a back delimiter or not
86 void TestDelimitedQueryDelimiterPresenceL(const TDesC& aQuery, TBool aFrontDelim, TBool aBackDelim) const;
88 // Tests remainder functionality for forward parsing
92 // ... - list of the expected remainders
94 void TestDelimitedQueryRemainderL(TRefByValue<const TDesC> aQuery, ...) const;
96 // Tests remainder functionality for reverse parsing
100 // ... - list of the expected remainders
102 void TestDelimitedQueryRemainderReverseL(TRefByValue<const TDesC> aQuery, ...) const;
104 // Tests Des() function
107 // aQuery - the query
109 void TestDelimitedQueryDesL(const TDesC& aQuery) const;
111 // Tests PushFront(), NewL() and NewLC()
114 // aQuery - the query
115 // ... - list of the query segments and expected full query for each push
117 void TestDelimitedQueryPushFrontL(TRefByValue<const TDesC> aQuery, ...) const;
119 // Tests PushBack(), NewL() and NewLC()
122 // aQuery - the query
123 // ... - list of the query segments and expected full query for each push
125 void TestDelimitedQueryPushBackL(TRefByValue<const TDesC> aQuery, ...) const;
127 // Tests PopFront(), NewL() and NewLC()
130 // aQuery - the query
131 // ... - list of the expected full query for each pop
133 void TestDelimitedQueryPopFrontL(TRefByValue<const TDesC> aQuery, ...) const;
135 // Tests PopBack(), NewL() and NewLC()
138 // aQuery - the query
139 // ... - list of the expected full query for each pop
141 void TestDelimitedQueryPopBackL(TRefByValue<const TDesC> aQuery, ...) const;
143 // Tests adding and triming of fromt and back delimiters
146 // aQuery - the query
148 void TestDelimitedQueryAddAndTrimFrontAndBackDelimiterL(const TDesC& aQuery) const;
150 // Tests InsertCurrent(), Parse()
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
157 void TestDelimitedQueryInsertAndParseL(TInt aStartPos, TRefByValue<const TDesC> aQuery, ...) const;
159 // Tests RemoveCurrent(), Parse()
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
166 void TestDelimitedQueryRemoveAndParseL(TInt aStartPos, TRefByValue<const TDesC> aQuery, ...) const;
168 // Tests InsertCurrent(), ParseReverse()
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
175 void TestDelimitedQueryInsertAndParseReverseL(TInt aStartPos, TRefByValue<const TDesC> aQuery, ...) const;
177 // Tests RemoveCurrent(), ParseReverse()
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
184 void TestDelimitedQueryRemoveAndParseReverseL(TInt aStartPos, TRefByValue<const TDesC> aQuery, ...) const;
186 // Tests InsertAndEscapeCurrent(), Parse()
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
193 void TestDelimitedQueryInsertEscapeAndParseL(TInt aStartPos, TRefByValue<const TDesC> aQuery, ...) const;
195 // Tests InsertAndEscapeCurrent(), ParseReverse()
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
202 void TestDelimitedQueryInsertEscapeAndParseReverseL(TInt aStartPos, TRefByValue<const TDesC> aQuery, ...) const;
204 // Tests PushAndEscapeFront(), NewL() and NewLC()
207 // aQuery - the query
208 // ... - list of the query segments and expected full query for each push
210 void TestDelimitedQueryPushAndEscapeFrontL(TRefByValue<const TDesC> aQuery, ...) const;
212 // Tests PushAndEscapeBack(), NewL() and NewLC()
215 // aQuery - the query
216 // ... - list of the query segments and expected full query for each push
218 void TestDelimitedQueryPushAndEscapeBackL(TRefByValue<const TDesC> aQuery, ...) const;
220 private: // Attributes
224 CIpuTestHarness* iTestHarness;
228 #endif // __CDELIMITEDQUERYTEST_H__