os/ossrv/genericservices/httputils/Test/t_uriparser/CDelimitedPathSegmentTest.cpp
First public contribution.
1 // Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
16 #include "CDelimitedPathSegmentTest.h"
19 #include <delimitedpathsegment16.h>
20 #include <delimitedpathsegment8.h>
22 #include "TDelimitedDataCommon.h"
23 #include "DelimitedPathSegmentTests.h"
27 _LIT(KTitle16Bit, "%S (16-Bit)");
28 _LIT(KTitle8Bit, "%S (8-Bit)");
30 CDelimitedPathSegmentTest* CDelimitedPathSegmentTest::NewLC(CIpuTestHarness* aTestHarness)
32 CDelimitedPathSegmentTest* self = new (ELeave) CDelimitedPathSegmentTest(aTestHarness);
33 CleanupStack::PushL(self);
38 CDelimitedPathSegmentTest* CDelimitedPathSegmentTest::NewL(CIpuTestHarness* aTestHarness)
40 CDelimitedPathSegmentTest* self = CDelimitedPathSegmentTest::NewLC(aTestHarness);
41 CleanupStack::Pop(self);
45 CDelimitedPathSegmentTest::CDelimitedPathSegmentTest(CIpuTestHarness* aTestHarness)
46 : iTestHarness(aTestHarness)
50 void CDelimitedPathSegmentTest::ConstructL()
54 CDelimitedPathSegmentTest::~CDelimitedPathSegmentTest()
58 void CDelimitedPathSegmentTest::DoTestsL()
62 // Delimited PathSegment Tests
66 TestDelimitedPathSegmentExtractionL(KPathSegmentParse0, &KPathSegmentParse0Seg0(), &KPathSegmentParse0Seg1(),
67 &KPathSegmentParse0Seg2(), NULL);
68 TestDelimitedPathSegmentExtractionL(KPathSegmentParse1, &KPathSegmentParse1Seg0(), &KPathSegmentParse1Seg1(), &KPathSegmentParse1Seg2(),
69 &KPathSegmentParse1Seg3(), NULL);
70 TestDelimitedPathSegmentExtractionL(KPathSegmentParse2, &KPathSegmentParse2Seg0(), &KPathSegmentParse2Seg1(), &KPathSegmentParse2Seg2(),
71 &KPathSegmentParse2Seg3(), &KPathSegmentParse2Seg4(), &KPathSegmentParse2Seg5(), &KPathSegmentParse2Seg6(),
72 &KPathSegmentParse2Seg7(), NULL);
74 TestDelimitedPathSegmentReverseExtractionL(KPathSegmentParse0, &KPathSegmentParse0Seg2(),
75 &KPathSegmentParse0Seg1(), &KPathSegmentParse0Seg0(), NULL);
76 TestDelimitedPathSegmentReverseExtractionL(KPathSegmentParse1, &KPathSegmentParse1Seg3(), &KPathSegmentParse1Seg2(),
77 &KPathSegmentParse1Seg1(), &KPathSegmentParse1Seg0(), NULL);
78 TestDelimitedPathSegmentReverseExtractionL(KPathSegmentParse2, &KPathSegmentParse2Seg7(), &KPathSegmentParse2Seg6(),
79 &KPathSegmentParse2Seg5(), &KPathSegmentParse2Seg4(), &KPathSegmentParse2Seg3(),
80 &KPathSegmentParse2Seg2(), &KPathSegmentParse2Seg1(), &KPathSegmentParse2Seg0(), NULL);
82 TestDelimitedPathSegmentDelimiterPresenceL(KPathSegment_DelimPresence0, KPathSegment_FrontDelim0, KPathSegment_BackDelim0);
83 TestDelimitedPathSegmentDelimiterPresenceL(KPathSegment_DelimPresence1, KPathSegment_FrontDelim1, KPathSegment_BackDelim1);
84 TestDelimitedPathSegmentDelimiterPresenceL(KPathSegment_DelimPresence2, KPathSegment_FrontDelim2, KPathSegment_BackDelim2);
85 TestDelimitedPathSegmentDelimiterPresenceL(KPathSegment_DelimPresence3, KPathSegment_FrontDelim3, KPathSegment_BackDelim3);
87 TestDelimitedPathSegmentRemainderL(KPathSegment_Rem_Forwards0_0, &KPathSegment_Rem_Forwards0_0(), &KPathSegment_Rem_Forwards0_1(),
88 &KPathSegment_Rem_Forwards0_2(), &KPathSegment_Rem_Forwards0_3(), NULL);
90 TestDelimitedPathSegmentRemainderReverseL(KPathSegment_Rem_Backwards0_0, &KPathSegment_Rem_Backwards0_0(), &KPathSegment_Rem_Backwards0_1(),
91 &KPathSegment_Rem_Backwards0_2(), &KPathSegment_Rem_Backwards0_3(), NULL);
93 TestDelimitedPathSegmentDesL(KPathSegment_Des0);
95 TestDelimitedPathSegmentPushFrontL(KPathSegment_PushPopFront0_0, &KPathSegment_Push0_a(), &KPathSegment_PushPopFront0_1(),
96 &KPathSegment_Push0_b(), &KPathSegment_PushPopFront0_2(),
97 &KPathSegment_Push0_c(), &KPathSegment_PushPopFront0_3(),
98 &KPathSegment_Push0_d(), &KPathSegment_PushPopFront0_4(),
99 &KPathSegment_Push0_e(), &KPathSegment_PushPopFront0_5(), NULL, NULL);
101 TestDelimitedPathSegmentPushBackL(KPathSegment_PushPopBack0_0, &KPathSegment_Push0_a(), &KPathSegment_PushPopBack0_1(),
102 &KPathSegment_Push0_b(), &KPathSegment_PushPopBack0_2(),
103 &KPathSegment_Push0_c(), &KPathSegment_PushPopBack0_3(),
104 &KPathSegment_Push0_d(), &KPathSegment_PushPopBack0_4(),
105 &KPathSegment_Push0_e(), &KPathSegment_PushPopBack0_5(), NULL, NULL);
107 TestDelimitedPathSegmentPopFrontL(KPathSegment_PushPopFront0_5, &KPathSegment_PushPopFront0_4(), &KPathSegment_PushPopFront0_3(),
108 &KPathSegment_PushPopFront0_2(), &KPathSegment_PushPopFront0_1(), &KPathSegment_PushPopFront0_0(), NULL);
110 TestDelimitedPathSegmentPopBackL(KPathSegment_PushPopBack0_5, &KPathSegment_PushPopBack0_4(), &KPathSegment_PushPopBack0_3(),
111 &KPathSegment_PushPopBack0_2(), &KPathSegment_PushPopBack0_1(), &KPathSegment_PushPopBack0_0(), NULL);
113 TestDelimitedPathSegmentAddAndTrimFrontAndBackDelimiterL(KPathSegment_AddTrimDelim0);
115 TestDelimitedPathSegmentInsertAndParseL(KPathSegmentInsertForwardsPos0, KPathSegment_InsertForwards0_0,
116 &KPathSegment_Insert0_a(), &KPathSegment_InsertForwards0_1(),
117 &KPathSegment_Insert0_b(), &KPathSegment_InsertForwards0_2(),
118 &KPathSegment_Insert0_c(), &KPathSegment_InsertForwards0_3(),
119 &KPathSegment_Insert0_d(), &KPathSegment_InsertForwards0_4(),
120 &KPathSegment_Insert0_e(), &KPathSegment_InsertForwards0_5(), NULL, NULL);
122 TestDelimitedPathSegmentRemoveAndParseL(KPathSegmentRemoveForwardsPos0, KPathSegment_RemoveForwards0_0,
123 &KPathSegment_RemoveForwards0_1(), &KPathSegment_RemoveForwards0_2(),
124 &KPathSegment_RemoveForwards0_3(), &KPathSegment_RemoveForwards0_4(),
125 &KPathSegment_RemoveForwards0_5(), NULL);
127 TestDelimitedPathSegmentInsertAndParseReverseL(KPathSegmentInsertBackwardsPos0, KPathSegment_InsertBackwards0_0,
128 &KPathSegment_Insert0_a(), &KPathSegment_InsertBackwards0_1(),
129 &KPathSegment_Insert0_b(), &KPathSegment_InsertBackwards0_2(),
130 &KPathSegment_Insert0_c(), &KPathSegment_InsertBackwards0_3(),
131 &KPathSegment_Insert0_d(), &KPathSegment_InsertBackwards0_4(),
132 &KPathSegment_Insert0_e(), &KPathSegment_InsertBackwards0_5(), NULL, NULL);
134 TestDelimitedPathSegmentRemoveAndParseReverseL(KPathSegmentRemoveBackwardsPos0, KPathSegment_RemoveBackwards0_0,
135 &KPathSegment_RemoveBackwards0_1(), &KPathSegment_RemoveBackwards0_2(),
136 &KPathSegment_RemoveBackwards0_3(), &KPathSegment_RemoveBackwards0_4(),
137 &KPathSegment_RemoveBackwards0_5(), NULL);
139 TestDelimitedPathSegmentInsertEscapeAndParseL(KPathSegmentInsertEscapeForwardsPos0, KPathSegment_InsertEscapeForwards0_0,
140 &KPathSegment_InsertEscape0_a(), &KPathSegment_InsertEscapeForwards0_1(),
141 &KPathSegment_InsertEscape0_b(), &KPathSegment_InsertEscapeForwards0_2(),
142 &KPathSegment_InsertEscape0_c(), &KPathSegment_InsertEscapeForwards0_3(),
143 &KPathSegment_InsertEscape0_d(), &KPathSegment_InsertEscapeForwards0_4(),
144 &KPathSegment_InsertEscape0_e(), &KPathSegment_InsertEscapeForwards0_5(), NULL, NULL);
146 TestDelimitedPathSegmentInsertEscapeAndParseReverseL(KPathSegmentInsertEscapeBackwardsPos0, KPathSegment_InsertEscapeBackwards0_0,
147 &KPathSegment_InsertEscape0_a(), &KPathSegment_InsertEscapeBackwards0_1(),
148 &KPathSegment_InsertEscape0_b(), &KPathSegment_InsertEscapeBackwards0_2(),
149 &KPathSegment_InsertEscape0_c(), &KPathSegment_InsertEscapeBackwards0_3(),
150 &KPathSegment_InsertEscape0_d(), &KPathSegment_InsertEscapeBackwards0_4(),
151 &KPathSegment_InsertEscape0_e(), &KPathSegment_InsertEscapeBackwards0_5(), NULL, NULL);
153 TestDelimitedPathSegmentPushAndEscapeFrontL(KPathSegment_PushEscapeFront0_0, &KPathSegment_PushEscape0_a(), &KPathSegment_PushEscapeFront0_1(),
154 &KPathSegment_PushEscape0_b(), &KPathSegment_PushEscapeFront0_2(),
155 &KPathSegment_PushEscape0_c(), &KPathSegment_PushEscapeFront0_3(),
156 &KPathSegment_PushEscape0_d(), &KPathSegment_PushEscapeFront0_4(),
157 &KPathSegment_PushEscape0_e(), &KPathSegment_PushEscapeFront0_5(), NULL, NULL);
159 TestDelimitedPathSegmentPushAndEscapeBackL(KPathSegment_PushEscapeBack0_0, &KPathSegment_PushEscape0_a(), &KPathSegment_PushEscapeBack0_1(),
160 &KPathSegment_PushEscape0_b(), &KPathSegment_PushEscapeBack0_2(),
161 &KPathSegment_PushEscape0_c(), &KPathSegment_PushEscapeBack0_3(),
162 &KPathSegment_PushEscape0_d(), &KPathSegment_PushEscapeBack0_4(),
163 &KPathSegment_PushEscape0_e(), &KPathSegment_PushEscapeBack0_5(), NULL, NULL);
168 // Delimited PathSegment tests
172 void CDelimitedPathSegmentTest::TestDelimitedPathSegmentExtractionL(TRefByValue<const TDesC> aPath, ...) const
174 VA_LIST list1; VA_START(list1, aPath);
175 VA_LIST list2; VA_START(list2, aPath);
176 const TDesC& path = aPath;
178 TestDelimitedDataExtractionL(_L("Test TDelimitedPathSegmentParser Parse : GetNext, Dec, Inc, Peek and Eos"), iTestHarness, path, list1, list2);
179 VA_END(list1); VA_END(list2);
182 void CDelimitedPathSegmentTest::TestDelimitedPathSegmentReverseExtractionL(TRefByValue<const TDesC> aPath, ...) const
184 VA_LIST list1; VA_START(list1, aPath);
185 VA_LIST list2; VA_START(list2, aPath);
186 const TDesC& path = aPath;
188 TestDelimitedDataReverseExtractionL(_L("Test TDelimitedPathSegmentParser ParseReverse : GetNext, Dec, Inc, Peek and Eos"), iTestHarness, path, list1, list2);
189 VA_END(list1); VA_END(list2);
192 void CDelimitedPathSegmentTest::TestDelimitedPathSegmentDelimiterPresenceL(const TDesC& aPath, TBool aFrontDelim, TBool aBackDelim) const
194 TestDelimitedDataDelimiterPresenceL(_L("Test TDelimitedPathSegmentParser Delimiter Presence"), iTestHarness, aPath, aFrontDelim, aBackDelim);
197 void CDelimitedPathSegmentTest::TestDelimitedPathSegmentRemainderL(TRefByValue<const TDesC> aPath, ...) const
199 VA_LIST list1; VA_START(list1, aPath);
200 VA_LIST list2; VA_START(list2, aPath);
201 const TDesC& path = aPath;
203 TestDelimitedDataRemainderL(_L("Test TDelimitedPathSegmentParser Remainder, Parse"), iTestHarness, path, list1, list2);
204 VA_END(list1); VA_END(list2);
207 void CDelimitedPathSegmentTest::TestDelimitedPathSegmentRemainderReverseL(TRefByValue<const TDesC> aPath, ...) const
209 VA_LIST list1; VA_START(list1, aPath);
210 VA_LIST list2; VA_START(list2, aPath);
211 const TDesC& path = aPath;
213 TestDelimitedDataRemainderReverseL(_L("Test TDelimitedPathSegmentParser Remainder, ParseReverse"), iTestHarness, path, list1, list2);
214 VA_END(list1); VA_END(list2);
217 void CDelimitedPathSegmentTest::TestDelimitedPathSegmentDesL(const TDesC& aPath) const
219 TestDelimitedDataDesL(_L("Test TDelimitedPathSegmentParser Des"), iTestHarness, aPath);
222 void CDelimitedPathSegmentTest::TestDelimitedPathSegmentPushFrontL(TRefByValue<const TDesC> aPath, ...) const
224 VA_LIST list1; VA_START(list1, aPath);
225 VA_LIST list2; VA_START(list2, aPath);
226 const TDesC& path = aPath;
228 TestDelimitedDataPushFrontL(_L("Test CDelimitedPathSegment PushFront"), iTestHarness, path, list1, list2);
233 void CDelimitedPathSegmentTest::TestDelimitedPathSegmentPushBackL(TRefByValue<const TDesC> aPath, ...) const
235 VA_LIST list1; VA_START(list1, aPath);
236 VA_LIST list2; VA_START(list2, aPath);
237 const TDesC& path = aPath;
239 TestDelimitedDataPushBackL(_L("Test CDelimitedPathSegment PushBack"), iTestHarness, path, list1, list2);
240 VA_END(list1); VA_END(list2);
243 void CDelimitedPathSegmentTest::TestDelimitedPathSegmentPopFrontL(TRefByValue<const TDesC> aPath, ...) const
245 VA_LIST list1; VA_START(list1, aPath);
246 VA_LIST list2; VA_START(list2, aPath);
247 const TDesC& path = aPath;
249 TestDelimitedDataPopFrontL(_L("Test CDelimitedPathSegment PopFront"), iTestHarness, path, list1, list2);
250 VA_END(list1); VA_END(list2);
253 void CDelimitedPathSegmentTest::TestDelimitedPathSegmentPopBackL(TRefByValue<const TDesC> aPath, ...) const
255 VA_LIST list1; VA_START(list1, aPath);
256 VA_LIST list2; VA_START(list2, aPath);
257 const TDesC& path = aPath;
259 TestDelimitedDataPopBackL(_L("Test CDelimitedPathSegment PopBack"), iTestHarness, path, list1, list2);
260 VA_END(list1); VA_END(list2);
263 void CDelimitedPathSegmentTest::TestDelimitedPathSegmentAddAndTrimFrontAndBackDelimiterL(const TDesC& aPath) const
265 TestDelimitedDataAddAndTrimFrontAndBackDelimiterL(_L("Test CDelimitedPathSegment Add and Trim Front and Back delimiter"), iTestHarness, aPath);
268 void CDelimitedPathSegmentTest::TestDelimitedPathSegmentInsertAndParseL(TInt aStartPos, TRefByValue<const TDesC> aPath, ...) const
270 VA_LIST list1; VA_START(list1, aPath);
271 VA_LIST list2; VA_START(list2, aPath);
272 const TDesC& path = aPath;
274 TestDelimitedDataInsertAndParseL(_L("Test CDelimitedPathSegment InsertCurrent, Parse"), iTestHarness, path, list1, list2, aStartPos);
275 VA_END(list1); VA_END(list2);
278 void CDelimitedPathSegmentTest::TestDelimitedPathSegmentRemoveAndParseL(TInt aStartPos, TRefByValue<const TDesC> aPath, ...) const
280 VA_LIST list1; VA_START(list1, aPath);
281 VA_LIST list2; VA_START(list2, aPath);
282 const TDesC& path = aPath;
284 TestDelimitedDataRemoveAndParseL(_L("Test CDelimitedPathSegment RemoveCurrent, Parse"), iTestHarness, path, list1, list2, aStartPos);
285 VA_END(list1); VA_END(list2);
288 void CDelimitedPathSegmentTest::TestDelimitedPathSegmentInsertAndParseReverseL(TInt aStartPos, TRefByValue<const TDesC> aPath, ...) const
290 VA_LIST list1; VA_START(list1, aPath);
291 VA_LIST list2; VA_START(list2, aPath);
292 const TDesC& path = aPath;
294 TestDelimitedDataInsertAndParseReverseL(_L("Test CDelimitedPathSegment InsertCurrent, ParseReverse"), iTestHarness, path, list1, list2, aStartPos);
295 VA_END(list1); VA_END(list2);
298 void CDelimitedPathSegmentTest::TestDelimitedPathSegmentRemoveAndParseReverseL(TInt aStartPos, TRefByValue<const TDesC> aPath, ...) const
300 VA_LIST list1; VA_START(list1, aPath);
301 VA_LIST list2; VA_START(list2, aPath);
302 const TDesC& path = aPath;
304 TestDelimitedDataRemoveAndParseReverseL(_L("Test CDelimitedPathSegment RemoveCurrent, ParseReverse"), iTestHarness, path, list1, list2, aStartPos);
305 VA_END(list1); VA_END(list2);
308 void CDelimitedPathSegmentTest::TestDelimitedPathSegmentInsertEscapeAndParseL(TInt aStartPos, TRefByValue<const TDesC> aPath, ...) const
310 VA_LIST list1; VA_START(list1, aPath);
311 VA_LIST list2; VA_START(list2, aPath);
312 const TDesC& path = aPath;
314 TestDelimitedDataInsertEscapeAndParseL(_L("Test CDelimitedPathSegment InsertAndEscapeCurrent, Parse"), iTestHarness, path, list1, list2, aStartPos);
315 VA_END(list1); VA_END(list2);
318 void CDelimitedPathSegmentTest::TestDelimitedPathSegmentInsertEscapeAndParseReverseL(TInt aStartPos, TRefByValue<const TDesC> aPath, ...) const
320 VA_LIST list1; VA_START(list1, aPath);
321 VA_LIST list2; VA_START(list2, aPath);
322 const TDesC& path = aPath;
324 TestDelimitedDataInsertEscapeAndParseReverseL(_L("Test CDelimitedPathSegment InsertAndEscapeCurrent, ParseReverse"), iTestHarness, path, list1, list2, aStartPos);
325 VA_END(list1); VA_END(list2);
328 void CDelimitedPathSegmentTest::TestDelimitedPathSegmentPushAndEscapeFrontL(TRefByValue<const TDesC> aPath, ...) const
330 VA_LIST list1; VA_START(list1, aPath);
331 VA_LIST list2; VA_START(list2, aPath);
332 const TDesC& path = aPath;
334 TestDelimitedDataPushAndEscapeFrontL(_L("Test CDelimitedPathSegment PushAndEscapeFront"), iTestHarness, path, list1, list2);
335 VA_END(list1); VA_END(list2);
338 void CDelimitedPathSegmentTest::TestDelimitedPathSegmentPushAndEscapeBackL(TRefByValue<const TDesC> aPath, ...) const
340 VA_LIST list1; VA_START(list1, aPath);
341 VA_LIST list2; VA_START(list2, aPath);
342 const TDesC& path = aPath;
344 TestDelimitedDataPushAndEscapeBackL(_L("Test CDelimitedPathSegment PushAndEscapeBack"), iTestHarness, path, list1, list2);
345 VA_END(list1); VA_END(list2);
349 // Implementation of LOCAL functions - test funcions
353 void TestDelimitedDataExtractionL(const TDesC& aTestTitle, CIpuTestHarness* aTestHarness,
354 const TDesC& aData, VA_LIST& aList1, VA_LIST& aList2) {
356 HBufC* title16Bit = HBufC::NewLC(aTestTitle.Length() + KTitle16Bit().Length());
357 title16Bit->Des().Format(KTitle16Bit, &aTestTitle);
358 aTestHarness->StartTestL(*title16Bit);
360 // Create TDelimitedPathSegmentParser object and do parsing
361 TDelimitedPathSegmentParser16 parser16Bit;
362 parser16Bit.Parse(aData);
364 TInt error = DoDelimitedDataParsingL<HBufC16, TPtrC16>(parser16Bit, aList1);
366 CleanupStack::PopAndDestroy(title16Bit); // title16Bit
367 aTestHarness->EndTest(error);
370 HBufC8* dataBuf = HBufC8::NewLC(aData.Length());
371 TPtr8 data8Bit = dataBuf->Des();
372 data8Bit.Copy(aData);
374 HBufC* title8Bit = HBufC::NewLC(aTestTitle.Length() + KTitle8Bit().Length());
375 title8Bit->Des().Format(KTitle8Bit, &aTestTitle);
376 aTestHarness->StartTestL(*title8Bit);
378 // Create TDelimitedPathSegmentParser object and do parsing
379 TDelimitedPathSegmentParser8 parser8Bit;
380 parser8Bit.Parse(data8Bit);
382 error = DoDelimitedDataParsingL<HBufC8, TPtrC8>(parser8Bit, aList2);
384 aTestHarness->EndTest(error);
385 CleanupStack::PopAndDestroy(2, dataBuf); // dataBuf, title8Bit
388 void TestDelimitedDataReverseExtractionL(const TDesC& aTestTitle, CIpuTestHarness* aTestHarness,
389 const TDesC& aData, VA_LIST& aList1, VA_LIST& aList2)
392 HBufC* title16Bit = HBufC::NewLC(aTestTitle.Length() + KTitle16Bit().Length());
393 title16Bit->Des().Format(KTitle16Bit, &aTestTitle);
394 aTestHarness->StartTestL(*title16Bit);
396 // Create TDelimitedPathSegmentParser object and do parsing
397 TDelimitedPathSegmentParser16 parser16Bit;
398 parser16Bit.ParseReverse(aData);
400 TInt error = DoDelimitedDataParsingL<HBufC16, TPtrC16>(parser16Bit, aList1);
402 CleanupStack::PopAndDestroy(title16Bit); // title16Bit
403 aTestHarness->EndTest(error);
406 HBufC8* dataBuf = HBufC8::NewLC(aData.Length());
407 TPtr8 data8Bit = dataBuf->Des();
408 data8Bit.Copy(aData);
411 HBufC* title8Bit = HBufC::NewLC(aTestTitle.Length() + KTitle8Bit().Length());
412 title8Bit->Des().Format(KTitle8Bit, &aTestTitle);
413 aTestHarness->StartTestL(*title8Bit);
415 // Create TDelimitedPathSegmentParser object and do parsing
416 TDelimitedPathSegmentParser8 parser8Bit;
417 parser8Bit.ParseReverse(data8Bit);
419 error = DoDelimitedDataParsingL<HBufC8, TPtrC8>(parser8Bit, aList2);
421 aTestHarness->EndTest(error);
422 CleanupStack::PopAndDestroy(2, dataBuf); // dataBuf, title8Bit
425 void TestDelimitedDataDelimiterPresenceL(const TDesC& aTestTitle, CIpuTestHarness* aTestHarness,
426 const TDesC& aData, TBool aFrontDelim, TBool aBackDelim)
429 HBufC* title16Bit = HBufC::NewLC(aTestTitle.Length() + KTitle16Bit().Length());
430 title16Bit->Des().Format(KTitle16Bit, &aTestTitle);
431 aTestHarness->StartTestL(*title16Bit);
433 // Create TDelimitedPathSegmentParser object
434 TDelimitedPathSegmentParser16 parser16Bit;
435 parser16Bit.Parse(aData);
436 TInt error = DoDelimiterPresenceTest(parser16Bit, aFrontDelim, aBackDelim);
438 CleanupStack::PopAndDestroy(title16Bit); // title16Bit
439 aTestHarness->EndTest(error);
442 HBufC8* dataBuf = HBufC8::NewLC(aData.Length());
443 TPtr8 data8Bit = dataBuf->Des();
444 data8Bit.Copy(aData);
447 HBufC* title8Bit = HBufC::NewLC(aTestTitle.Length() + KTitle8Bit().Length());
448 title8Bit->Des().Format(KTitle8Bit, &aTestTitle);
449 aTestHarness->StartTestL(*title8Bit);
451 // Create TDelimitedPathSegmentParser object
452 TDelimitedPathSegmentParser8 parser8Bit;
453 parser8Bit.Parse(data8Bit);
454 error = DoDelimiterPresenceTest(parser8Bit, aFrontDelim, aBackDelim);
456 aTestHarness->EndTest(error);
457 CleanupStack::PopAndDestroy(2, dataBuf); // dataBuf, title8Bit
460 void TestDelimitedDataRemainderL(const TDesC& aTestTitle, CIpuTestHarness* aTestHarness,
461 const TDesC& aData, VA_LIST& aList1, VA_LIST& aList2)
464 HBufC* title16Bit = HBufC::NewLC(aTestTitle.Length() + KTitle16Bit().Length());
465 title16Bit->Des().Format(KTitle16Bit, &aTestTitle);
466 aTestHarness->StartTestL(*title16Bit);
468 // Create TDelimiteddataParser object and do parsing
469 TDelimitedPathSegmentParser16 parser16Bit;
470 parser16Bit.Parse(aData);
472 TInt error = DoDelimitedDataRemainderTestL<HBufC16, TPtrC16>(parser16Bit, aList1);
474 CleanupStack::PopAndDestroy(title16Bit); // title16Bit
475 aTestHarness->EndTest(error);
478 HBufC8* dataBuf = HBufC8::NewLC(aData.Length());
479 TPtr8 data8Bit = dataBuf->Des();
480 data8Bit.Copy(aData);
483 HBufC* title8Bit = HBufC::NewLC(aTestTitle.Length() + KTitle8Bit().Length());
484 title8Bit->Des().Format(KTitle8Bit, &aTestTitle);
485 aTestHarness->StartTestL(*title8Bit);
487 // Create TDelimiteddataParser object and do parsing
488 TDelimitedPathSegmentParser8 parser8Bit;
489 parser8Bit.Parse(data8Bit);
491 error = DoDelimitedDataRemainderTestL<HBufC8, TPtrC8>(parser8Bit, aList2);
493 aTestHarness->EndTest(error);
494 CleanupStack::PopAndDestroy(2, dataBuf); // dataBuf, title8Bit
497 void TestDelimitedDataRemainderReverseL(const TDesC& aTestTitle, CIpuTestHarness* aTestHarness,
498 const TDesC& aData, VA_LIST& aList1, VA_LIST& aList2)
501 HBufC* title16Bit = HBufC::NewLC(aTestTitle.Length() + KTitle16Bit().Length());
502 title16Bit->Des().Format(KTitle16Bit, &aTestTitle);
503 aTestHarness->StartTestL(*title16Bit);
505 // Create TDelimitedPathSegmentParser object and do parsing
506 TDelimitedPathSegmentParser16 parser16Bit;
507 parser16Bit.ParseReverse(aData);
509 TInt error = DoDelimitedDataRemainderTestL<HBufC16, TPtrC16>(parser16Bit, aList1);
511 CleanupStack::PopAndDestroy(title16Bit); // title16Bit
512 aTestHarness->EndTest(error);
515 HBufC8* dataBuf = HBufC8::NewLC(aData.Length());
516 TPtr8 data8Bit = dataBuf->Des();
517 data8Bit.Copy(aData);
520 HBufC* title8Bit = HBufC::NewLC(aTestTitle.Length() + KTitle8Bit().Length());
521 title8Bit->Des().Format(KTitle8Bit, &aTestTitle);
522 aTestHarness->StartTestL(*title8Bit);
524 // Create TDelimitedPathSegmentParser object and do parsing
525 TDelimitedPathSegmentParser8 parser8Bit;
526 parser8Bit.ParseReverse(data8Bit);
528 error = DoDelimitedDataRemainderTestL<HBufC8, TPtrC8>(parser8Bit, aList2);
530 aTestHarness->EndTest(error);
531 CleanupStack::PopAndDestroy(2, dataBuf); // dataBuf, title8Bit
534 void TestDelimitedDataDesL(const TDesC& aTestTitle, CIpuTestHarness* aTestHarness, const TDesC& aData)
537 HBufC* title16Bit = HBufC::NewLC(aTestTitle.Length() + KTitle16Bit().Length());
538 title16Bit->Des().Format(KTitle16Bit, &aTestTitle);
539 aTestHarness->StartTestL(*title16Bit);
541 // Create TDelimitedPathSegmentParser object and do parsing
542 TDelimitedPathSegmentParser16 parser16Bit;
543 parser16Bit.Parse(aData);
545 TInt error = DoDelimitedDataDes(parser16Bit, aData);
547 CleanupStack::PopAndDestroy(title16Bit); // title16Bit
548 aTestHarness->EndTest(error);
551 HBufC8* dataBuf = HBufC8::NewLC(aData.Length());
552 TPtr8 data8Bit = dataBuf->Des();
553 data8Bit.Copy(aData);
556 HBufC* title8Bit = HBufC::NewLC(aTestTitle.Length() + KTitle8Bit().Length());
557 title8Bit->Des().Format(KTitle8Bit, &aTestTitle);
558 aTestHarness->StartTestL(*title8Bit);
560 // Create TDelimitedPathSegmentParser object and do parsing
561 TDelimitedPathSegmentParser8 parser8Bit;
562 parser8Bit.Parse(data8Bit);
564 error = DoDelimitedDataDes(parser8Bit, data8Bit);
566 aTestHarness->EndTest(error);
567 CleanupStack::PopAndDestroy(2, dataBuf); // dataBuf, title8Bit
570 void TestDelimitedDataPushFrontL(const TDesC& aTestTitle, CIpuTestHarness* aTestHarness,
571 const TDesC& aData, VA_LIST& aList1, VA_LIST& aList2)
574 HBufC* title16Bit = HBufC::NewLC(aTestTitle.Length() + KTitle16Bit().Length());
575 title16Bit->Des().Format(KTitle16Bit, &aTestTitle);
576 aTestHarness->StartTestL(*title16Bit);
578 // Create TDelimitedPathSegmentParser object and do parsing
579 CDelimitedPathSegment16* data16Bit = CDelimitedPathSegment16::NewL(aData); // Also excersies NewLC()
580 CleanupStack::PushL(data16Bit);
582 TInt error = DoDelimitedDataPushFrontL<HBufC16>(data16Bit, aList1);
584 CleanupStack::PopAndDestroy(2, title16Bit); // title16Bit, data16Bit
585 aTestHarness->EndTest(error);
588 HBufC8* dataBuf = HBufC8::NewLC(aData.Length());
589 TPtr8 initData8Bit = dataBuf->Des();
590 initData8Bit.Copy(aData);
593 HBufC* title8Bit = HBufC::NewLC(aTestTitle.Length() + KTitle8Bit().Length());
594 title8Bit->Des().Format(KTitle8Bit, &aTestTitle);
595 aTestHarness->StartTestL(*title8Bit);
597 // Create TDelimitedPathSegmentParser object and do parsing
598 CDelimitedPathSegment8* data8Bit = CDelimitedPathSegment8::NewL(initData8Bit); // Also excersies NewLC()
599 CleanupStack::PushL(data8Bit);
601 error = DoDelimitedDataPushFrontL<HBufC8>(data8Bit, aList2);
603 aTestHarness->EndTest(error);
604 CleanupStack::PopAndDestroy(3, dataBuf); // dataBuf, title8Bit, data8Bit
607 void TestDelimitedDataPushAndEscapeFrontL(const TDesC& aTestTitle, CIpuTestHarness* aTestHarness,
608 const TDesC& aData, VA_LIST& aList1, VA_LIST& aList2)
611 HBufC* title16Bit = HBufC::NewLC(aTestTitle.Length() + KTitle16Bit().Length());
612 title16Bit->Des().Format(KTitle16Bit, &aTestTitle);
613 aTestHarness->StartTestL(*title16Bit);
615 // Create TDelimitedPathSegmentParser object and do parsing
616 CDelimitedPathSegment16* data16Bit = CDelimitedPathSegment16::NewL(aData); // Also excersies NewLC()
617 CleanupStack::PushL(data16Bit);
619 TInt error = DoDelimitedDataPushAndEscapeFrontL<HBufC16>(data16Bit, aList1);
621 CleanupStack::PopAndDestroy(2, title16Bit); // title16Bit, data16Bit
622 aTestHarness->EndTest(error);
625 HBufC8* dataBuf = HBufC8::NewLC(aData.Length());
626 TPtr8 initData8Bit = dataBuf->Des();
627 initData8Bit.Copy(aData);
630 HBufC* title8Bit = HBufC::NewLC(aTestTitle.Length() + KTitle8Bit().Length());
631 title8Bit->Des().Format(KTitle8Bit, &aTestTitle);
632 aTestHarness->StartTestL(*title8Bit);
634 // Create TDelimitedPathSegmentParser object and do parsing
635 CDelimitedPathSegment8* data8Bit = CDelimitedPathSegment8::NewL(initData8Bit); // Also excersies NewLC()
636 CleanupStack::PushL(data8Bit);
638 error = DoDelimitedDataPushAndEscapeFrontL<HBufC8>(data8Bit, aList2);
640 aTestHarness->EndTest(error);
641 CleanupStack::PopAndDestroy(3, dataBuf); // dataBuf, title8Bit, data8Bit
644 void TestDelimitedDataPushBackL(const TDesC& aTestTitle, CIpuTestHarness* aTestHarness,
645 const TDesC& aData, VA_LIST& aList1, VA_LIST& aList2)
648 HBufC* title16Bit = HBufC::NewLC(aTestTitle.Length() + KTitle16Bit().Length());
649 title16Bit->Des().Format(KTitle16Bit, &aTestTitle);
650 aTestHarness->StartTestL(*title16Bit);
652 // Create TDelimitedPathSegmentParser object and do parsing
653 CDelimitedPathSegment16* data16Bit = CDelimitedPathSegment16::NewL(aData); // Also excersies NewLC()
654 CleanupStack::PushL(data16Bit);
656 TInt error = DoDelimitedDataPushBackL<HBufC16>(data16Bit, aList1);
658 CleanupStack::PopAndDestroy(2, title16Bit); // title16Bit, data16Bit
659 aTestHarness->EndTest(error);
662 HBufC8* dataBuf = HBufC8::NewLC(aData.Length());
663 TPtr8 initData8Bit = dataBuf->Des();
664 initData8Bit.Copy(aData);
667 HBufC* title8Bit = HBufC::NewLC(aTestTitle.Length() + KTitle8Bit().Length());
668 title8Bit->Des().Format(KTitle8Bit, &aTestTitle);
669 aTestHarness->StartTestL(*title8Bit);
671 // Create TDelimitedPathSegmentParser object and do parsing
672 CDelimitedPathSegment8* data8Bit = CDelimitedPathSegment8::NewL(initData8Bit); // Also excersies NewLC()
673 CleanupStack::PushL(data8Bit);
675 error = DoDelimitedDataPushBackL<HBufC8>(data8Bit, aList2);
677 aTestHarness->EndTest(error);
678 CleanupStack::PopAndDestroy(3, dataBuf); // dataBuf, title8Bit, data8Bit
681 void TestDelimitedDataPushAndEscapeBackL(const TDesC& aTestTitle, CIpuTestHarness* aTestHarness,
682 const TDesC& aData, VA_LIST& aList1, VA_LIST& aList2)
685 HBufC* title16Bit = HBufC::NewLC(aTestTitle.Length() + KTitle16Bit().Length());
686 title16Bit->Des().Format(KTitle16Bit, &aTestTitle);
687 aTestHarness->StartTestL(*title16Bit);
689 // Create TDelimitedPathSegmentParser object and do parsing
690 CDelimitedPathSegment16* data16Bit = CDelimitedPathSegment16::NewL(aData); // Also excersies NewLC()
691 CleanupStack::PushL(data16Bit);
693 TInt error = DoDelimitedDataPushAndEscapeBackL<HBufC16>(data16Bit, aList1);
695 CleanupStack::PopAndDestroy(2, title16Bit); // title16Bit, data16Bit
696 aTestHarness->EndTest(error);
699 HBufC8* dataBuf = HBufC8::NewLC(aData.Length());
700 TPtr8 initData8Bit = dataBuf->Des();
701 initData8Bit.Copy(aData);
704 HBufC* title8Bit = HBufC::NewLC(aTestTitle.Length() + KTitle8Bit().Length());
705 title8Bit->Des().Format(KTitle8Bit, &aTestTitle);
706 aTestHarness->StartTestL(*title8Bit);
708 // Create TDelimitedPathSegmentParser object and do parsing
709 CDelimitedPathSegment8* data8Bit = CDelimitedPathSegment8::NewL(initData8Bit); // Also excersies NewLC()
710 CleanupStack::PushL(data8Bit);
712 error = DoDelimitedDataPushAndEscapeBackL<HBufC8>(data8Bit, aList2);
714 aTestHarness->EndTest(error);
715 CleanupStack::PopAndDestroy(3, dataBuf); // dataBuf, title8Bit, data8Bit
718 void TestDelimitedDataPopFrontL(const TDesC& aTestTitle, CIpuTestHarness* aTestHarness,
719 const TDesC& aData, VA_LIST& aList1, VA_LIST& aList2)
722 HBufC* title16Bit = HBufC::NewLC(aTestTitle.Length() + KTitle16Bit().Length());
723 title16Bit->Des().Format(KTitle16Bit, &aTestTitle);
724 aTestHarness->StartTestL(*title16Bit);
726 // Create TDelimitedPathSegmentParser object and do parsing
727 CDelimitedPathSegment16* data16Bit = CDelimitedPathSegment16::NewL(aData); // Also excersies NewLC()
728 CleanupStack::PushL(data16Bit);
730 TInt error = DoDelimitedDataPopFrontL<HBufC16>(data16Bit, aList1);
732 CleanupStack::PopAndDestroy(2, title16Bit); // title16Bit, data16Bit
733 aTestHarness->EndTest(error);
736 HBufC8* dataBuf = HBufC8::NewLC(aData.Length());
737 TPtr8 initData8Bit = dataBuf->Des();
738 initData8Bit.Copy(aData);
741 HBufC* title8Bit = HBufC::NewLC(aTestTitle.Length() + KTitle8Bit().Length());
742 title8Bit->Des().Format(KTitle8Bit, &aTestTitle);
743 aTestHarness->StartTestL(*title8Bit);
745 // Create TDelimitedPathSegmentParser object and do parsing
746 CDelimitedPathSegment8* data8Bit = CDelimitedPathSegment8::NewL(initData8Bit); // Also excersies NewLC()
747 CleanupStack::PushL(data8Bit);
749 error = DoDelimitedDataPopFrontL<HBufC8>(data8Bit, aList2);
751 aTestHarness->EndTest(error);
752 CleanupStack::PopAndDestroy(3, dataBuf); // dataBuf, title8Bit, data8Bit
755 void TestDelimitedDataPopBackL(const TDesC& aTestTitle, CIpuTestHarness* aTestHarness,
756 const TDesC& aData, VA_LIST& aList1, VA_LIST& aList2)
759 HBufC* title16Bit = HBufC::NewLC(aTestTitle.Length() + KTitle16Bit().Length());
760 title16Bit->Des().Format(KTitle16Bit, &aTestTitle);
761 aTestHarness->StartTestL(*title16Bit);
763 // Create TDelimitedPathSegmentParser object and do parsing
764 CDelimitedPathSegment16* data16Bit = CDelimitedPathSegment16::NewL(aData); // Also excersies NewLC()
765 CleanupStack::PushL(data16Bit);
767 TInt error = DoDelimitedDataPopBackL<HBufC16>(data16Bit, aList1);
769 CleanupStack::PopAndDestroy(2, title16Bit); // title16Bit, data16Bit
770 aTestHarness->EndTest(error);
773 HBufC8* dataBuf = HBufC8::NewLC(aData.Length());
774 TPtr8 initData8Bit = dataBuf->Des();
775 initData8Bit.Copy(aData);
778 HBufC* title8Bit = HBufC::NewLC(aTestTitle.Length() + KTitle8Bit().Length());
779 title8Bit->Des().Format(KTitle8Bit, &aTestTitle);
780 aTestHarness->StartTestL(*title8Bit);
782 // Create TDelimitedPathSegmentParser object and do parsing
783 CDelimitedPathSegment8* data8Bit = CDelimitedPathSegment8::NewL(initData8Bit); // Also excersies NewLC()
784 CleanupStack::PushL(data8Bit);
786 error = DoDelimitedDataPopBackL<HBufC8>(data8Bit, aList2);
788 aTestHarness->EndTest(error);
789 CleanupStack::PopAndDestroy(3, dataBuf); // dataBuf, title8Bit, data8Bit
792 void TestDelimitedDataAddAndTrimFrontAndBackDelimiterL(const TDesC& aTestTitle, CIpuTestHarness* aTestHarness, const TDesC& aData)
795 HBufC* title16Bit = HBufC::NewLC(aTestTitle.Length() + KTitle16Bit().Length());
796 title16Bit->Des().Format(KTitle16Bit, &aTestTitle);
797 aTestHarness->StartTestL(*title16Bit);
799 // Create TDelimitedPathSegmentParser object and do parsing
800 CDelimitedPathSegment16* data16Bit = CDelimitedPathSegment16::NewL(aData); // Also excersies NewLC()
801 CleanupStack::PushL(data16Bit);
803 TInt error = DoDelimitedDataAddAndTrimFrontAndBackDelimiterL(data16Bit);
805 CleanupStack::PopAndDestroy(2, title16Bit); // title16Bit, data16Bit
806 aTestHarness->EndTest(error);
809 HBufC8* dataBuf = HBufC8::NewLC(aData.Length());
810 TPtr8 initData8Bit = dataBuf->Des();
811 initData8Bit.Copy(aData);
814 HBufC* title8Bit = HBufC::NewLC(aTestTitle.Length() + KTitle8Bit().Length());
815 title8Bit->Des().Format(KTitle8Bit, &aTestTitle);
816 aTestHarness->StartTestL(*title8Bit);
818 // Create TDelimitedPathSegmentParser object and do parsing
819 CDelimitedPathSegment8* data8Bit = CDelimitedPathSegment8::NewL(initData8Bit); // Also excersies NewLC()
820 CleanupStack::PushL(data8Bit);
822 error = DoDelimitedDataAddAndTrimFrontAndBackDelimiterL(data8Bit);
824 aTestHarness->EndTest(error);
825 CleanupStack::PopAndDestroy(3, dataBuf); // dataBuf, title8Bit, data8Bit
828 void TestDelimitedDataInsertAndParseL(const TDesC& aTestTitle, CIpuTestHarness* aTestHarness,
829 const TDesC& aData, VA_LIST& aList1, VA_LIST& aList2, TInt aStartPos)
832 HBufC* title16Bit = HBufC::NewLC(aTestTitle.Length() + KTitle16Bit().Length());
833 title16Bit->Des().Format(KTitle16Bit, &aTestTitle);
834 aTestHarness->StartTestL(*title16Bit);
836 // Create TDelimitedPathSegmentParser object and do parsing
837 CDelimitedPathSegment16* data16Bit = CDelimitedPathSegment16::NewL(aData); // Also excersies NewLC()
838 CleanupStack::PushL(data16Bit);
840 // Do initial parse and get to position
842 TInt error = DoDelimitedDataParseToPosition(data16Bit, aStartPos);
843 if( error == KErrNone )
845 error = DoDelimitedDataInsertL<HBufC16, TPtrC16>(data16Bit, aList1);
847 CleanupStack::PopAndDestroy(2, title16Bit); // title16Bit, data16Bit
848 aTestHarness->EndTest(error);
851 HBufC8* dataBuf = HBufC8::NewLC(aData.Length());
852 TPtr8 initData8Bit = dataBuf->Des();
853 initData8Bit.Copy(aData);
856 HBufC* title8Bit = HBufC::NewLC(aTestTitle.Length() + KTitle8Bit().Length());
857 title8Bit->Des().Format(KTitle8Bit, &aTestTitle);
858 aTestHarness->StartTestL(*title8Bit);
860 // Create TDelimitedPathSegmentParser object and do parsing
861 CDelimitedPathSegment8* data8Bit = CDelimitedPathSegment8::NewL(initData8Bit); // Also excersies NewLC()
862 CleanupStack::PushL(data8Bit);
864 // Do initial parse and get to position
866 error = DoDelimitedDataParseToPosition(data8Bit, aStartPos);
867 if( error == KErrNone )
869 error = DoDelimitedDataInsertL<HBufC8, TPtrC8>(data8Bit, aList2);
871 aTestHarness->EndTest(error);
872 CleanupStack::PopAndDestroy(3, dataBuf); // dataBuf, title8Bit, data8Bit
875 void TestDelimitedDataRemoveAndParseL(const TDesC& aTestTitle, CIpuTestHarness* aTestHarness,
876 const TDesC& aData, VA_LIST& aList1, VA_LIST& aList2, TInt aStartPos)
879 HBufC* title16Bit = HBufC::NewLC(aTestTitle.Length() + KTitle16Bit().Length());
880 title16Bit->Des().Format(KTitle16Bit, &aTestTitle);
881 aTestHarness->StartTestL(*title16Bit);
883 // Create TDelimitedPathSegmentParser object and do parsing
884 CDelimitedPathSegment16* data16Bit = CDelimitedPathSegment16::NewL(aData); // Also excersies NewLC()
885 CleanupStack::PushL(data16Bit);
887 // Do initial parse and get to position
889 TInt error = DoDelimitedDataParseToPosition(data16Bit, aStartPos);
890 if( error == KErrNone )
892 error = DoDelimitedDataRemoveL<HBufC16, TPtrC16>(data16Bit, aList1);
894 CleanupStack::PopAndDestroy(2, title16Bit); // title16Bit, data16Bit
895 aTestHarness->EndTest(error);
898 HBufC8* dataBuf = HBufC8::NewLC(aData.Length());
899 TPtr8 initData8Bit = dataBuf->Des();
900 initData8Bit.Copy(aData);
903 HBufC* title8Bit = HBufC::NewLC(aTestTitle.Length() + KTitle8Bit().Length());
904 title8Bit->Des().Format(KTitle8Bit, &aTestTitle);
905 aTestHarness->StartTestL(*title8Bit);
907 // Create TDelimitedPathSegmentParser object and do parsing
908 CDelimitedPathSegment8* data8Bit = CDelimitedPathSegment8::NewL(initData8Bit); // Also excersies NewLC()
909 CleanupStack::PushL(data8Bit);
911 // Do initial parse and get to position
913 error = DoDelimitedDataParseToPosition(data8Bit, aStartPos);
914 if( error == KErrNone )
916 error = DoDelimitedDataRemoveL<HBufC8, TPtrC8>(data8Bit, aList2);
918 aTestHarness->EndTest(error);
919 CleanupStack::PopAndDestroy(3, dataBuf); // dataBuf, title8Bit, data8Bit
922 void TestDelimitedDataInsertAndParseReverseL(const TDesC& aTestTitle, CIpuTestHarness* aTestHarness,
923 const TDesC& aData, VA_LIST& aList1, VA_LIST& aList2, TInt aStartPos)
926 HBufC* title16Bit = HBufC::NewLC(aTestTitle.Length() + KTitle16Bit().Length());
927 title16Bit->Des().Format(KTitle16Bit, &aTestTitle);
928 aTestHarness->StartTestL(*title16Bit);
930 // Create TDelimitedPathSegmentParser object and do parsing
931 CDelimitedPathSegment16* data16Bit = CDelimitedPathSegment16::NewL(aData); // Also excersies NewLC()
932 CleanupStack::PushL(data16Bit);
934 // Do initial parse and get to position
935 data16Bit->ParseReverse();
936 TInt error = DoDelimitedDataParseToPosition(data16Bit, aStartPos);
937 if( error == KErrNone )
939 error = DoDelimitedDataInsertL<HBufC16, TPtrC16>(data16Bit, aList1);
941 CleanupStack::PopAndDestroy(2, title16Bit); // title16Bit, data16Bit
942 aTestHarness->EndTest(error);
945 HBufC8* dataBuf = HBufC8::NewLC(aData.Length());
946 TPtr8 initData8Bit = dataBuf->Des();
947 initData8Bit.Copy(aData);
950 HBufC* title8Bit = HBufC::NewLC(aTestTitle.Length() + KTitle8Bit().Length());
951 title8Bit->Des().Format(KTitle8Bit, &aTestTitle);
952 aTestHarness->StartTestL(*title8Bit);
954 // Create TDelimitedPathSegmentParser object and do parsing
955 CDelimitedPathSegment8* data8Bit = CDelimitedPathSegment8::NewL(initData8Bit); // Also excersies NewLC()
956 CleanupStack::PushL(data8Bit);
958 // Do initial parse and get to position
959 data8Bit->ParseReverse();
960 error = DoDelimitedDataParseToPosition(data8Bit, aStartPos);
961 if( error == KErrNone )
963 error = DoDelimitedDataInsertL<HBufC8, TPtrC8>(data8Bit, aList2);
965 aTestHarness->EndTest(error);
966 CleanupStack::PopAndDestroy(3, dataBuf); // dataBuf, title8Bit, data8Bit
969 void TestDelimitedDataRemoveAndParseReverseL(const TDesC& aTestTitle, CIpuTestHarness* aTestHarness,
970 const TDesC& aData, VA_LIST& aList1, VA_LIST& aList2, TInt aStartPos)
973 HBufC* title16Bit = HBufC::NewLC(aTestTitle.Length() + KTitle16Bit().Length());
974 title16Bit->Des().Format(KTitle16Bit, &aTestTitle);
975 aTestHarness->StartTestL(*title16Bit);
977 // Create TDelimitedPathSegmentParser object and do parsing
978 CDelimitedPathSegment16* data16Bit = CDelimitedPathSegment16::NewL(aData); // Also excersies NewLC()
979 CleanupStack::PushL(data16Bit);
981 // Do initial parse and get to position
982 data16Bit->ParseReverse();
983 TInt error = DoDelimitedDataParseToPosition(data16Bit, aStartPos);
984 if( error == KErrNone )
986 error = DoDelimitedDataRemoveL<HBufC16, TPtrC16>(data16Bit, aList1);
988 CleanupStack::PopAndDestroy(2, title16Bit); // title16Bit, data16Bit
989 aTestHarness->EndTest(error);
992 HBufC8* dataBuf = HBufC8::NewLC(aData.Length());
993 TPtr8 initData8Bit = dataBuf->Des();
994 initData8Bit.Copy(aData);
997 HBufC* title8Bit = HBufC::NewLC(aTestTitle.Length() + KTitle8Bit().Length());
998 title8Bit->Des().Format(KTitle8Bit, &aTestTitle);
999 aTestHarness->StartTestL(*title8Bit);
1001 // Create TDelimitedPathSegmentParser object and do parsing
1002 CDelimitedPathSegment8* data8Bit = CDelimitedPathSegment8::NewL(initData8Bit); // Also excersies NewLC()
1003 CleanupStack::PushL(data8Bit);
1005 // Do initial parse and get to position
1006 data8Bit->ParseReverse();
1007 error = DoDelimitedDataParseToPosition(data8Bit, aStartPos);
1008 if( error == KErrNone )
1010 error = DoDelimitedDataRemoveL<HBufC8, TPtrC8>(data8Bit, aList2);
1012 aTestHarness->EndTest(error);
1013 CleanupStack::PopAndDestroy(3, dataBuf); // dataBuf, title8Bit, data8Bit
1016 void TestDelimitedDataInsertEscapeAndParseL(const TDesC& aTestTitle, CIpuTestHarness* aTestHarness,
1017 const TDesC& aData, VA_LIST& aList1, VA_LIST& aList2, TInt aStartPos)
1020 HBufC* title16Bit = HBufC::NewLC(aTestTitle.Length() + KTitle16Bit().Length());
1021 title16Bit->Des().Format(KTitle16Bit, &aTestTitle);
1022 aTestHarness->StartTestL(*title16Bit);
1024 // Create TDelimitedPathSegmentParser object and do parsing
1025 CDelimitedPathSegment16* data16Bit = CDelimitedPathSegment16::NewL(aData); // Also excersies NewLC()
1026 CleanupStack::PushL(data16Bit);
1028 // Do initial parse and get to position
1030 TInt error = DoDelimitedDataParseToPosition(data16Bit, aStartPos);
1031 if( error == KErrNone )
1033 error = DoDelimitedDataInsertAndEscapeL<HBufC16, TPtrC16>(data16Bit, aList1);
1035 CleanupStack::PopAndDestroy(2, title16Bit); // title16Bit, data16Bit
1036 aTestHarness->EndTest(error);
1039 HBufC8* dataBuf = HBufC8::NewLC(aData.Length());
1040 TPtr8 initData8Bit = dataBuf->Des();
1041 initData8Bit.Copy(aData);
1044 HBufC* title8Bit = HBufC::NewLC(aTestTitle.Length() + KTitle8Bit().Length());
1045 title8Bit->Des().Format(KTitle8Bit, &aTestTitle);
1046 aTestHarness->StartTestL(*title8Bit);
1048 // Create TDelimitedPathSegmentParser object and do parsing
1049 CDelimitedPathSegment8* data8Bit = CDelimitedPathSegment8::NewL(initData8Bit); // Also excersies NewLC()
1050 CleanupStack::PushL(data8Bit);
1052 // Do initial parse and get to position
1054 error = DoDelimitedDataParseToPosition(data8Bit, aStartPos);
1055 if( error == KErrNone )
1057 error = DoDelimitedDataInsertAndEscapeL<HBufC8, TPtrC8>(data8Bit, aList2);
1059 aTestHarness->EndTest(error);
1060 CleanupStack::PopAndDestroy(3, dataBuf); // dataBuf, title8Bit, data8Bit
1063 void TestDelimitedDataInsertEscapeAndParseReverseL(const TDesC& aTestTitle, CIpuTestHarness* aTestHarness,
1064 const TDesC& aData, VA_LIST& aList1, VA_LIST& aList2, TInt aStartPos)
1067 HBufC* title16Bit = HBufC::NewLC(aTestTitle.Length() + KTitle16Bit().Length());
1068 title16Bit->Des().Format(KTitle16Bit, &aTestTitle);
1069 aTestHarness->StartTestL(*title16Bit);
1071 // Create TDelimitedPathSegmentParser object and do parsing
1072 CDelimitedPathSegment16* data16Bit = CDelimitedPathSegment16::NewL(aData); // Also excersies NewLC()
1073 CleanupStack::PushL(data16Bit);
1075 // Do initial parse and get to position
1076 data16Bit->ParseReverse();
1077 TInt error = DoDelimitedDataParseToPosition(data16Bit, aStartPos);
1078 if( error == KErrNone )
1080 error = DoDelimitedDataInsertAndEscapeL<HBufC16, TPtrC16>(data16Bit, aList1);
1082 CleanupStack::PopAndDestroy(2, title16Bit); // title16Bit, data16Bit
1083 aTestHarness->EndTest(error);
1086 HBufC8* dataBuf = HBufC8::NewLC(aData.Length());
1087 TPtr8 initData8Bit = dataBuf->Des();
1088 initData8Bit.Copy(aData);
1091 HBufC* title8Bit = HBufC::NewLC(aTestTitle.Length() + KTitle8Bit().Length());
1092 title8Bit->Des().Format(KTitle8Bit, &aTestTitle);
1093 aTestHarness->StartTestL(*title8Bit);
1095 // Create TDelimitedPathSegmentParser object and do parsing
1096 CDelimitedPathSegment8* data8Bit = CDelimitedPathSegment8::NewL(initData8Bit); // Also excersies NewLC()
1097 CleanupStack::PushL(data8Bit);
1099 // Do initial parse and get to position
1100 data8Bit->ParseReverse();
1101 error = DoDelimitedDataParseToPosition(data8Bit, aStartPos);
1102 if( error == KErrNone )
1104 error = DoDelimitedDataInsertAndEscapeL<HBufC8, TPtrC8>(data8Bit, aList2);
1106 aTestHarness->EndTest(error);
1107 CleanupStack::PopAndDestroy(3, dataBuf); // dataBuf, title8Bit, data8Bit
1112 // Implementation of LOCAL functions - helper functions
1116 #include "TDelimitedDataCommon.cpp"