|
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 #include "CDelimitedPathTest.h" |
|
17 |
|
18 #include <e32base.h> |
|
19 #include <delimitedpath16.h> |
|
20 #include <delimitedpath8.h> |
|
21 |
|
22 #include "TDelimitedDataCommon.h" |
|
23 #include "DelimitedPathTests.h" |
|
24 |
|
25 // Constants |
|
26 // |
|
27 _LIT(KTitle16Bit, "%S (16-Bit)"); |
|
28 _LIT(KTitle8Bit, "%S (8-Bit)"); |
|
29 |
|
30 CDelimitedPathTest* CDelimitedPathTest::NewLC(CIpuTestHarness* aTestHarness) |
|
31 { |
|
32 CDelimitedPathTest* self = new (ELeave) CDelimitedPathTest(aTestHarness); |
|
33 CleanupStack::PushL(self); |
|
34 self->ConstructL(); |
|
35 return self; |
|
36 } |
|
37 |
|
38 CDelimitedPathTest* CDelimitedPathTest::NewL(CIpuTestHarness* aTestHarness) |
|
39 { |
|
40 CDelimitedPathTest* self = CDelimitedPathTest::NewLC(aTestHarness); |
|
41 CleanupStack::Pop(); // self |
|
42 return self; |
|
43 } |
|
44 |
|
45 CDelimitedPathTest::CDelimitedPathTest(CIpuTestHarness* aTestHarness) |
|
46 : iTestHarness(aTestHarness) |
|
47 { |
|
48 } |
|
49 |
|
50 void CDelimitedPathTest::ConstructL() |
|
51 { |
|
52 } |
|
53 |
|
54 CDelimitedPathTest::~CDelimitedPathTest() |
|
55 { |
|
56 } |
|
57 |
|
58 void CDelimitedPathTest::DoTestsL() |
|
59 { |
|
60 // |
|
61 // |
|
62 // Delimited Path Tests |
|
63 // |
|
64 // |
|
65 |
|
66 TestDelimitedPathExtractionL(KPathParse0, &KPathParse0Seg0(), &KPathParse0Seg1(), &KPathParse0Seg2(), |
|
67 &KPathParse0Seg3(), &KPathParse0Seg4(), NULL); |
|
68 TestDelimitedPathExtractionL(KPathParse1, &KPathParse1Seg0(), &KPathParse1Seg1(), NULL); |
|
69 TestDelimitedPathExtractionL(KPathParse2, &KPathParse2Seg0(), &KPathParse2Seg1(), &KPathParse2Seg2(), |
|
70 &KPathParse2Seg3(), &KPathParse2Seg4(), &KPathParse2Seg5(), &KPathParse2Seg6(), NULL); |
|
71 |
|
72 TestDelimitedPathReverseExtractionL(KPathParse0, &KPathParse0Seg4(), &KPathParse0Seg3(), &KPathParse0Seg2(), |
|
73 &KPathParse0Seg1(), &KPathParse0Seg0(), NULL); |
|
74 TestDelimitedPathReverseExtractionL(KPathParse1, &KPathParse1Seg1(), &KPathParse1Seg0(), NULL); |
|
75 TestDelimitedPathReverseExtractionL(KPathParse2, &KPathParse2Seg6(), &KPathParse2Seg5(), &KPathParse2Seg4(), |
|
76 &KPathParse2Seg3(), &KPathParse2Seg2(), &KPathParse2Seg1(), &KPathParse2Seg0(), NULL); |
|
77 |
|
78 TestDelimitedPathDelimiterPresenceL(KPath_DelimPresence0, KPath_FrontDelim0, KPath_BackDelim0); |
|
79 TestDelimitedPathDelimiterPresenceL(KPath_DelimPresence1, KPath_FrontDelim1, KPath_BackDelim1); |
|
80 TestDelimitedPathDelimiterPresenceL(KPath_DelimPresence2, KPath_FrontDelim2, KPath_BackDelim2); |
|
81 TestDelimitedPathDelimiterPresenceL(KPath_DelimPresence3, KPath_FrontDelim3, KPath_BackDelim3); |
|
82 |
|
83 TestDelimitedPathRemainderL(KPath_Rem_Forwards0_0, &KPath_Rem_Forwards0_0(), &KPath_Rem_Forwards0_1(), |
|
84 &KPath_Rem_Forwards0_2(), &KPath_Rem_Forwards0_3(), &KPath_Rem_Forwards0_4(), NULL); |
|
85 TestDelimitedPathRemainderL(KPath_Rem_Forwards1_0, &KPath_Rem_Forwards1_0(), &KPath_Rem_Forwards1_1(), |
|
86 &KPath_Rem_Forwards1_2(), &KPath_Rem_Forwards1_3(), NULL); |
|
87 TestDelimitedPathRemainderL(KPath_Rem_Forwards2_0, &KPath_Rem_Forwards2_0(), &KPath_Rem_Forwards2_1(), |
|
88 &KPath_Rem_Forwards2_2(), &KPath_Rem_Forwards2_3(), NULL); |
|
89 |
|
90 TestDelimitedPathRemainderReverseL(KPath_Rem_Backwards0_0, &KPath_Rem_Backwards0_0(), &KPath_Rem_Backwards0_1(), |
|
91 &KPath_Rem_Backwards0_2(), &KPath_Rem_Backwards0_3(), &KPath_Rem_Backwards0_4(), NULL); |
|
92 TestDelimitedPathRemainderReverseL(KPath_Rem_Backwards1_0, &KPath_Rem_Backwards1_0(), &KPath_Rem_Backwards1_1(), |
|
93 &KPath_Rem_Backwards1_2(), &KPath_Rem_Backwards1_3(), NULL); |
|
94 TestDelimitedPathRemainderReverseL(KPath_Rem_Backwards2_0, &KPath_Rem_Backwards2_0(), &KPath_Rem_Backwards2_1(), |
|
95 &KPath_Rem_Backwards2_2(), &KPath_Rem_Backwards2_3(), NULL); |
|
96 |
|
97 TestDelimitedPathDesL(KPath_Des0); |
|
98 |
|
99 TestDelimitedPathPushFrontL(KPath_PushPopFront0_0, &KPath_Push0_a(), &KPath_PushPopFront0_1(), |
|
100 &KPath_Push0_b(), &KPath_PushPopFront0_2(), |
|
101 &KPath_Push0_c(), &KPath_PushPopFront0_3(), |
|
102 &KPath_Push0_d(), &KPath_PushPopFront0_4(), |
|
103 &KPath_Push0_e(), &KPath_PushPopFront0_5(), NULL, NULL); |
|
104 |
|
105 TestDelimitedPathPushBackL(KPath_PushPopBack0_0, &KPath_Push0_a(), &KPath_PushPopBack0_1(), |
|
106 &KPath_Push0_b(), &KPath_PushPopBack0_2(), |
|
107 &KPath_Push0_c(), &KPath_PushPopBack0_3(), |
|
108 &KPath_Push0_d(), &KPath_PushPopBack0_4(), |
|
109 &KPath_Push0_e(), &KPath_PushPopBack0_5(), NULL, NULL); |
|
110 |
|
111 TestDelimitedPathPopFrontL(KPath_PushPopFront0_5, &KPath_PushPopFront0_4(), &KPath_PushPopFront0_3(), |
|
112 &KPath_PushPopFront0_2(), &KPath_PushPopFront0_1(), &KPath_PushPopFront0_0(), NULL); |
|
113 |
|
114 TestDelimitedPathPopBackL(KPath_PushPopBack0_5, &KPath_PushPopBack0_4(), &KPath_PushPopBack0_3(), |
|
115 &KPath_PushPopBack0_2(), &KPath_PushPopBack0_1(), &KPath_PushPopBack0_0(), NULL); |
|
116 |
|
117 TestDelimitedPathAddAndTrimFrontAndBackDelimiterL(KPath_AddTrimDelim0); |
|
118 |
|
119 TestDelimitedPathInsertAndParseL(KPathInsertForwardsPos0, KPath_InsertForwards0_0, |
|
120 &KPath_Insert0_a(), &KPath_InsertForwards0_1(), |
|
121 &KPath_Insert0_b(), &KPath_InsertForwards0_2(), |
|
122 &KPath_Insert0_c(), &KPath_InsertForwards0_3(), |
|
123 &KPath_Insert0_d(), &KPath_InsertForwards0_4(), |
|
124 &KPath_Insert0_e(), &KPath_InsertForwards0_5(), NULL, NULL); |
|
125 |
|
126 TestDelimitedPathRemoveAndParseL(KPathRemoveForwardsPos0, KPath_RemoveForwards0_0, |
|
127 &KPath_RemoveForwards0_1(), &KPath_RemoveForwards0_2(), |
|
128 &KPath_RemoveForwards0_3(), &KPath_RemoveForwards0_4(), |
|
129 &KPath_RemoveForwards0_5(), NULL); |
|
130 |
|
131 TestDelimitedPathInsertAndParseReverseL(KPathInsertBackwardsPos0, KPath_InsertBackwards0_0, |
|
132 &KPath_Insert0_a(), &KPath_InsertBackwards0_1(), |
|
133 &KPath_Insert0_b(), &KPath_InsertBackwards0_2(), |
|
134 &KPath_Insert0_c(), &KPath_InsertBackwards0_3(), |
|
135 &KPath_Insert0_d(), &KPath_InsertBackwards0_4(), |
|
136 &KPath_Insert0_e(), &KPath_InsertBackwards0_5(), NULL, NULL); |
|
137 |
|
138 TestDelimitedPathRemoveAndParseReverseL(KPathRemoveBackwardsPos0, KPath_RemoveBackwards0_0, |
|
139 &KPath_RemoveBackwards0_1(), &KPath_RemoveBackwards0_2(), |
|
140 &KPath_RemoveBackwards0_3(), &KPath_RemoveBackwards0_4(), |
|
141 &KPath_RemoveBackwards0_5(), NULL); |
|
142 |
|
143 TestDelimitedPathInsertEscapeAndParseL(KPathInsertEscapeForwardsPos0, KPath_InsertEscapeForwards0_0, |
|
144 &KPath_InsertEscape0_a(), &KPath_InsertEscapeForwards0_1(), |
|
145 &KPath_InsertEscape0_b(), &KPath_InsertEscapeForwards0_2(), |
|
146 &KPath_InsertEscape0_c(), &KPath_InsertEscapeForwards0_3(), |
|
147 &KPath_InsertEscape0_d(), &KPath_InsertEscapeForwards0_4(), |
|
148 &KPath_InsertEscape0_e(), &KPath_InsertEscapeForwards0_5(), NULL, NULL); |
|
149 |
|
150 TestDelimitedPathInsertEscapeAndParseReverseL(KPathInsertEscapeBackwardsPos0, KPath_InsertEscapeBackwards0_0, |
|
151 &KPath_InsertEscape0_a(), &KPath_InsertEscapeBackwards0_1(), |
|
152 &KPath_InsertEscape0_b(), &KPath_InsertEscapeBackwards0_2(), |
|
153 &KPath_InsertEscape0_c(), &KPath_InsertEscapeBackwards0_3(), |
|
154 &KPath_InsertEscape0_d(), &KPath_InsertEscapeBackwards0_4(), |
|
155 &KPath_InsertEscape0_e(), &KPath_InsertEscapeBackwards0_5(), NULL, NULL); |
|
156 |
|
157 TestDelimitedPathPushAndEscapeFrontL(KPath_PushEscapeFront0_0, &KPath_PushEscape0_a(), &KPath_PushEscapeFront0_1(), |
|
158 &KPath_PushEscape0_b(), &KPath_PushEscapeFront0_2(), |
|
159 &KPath_PushEscape0_c(), &KPath_PushEscapeFront0_3(), |
|
160 &KPath_PushEscape0_d(), &KPath_PushEscapeFront0_4(), |
|
161 &KPath_PushEscape0_e(), &KPath_PushEscapeFront0_5(), NULL, NULL); |
|
162 |
|
163 TestDelimitedPathPushAndEscapeBackL(KPath_PushEscapeBack0_0, &KPath_PushEscape0_a(), &KPath_PushEscapeBack0_1(), |
|
164 &KPath_PushEscape0_b(), &KPath_PushEscapeBack0_2(), |
|
165 &KPath_PushEscape0_c(), &KPath_PushEscapeBack0_3(), |
|
166 &KPath_PushEscape0_d(), &KPath_PushEscapeBack0_4(), |
|
167 &KPath_PushEscape0_e(), &KPath_PushEscapeBack0_5(), NULL, NULL); |
|
168 |
|
169 // |
|
170 // |
|
171 // Delimited PathSegment Tests |
|
172 // |
|
173 // |
|
174 /* |
|
175 TestDelimitedPathSegmentExtractionL(KPathSegmentParse0, &KPathSegmentParse0Seg0(), &KPathSegmentParse0Seg1(), |
|
176 &KPathSegmentParse0Seg2(), NULL); |
|
177 TestDelimitedPathSegmentExtractionL(KPathSegmentParse1, &KPathSegmentParse1Seg0(), &KPathSegmentParse1Seg1(), &KPathSegmentParse1Seg2(), |
|
178 &KPathSegmentParse1Seg3(), NULL); |
|
179 TestDelimitedPathSegmentExtractionL(KPathSegmentParse2, &KPathSegmentParse2Seg0(), &KPathSegmentParse2Seg1(), &KPathSegmentParse2Seg2(), |
|
180 &KPathSegmentParse2Seg3(), &KPathSegmentParse2Seg4(), &KPathSegmentParse2Seg5(), &KPathSegmentParse2Seg6(), |
|
181 &KPathSegmentParse2Seg7(), NULL); |
|
182 |
|
183 TestDelimitedPathSegmentReverseExtractionL(KPathSegmentParse0, &KPathSegmentParse0Seg2(), |
|
184 &KPathSegmentParse0Seg1(), &KPathSegmentParse0Seg0(), NULL); |
|
185 TestDelimitedPathSegmentReverseExtractionL(KPathSegmentParse1, &KPathSegmentParse1Seg3(), &KPathSegmentParse1Seg2(), |
|
186 &KPathSegmentParse1Seg1(), &KPathSegmentParse1Seg0(), NULL); |
|
187 TestDelimitedPathSegmentReverseExtractionL(KPathSegmentParse2, &KPathSegmentParse2Seg7(), &KPathSegmentParse2Seg6(), |
|
188 &KPathSegmentParse2Seg5(), &KPathSegmentParse2Seg4(), &KPathSegmentParse2Seg3(), |
|
189 &KPathSegmentParse2Seg2(), &KPathSegmentParse2Seg1(), &KPathSegmentParse2Seg0(), NULL); |
|
190 |
|
191 TestDelimitedPathSegmentDelimiterPresenceL(KPathSegment_DelimPresence0, KPathSegment_FrontDelim0, KPathSegment_BackDelim0); |
|
192 TestDelimitedPathSegmentDelimiterPresenceL(KPathSegment_DelimPresence1, KPathSegment_FrontDelim1, KPathSegment_BackDelim1); |
|
193 TestDelimitedPathSegmentDelimiterPresenceL(KPathSegment_DelimPresence2, KPathSegment_FrontDelim2, KPathSegment_BackDelim2); |
|
194 TestDelimitedPathSegmentDelimiterPresenceL(KPathSegment_DelimPresence3, KPathSegment_FrontDelim3, KPathSegment_BackDelim3); |
|
195 |
|
196 TestDelimitedPathSegmentRemainderL(KPathSegment_Rem_Forwards0_0, &KPathSegment_Rem_Forwards0_0(), &KPathSegment_Rem_Forwards0_1(), |
|
197 &KPathSegment_Rem_Forwards0_2(), &KPathSegment_Rem_Forwards0_3(), NULL); |
|
198 |
|
199 TestDelimitedPathSegmentRemainderReverseL(KPathSegment_Rem_Backwards0_0, &KPathSegment_Rem_Backwards0_0(), &KPathSegment_Rem_Backwards0_1(), |
|
200 &KPathSegment_Rem_Backwards0_2(), &KPathSegment_Rem_Backwards0_3(), NULL); |
|
201 |
|
202 TestDelimitedPathSegmentDesL(KPathSegment_Des0); |
|
203 |
|
204 TestDelimitedPathSegmentPushFrontL(KPathSegment_PushPopFront0_0, &KPathSegment_Push0_a(), &KPathSegment_PushPopFront0_1(), |
|
205 &KPathSegment_Push0_b(), &KPathSegment_PushPopFront0_2(), |
|
206 &KPathSegment_Push0_c(), &KPathSegment_PushPopFront0_3(), |
|
207 &KPathSegment_Push0_d(), &KPathSegment_PushPopFront0_4(), |
|
208 &KPathSegment_Push0_e(), &KPathSegment_PushPopFront0_5(), NULL, NULL); |
|
209 |
|
210 TestDelimitedPathSegmentPushBackL(KPathSegment_PushPopBack0_0, &KPathSegment_Push0_a(), &KPathSegment_PushPopBack0_1(), |
|
211 &KPathSegment_Push0_b(), &KPathSegment_PushPopBack0_2(), |
|
212 &KPathSegment_Push0_c(), &KPathSegment_PushPopBack0_3(), |
|
213 &KPathSegment_Push0_d(), &KPathSegment_PushPopBack0_4(), |
|
214 &KPathSegment_Push0_e(), &KPathSegment_PushPopBack0_5(), NULL, NULL); |
|
215 |
|
216 TestDelimitedPathSegmentPopFrontL(KPathSegment_PushPopFront0_5, &KPathSegment_PushPopFront0_4(), &KPathSegment_PushPopFront0_3(), |
|
217 &KPathSegment_PushPopFront0_2(), &KPathSegment_PushPopFront0_1(), &KPathSegment_PushPopFront0_0(), NULL); |
|
218 |
|
219 TestDelimitedPathSegmentPopBackL(KPathSegment_PushPopBack0_5, &KPathSegment_PushPopBack0_4(), &KPathSegment_PushPopBack0_3(), |
|
220 &KPathSegment_PushPopBack0_2(), &KPathSegment_PushPopBack0_1(), &KPathSegment_PushPopBack0_0(), NULL); |
|
221 |
|
222 TestDelimitedPathSegmentAddAndTrimFrontAndBackDelimiterL(KPathSegment_AddTrimDelim0); |
|
223 |
|
224 TestDelimitedPathSegmentInsertAndParseL(KPathSegmentInsertForwardsPos0, KPathSegment_InsertForwards0_0, |
|
225 &KPathSegment_Insert0_a(), &KPathSegment_InsertForwards0_1(), |
|
226 &KPathSegment_Insert0_b(), &KPathSegment_InsertForwards0_2(), |
|
227 &KPathSegment_Insert0_c(), &KPathSegment_InsertForwards0_3(), |
|
228 &KPathSegment_Insert0_d(), &KPathSegment_InsertForwards0_4(), |
|
229 &KPathSegment_Insert0_e(), &KPathSegment_InsertForwards0_5(), NULL, NULL); |
|
230 |
|
231 TestDelimitedPathSegmentRemoveAndParseL(KPathSegmentRemoveForwardsPos0, KPathSegment_RemoveForwards0_0, |
|
232 &KPathSegment_RemoveForwards0_1(), &KPathSegment_RemoveForwards0_2(), |
|
233 &KPathSegment_RemoveForwards0_3(), &KPathSegment_RemoveForwards0_4(), |
|
234 &KPathSegment_RemoveForwards0_5(), NULL); |
|
235 |
|
236 TestDelimitedPathSegmentInsertAndParseReverseL(KPathSegmentInsertBackwardsPos0, KPathSegment_InsertBackwards0_0, |
|
237 &KPathSegment_Insert0_a(), &KPathSegment_InsertBackwards0_1(), |
|
238 &KPathSegment_Insert0_b(), &KPathSegment_InsertBackwards0_2(), |
|
239 &KPathSegment_Insert0_c(), &KPathSegment_InsertBackwards0_3(), |
|
240 &KPathSegment_Insert0_d(), &KPathSegment_InsertBackwards0_4(), |
|
241 &KPathSegment_Insert0_e(), &KPathSegment_InsertBackwards0_5(), NULL, NULL); |
|
242 |
|
243 TestDelimitedPathSegmentRemoveAndParseReverseL(KPathSegmentRemoveBackwardsPos0, KPathSegment_RemoveBackwards0_0, |
|
244 &KPathSegment_RemoveBackwards0_1(), &KPathSegment_RemoveBackwards0_2(), |
|
245 &KPathSegment_RemoveBackwards0_3(), &KPathSegment_RemoveBackwards0_4(), |
|
246 &KPathSegment_RemoveBackwards0_5(), NULL); |
|
247 |
|
248 TestDelimitedPathSegmentInsertEscapeAndParseL(KPathSegmentInsertEscapeForwardsPos0, KPathSegment_InsertEscapeForwards0_0, |
|
249 &KPathSegment_InsertEscape0_a(), &KPathSegment_InsertEscapeForwards0_1(), |
|
250 &KPathSegment_InsertEscape0_b(), &KPathSegment_InsertEscapeForwards0_2(), |
|
251 &KPathSegment_InsertEscape0_c(), &KPathSegment_InsertEscapeForwards0_3(), |
|
252 &KPathSegment_InsertEscape0_d(), &KPathSegment_InsertEscapeForwards0_4(), |
|
253 &KPathSegment_InsertEscape0_e(), &KPathSegment_InsertEscapeForwards0_5(), NULL, NULL); |
|
254 |
|
255 TestDelimitedPathSegmentInsertEscapeAndParseReverseL(KPathSegmentInsertEscapeBackwardsPos0, KPathSegment_InsertEscapeBackwards0_0, |
|
256 &KPathSegment_InsertEscape0_a(), &KPathSegment_InsertEscapeBackwards0_1(), |
|
257 &KPathSegment_InsertEscape0_b(), &KPathSegment_InsertEscapeBackwards0_2(), |
|
258 &KPathSegment_InsertEscape0_c(), &KPathSegment_InsertEscapeBackwards0_3(), |
|
259 &KPathSegment_InsertEscape0_d(), &KPathSegment_InsertEscapeBackwards0_4(), |
|
260 &KPathSegment_InsertEscape0_e(), &KPathSegment_InsertEscapeBackwards0_5(), NULL, NULL); |
|
261 |
|
262 TestDelimitedPathSegmentPushAndEscapeFrontL(KPathSegment_PushEscapeFront0_0, &KPathSegment_PushEscape0_a(), &KPathSegment_PushEscapeFront0_1(), |
|
263 &KPathSegment_PushEscape0_b(), &KPathSegment_PushEscapeFront0_2(), |
|
264 &KPathSegment_PushEscape0_c(), &KPathSegment_PushEscapeFront0_3(), |
|
265 &KPathSegment_PushEscape0_d(), &KPathSegment_PushEscapeFront0_4(), |
|
266 &KPathSegment_PushEscape0_e(), &KPathSegment_PushEscapeFront0_5(), NULL, NULL); |
|
267 |
|
268 TestDelimitedPathSegmentPushAndEscapeBackL(KPathSegment_PushEscapeBack0_0, &KPathSegment_PushEscape0_a(), &KPathSegment_PushEscapeBack0_1(), |
|
269 &KPathSegment_PushEscape0_b(), &KPathSegment_PushEscapeBack0_2(), |
|
270 &KPathSegment_PushEscape0_c(), &KPathSegment_PushEscapeBack0_3(), |
|
271 &KPathSegment_PushEscape0_d(), &KPathSegment_PushEscapeBack0_4(), |
|
272 &KPathSegment_PushEscape0_e(), &KPathSegment_PushEscapeBack0_5(), NULL, NULL); |
|
273 |
|
274 // |
|
275 // |
|
276 // Delimited Query Tests |
|
277 // |
|
278 // |
|
279 TestDelimitedQueryExtractionL(KQueryParse0, &KQueryParse0Seg0(), &KQueryParse0Seg1(), &KQueryParse0Seg2(), |
|
280 &KQueryParse0Seg3(), NULL); |
|
281 TestDelimitedQueryExtractionL(KQueryParse1, &KQueryParse1Seg0(), &KQueryParse1Seg1(), NULL); |
|
282 TestDelimitedQueryExtractionL(KQueryParse2, &KQueryParse2Seg0(), &KQueryParse2Seg1(), &KQueryParse2Seg2(), |
|
283 &KQueryParse2Seg3(), &KQueryParse2Seg4(), &KQueryParse2Seg5(), NULL); |
|
284 |
|
285 TestDelimitedQueryReverseExtractionL(KQueryParse0, &KQueryParse0Seg3(), &KQueryParse0Seg2(), |
|
286 &KQueryParse0Seg1(), &KQueryParse0Seg0(), NULL); |
|
287 TestDelimitedQueryReverseExtractionL(KQueryParse1, &KQueryParse1Seg1(), &KQueryParse1Seg0(), NULL); |
|
288 TestDelimitedQueryReverseExtractionL(KQueryParse2, &KQueryParse2Seg5(), &KQueryParse2Seg4(), |
|
289 &KQueryParse2Seg3(), &KQueryParse2Seg2(), &KQueryParse2Seg1(), &KQueryParse2Seg0(), NULL); |
|
290 |
|
291 TestDelimitedQueryDelimiterPresenceL(KQuery_DelimPresence0, KQuery_FrontDelim0, KQuery_BackDelim0); |
|
292 TestDelimitedQueryDelimiterPresenceL(KQuery_DelimPresence1, KQuery_FrontDelim1, KQuery_BackDelim1); |
|
293 TestDelimitedQueryDelimiterPresenceL(KQuery_DelimPresence2, KQuery_FrontDelim2, KQuery_BackDelim2); |
|
294 TestDelimitedQueryDelimiterPresenceL(KQuery_DelimPresence3, KQuery_FrontDelim3, KQuery_BackDelim3); |
|
295 |
|
296 TestDelimitedQueryRemainderL(KQuery_Rem_Forwards0_0, &KQuery_Rem_Forwards0_0(), &KQuery_Rem_Forwards0_1(), |
|
297 &KQuery_Rem_Forwards0_2(), &KQuery_Rem_Forwards0_3(), NULL); |
|
298 |
|
299 TestDelimitedQueryRemainderReverseL(KQuery_Rem_Backwards0_0, &KQuery_Rem_Backwards0_0(), &KQuery_Rem_Backwards0_1(), |
|
300 &KQuery_Rem_Backwards0_2(), &KQuery_Rem_Backwards0_3(), NULL); |
|
301 |
|
302 TestDelimitedQueryDesL(KQuery_Des0); |
|
303 |
|
304 TestDelimitedQueryPushFrontL(KQuery_PushPopFront0_0, &KQuery_Push0_a(), &KQuery_PushPopFront0_1(), |
|
305 &KQuery_Push0_b(), &KQuery_PushPopFront0_2(), |
|
306 &KQuery_Push0_c(), &KQuery_PushPopFront0_3(), |
|
307 &KQuery_Push0_d(), &KQuery_PushPopFront0_4(), |
|
308 &KQuery_Push0_e(), &KQuery_PushPopFront0_5(), NULL, NULL); |
|
309 |
|
310 TestDelimitedQueryPushBackL(KQuery_PushPopBack0_0, &KQuery_Push0_a(), &KQuery_PushPopBack0_1(), |
|
311 &KQuery_Push0_b(), &KQuery_PushPopBack0_2(), |
|
312 &KQuery_Push0_c(), &KQuery_PushPopBack0_3(), |
|
313 &KQuery_Push0_d(), &KQuery_PushPopBack0_4(), |
|
314 &KQuery_Push0_e(), &KQuery_PushPopBack0_5(), NULL, NULL); |
|
315 |
|
316 TestDelimitedQueryPopFrontL(KQuery_PushPopFront0_5, &KQuery_PushPopFront0_4(), &KQuery_PushPopFront0_3(), |
|
317 &KQuery_PushPopFront0_2(), &KQuery_PushPopFront0_1(), &KQuery_PushPopFront0_0(), NULL); |
|
318 |
|
319 TestDelimitedQueryPopBackL(KQuery_PushPopBack0_5, &KQuery_PushPopBack0_4(), &KQuery_PushPopBack0_3(), |
|
320 &KQuery_PushPopBack0_2(), &KQuery_PushPopBack0_1(), &KQuery_PushPopBack0_0(), NULL); |
|
321 |
|
322 TestDelimitedQueryAddAndTrimFrontAndBackDelimiterL(KQuery_AddTrimDelim0); |
|
323 |
|
324 TestDelimitedQueryInsertAndParseL(KQueryInsertForwardsPos0, KQuery_InsertForwards0_0, |
|
325 &KQuery_Insert0_a(), &KQuery_InsertForwards0_1(), |
|
326 &KQuery_Insert0_b(), &KQuery_InsertForwards0_2(), |
|
327 &KQuery_Insert0_c(), &KQuery_InsertForwards0_3(), |
|
328 &KQuery_Insert0_d(), &KQuery_InsertForwards0_4(), |
|
329 &KQuery_Insert0_e(), &KQuery_InsertForwards0_5(), NULL, NULL); |
|
330 |
|
331 TestDelimitedQueryRemoveAndParseL(KQueryRemoveForwardsPos0, KQuery_RemoveForwards0_0, |
|
332 &KQuery_RemoveForwards0_1(), &KQuery_RemoveForwards0_2(), |
|
333 &KQuery_RemoveForwards0_3(), &KQuery_RemoveForwards0_4(), |
|
334 &KQuery_RemoveForwards0_5(), NULL); |
|
335 |
|
336 TestDelimitedQueryInsertAndParseReverseL(KQueryInsertBackwardsPos0, KQuery_InsertBackwards0_0, |
|
337 &KQuery_Insert0_a(), &KQuery_InsertBackwards0_1(), |
|
338 &KQuery_Insert0_b(), &KQuery_InsertBackwards0_2(), |
|
339 &KQuery_Insert0_c(), &KQuery_InsertBackwards0_3(), |
|
340 &KQuery_Insert0_d(), &KQuery_InsertBackwards0_4(), |
|
341 &KQuery_Insert0_e(), &KQuery_InsertBackwards0_5(), NULL, NULL); |
|
342 |
|
343 TestDelimitedQueryRemoveAndParseReverseL(KQueryRemoveBackwardsPos0, KQuery_RemoveBackwards0_0, |
|
344 &KQuery_RemoveBackwards0_1(), &KQuery_RemoveBackwards0_2(), |
|
345 &KQuery_RemoveBackwards0_3(), &KQuery_RemoveBackwards0_4(), |
|
346 &KQuery_RemoveBackwards0_5(), NULL); |
|
347 |
|
348 TestDelimitedQueryInsertEscapeAndParseL(KQueryInsertEscapeForwardsPos0, KQuery_InsertEscapeForwards0_0, |
|
349 &KQuery_InsertEscape0_a(), &KQuery_InsertEscapeForwards0_1(), |
|
350 &KQuery_InsertEscape0_b(), &KQuery_InsertEscapeForwards0_2(), |
|
351 &KQuery_InsertEscape0_c(), &KQuery_InsertEscapeForwards0_3(), |
|
352 &KQuery_InsertEscape0_d(), &KQuery_InsertEscapeForwards0_4(), |
|
353 &KQuery_InsertEscape0_e(), &KQuery_InsertEscapeForwards0_5(), NULL, NULL); |
|
354 |
|
355 TestDelimitedQueryInsertEscapeAndParseReverseL(KQueryInsertEscapeBackwardsPos0, KQuery_InsertEscapeBackwards0_0, |
|
356 &KQuery_InsertEscape0_a(), &KQuery_InsertEscapeBackwards0_1(), |
|
357 &KQuery_InsertEscape0_b(), &KQuery_InsertEscapeBackwards0_2(), |
|
358 &KQuery_InsertEscape0_c(), &KQuery_InsertEscapeBackwards0_3(), |
|
359 &KQuery_InsertEscape0_d(), &KQuery_InsertEscapeBackwards0_4(), |
|
360 &KQuery_InsertEscape0_e(), &KQuery_InsertEscapeBackwards0_5(), NULL, NULL); |
|
361 |
|
362 TestDelimitedQueryPushAndEscapeFrontL(KQuery_PushEscapeFront0_0, &KQuery_PushEscape0_a(), &KQuery_PushEscapeFront0_1(), |
|
363 &KQuery_PushEscape0_b(), &KQuery_PushEscapeFront0_2(), |
|
364 &KQuery_PushEscape0_c(), &KQuery_PushEscapeFront0_3(), |
|
365 &KQuery_PushEscape0_d(), &KQuery_PushEscapeFront0_4(), |
|
366 &KQuery_PushEscape0_e(), &KQuery_PushEscapeFront0_5(), NULL, NULL); |
|
367 |
|
368 TestDelimitedQueryPushAndEscapeBackL(KQuery_PushEscapeBack0_0, &KQuery_PushEscape0_a(), &KQuery_PushEscapeBack0_1(), |
|
369 &KQuery_PushEscape0_b(), &KQuery_PushEscapeBack0_2(), |
|
370 &KQuery_PushEscape0_c(), &KQuery_PushEscapeBack0_3(), |
|
371 &KQuery_PushEscape0_d(), &KQuery_PushEscapeBack0_4(), |
|
372 &KQuery_PushEscape0_e(), &KQuery_PushEscapeBack0_5(), NULL, NULL); |
|
373 */ } |
|
374 |
|
375 // |
|
376 // |
|
377 // Delimited Path tests |
|
378 // |
|
379 // |
|
380 |
|
381 void CDelimitedPathTest::TestDelimitedPathExtractionL(TRefByValue<const TDesC> aPath, ...) const |
|
382 { |
|
383 VA_LIST list1; VA_START(list1, aPath); |
|
384 VA_LIST list2; VA_START(list2, aPath); |
|
385 const TDesC& path = aPath; |
|
386 |
|
387 TestDelimitedDataExtractionL(_L("Test TDelimitedPathParser Parse : GetNext, Dec, Inc, Peek and Eos"), iTestHarness, path, list1, list2); |
|
388 VA_END(list1); VA_END(list2); |
|
389 } |
|
390 |
|
391 void CDelimitedPathTest::TestDelimitedPathReverseExtractionL(TRefByValue<const TDesC> aPath, ...) const |
|
392 { |
|
393 VA_LIST list1; VA_START(list1, aPath); |
|
394 VA_LIST list2; VA_START(list2, aPath); |
|
395 const TDesC& path = aPath; |
|
396 |
|
397 TestDelimitedDataReverseExtractionL(_L("Test TDelimitedPathParser ParseReverse : GetNext, Dec, Inc, Peek and Eos"), iTestHarness, path, list1, list2); |
|
398 VA_END(list1); VA_END(list2); |
|
399 } |
|
400 |
|
401 void CDelimitedPathTest::TestDelimitedPathDelimiterPresenceL(const TDesC& aPath, TBool aFrontDelim, TBool aBackDelim) const |
|
402 { |
|
403 TestDelimitedDataDelimiterPresenceL(_L("Test TDelimitedPathParser Delimiter Presence"), iTestHarness, aPath, aFrontDelim, aBackDelim); |
|
404 } |
|
405 |
|
406 void CDelimitedPathTest::TestDelimitedPathRemainderL(TRefByValue<const TDesC> aPath, ...) const |
|
407 { |
|
408 VA_LIST list1; VA_START(list1, aPath); |
|
409 VA_LIST list2; VA_START(list2, aPath); |
|
410 const TDesC& path = aPath; |
|
411 |
|
412 TestDelimitedDataRemainderL(_L("Test TDelimitedPathParser Remainder, Parse"), iTestHarness, path, list1, list2); |
|
413 VA_END(list1); VA_END(list2); |
|
414 } |
|
415 |
|
416 void CDelimitedPathTest::TestDelimitedPathRemainderReverseL(TRefByValue<const TDesC> aPath, ...) const |
|
417 { |
|
418 VA_LIST list1; VA_START(list1, aPath); |
|
419 VA_LIST list2; VA_START(list2, aPath); |
|
420 const TDesC& path = aPath; |
|
421 |
|
422 TestDelimitedDataRemainderReverseL(_L("Test TDelimitedPathParser Remainder, ParseReverse"), iTestHarness, path, list1, list2); |
|
423 VA_END(list1); VA_END(list2); |
|
424 } |
|
425 |
|
426 void CDelimitedPathTest::TestDelimitedPathDesL(const TDesC& aPath) const |
|
427 { |
|
428 TestDelimitedDataDesL(_L("Test TDelimitedPathParser Des"), iTestHarness, aPath); |
|
429 } |
|
430 |
|
431 void CDelimitedPathTest::TestDelimitedPathPushFrontL(TRefByValue<const TDesC> aPath, ...) const |
|
432 { |
|
433 VA_LIST list1; VA_START(list1, aPath); |
|
434 VA_LIST list2; VA_START(list2, aPath); |
|
435 const TDesC& path = aPath; |
|
436 |
|
437 TestDelimitedDataPushFrontL(_L("Test CDelimitedPath PushFront"), iTestHarness, path, list1, list2); |
|
438 VA_END(list1); |
|
439 VA_END(list2); |
|
440 } |
|
441 |
|
442 void CDelimitedPathTest::TestDelimitedPathPushBackL(TRefByValue<const TDesC> aPath, ...) const |
|
443 { |
|
444 VA_LIST list1; VA_START(list1, aPath); |
|
445 VA_LIST list2; VA_START(list2, aPath); |
|
446 const TDesC& path = aPath; |
|
447 |
|
448 TestDelimitedDataPushBackL(_L("Test CDelimitedPath PushBack"), iTestHarness, path, list1, list2); |
|
449 VA_END(list1); VA_END(list2); |
|
450 } |
|
451 |
|
452 void CDelimitedPathTest::TestDelimitedPathPopFrontL(TRefByValue<const TDesC> aPath, ...) const |
|
453 { |
|
454 VA_LIST list1; VA_START(list1, aPath); |
|
455 VA_LIST list2; VA_START(list2, aPath); |
|
456 const TDesC& path = aPath; |
|
457 |
|
458 TestDelimitedDataPopFrontL(_L("Test CDelimitedPath PopFront"), iTestHarness, path, list1, list2); |
|
459 VA_END(list1); VA_END(list2); |
|
460 } |
|
461 |
|
462 void CDelimitedPathTest::TestDelimitedPathPopBackL(TRefByValue<const TDesC> aPath, ...) const |
|
463 { |
|
464 VA_LIST list1; VA_START(list1, aPath); |
|
465 VA_LIST list2; VA_START(list2, aPath); |
|
466 const TDesC& path = aPath; |
|
467 |
|
468 TestDelimitedDataPopBackL(_L("Test CDelimitedPath PopBack"), iTestHarness, path, list1, list2); |
|
469 VA_END(list1); VA_END(list2); |
|
470 } |
|
471 |
|
472 void CDelimitedPathTest::TestDelimitedPathAddAndTrimFrontAndBackDelimiterL(const TDesC& aPath) const |
|
473 { |
|
474 TestDelimitedDataAddAndTrimFrontAndBackDelimiterL(_L("Test CDelimitedPath Add and Trim Front and Back delimiter"), iTestHarness, aPath); |
|
475 } |
|
476 |
|
477 void CDelimitedPathTest::TestDelimitedPathInsertAndParseL(TInt aStartPos, TRefByValue<const TDesC> aPath, ...) const |
|
478 { |
|
479 VA_LIST list1; VA_START(list1, aPath); |
|
480 VA_LIST list2; VA_START(list2, aPath); |
|
481 const TDesC& path = aPath; |
|
482 |
|
483 TestDelimitedDataInsertAndParseL(_L("Test CDelimitedPath InsertCurrent, Parse"), iTestHarness, path, list1, list2, aStartPos); |
|
484 VA_END(list1); VA_END(list2); |
|
485 } |
|
486 |
|
487 void CDelimitedPathTest::TestDelimitedPathRemoveAndParseL(TInt aStartPos, TRefByValue<const TDesC> aPath, ...) const |
|
488 { |
|
489 VA_LIST list1; VA_START(list1, aPath); |
|
490 VA_LIST list2; VA_START(list2, aPath); |
|
491 const TDesC& path = aPath; |
|
492 |
|
493 TestDelimitedDataRemoveAndParseL(_L("Test CDelimitedPath RemoveCurrent, Parse"), iTestHarness, path, list1, list2, aStartPos); |
|
494 VA_END(list1); VA_END(list2); |
|
495 } |
|
496 |
|
497 void CDelimitedPathTest::TestDelimitedPathInsertAndParseReverseL(TInt aStartPos, TRefByValue<const TDesC> aPath, ...) const |
|
498 { |
|
499 VA_LIST list1; VA_START(list1, aPath); |
|
500 VA_LIST list2; VA_START(list2, aPath); |
|
501 const TDesC& path = aPath; |
|
502 |
|
503 TestDelimitedDataInsertAndParseReverseL(_L("Test CDelimitedPath InsertCurrent, ParseReverse"), iTestHarness, path, list1, list2, aStartPos); |
|
504 VA_END(list1); VA_END(list2); |
|
505 } |
|
506 |
|
507 void CDelimitedPathTest::TestDelimitedPathRemoveAndParseReverseL(TInt aStartPos, TRefByValue<const TDesC> aPath, ...) const |
|
508 { |
|
509 VA_LIST list1; VA_START(list1, aPath); |
|
510 VA_LIST list2; VA_START(list2, aPath); |
|
511 const TDesC& path = aPath; |
|
512 |
|
513 TestDelimitedDataRemoveAndParseReverseL(_L("Test CDelimitedPath RemoveCurrent, ParseReverse"), iTestHarness, path, list1, list2, aStartPos); |
|
514 VA_END(list1); VA_END(list2); |
|
515 } |
|
516 |
|
517 void CDelimitedPathTest::TestDelimitedPathInsertEscapeAndParseL(TInt aStartPos, TRefByValue<const TDesC> aPath, ...) const |
|
518 { |
|
519 VA_LIST list1; VA_START(list1, aPath); |
|
520 VA_LIST list2; VA_START(list2, aPath); |
|
521 const TDesC& path = aPath; |
|
522 |
|
523 TestDelimitedDataInsertEscapeAndParseL(_L("Test CDelimitedPath InsertAndEscapeCurrent, Parse"), iTestHarness, path, list1, list2, aStartPos); |
|
524 VA_END(list1); VA_END(list2); |
|
525 } |
|
526 |
|
527 void CDelimitedPathTest::TestDelimitedPathInsertEscapeAndParseReverseL(TInt aStartPos, TRefByValue<const TDesC> aPath, ...) const |
|
528 { |
|
529 VA_LIST list1; VA_START(list1, aPath); |
|
530 VA_LIST list2; VA_START(list2, aPath); |
|
531 const TDesC& path = aPath; |
|
532 |
|
533 TestDelimitedDataInsertEscapeAndParseReverseL(_L("Test CDelimitedPath InsertAndEscapeCurrent, ParseReverse"), iTestHarness, path, list1, list2, aStartPos); |
|
534 VA_END(list1); VA_END(list2); |
|
535 } |
|
536 |
|
537 void CDelimitedPathTest::TestDelimitedPathPushAndEscapeFrontL(TRefByValue<const TDesC> aPath, ...) const |
|
538 { |
|
539 VA_LIST list1; VA_START(list1, aPath); |
|
540 VA_LIST list2; VA_START(list2, aPath); |
|
541 const TDesC& path = aPath; |
|
542 |
|
543 TestDelimitedDataPushAndEscapeFrontL(_L("Test CDelimitedPath PushAndEscapeFront"), iTestHarness, path, list1, list2); |
|
544 VA_END(list1); VA_END(list2); |
|
545 } |
|
546 |
|
547 void CDelimitedPathTest::TestDelimitedPathPushAndEscapeBackL(TRefByValue<const TDesC> aPath, ...) const |
|
548 { |
|
549 VA_LIST list1; VA_START(list1, aPath); |
|
550 VA_LIST list2; VA_START(list2, aPath); |
|
551 const TDesC& path = aPath; |
|
552 |
|
553 TestDelimitedDataPushAndEscapeBackL(_L("Test CDelimitedPath PushAndEscapeBack"), iTestHarness, path, list1, list2); |
|
554 VA_END(list1); VA_END(list2); |
|
555 } |
|
556 /* |
|
557 // |
|
558 // |
|
559 // Delimited PathSegment tests |
|
560 // |
|
561 // |
|
562 |
|
563 void CDelimitedPathTest::TestDelimitedPathSegmentExtractionL(TRefByValue<const TDesC> aPathSegment, ...) const |
|
564 { |
|
565 VA_LIST list1; VA_START(list1, aPathSegment); |
|
566 VA_LIST list2; VA_START(list2, aPathSegment); |
|
567 const TDesC& pathSegment = aPathSegment; |
|
568 |
|
569 TestDelimitedDataExtractionL(TDelimitedPathSegmentParser16(), TDelimitedPathSegmentParser8(), |
|
570 _L("Test TDelimitedPathSegmentParser Parse : GetNext, Dec, Inc, Peek and Eos"), iTestHarness, pathSegment, list1, list2); |
|
571 VA_END(list1); VA_END(list2); |
|
572 } |
|
573 |
|
574 void CDelimitedPathTest::TestDelimitedPathSegmentReverseExtractionL(TRefByValue<const TDesC> aPathSegment, ...) const |
|
575 { |
|
576 VA_LIST list1; VA_START(list1, aPathSegment); |
|
577 VA_LIST list2; VA_START(list2, aPathSegment); |
|
578 const TDesC& pathSegment = aPathSegment; |
|
579 |
|
580 TestDelimitedDataReverseExtractionL<TDelimitedPathSegmentParser16, TDelimitedPathSegmentParser8>( |
|
581 _L("Test TDelimitedPathSegmentParser ParseReverse : GetNext, Dec, Inc, Peek and Eos"), iTestHarness, pathSegment, list1, list2); |
|
582 VA_END(list1); VA_END(list2); |
|
583 } |
|
584 |
|
585 void CDelimitedPathTest::TestDelimitedPathSegmentDelimiterPresenceL(const TDesC& aPathSegment, TBool aFrontDelim, TBool aBackDelim) const |
|
586 { |
|
587 TestDelimitedDataDelimiterPresenceL<TDelimitedPathSegmentParser16, TDelimitedPathSegmentParser8>( |
|
588 _L("Test TDelimitedPathSegmentParser Delimiter Presence"), iTestHarness, aPathSegment, aFrontDelim, aBackDelim); |
|
589 } |
|
590 |
|
591 void CDelimitedPathTest::TestDelimitedPathSegmentRemainderL(TRefByValue<const TDesC> aPathSegment, ...) const |
|
592 { |
|
593 VA_LIST list1; VA_START(list1, aPathSegment); |
|
594 VA_LIST list2; VA_START(list2, aPathSegment); |
|
595 const TDesC& pathSegment = aPathSegment; |
|
596 |
|
597 TestDelimitedDataRemainderL<TDelimitedPathSegmentParser16, TDelimitedPathSegmentParser8>( |
|
598 _L("Test TDelimitedPathSegmentParser Remainder, Parse"), iTestHarness, pathSegment, list1, list2); |
|
599 VA_END(list1); VA_END(list2); |
|
600 } |
|
601 |
|
602 void CDelimitedPathTest::TestDelimitedPathSegmentRemainderReverseL(TRefByValue<const TDesC> aPathSegment, ...) const |
|
603 { |
|
604 VA_LIST list1; VA_START(list1, aPathSegment); |
|
605 VA_LIST list2; VA_START(list2, aPathSegment); |
|
606 const TDesC& pathSegment = aPathSegment; |
|
607 |
|
608 TestDelimitedDataRemainderReverseL<TDelimitedPathSegmentParser16, TDelimitedPathSegmentParser8>( |
|
609 _L("Test TDelimitedPathSegmentParser Remainder, ParseReverse"), iTestHarness, pathSegment, list1, list2); |
|
610 VA_END(list1); VA_END(list2); |
|
611 } |
|
612 |
|
613 void CDelimitedPathTest::TestDelimitedPathSegmentDesL(const TDesC& aPathSegment) const |
|
614 { |
|
615 TestDelimitedDataDesL<TDelimitedPathSegmentParser16, TDelimitedPathSegmentParser8>(_L("Test TDelimitedPathSegment Des"), iTestHarness, aPathSegment); |
|
616 } |
|
617 |
|
618 void CDelimitedPathTest::TestDelimitedPathSegmentPushFrontL(TRefByValue<const TDesC> aPathSegment, ...) const |
|
619 { |
|
620 VA_LIST list1; VA_START(list1, aPathSegment); |
|
621 VA_LIST list2; VA_START(list2, aPathSegment); |
|
622 const TDesC& pathSegment = aPathSegment; |
|
623 |
|
624 CDelimitedPath16* path16Bit = NULL; CDelimitedPath8* path8Bit = NULL; |
|
625 TestDelimitedDataPushFrontL(path16Bit, path8Bit, |
|
626 _L("Test TDelimitedPathSegmentParser PushFront"), iTestHarness, pathSegment, list1, list2); |
|
627 VA_END(list1); |
|
628 VA_END(list2); |
|
629 } |
|
630 |
|
631 void CDelimitedPathTest::TestDelimitedPathSegmentPushBackL(TRefByValue<const TDesC> aPathSegment, ...) const |
|
632 { |
|
633 VA_LIST list1; VA_START(list1, aPathSegment); |
|
634 VA_LIST list2; VA_START(list2, aPathSegment); |
|
635 const TDesC& pathSegment = aPathSegment; |
|
636 |
|
637 TestDelimitedDataPushBackL<CDelimitedPathSegment16, CDelimitedPathSegment8>( |
|
638 _L("Test TDelimitedPathSegmentParser PushBack"), iTestHarness, pathSegment, list1, list2); |
|
639 VA_END(list1); VA_END(list2); |
|
640 } |
|
641 |
|
642 void CDelimitedPathTest::TestDelimitedPathSegmentPopFrontL(TRefByValue<const TDesC> aPathSegment, ...) const |
|
643 { |
|
644 VA_LIST list1; VA_START(list1, aPathSegment); |
|
645 VA_LIST list2; VA_START(list2, aPathSegment); |
|
646 const TDesC& pathSegment = aPathSegment; |
|
647 |
|
648 TestDelimitedDataPopFrontL<CDelimitedPathSegment16, CDelimitedPathSegment8>( |
|
649 _L("Test TDelimitedPathSegmentParser PopFront"), iTestHarness, pathSegment, list1, list2); |
|
650 VA_END(list1); VA_END(list2); |
|
651 } |
|
652 |
|
653 void CDelimitedPathTest::TestDelimitedPathSegmentPopBackL(TRefByValue<const TDesC> aPathSegment, ...) const |
|
654 { |
|
655 VA_LIST list1; VA_START(list1, aPathSegment); |
|
656 VA_LIST list2; VA_START(list2, aPathSegment); |
|
657 const TDesC& pathSegment = aPathSegment; |
|
658 |
|
659 TestDelimitedDataPopBackL<CDelimitedPathSegment16, CDelimitedPathSegment8>( |
|
660 _L("Test TDelimitedPathSegmentParser PopBack"), iTestHarness, pathSegment, list1, list2); |
|
661 VA_END(list1); VA_END(list2); |
|
662 } |
|
663 |
|
664 void CDelimitedPathTest::TestDelimitedPathSegmentAddAndTrimFrontAndBackDelimiterL(const TDesC& aPathSegment) const |
|
665 { |
|
666 TestDelimitedDataAddAndTrimFrontAndBackDelimiterL<CDelimitedPathSegment16, CDelimitedPathSegment8>( |
|
667 _L("Test TDelimitedPathSegmentParser Add and Trim Front and Back delimiter"), iTestHarness, aPathSegment); |
|
668 } |
|
669 |
|
670 void CDelimitedPathTest::TestDelimitedPathSegmentInsertAndParseL(TInt aStartPos, TRefByValue<const TDesC> aPathSegment, ...) const |
|
671 { |
|
672 VA_LIST list1; VA_START(list1, aPathSegment); |
|
673 VA_LIST list2; VA_START(list2, aPathSegment); |
|
674 const TDesC& pathSegment = aPathSegment; |
|
675 |
|
676 TestDelimitedDataInsertAndParseL<CDelimitedPathSegment16, CDelimitedPathSegment8>( |
|
677 _L("Test TDelimitedPathSegmentParser InsertCurrent, Parse"), iTestHarness, pathSegment, list1, list2, aStartPos); |
|
678 VA_END(list1); VA_END(list2); |
|
679 } |
|
680 |
|
681 void CDelimitedPathTest::TestDelimitedPathSegmentRemoveAndParseL(TInt aStartPos, TRefByValue<const TDesC> aPathSegment, ...) const |
|
682 { |
|
683 VA_LIST list1; VA_START(list1, aPathSegment); |
|
684 VA_LIST list2; VA_START(list2, aPathSegment); |
|
685 const TDesC& pathSegment = aPathSegment; |
|
686 |
|
687 TestDelimitedDataRemoveAndParseL<CDelimitedPathSegment16, CDelimitedPathSegment8>( |
|
688 _L("Test TDelimitedPathSegmentParser RemoveCurrent, Parse"), iTestHarness, pathSegment, list1, list2, aStartPos); |
|
689 VA_END(list1); VA_END(list2); |
|
690 } |
|
691 |
|
692 void CDelimitedPathTest::TestDelimitedPathSegmentInsertAndParseReverseL(TInt aStartPos, TRefByValue<const TDesC> aPathSegment, ...) const |
|
693 { |
|
694 VA_LIST list1; VA_START(list1, aPathSegment); |
|
695 VA_LIST list2; VA_START(list2, aPathSegment); |
|
696 const TDesC& pathSegment = aPathSegment; |
|
697 |
|
698 TestDelimitedDataInsertAndParseReverseL<CDelimitedPathSegment16, CDelimitedPathSegment8>( |
|
699 _L("Test TDelimitedPathSegmentParser InsertCurrent, ParseReverse"), iTestHarness, pathSegment, list1, list2, aStartPos); |
|
700 VA_END(list1); VA_END(list2); |
|
701 } |
|
702 |
|
703 void CDelimitedPathTest::TestDelimitedPathSegmentRemoveAndParseReverseL(TInt aStartPos, TRefByValue<const TDesC> aPathSegment, ...) const |
|
704 { |
|
705 VA_LIST list1; VA_START(list1, aPathSegment); |
|
706 VA_LIST list2; VA_START(list2, aPathSegment); |
|
707 const TDesC& pathSegment = aPathSegment; |
|
708 |
|
709 TestDelimitedDataRemoveAndParseReverseL<CDelimitedPathSegment16, CDelimitedPathSegment8>( |
|
710 _L("Test TDelimitedPathSegmentParser RemoveCurrent, ParseReverse"), iTestHarness, pathSegment, list1, list2, aStartPos); |
|
711 VA_END(list1); VA_END(list2); |
|
712 } |
|
713 |
|
714 void CDelimitedPathTest::TestDelimitedPathSegmentInsertEscapeAndParseL(TInt aStartPos, TRefByValue<const TDesC> aPathSegment, ...) const |
|
715 { |
|
716 VA_LIST list1; VA_START(list1, aPathSegment); |
|
717 VA_LIST list2; VA_START(list2, aPathSegment); |
|
718 const TDesC& pathSegment = aPathSegment; |
|
719 |
|
720 TestDelimitedDataInsertEscapeAndParseL<CDelimitedPathSegment16, CDelimitedPathSegment8>( |
|
721 _L("Test TDelimitedPathSegmentParser InsertAndEscapeCurrent, Parse"), iTestHarness, pathSegment, list1, list2, aStartPos); |
|
722 VA_END(list1); VA_END(list2); |
|
723 } |
|
724 |
|
725 void CDelimitedPathTest::TestDelimitedPathSegmentInsertEscapeAndParseReverseL(TInt aStartPos, TRefByValue<const TDesC> aPathSegment, ...) const |
|
726 { |
|
727 VA_LIST list1; VA_START(list1, aPathSegment); |
|
728 VA_LIST list2; VA_START(list2, aPathSegment); |
|
729 const TDesC& pathSegment = aPathSegment; |
|
730 |
|
731 TestDelimitedDataInsertEscapeAndParseReverseL<CDelimitedPathSegment16, CDelimitedPathSegment8>( |
|
732 _L("Test TDelimitedPathSegmentParser InsertAndEscapeCurrent, ParseReverse"), iTestHarness, pathSegment, list1, list2, aStartPos); |
|
733 VA_END(list1); VA_END(list2); |
|
734 } |
|
735 |
|
736 void CDelimitedPathTest::TestDelimitedPathSegmentPushAndEscapeFrontL(TRefByValue<const TDesC> aPathSegment, ...) const |
|
737 { |
|
738 VA_LIST list1; VA_START(list1, aPathSegment); |
|
739 VA_LIST list2; VA_START(list2, aPathSegment); |
|
740 const TDesC& pathSegment = aPathSegment; |
|
741 |
|
742 TestDelimitedDataPushAndEscapeFrontL<CDelimitedPathSegment16, CDelimitedPathSegment8>( |
|
743 _L("Test TDelimitedPathSegmentParser PushAndEscapeFront"), iTestHarness, pathSegment, list1, list2); |
|
744 VA_END(list1); VA_END(list2); |
|
745 } |
|
746 |
|
747 void CDelimitedPathTest::TestDelimitedPathSegmentPushAndEscapeBackL(TRefByValue<const TDesC> aPathSegment, ...) const |
|
748 { |
|
749 VA_LIST list1; VA_START(list1, aPathSegment); |
|
750 VA_LIST list2; VA_START(list2, aPathSegment); |
|
751 const TDesC& pathSegment = aPathSegment; |
|
752 |
|
753 TestDelimitedDataPushAndEscapeBackL<CDelimitedPathSegment16, CDelimitedPathSegment8>( |
|
754 _L("Test TDelimitedPathSegmentParser PushAndEscapeBack"), iTestHarness, pathSegment, list1, list2); |
|
755 VA_END(list1); VA_END(list2); |
|
756 } |
|
757 |
|
758 // |
|
759 // |
|
760 // Delimited Query tests |
|
761 // |
|
762 // |
|
763 void CDelimitedPathTest::TestDelimitedQueryExtractionL(TRefByValue<const TDesC> aQuery, ...) const |
|
764 { |
|
765 VA_LIST list1; VA_START(list1, aQuery); |
|
766 VA_LIST list2; VA_START(list2, aQuery); |
|
767 const TDesC& query = aQuery; |
|
768 |
|
769 TestDelimitedDataExtractionL<TDelimitedQueryParser16, TDelimitedQueryParser8>( |
|
770 _L("Test TDelimitedQueryParser Parse : GetNext, Dec, Inc, Peek and Eos"), iTestHarness, query, list1, list2); |
|
771 VA_END(list1); VA_END(list2); |
|
772 } |
|
773 |
|
774 void CDelimitedPathTest::TestDelimitedQueryReverseExtractionL(TRefByValue<const TDesC> aQuery, ...) const |
|
775 { |
|
776 VA_LIST list1; VA_START(list1, aQuery); |
|
777 VA_LIST list2; VA_START(list2, aQuery); |
|
778 const TDesC& query = aQuery; |
|
779 |
|
780 TestDelimitedDataReverseExtractionL<TDelimitedQueryParser16, TDelimitedQueryParser8>( |
|
781 _L("Test TDelimitedQueryParser ParseReverse : GetNext, Dec, Inc, Peek and Eos"), iTestHarness, query, list1, list2); |
|
782 VA_END(list1); VA_END(list2); |
|
783 } |
|
784 |
|
785 void CDelimitedPathTest::TestDelimitedQueryDelimiterPresenceL(const TDesC& aQuery, TBool aFrontDelim, TBool aBackDelim) const |
|
786 { |
|
787 TestDelimitedDataDelimiterPresenceL<TDelimitedQueryParser16, TDelimitedQueryParser8>( |
|
788 _L("Test TDelimitedQueryParser Delimiter Presence"), iTestHarness, aQuery, aFrontDelim, aBackDelim); |
|
789 } |
|
790 |
|
791 void CDelimitedPathTest::TestDelimitedQueryRemainderL(TRefByValue<const TDesC> aQuery, ...) const |
|
792 { |
|
793 VA_LIST list1; VA_START(list1, aQuery); |
|
794 VA_LIST list2; VA_START(list2, aQuery); |
|
795 const TDesC& query = aQuery; |
|
796 |
|
797 TestDelimitedDataRemainderL<TDelimitedQueryParser16, TDelimitedQueryParser8>( |
|
798 _L("Test TDelimitedQueryParser Remainder, Parse"), iTestHarness, query, list1, list2); |
|
799 VA_END(list1); VA_END(list2); |
|
800 } |
|
801 |
|
802 void CDelimitedPathTest::TestDelimitedQueryRemainderReverseL(TRefByValue<const TDesC> aQuery, ...) const |
|
803 { |
|
804 VA_LIST list1; VA_START(list1, aQuery); |
|
805 VA_LIST list2; VA_START(list2, aQuery); |
|
806 const TDesC& query = aQuery; |
|
807 |
|
808 TestDelimitedDataRemainderReverseL<TDelimitedQueryParser16, TDelimitedQueryParser8>( |
|
809 _L("Test TDelimitedQueryParser Remainder, ParseReverse"), iTestHarness, query, list1, list2); |
|
810 VA_END(list1); VA_END(list2); |
|
811 } |
|
812 |
|
813 void CDelimitedPathTest::TestDelimitedQueryDesL(const TDesC& aQuery) const |
|
814 { |
|
815 TestDelimitedDataDesL<TDelimitedQueryParser16, TDelimitedQueryParser8>(_L("Test TDelimitedQuery Des"), iTestHarness, aQuery); |
|
816 } |
|
817 |
|
818 void CDelimitedPathTest::TestDelimitedQueryPushFrontL(TRefByValue<const TDesC> aQuery, ...) const |
|
819 { |
|
820 VA_LIST list1; VA_START(list1, aQuery); |
|
821 VA_LIST list2; VA_START(list2, aQuery); |
|
822 const TDesC& query = aQuery; |
|
823 |
|
824 TestDelimitedDataPushFrontL<CDelimitedQuery16, CDelimitedQuery8>( |
|
825 _L("Test TDelimitedQueryParser PushFront"), iTestHarness, query, list1, list2); |
|
826 VA_END(list1); |
|
827 VA_END(list2); |
|
828 } |
|
829 |
|
830 void CDelimitedPathTest::TestDelimitedQueryPushBackL(TRefByValue<const TDesC> aQuery, ...) const |
|
831 { |
|
832 VA_LIST list1; VA_START(list1, aQuery); |
|
833 VA_LIST list2; VA_START(list2, aQuery); |
|
834 const TDesC& query = aQuery; |
|
835 |
|
836 TestDelimitedDataPushBackL<CDelimitedQuery16, CDelimitedQuery8>( |
|
837 _L("Test TDelimitedQueryParser PushBack"), iTestHarness, query, list1, list2); |
|
838 VA_END(list1); VA_END(list2); |
|
839 } |
|
840 |
|
841 void CDelimitedPathTest::TestDelimitedQueryPopFrontL(TRefByValue<const TDesC> aQuery, ...) const |
|
842 { |
|
843 VA_LIST list1; VA_START(list1, aQuery); |
|
844 VA_LIST list2; VA_START(list2, aQuery); |
|
845 const TDesC& query = aQuery; |
|
846 |
|
847 TestDelimitedDataPopFrontL<CDelimitedQuery16, CDelimitedQuery8>( |
|
848 _L("Test TDelimitedQueryParser PopFront"), iTestHarness, query, list1, list2); |
|
849 VA_END(list1); VA_END(list2); |
|
850 } |
|
851 |
|
852 void CDelimitedPathTest::TestDelimitedQueryPopBackL(TRefByValue<const TDesC> aQuery, ...) const |
|
853 { |
|
854 VA_LIST list1; VA_START(list1, aQuery); |
|
855 VA_LIST list2; VA_START(list2, aQuery); |
|
856 const TDesC& query = aQuery; |
|
857 |
|
858 TestDelimitedDataPopBackL<CDelimitedQuery16, CDelimitedQuery8>( |
|
859 _L("Test TDelimitedQueryParser PopBack"), iTestHarness, query, list1, list2); |
|
860 VA_END(list1); VA_END(list2); |
|
861 } |
|
862 |
|
863 void CDelimitedPathTest::TestDelimitedQueryAddAndTrimFrontAndBackDelimiterL(const TDesC& aQuery) const |
|
864 { |
|
865 TestDelimitedDataAddAndTrimFrontAndBackDelimiterL<CDelimitedQuery16, CDelimitedQuery8>( |
|
866 _L("Test TDelimitedQueryParser Add and Trim Front and Back delimiter"), iTestHarness, aQuery); |
|
867 } |
|
868 |
|
869 void CDelimitedPathTest::TestDelimitedQueryInsertAndParseL(TInt aStartPos, TRefByValue<const TDesC> aQuery, ...) const |
|
870 { |
|
871 VA_LIST list1; VA_START(list1, aQuery); |
|
872 VA_LIST list2; VA_START(list2, aQuery); |
|
873 const TDesC& query = aQuery; |
|
874 |
|
875 TestDelimitedDataInsertAndParseL<CDelimitedQuery16, CDelimitedQuery8>( |
|
876 _L("Test TDelimitedQueryParser InsertCurrent, Parse"), iTestHarness, query, list1, list2, aStartPos); |
|
877 VA_END(list1); VA_END(list2); |
|
878 } |
|
879 |
|
880 void CDelimitedPathTest::TestDelimitedQueryRemoveAndParseL(TInt aStartPos, TRefByValue<const TDesC> aQuery, ...) const |
|
881 { |
|
882 VA_LIST list1; VA_START(list1, aQuery); |
|
883 VA_LIST list2; VA_START(list2, aQuery); |
|
884 const TDesC& query = aQuery; |
|
885 |
|
886 TestDelimitedDataRemoveAndParseL<CDelimitedQuery16, CDelimitedQuery8>( |
|
887 _L("Test TDelimitedQueryParser RemoveCurrent, Parse"), iTestHarness, query, list1, list2, aStartPos); |
|
888 VA_END(list1); VA_END(list2); |
|
889 } |
|
890 |
|
891 void CDelimitedPathTest::TestDelimitedQueryInsertAndParseReverseL(TInt aStartPos, TRefByValue<const TDesC> aQuery, ...) const |
|
892 { |
|
893 VA_LIST list1; VA_START(list1, aQuery); |
|
894 VA_LIST list2; VA_START(list2, aQuery); |
|
895 const TDesC& query = aQuery; |
|
896 |
|
897 TestDelimitedDataInsertAndParseReverseL<CDelimitedQuery16, CDelimitedQuery8>( |
|
898 _L("Test TDelimitedQueryParser InsertCurrent, ParseReverse"), iTestHarness, query, list1, list2, aStartPos); |
|
899 VA_END(list1); VA_END(list2); |
|
900 } |
|
901 |
|
902 void CDelimitedPathTest::TestDelimitedQueryRemoveAndParseReverseL(TInt aStartPos, TRefByValue<const TDesC> aQuery, ...) const |
|
903 { |
|
904 VA_LIST list1; VA_START(list1, aQuery); |
|
905 VA_LIST list2; VA_START(list2, aQuery); |
|
906 const TDesC& query = aQuery; |
|
907 |
|
908 TestDelimitedDataRemoveAndParseReverseL<CDelimitedQuery16, CDelimitedQuery8>( |
|
909 _L("Test TDelimitedQueryParser RemoveCurrent, ParseReverse"), iTestHarness, query, list1, list2, aStartPos); |
|
910 VA_END(list1); VA_END(list2); |
|
911 } |
|
912 |
|
913 void CDelimitedPathTest::TestDelimitedQueryInsertEscapeAndParseL(TInt aStartPos, TRefByValue<const TDesC> aQuery, ...) const |
|
914 { |
|
915 VA_LIST list1; VA_START(list1, aQuery); |
|
916 VA_LIST list2; VA_START(list2, aQuery); |
|
917 const TDesC& query = aQuery; |
|
918 |
|
919 TestDelimitedDataInsertEscapeAndParseL<CDelimitedQuery16, CDelimitedQuery8>( |
|
920 _L("Test TDelimitedQueryParser InsertAndEscapeCurrent, Parse"), iTestHarness, query, list1, list2, aStartPos); |
|
921 VA_END(list1); VA_END(list2); |
|
922 } |
|
923 |
|
924 void CDelimitedPathTest::TestDelimitedQueryInsertEscapeAndParseReverseL(TInt aStartPos, TRefByValue<const TDesC> aQuery, ...) const |
|
925 { |
|
926 VA_LIST list1; VA_START(list1, aQuery); |
|
927 VA_LIST list2; VA_START(list2, aQuery); |
|
928 const TDesC& query = aQuery; |
|
929 |
|
930 TestDelimitedDataInsertEscapeAndParseReverseL<CDelimitedQuery16, CDelimitedQuery8>( |
|
931 _L("Test TDelimitedQueryParser InsertAndEscapeCurrent, ParseReverse"), iTestHarness, query, list1, list2, aStartPos); |
|
932 VA_END(list1); VA_END(list2); |
|
933 } |
|
934 |
|
935 void CDelimitedPathTest::TestDelimitedQueryPushAndEscapeFrontL(TRefByValue<const TDesC> aQuery, ...) const |
|
936 { |
|
937 VA_LIST list1; VA_START(list1, aQuery); |
|
938 VA_LIST list2; VA_START(list2, aQuery); |
|
939 const TDesC& query = aQuery; |
|
940 |
|
941 TestDelimitedDataPushAndEscapeFrontL<CDelimitedQuery16, CDelimitedQuery8>( |
|
942 _L("Test TDelimitedQueryParser PushAndEscapeFront"), iTestHarness, query, list1, list2); |
|
943 VA_END(list1); VA_END(list2); |
|
944 } |
|
945 |
|
946 void CDelimitedPathTest::TestDelimitedQueryPushAndEscapeBackL(TRefByValue<const TDesC> aQuery, ...) const |
|
947 { |
|
948 VA_LIST list1; VA_START(list1, aQuery); |
|
949 VA_LIST list2; VA_START(list2, aQuery); |
|
950 const TDesC& query = aQuery; |
|
951 |
|
952 TestDelimitedDataPushAndEscapeBackL<CDelimitedQuery16, CDelimitedQuery8>( |
|
953 _L("Test TDelimitedQueryParser PushAndEscapeBack"), iTestHarness, query, list1, list2); |
|
954 VA_END(list1); VA_END(list2); |
|
955 } |
|
956 */ |
|
957 // |
|
958 // |
|
959 // Implementation of LOCAL functions - test funcions |
|
960 // |
|
961 // |
|
962 |
|
963 void TestDelimitedDataExtractionL(const TDesC& aTestTitle, CIpuTestHarness* aTestHarness, |
|
964 const TDesC& aData, VA_LIST& aList1, VA_LIST& aList2) { |
|
965 // Create title |
|
966 HBufC* title16Bit = HBufC::NewLC(aTestTitle.Length() + KTitle16Bit().Length()); |
|
967 title16Bit->Des().Format(KTitle16Bit, &aTestTitle); |
|
968 aTestHarness->StartTestL(*title16Bit); |
|
969 |
|
970 // Create TDelimitedPathParser object and do parsing |
|
971 TDelimitedPathParser16 parser16Bit; |
|
972 parser16Bit.Parse(aData); |
|
973 |
|
974 TInt error = DoDelimitedDataParsingL<HBufC16, TPtrC16>(parser16Bit, aList1); |
|
975 |
|
976 CleanupStack::PopAndDestroy(title16Bit); // title16Bit |
|
977 aTestHarness->EndTest(error); |
|
978 |
|
979 // Make 8-bit copy |
|
980 HBufC8* dataBuf = HBufC8::NewLC(aData.Length()); |
|
981 TPtr8 data8Bit = dataBuf->Des(); |
|
982 data8Bit.Copy(aData); |
|
983 |
|
984 HBufC* title8Bit = HBufC::NewLC(aTestTitle.Length() + KTitle8Bit().Length()); |
|
985 title8Bit->Des().Format(KTitle8Bit, &aTestTitle); |
|
986 aTestHarness->StartTestL(*title8Bit); |
|
987 |
|
988 // Create TDelimitedPathParser object and do parsing |
|
989 TDelimitedPathParser8 parser8Bit; |
|
990 parser8Bit.Parse(data8Bit); |
|
991 |
|
992 error = DoDelimitedDataParsingL<HBufC8, TPtrC8>(parser8Bit, aList2); |
|
993 |
|
994 aTestHarness->EndTest(error); |
|
995 CleanupStack::PopAndDestroy(2, dataBuf); // dataBuf, title8Bit |
|
996 } |
|
997 |
|
998 void TestDelimitedDataReverseExtractionL(const TDesC& aTestTitle, CIpuTestHarness* aTestHarness, |
|
999 const TDesC& aData, VA_LIST& aList1, VA_LIST& aList2) |
|
1000 { |
|
1001 // Create title |
|
1002 HBufC* title16Bit = HBufC::NewLC(aTestTitle.Length() + KTitle16Bit().Length()); |
|
1003 title16Bit->Des().Format(KTitle16Bit, &aTestTitle); |
|
1004 aTestHarness->StartTestL(*title16Bit); |
|
1005 |
|
1006 // Create TDelimitedPathParser object and do parsing |
|
1007 TDelimitedPathParser16 parser16Bit; |
|
1008 parser16Bit.ParseReverse(aData); |
|
1009 |
|
1010 TInt error = DoDelimitedDataParsingL<HBufC16, TPtrC16>(parser16Bit, aList1); |
|
1011 |
|
1012 CleanupStack::PopAndDestroy(title16Bit); // title16Bit |
|
1013 aTestHarness->EndTest(error); |
|
1014 |
|
1015 // Make 8-bit copy |
|
1016 HBufC8* dataBuf = HBufC8::NewLC(aData.Length()); |
|
1017 TPtr8 data8Bit = dataBuf->Des(); |
|
1018 data8Bit.Copy(aData); |
|
1019 |
|
1020 // Create title |
|
1021 HBufC* title8Bit = HBufC::NewLC(aTestTitle.Length() + KTitle8Bit().Length()); |
|
1022 title8Bit->Des().Format(KTitle8Bit, &aTestTitle); |
|
1023 aTestHarness->StartTestL(*title8Bit); |
|
1024 |
|
1025 // Create TDelimitedPathParser object and do parsing |
|
1026 TDelimitedPathParser8 parser8Bit; |
|
1027 parser8Bit.ParseReverse(data8Bit); |
|
1028 |
|
1029 error = DoDelimitedDataParsingL<HBufC8, TPtrC8>(parser8Bit, aList2); |
|
1030 |
|
1031 aTestHarness->EndTest(error); |
|
1032 CleanupStack::PopAndDestroy(2, dataBuf); // dataBuf, title8Bit |
|
1033 } |
|
1034 |
|
1035 void TestDelimitedDataDelimiterPresenceL(const TDesC& aTestTitle, CIpuTestHarness* aTestHarness, |
|
1036 const TDesC& aData, TBool aFrontDelim, TBool aBackDelim) |
|
1037 { |
|
1038 // Create title |
|
1039 HBufC* title16Bit = HBufC::NewLC(aTestTitle.Length() + KTitle16Bit().Length()); |
|
1040 title16Bit->Des().Format(KTitle16Bit, &aTestTitle); |
|
1041 aTestHarness->StartTestL(*title16Bit); |
|
1042 |
|
1043 // Create TDelimitedPathParser object |
|
1044 TDelimitedPathParser16 parser16Bit; |
|
1045 parser16Bit.Parse(aData); |
|
1046 TInt error = DoDelimiterPresenceTest(parser16Bit, aFrontDelim, aBackDelim); |
|
1047 |
|
1048 CleanupStack::PopAndDestroy(title16Bit); // title16Bit |
|
1049 aTestHarness->EndTest(error); |
|
1050 |
|
1051 // Make 8-bit copy |
|
1052 HBufC8* dataBuf = HBufC8::NewLC(aData.Length()); |
|
1053 TPtr8 data8Bit = dataBuf->Des(); |
|
1054 data8Bit.Copy(aData); |
|
1055 |
|
1056 // Create title |
|
1057 HBufC* title8Bit = HBufC::NewLC(aTestTitle.Length() + KTitle8Bit().Length()); |
|
1058 title8Bit->Des().Format(KTitle8Bit, &aTestTitle); |
|
1059 aTestHarness->StartTestL(*title8Bit); |
|
1060 |
|
1061 // Create TDelimitedPathParser object |
|
1062 TDelimitedPathParser8 parser8Bit; |
|
1063 parser8Bit.Parse(data8Bit); |
|
1064 error = DoDelimiterPresenceTest(parser8Bit, aFrontDelim, aBackDelim); |
|
1065 |
|
1066 aTestHarness->EndTest(error); |
|
1067 CleanupStack::PopAndDestroy(2, dataBuf); // dataBuf, title8Bit |
|
1068 } |
|
1069 |
|
1070 void TestDelimitedDataRemainderL(const TDesC& aTestTitle, CIpuTestHarness* aTestHarness, |
|
1071 const TDesC& aData, VA_LIST& aList1, VA_LIST& aList2) |
|
1072 { |
|
1073 // Create title |
|
1074 HBufC* title16Bit = HBufC::NewLC(aTestTitle.Length() + KTitle16Bit().Length()); |
|
1075 title16Bit->Des().Format(KTitle16Bit, &aTestTitle); |
|
1076 aTestHarness->StartTestL(*title16Bit); |
|
1077 |
|
1078 // Create TDelimiteddataParser object and do parsing |
|
1079 TDelimitedPathParser16 parser16Bit; |
|
1080 parser16Bit.Parse(aData); |
|
1081 |
|
1082 TInt error = DoDelimitedDataRemainderTestL<HBufC16, TPtrC16>(parser16Bit, aList1); |
|
1083 |
|
1084 CleanupStack::PopAndDestroy(title16Bit); // title16Bit |
|
1085 aTestHarness->EndTest(error); |
|
1086 |
|
1087 // Make 8-bit copy |
|
1088 HBufC8* dataBuf = HBufC8::NewLC(aData.Length()); |
|
1089 TPtr8 data8Bit = dataBuf->Des(); |
|
1090 data8Bit.Copy(aData); |
|
1091 |
|
1092 // Create title |
|
1093 HBufC* title8Bit = HBufC::NewLC(aTestTitle.Length() + KTitle8Bit().Length()); |
|
1094 title8Bit->Des().Format(KTitle8Bit, &aTestTitle); |
|
1095 aTestHarness->StartTestL(*title8Bit); |
|
1096 |
|
1097 // Create TDelimiteddataParser object and do parsing |
|
1098 TDelimitedPathParser8 parser8Bit; |
|
1099 parser8Bit.Parse(data8Bit); |
|
1100 |
|
1101 error = DoDelimitedDataRemainderTestL<HBufC8, TPtrC8>(parser8Bit, aList2); |
|
1102 |
|
1103 aTestHarness->EndTest(error); |
|
1104 CleanupStack::PopAndDestroy(2, dataBuf); // dataBuf, title8Bit |
|
1105 } |
|
1106 |
|
1107 void TestDelimitedDataRemainderReverseL(const TDesC& aTestTitle, CIpuTestHarness* aTestHarness, |
|
1108 const TDesC& aData, VA_LIST& aList1, VA_LIST& aList2) |
|
1109 { |
|
1110 // Create title |
|
1111 HBufC* title16Bit = HBufC::NewLC(aTestTitle.Length() + KTitle16Bit().Length()); |
|
1112 title16Bit->Des().Format(KTitle16Bit, &aTestTitle); |
|
1113 aTestHarness->StartTestL(*title16Bit); |
|
1114 |
|
1115 // Create TDelimitedPathParser object and do parsing |
|
1116 TDelimitedPathParser16 parser16Bit; |
|
1117 parser16Bit.ParseReverse(aData); |
|
1118 |
|
1119 TInt error = DoDelimitedDataRemainderTestL<HBufC16, TPtrC16>(parser16Bit, aList1); |
|
1120 |
|
1121 CleanupStack::PopAndDestroy(title16Bit); // title16Bit |
|
1122 aTestHarness->EndTest(error); |
|
1123 |
|
1124 // Make 8-bit copy |
|
1125 HBufC8* dataBuf = HBufC8::NewLC(aData.Length()); |
|
1126 TPtr8 data8Bit = dataBuf->Des(); |
|
1127 data8Bit.Copy(aData); |
|
1128 |
|
1129 // Create title |
|
1130 HBufC* title8Bit = HBufC::NewLC(aTestTitle.Length() + KTitle8Bit().Length()); |
|
1131 title8Bit->Des().Format(KTitle8Bit, &aTestTitle); |
|
1132 aTestHarness->StartTestL(*title8Bit); |
|
1133 |
|
1134 // Create TDelimitedPathParser object and do parsing |
|
1135 TDelimitedPathParser8 parser8Bit; |
|
1136 parser8Bit.ParseReverse(data8Bit); |
|
1137 |
|
1138 error = DoDelimitedDataRemainderTestL<HBufC8, TPtrC8>(parser8Bit, aList2); |
|
1139 |
|
1140 aTestHarness->EndTest(error); |
|
1141 CleanupStack::PopAndDestroy(2, dataBuf); // dataBuf, title8Bit |
|
1142 } |
|
1143 |
|
1144 void TestDelimitedDataDesL(const TDesC& aTestTitle, CIpuTestHarness* aTestHarness, const TDesC& aData) |
|
1145 { |
|
1146 // Create title |
|
1147 HBufC* title16Bit = HBufC::NewLC(aTestTitle.Length() + KTitle16Bit().Length()); |
|
1148 title16Bit->Des().Format(KTitle16Bit, &aTestTitle); |
|
1149 aTestHarness->StartTestL(*title16Bit); |
|
1150 |
|
1151 // Create TDelimitedPathParser object and do parsing |
|
1152 TDelimitedPathParser16 parser16Bit; |
|
1153 parser16Bit.Parse(aData); |
|
1154 |
|
1155 TInt error = DoDelimitedDataDes(parser16Bit, aData); |
|
1156 |
|
1157 CleanupStack::PopAndDestroy(title16Bit); // title16Bit |
|
1158 aTestHarness->EndTest(error); |
|
1159 |
|
1160 // Make 8-bit copy |
|
1161 HBufC8* dataBuf = HBufC8::NewLC(aData.Length()); |
|
1162 TPtr8 data8Bit = dataBuf->Des(); |
|
1163 data8Bit.Copy(aData); |
|
1164 |
|
1165 // Create title |
|
1166 HBufC* title8Bit = HBufC::NewLC(aTestTitle.Length() + KTitle8Bit().Length()); |
|
1167 title8Bit->Des().Format(KTitle8Bit, &aTestTitle); |
|
1168 aTestHarness->StartTestL(*title8Bit); |
|
1169 |
|
1170 // Create TDelimitedPathParser object and do parsing |
|
1171 TDelimitedPathParser8 parser8Bit; |
|
1172 parser8Bit.Parse(data8Bit); |
|
1173 |
|
1174 error = DoDelimitedDataDes(parser8Bit, data8Bit); |
|
1175 |
|
1176 aTestHarness->EndTest(error); |
|
1177 CleanupStack::PopAndDestroy(2, dataBuf); // dataBuf, title8Bit |
|
1178 } |
|
1179 |
|
1180 void TestDelimitedDataPushFrontL(const TDesC& aTestTitle, CIpuTestHarness* aTestHarness, |
|
1181 const TDesC& aData, VA_LIST& aList1, VA_LIST& aList2) |
|
1182 { |
|
1183 // Create title |
|
1184 HBufC* title16Bit = HBufC::NewLC(aTestTitle.Length() + KTitle16Bit().Length()); |
|
1185 title16Bit->Des().Format(KTitle16Bit, &aTestTitle); |
|
1186 aTestHarness->StartTestL(*title16Bit); |
|
1187 |
|
1188 // Create TDelimitedPathParser object and do parsing |
|
1189 CDelimitedPath16* data16Bit = CDelimitedPath16::NewL(aData); // Also excersies NewLC() |
|
1190 CleanupStack::PushL(data16Bit); |
|
1191 |
|
1192 TInt error = DoDelimitedDataPushFrontL<HBufC16>(data16Bit, aList1); |
|
1193 |
|
1194 CleanupStack::PopAndDestroy(2, title16Bit); // title16Bit, data16Bit |
|
1195 aTestHarness->EndTest(error); |
|
1196 |
|
1197 // Make 8-bit copy |
|
1198 HBufC8* dataBuf = HBufC8::NewLC(aData.Length()); |
|
1199 TPtr8 initData8Bit = dataBuf->Des(); |
|
1200 initData8Bit.Copy(aData); |
|
1201 |
|
1202 // Create title |
|
1203 HBufC* title8Bit = HBufC::NewLC(aTestTitle.Length() + KTitle8Bit().Length()); |
|
1204 title8Bit->Des().Format(KTitle8Bit, &aTestTitle); |
|
1205 aTestHarness->StartTestL(*title8Bit); |
|
1206 |
|
1207 // Create TDelimitedPathParser object and do parsing |
|
1208 CDelimitedPath8* data8Bit = CDelimitedPath8::NewL(initData8Bit); // Also excersies NewLC() |
|
1209 CleanupStack::PushL(data8Bit); |
|
1210 |
|
1211 error = DoDelimitedDataPushFrontL<HBufC8>(data8Bit, aList2); |
|
1212 |
|
1213 aTestHarness->EndTest(error); |
|
1214 CleanupStack::PopAndDestroy(3, dataBuf); // dataBuf, title8Bit, data8Bit |
|
1215 } |
|
1216 |
|
1217 void TestDelimitedDataPushAndEscapeFrontL(const TDesC& aTestTitle, CIpuTestHarness* aTestHarness, |
|
1218 const TDesC& aData, VA_LIST& aList1, VA_LIST& aList2) |
|
1219 { |
|
1220 // Create title |
|
1221 HBufC* title16Bit = HBufC::NewLC(aTestTitle.Length() + KTitle16Bit().Length()); |
|
1222 title16Bit->Des().Format(KTitle16Bit, &aTestTitle); |
|
1223 aTestHarness->StartTestL(*title16Bit); |
|
1224 |
|
1225 // Create TDelimitedPathParser object and do parsing |
|
1226 CDelimitedPath16* data16Bit = CDelimitedPath16::NewL(aData); // Also excersies NewLC() |
|
1227 CleanupStack::PushL(data16Bit); |
|
1228 |
|
1229 TInt error = DoDelimitedDataPushAndEscapeFrontL<HBufC16>(data16Bit, aList1); |
|
1230 |
|
1231 CleanupStack::PopAndDestroy(2, title16Bit); // title16Bit, data16Bit |
|
1232 aTestHarness->EndTest(error); |
|
1233 |
|
1234 // Make 8-bit copy |
|
1235 HBufC8* dataBuf = HBufC8::NewLC(aData.Length()); |
|
1236 TPtr8 initData8Bit = dataBuf->Des(); |
|
1237 initData8Bit.Copy(aData); |
|
1238 |
|
1239 // Create title |
|
1240 HBufC* title8Bit = HBufC::NewLC(aTestTitle.Length() + KTitle8Bit().Length()); |
|
1241 title8Bit->Des().Format(KTitle8Bit, &aTestTitle); |
|
1242 aTestHarness->StartTestL(*title8Bit); |
|
1243 |
|
1244 // Create TDelimitedPathParser object and do parsing |
|
1245 CDelimitedPath8* data8Bit = CDelimitedPath8::NewL(initData8Bit); // Also excersies NewLC() |
|
1246 CleanupStack::PushL(data8Bit); |
|
1247 |
|
1248 error = DoDelimitedDataPushAndEscapeFrontL<HBufC8>(data8Bit, aList2); |
|
1249 |
|
1250 aTestHarness->EndTest(error); |
|
1251 CleanupStack::PopAndDestroy(3, dataBuf); // dataBuf, title8Bit, data8Bit |
|
1252 } |
|
1253 |
|
1254 void TestDelimitedDataPushBackL(const TDesC& aTestTitle, CIpuTestHarness* aTestHarness, |
|
1255 const TDesC& aData, VA_LIST& aList1, VA_LIST& aList2) |
|
1256 { |
|
1257 // Create title |
|
1258 HBufC* title16Bit = HBufC::NewLC(aTestTitle.Length() + KTitle16Bit().Length()); |
|
1259 title16Bit->Des().Format(KTitle16Bit, &aTestTitle); |
|
1260 aTestHarness->StartTestL(*title16Bit); |
|
1261 |
|
1262 // Create TDelimitedPathParser object and do parsing |
|
1263 CDelimitedPath16* data16Bit = CDelimitedPath16::NewL(aData); // Also excersies NewLC() |
|
1264 CleanupStack::PushL(data16Bit); |
|
1265 |
|
1266 TInt error = DoDelimitedDataPushBackL<HBufC16>(data16Bit, aList1); |
|
1267 |
|
1268 CleanupStack::PopAndDestroy(2, title16Bit); // title16Bit, data16Bit |
|
1269 aTestHarness->EndTest(error); |
|
1270 |
|
1271 // Make 8-bit copy |
|
1272 HBufC8* dataBuf = HBufC8::NewLC(aData.Length()); |
|
1273 TPtr8 initData8Bit = dataBuf->Des(); |
|
1274 initData8Bit.Copy(aData); |
|
1275 |
|
1276 // Create title |
|
1277 HBufC* title8Bit = HBufC::NewLC(aTestTitle.Length() + KTitle8Bit().Length()); |
|
1278 title8Bit->Des().Format(KTitle8Bit, &aTestTitle); |
|
1279 aTestHarness->StartTestL(*title8Bit); |
|
1280 |
|
1281 // Create TDelimitedPathParser object and do parsing |
|
1282 CDelimitedPath8* data8Bit = CDelimitedPath8::NewL(initData8Bit); // Also excersies NewLC() |
|
1283 CleanupStack::PushL(data8Bit); |
|
1284 |
|
1285 error = DoDelimitedDataPushBackL<HBufC8>(data8Bit, aList2); |
|
1286 |
|
1287 aTestHarness->EndTest(error); |
|
1288 CleanupStack::PopAndDestroy(3, dataBuf); // dataBuf, title8Bit, data8Bit |
|
1289 } |
|
1290 |
|
1291 void TestDelimitedDataPushAndEscapeBackL(const TDesC& aTestTitle, CIpuTestHarness* aTestHarness, |
|
1292 const TDesC& aData, VA_LIST& aList1, VA_LIST& aList2) |
|
1293 { |
|
1294 // Create title |
|
1295 HBufC* title16Bit = HBufC::NewLC(aTestTitle.Length() + KTitle16Bit().Length()); |
|
1296 title16Bit->Des().Format(KTitle16Bit, &aTestTitle); |
|
1297 aTestHarness->StartTestL(*title16Bit); |
|
1298 |
|
1299 // Create TDelimitedPathParser object and do parsing |
|
1300 CDelimitedPath16* data16Bit = CDelimitedPath16::NewL(aData); // Also excersies NewLC() |
|
1301 CleanupStack::PushL(data16Bit); |
|
1302 |
|
1303 TInt error = DoDelimitedDataPushAndEscapeBackL<HBufC16>(data16Bit, aList1); |
|
1304 |
|
1305 CleanupStack::PopAndDestroy(2, title16Bit); // title16Bit, data16Bit |
|
1306 aTestHarness->EndTest(error); |
|
1307 |
|
1308 // Make 8-bit copy |
|
1309 HBufC8* dataBuf = HBufC8::NewLC(aData.Length()); |
|
1310 TPtr8 initData8Bit = dataBuf->Des(); |
|
1311 initData8Bit.Copy(aData); |
|
1312 |
|
1313 // Create title |
|
1314 HBufC* title8Bit = HBufC::NewLC(aTestTitle.Length() + KTitle8Bit().Length()); |
|
1315 title8Bit->Des().Format(KTitle8Bit, &aTestTitle); |
|
1316 aTestHarness->StartTestL(*title8Bit); |
|
1317 |
|
1318 // Create TDelimitedPathParser object and do parsing |
|
1319 CDelimitedPath8* data8Bit = CDelimitedPath8::NewL(initData8Bit); // Also excersies NewLC() |
|
1320 CleanupStack::PushL(data8Bit); |
|
1321 |
|
1322 error = DoDelimitedDataPushAndEscapeBackL<HBufC8>(data8Bit, aList2); |
|
1323 |
|
1324 aTestHarness->EndTest(error); |
|
1325 CleanupStack::PopAndDestroy(3, dataBuf); // dataBuf, title8Bit, data8Bit |
|
1326 } |
|
1327 |
|
1328 void TestDelimitedDataPopFrontL(const TDesC& aTestTitle, CIpuTestHarness* aTestHarness, |
|
1329 const TDesC& aData, VA_LIST& aList1, VA_LIST& aList2) |
|
1330 { |
|
1331 // Create title |
|
1332 HBufC* title16Bit = HBufC::NewLC(aTestTitle.Length() + KTitle16Bit().Length()); |
|
1333 title16Bit->Des().Format(KTitle16Bit, &aTestTitle); |
|
1334 aTestHarness->StartTestL(*title16Bit); |
|
1335 |
|
1336 // Create TDelimitedPathParser object and do parsing |
|
1337 CDelimitedPath16* data16Bit = CDelimitedPath16::NewL(aData); // Also excersies NewLC() |
|
1338 CleanupStack::PushL(data16Bit); |
|
1339 |
|
1340 TInt error = DoDelimitedDataPopFrontL<HBufC16>(data16Bit, aList1); |
|
1341 |
|
1342 CleanupStack::PopAndDestroy(2, title16Bit); // title16Bit, data16Bit |
|
1343 aTestHarness->EndTest(error); |
|
1344 |
|
1345 // Make 8-bit copy |
|
1346 HBufC8* dataBuf = HBufC8::NewLC(aData.Length()); |
|
1347 TPtr8 initData8Bit = dataBuf->Des(); |
|
1348 initData8Bit.Copy(aData); |
|
1349 |
|
1350 // Create title |
|
1351 HBufC* title8Bit = HBufC::NewLC(aTestTitle.Length() + KTitle8Bit().Length()); |
|
1352 title8Bit->Des().Format(KTitle8Bit, &aTestTitle); |
|
1353 aTestHarness->StartTestL(*title8Bit); |
|
1354 |
|
1355 // Create TDelimitedPathParser object and do parsing |
|
1356 CDelimitedPath8* data8Bit = CDelimitedPath8::NewL(initData8Bit); // Also excersies NewLC() |
|
1357 CleanupStack::PushL(data8Bit); |
|
1358 |
|
1359 error = DoDelimitedDataPopFrontL<HBufC8>(data8Bit, aList2); |
|
1360 |
|
1361 aTestHarness->EndTest(error); |
|
1362 CleanupStack::PopAndDestroy(3, dataBuf); // dataBuf, title8Bit, data8Bit |
|
1363 } |
|
1364 |
|
1365 void TestDelimitedDataPopBackL(const TDesC& aTestTitle, CIpuTestHarness* aTestHarness, |
|
1366 const TDesC& aData, VA_LIST& aList1, VA_LIST& aList2) |
|
1367 { |
|
1368 // Create title |
|
1369 HBufC* title16Bit = HBufC::NewLC(aTestTitle.Length() + KTitle16Bit().Length()); |
|
1370 title16Bit->Des().Format(KTitle16Bit, &aTestTitle); |
|
1371 aTestHarness->StartTestL(*title16Bit); |
|
1372 |
|
1373 // Create TDelimitedPathParser object and do parsing |
|
1374 CDelimitedPath16* data16Bit = CDelimitedPath16::NewL(aData); // Also excersies NewLC() |
|
1375 CleanupStack::PushL(data16Bit); |
|
1376 |
|
1377 TInt error = DoDelimitedDataPopBackL<HBufC16>(data16Bit, aList1); |
|
1378 |
|
1379 CleanupStack::PopAndDestroy(2, title16Bit); // title16Bit, data16Bit |
|
1380 aTestHarness->EndTest(error); |
|
1381 |
|
1382 // Make 8-bit copy |
|
1383 HBufC8* dataBuf = HBufC8::NewLC(aData.Length()); |
|
1384 TPtr8 initData8Bit = dataBuf->Des(); |
|
1385 initData8Bit.Copy(aData); |
|
1386 |
|
1387 // Create title |
|
1388 HBufC* title8Bit = HBufC::NewLC(aTestTitle.Length() + KTitle8Bit().Length()); |
|
1389 title8Bit->Des().Format(KTitle8Bit, &aTestTitle); |
|
1390 aTestHarness->StartTestL(*title8Bit); |
|
1391 |
|
1392 // Create TDelimitedPathParser object and do parsing |
|
1393 CDelimitedPath8* data8Bit = CDelimitedPath8::NewL(initData8Bit); // Also excersies NewLC() |
|
1394 CleanupStack::PushL(data8Bit); |
|
1395 |
|
1396 error = DoDelimitedDataPopBackL<HBufC8>(data8Bit, aList2); |
|
1397 |
|
1398 aTestHarness->EndTest(error); |
|
1399 CleanupStack::PopAndDestroy(3, dataBuf); // dataBuf, title8Bit, data8Bit |
|
1400 } |
|
1401 |
|
1402 void TestDelimitedDataAddAndTrimFrontAndBackDelimiterL(const TDesC& aTestTitle, CIpuTestHarness* aTestHarness, const TDesC& aData) |
|
1403 { |
|
1404 // Create title |
|
1405 HBufC* title16Bit = HBufC::NewLC(aTestTitle.Length() + KTitle16Bit().Length()); |
|
1406 title16Bit->Des().Format(KTitle16Bit, &aTestTitle); |
|
1407 aTestHarness->StartTestL(*title16Bit); |
|
1408 |
|
1409 // Create TDelimitedPathParser object and do parsing |
|
1410 CDelimitedPath16* data16Bit = CDelimitedPath16::NewL(aData); // Also excersies NewLC() |
|
1411 CleanupStack::PushL(data16Bit); |
|
1412 |
|
1413 TInt error = DoDelimitedDataAddAndTrimFrontAndBackDelimiterL(data16Bit); |
|
1414 |
|
1415 CleanupStack::PopAndDestroy(2, title16Bit); // title16Bit, data16Bit |
|
1416 aTestHarness->EndTest(error); |
|
1417 |
|
1418 // Make 8-bit copy |
|
1419 HBufC8* dataBuf = HBufC8::NewLC(aData.Length()); |
|
1420 TPtr8 initData8Bit = dataBuf->Des(); |
|
1421 initData8Bit.Copy(aData); |
|
1422 |
|
1423 // Create title |
|
1424 HBufC* title8Bit = HBufC::NewLC(aTestTitle.Length() + KTitle8Bit().Length()); |
|
1425 title8Bit->Des().Format(KTitle8Bit, &aTestTitle); |
|
1426 aTestHarness->StartTestL(*title8Bit); |
|
1427 |
|
1428 // Create TDelimitedPathParser object and do parsing |
|
1429 CDelimitedPath8* data8Bit = CDelimitedPath8::NewL(initData8Bit); // Also excersies NewLC() |
|
1430 CleanupStack::PushL(data8Bit); |
|
1431 |
|
1432 error = DoDelimitedDataAddAndTrimFrontAndBackDelimiterL(data8Bit); |
|
1433 |
|
1434 aTestHarness->EndTest(error); |
|
1435 CleanupStack::PopAndDestroy(3, dataBuf); // dataBuf, title8Bit, data8Bit |
|
1436 } |
|
1437 |
|
1438 void TestDelimitedDataInsertAndParseL(const TDesC& aTestTitle, CIpuTestHarness* aTestHarness, |
|
1439 const TDesC& aData, VA_LIST& aList1, VA_LIST& aList2, TInt aStartPos) |
|
1440 { |
|
1441 // Create title |
|
1442 HBufC* title16Bit = HBufC::NewLC(aTestTitle.Length() + KTitle16Bit().Length()); |
|
1443 title16Bit->Des().Format(KTitle16Bit, &aTestTitle); |
|
1444 aTestHarness->StartTestL(*title16Bit); |
|
1445 |
|
1446 // Create TDelimitedPathParser object and do parsing |
|
1447 CDelimitedPath16* data16Bit = CDelimitedPath16::NewL(aData); // Also excersies NewLC() |
|
1448 CleanupStack::PushL(data16Bit); |
|
1449 |
|
1450 // Do initial parse and get to position |
|
1451 data16Bit->Parse(); |
|
1452 TInt error = DoDelimitedDataParseToPosition(data16Bit, aStartPos); |
|
1453 if( error == KErrNone ) |
|
1454 { |
|
1455 error = DoDelimitedDataInsertL<HBufC16, TPtrC16>(data16Bit, aList1); |
|
1456 } |
|
1457 CleanupStack::PopAndDestroy(2, title16Bit); // title16Bit, data16Bit |
|
1458 aTestHarness->EndTest(error); |
|
1459 |
|
1460 // Make 8-bit copy |
|
1461 HBufC8* dataBuf = HBufC8::NewLC(aData.Length()); |
|
1462 TPtr8 initData8Bit = dataBuf->Des(); |
|
1463 initData8Bit.Copy(aData); |
|
1464 |
|
1465 // Create title |
|
1466 HBufC* title8Bit = HBufC::NewLC(aTestTitle.Length() + KTitle8Bit().Length()); |
|
1467 title8Bit->Des().Format(KTitle8Bit, &aTestTitle); |
|
1468 aTestHarness->StartTestL(*title8Bit); |
|
1469 |
|
1470 // Create TDelimitedPathParser object and do parsing |
|
1471 CDelimitedPath8* data8Bit = CDelimitedPath8::NewL(initData8Bit); // Also excersies NewLC() |
|
1472 CleanupStack::PushL(data8Bit); |
|
1473 |
|
1474 // Do initial parse and get to position |
|
1475 data8Bit->Parse(); |
|
1476 error = DoDelimitedDataParseToPosition(data8Bit, aStartPos); |
|
1477 if( error == KErrNone ) |
|
1478 { |
|
1479 error = DoDelimitedDataInsertL<HBufC8, TPtrC8>(data8Bit, aList2); |
|
1480 } |
|
1481 aTestHarness->EndTest(error); |
|
1482 CleanupStack::PopAndDestroy(3, dataBuf); // dataBuf, title8Bit, data8Bit |
|
1483 } |
|
1484 |
|
1485 void TestDelimitedDataRemoveAndParseL(const TDesC& aTestTitle, CIpuTestHarness* aTestHarness, |
|
1486 const TDesC& aData, VA_LIST& aList1, VA_LIST& aList2, TInt aStartPos) |
|
1487 { |
|
1488 // Create title |
|
1489 HBufC* title16Bit = HBufC::NewLC(aTestTitle.Length() + KTitle16Bit().Length()); |
|
1490 title16Bit->Des().Format(KTitle16Bit, &aTestTitle); |
|
1491 aTestHarness->StartTestL(*title16Bit); |
|
1492 |
|
1493 // Create TDelimitedPathParser object and do parsing |
|
1494 CDelimitedPath16* data16Bit = CDelimitedPath16::NewL(aData); // Also excersies NewLC() |
|
1495 CleanupStack::PushL(data16Bit); |
|
1496 |
|
1497 // Do initial parse and get to position |
|
1498 data16Bit->Parse(); |
|
1499 TInt error = DoDelimitedDataParseToPosition(data16Bit, aStartPos); |
|
1500 if( error == KErrNone ) |
|
1501 { |
|
1502 error = DoDelimitedDataRemoveL<HBufC16, TPtrC16>(data16Bit, aList1); |
|
1503 } |
|
1504 CleanupStack::PopAndDestroy(2, title16Bit); // title16Bit, data16Bit |
|
1505 aTestHarness->EndTest(error); |
|
1506 |
|
1507 // Make 8-bit copy |
|
1508 HBufC8* dataBuf = HBufC8::NewLC(aData.Length()); |
|
1509 TPtr8 initData8Bit = dataBuf->Des(); |
|
1510 initData8Bit.Copy(aData); |
|
1511 |
|
1512 // Create title |
|
1513 HBufC* title8Bit = HBufC::NewLC(aTestTitle.Length() + KTitle8Bit().Length()); |
|
1514 title8Bit->Des().Format(KTitle8Bit, &aTestTitle); |
|
1515 aTestHarness->StartTestL(*title8Bit); |
|
1516 |
|
1517 // Create TDelimitedPathParser object and do parsing |
|
1518 CDelimitedPath8* data8Bit = CDelimitedPath8::NewL(initData8Bit); // Also excersies NewLC() |
|
1519 CleanupStack::PushL(data8Bit); |
|
1520 |
|
1521 // Do initial parse and get to position |
|
1522 data8Bit->Parse(); |
|
1523 error = DoDelimitedDataParseToPosition(data8Bit, aStartPos); |
|
1524 if( error == KErrNone ) |
|
1525 { |
|
1526 error = DoDelimitedDataRemoveL<HBufC8, TPtrC8>(data8Bit, aList2); |
|
1527 } |
|
1528 aTestHarness->EndTest(error); |
|
1529 CleanupStack::PopAndDestroy(3, dataBuf); // dataBuf, title8Bit, data8Bit |
|
1530 } |
|
1531 |
|
1532 void TestDelimitedDataInsertAndParseReverseL(const TDesC& aTestTitle, CIpuTestHarness* aTestHarness, |
|
1533 const TDesC& aData, VA_LIST& aList1, VA_LIST& aList2, TInt aStartPos) |
|
1534 { |
|
1535 // Create title |
|
1536 HBufC* title16Bit = HBufC::NewLC(aTestTitle.Length() + KTitle16Bit().Length()); |
|
1537 title16Bit->Des().Format(KTitle16Bit, &aTestTitle); |
|
1538 aTestHarness->StartTestL(*title16Bit); |
|
1539 |
|
1540 // Create TDelimitedPathParser object and do parsing |
|
1541 CDelimitedPath16* data16Bit = CDelimitedPath16::NewL(aData); // Also excersies NewLC() |
|
1542 CleanupStack::PushL(data16Bit); |
|
1543 |
|
1544 // Do initial parse and get to position |
|
1545 data16Bit->ParseReverse(); |
|
1546 TInt error = DoDelimitedDataParseToPosition(data16Bit, aStartPos); |
|
1547 if( error == KErrNone ) |
|
1548 { |
|
1549 error = DoDelimitedDataInsertL<HBufC16, TPtrC16>(data16Bit, aList1); |
|
1550 } |
|
1551 CleanupStack::PopAndDestroy(2, title16Bit); // title16Bit, data16Bit |
|
1552 aTestHarness->EndTest(error); |
|
1553 |
|
1554 // Make 8-bit copy |
|
1555 HBufC8* dataBuf = HBufC8::NewLC(aData.Length()); |
|
1556 TPtr8 initData8Bit = dataBuf->Des(); |
|
1557 initData8Bit.Copy(aData); |
|
1558 |
|
1559 // Create title |
|
1560 HBufC* title8Bit = HBufC::NewLC(aTestTitle.Length() + KTitle8Bit().Length()); |
|
1561 title8Bit->Des().Format(KTitle8Bit, &aTestTitle); |
|
1562 aTestHarness->StartTestL(*title8Bit); |
|
1563 |
|
1564 // Create TDelimitedPathParser object and do parsing |
|
1565 CDelimitedPath8* data8Bit = CDelimitedPath8::NewL(initData8Bit); // Also excersies NewLC() |
|
1566 CleanupStack::PushL(data8Bit); |
|
1567 |
|
1568 // Do initial parse and get to position |
|
1569 data8Bit->ParseReverse(); |
|
1570 error = DoDelimitedDataParseToPosition(data8Bit, aStartPos); |
|
1571 if( error == KErrNone ) |
|
1572 { |
|
1573 error = DoDelimitedDataInsertL<HBufC8, TPtrC8>(data8Bit, aList2); |
|
1574 } |
|
1575 aTestHarness->EndTest(error); |
|
1576 CleanupStack::PopAndDestroy(3, dataBuf); // dataBuf, title8Bit, data8Bit |
|
1577 } |
|
1578 |
|
1579 void TestDelimitedDataRemoveAndParseReverseL(const TDesC& aTestTitle, CIpuTestHarness* aTestHarness, |
|
1580 const TDesC& aData, VA_LIST& aList1, VA_LIST& aList2, TInt aStartPos) |
|
1581 { |
|
1582 // Create title |
|
1583 HBufC* title16Bit = HBufC::NewLC(aTestTitle.Length() + KTitle16Bit().Length()); |
|
1584 title16Bit->Des().Format(KTitle16Bit, &aTestTitle); |
|
1585 aTestHarness->StartTestL(*title16Bit); |
|
1586 |
|
1587 // Create TDelimitedPathParser object and do parsing |
|
1588 CDelimitedPath16* data16Bit = CDelimitedPath16::NewL(aData); // Also excersies NewLC() |
|
1589 CleanupStack::PushL(data16Bit); |
|
1590 |
|
1591 // Do initial parse and get to position |
|
1592 data16Bit->ParseReverse(); |
|
1593 TInt error = DoDelimitedDataParseToPosition(data16Bit, aStartPos); |
|
1594 if( error == KErrNone ) |
|
1595 { |
|
1596 error = DoDelimitedDataRemoveL<HBufC16, TPtrC16>(data16Bit, aList1); |
|
1597 } |
|
1598 CleanupStack::PopAndDestroy(2, title16Bit); // title16Bit, data16Bit |
|
1599 aTestHarness->EndTest(error); |
|
1600 |
|
1601 // Make 8-bit copy |
|
1602 HBufC8* dataBuf = HBufC8::NewLC(aData.Length()); |
|
1603 TPtr8 initData8Bit = dataBuf->Des(); |
|
1604 initData8Bit.Copy(aData); |
|
1605 |
|
1606 // Create title |
|
1607 HBufC* title8Bit = HBufC::NewLC(aTestTitle.Length() + KTitle8Bit().Length()); |
|
1608 title8Bit->Des().Format(KTitle8Bit, &aTestTitle); |
|
1609 aTestHarness->StartTestL(*title8Bit); |
|
1610 |
|
1611 // Create TDelimitedPathParser object and do parsing |
|
1612 CDelimitedPath8* data8Bit = CDelimitedPath8::NewL(initData8Bit); // Also excersies NewLC() |
|
1613 CleanupStack::PushL(data8Bit); |
|
1614 |
|
1615 // Do initial parse and get to position |
|
1616 data8Bit->ParseReverse(); |
|
1617 error = DoDelimitedDataParseToPosition(data8Bit, aStartPos); |
|
1618 if( error == KErrNone ) |
|
1619 { |
|
1620 error = DoDelimitedDataRemoveL<HBufC8, TPtrC8>(data8Bit, aList2); |
|
1621 } |
|
1622 aTestHarness->EndTest(error); |
|
1623 CleanupStack::PopAndDestroy(3, dataBuf); // dataBuf, title8Bit, data8Bit |
|
1624 } |
|
1625 |
|
1626 void TestDelimitedDataInsertEscapeAndParseL(const TDesC& aTestTitle, CIpuTestHarness* aTestHarness, |
|
1627 const TDesC& aData, VA_LIST& aList1, VA_LIST& aList2, TInt aStartPos) |
|
1628 { |
|
1629 // Create title |
|
1630 HBufC* title16Bit = HBufC::NewLC(aTestTitle.Length() + KTitle16Bit().Length()); |
|
1631 title16Bit->Des().Format(KTitle16Bit, &aTestTitle); |
|
1632 aTestHarness->StartTestL(*title16Bit); |
|
1633 |
|
1634 // Create TDelimitedPathParser object and do parsing |
|
1635 CDelimitedPath16* data16Bit = CDelimitedPath16::NewL(aData); // Also excersies NewLC() |
|
1636 CleanupStack::PushL(data16Bit); |
|
1637 |
|
1638 // Do initial parse and get to position |
|
1639 data16Bit->Parse(); |
|
1640 TInt error = DoDelimitedDataParseToPosition(data16Bit, aStartPos); |
|
1641 if( error == KErrNone ) |
|
1642 { |
|
1643 error = DoDelimitedDataInsertAndEscapeL<HBufC16, TPtrC16>(data16Bit, aList1); |
|
1644 } |
|
1645 CleanupStack::PopAndDestroy(2, title16Bit); // title16Bit, data16Bit |
|
1646 aTestHarness->EndTest(error); |
|
1647 |
|
1648 // Make 8-bit copy |
|
1649 HBufC8* dataBuf = HBufC8::NewLC(aData.Length()); |
|
1650 TPtr8 initData8Bit = dataBuf->Des(); |
|
1651 initData8Bit.Copy(aData); |
|
1652 |
|
1653 // Create title |
|
1654 HBufC* title8Bit = HBufC::NewLC(aTestTitle.Length() + KTitle8Bit().Length()); |
|
1655 title8Bit->Des().Format(KTitle8Bit, &aTestTitle); |
|
1656 aTestHarness->StartTestL(*title8Bit); |
|
1657 |
|
1658 // Create TDelimitedPathParser object and do parsing |
|
1659 CDelimitedPath8* data8Bit = CDelimitedPath8::NewL(initData8Bit); // Also excersies NewLC() |
|
1660 CleanupStack::PushL(data8Bit); |
|
1661 |
|
1662 // Do initial parse and get to position |
|
1663 data8Bit->Parse(); |
|
1664 error = DoDelimitedDataParseToPosition(data8Bit, aStartPos); |
|
1665 if( error == KErrNone ) |
|
1666 { |
|
1667 error = DoDelimitedDataInsertAndEscapeL<HBufC8, TPtrC8>(data8Bit, aList2); |
|
1668 } |
|
1669 aTestHarness->EndTest(error); |
|
1670 CleanupStack::PopAndDestroy(3, dataBuf); // dataBuf, title8Bit, data8Bit |
|
1671 } |
|
1672 |
|
1673 void TestDelimitedDataInsertEscapeAndParseReverseL(const TDesC& aTestTitle, CIpuTestHarness* aTestHarness, |
|
1674 const TDesC& aData, VA_LIST& aList1, VA_LIST& aList2, TInt aStartPos) |
|
1675 { |
|
1676 // Create title |
|
1677 HBufC* title16Bit = HBufC::NewLC(aTestTitle.Length() + KTitle16Bit().Length()); |
|
1678 title16Bit->Des().Format(KTitle16Bit, &aTestTitle); |
|
1679 aTestHarness->StartTestL(*title16Bit); |
|
1680 |
|
1681 // Create TDelimitedPathParser object and do parsing |
|
1682 CDelimitedPath16* data16Bit = CDelimitedPath16::NewL(aData); // Also excersies NewLC() |
|
1683 CleanupStack::PushL(data16Bit); |
|
1684 |
|
1685 // Do initial parse and get to position |
|
1686 data16Bit->ParseReverse(); |
|
1687 TInt error = DoDelimitedDataParseToPosition(data16Bit, aStartPos); |
|
1688 if( error == KErrNone ) |
|
1689 { |
|
1690 error = DoDelimitedDataInsertAndEscapeL<HBufC16, TPtrC16>(data16Bit, aList1); |
|
1691 } |
|
1692 CleanupStack::PopAndDestroy(2, title16Bit); // title16Bit, data16Bit |
|
1693 aTestHarness->EndTest(error); |
|
1694 |
|
1695 // Make 8-bit copy |
|
1696 HBufC8* dataBuf = HBufC8::NewLC(aData.Length()); |
|
1697 TPtr8 initData8Bit = dataBuf->Des(); |
|
1698 initData8Bit.Copy(aData); |
|
1699 |
|
1700 // Create title |
|
1701 HBufC* title8Bit = HBufC::NewLC(aTestTitle.Length() + KTitle8Bit().Length()); |
|
1702 title8Bit->Des().Format(KTitle8Bit, &aTestTitle); |
|
1703 aTestHarness->StartTestL(*title8Bit); |
|
1704 |
|
1705 // Create TDelimitedPathParser object and do parsing |
|
1706 CDelimitedPath8* data8Bit = CDelimitedPath8::NewL(initData8Bit); // Also excersies NewLC() |
|
1707 CleanupStack::PushL(data8Bit); |
|
1708 |
|
1709 // Do initial parse and get to position |
|
1710 data8Bit->ParseReverse(); |
|
1711 error = DoDelimitedDataParseToPosition(data8Bit, aStartPos); |
|
1712 if( error == KErrNone ) |
|
1713 { |
|
1714 error = DoDelimitedDataInsertAndEscapeL<HBufC8, TPtrC8>(data8Bit, aList2); |
|
1715 } |
|
1716 aTestHarness->EndTest(error); |
|
1717 CleanupStack::PopAndDestroy(3, dataBuf); // dataBuf, title8Bit, data8Bit |
|
1718 } |
|
1719 |
|
1720 // |
|
1721 // |
|
1722 // Implementation of LOCAL functions - helper functions |
|
1723 // |
|
1724 // |
|
1725 |
|
1726 #include "TDelimitedDataCommon.cpp" |