sl@0
|
1 |
// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
2 |
// All rights reserved.
|
sl@0
|
3 |
// This component and the accompanying materials are made available
|
sl@0
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
sl@0
|
5 |
// which accompanies this distribution, and is available
|
sl@0
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
7 |
//
|
sl@0
|
8 |
// Initial Contributors:
|
sl@0
|
9 |
// Nokia Corporation - initial contribution.
|
sl@0
|
10 |
//
|
sl@0
|
11 |
// Contributors:
|
sl@0
|
12 |
//
|
sl@0
|
13 |
// Description:
|
sl@0
|
14 |
//
|
sl@0
|
15 |
|
sl@0
|
16 |
#include "CDelimitedPathSegmentTest.h"
|
sl@0
|
17 |
|
sl@0
|
18 |
#include <e32base.h>
|
sl@0
|
19 |
#include <delimitedpathsegment16.h>
|
sl@0
|
20 |
#include <delimitedpathsegment8.h>
|
sl@0
|
21 |
|
sl@0
|
22 |
#include "TDelimitedDataCommon.h"
|
sl@0
|
23 |
#include "DelimitedPathSegmentTests.h"
|
sl@0
|
24 |
|
sl@0
|
25 |
// Constants
|
sl@0
|
26 |
//
|
sl@0
|
27 |
_LIT(KTitle16Bit, "%S (16-Bit)");
|
sl@0
|
28 |
_LIT(KTitle8Bit, "%S (8-Bit)");
|
sl@0
|
29 |
|
sl@0
|
30 |
CDelimitedPathSegmentTest* CDelimitedPathSegmentTest::NewLC(CIpuTestHarness* aTestHarness)
|
sl@0
|
31 |
{
|
sl@0
|
32 |
CDelimitedPathSegmentTest* self = new (ELeave) CDelimitedPathSegmentTest(aTestHarness);
|
sl@0
|
33 |
CleanupStack::PushL(self);
|
sl@0
|
34 |
self->ConstructL();
|
sl@0
|
35 |
return self;
|
sl@0
|
36 |
}
|
sl@0
|
37 |
|
sl@0
|
38 |
CDelimitedPathSegmentTest* CDelimitedPathSegmentTest::NewL(CIpuTestHarness* aTestHarness)
|
sl@0
|
39 |
{
|
sl@0
|
40 |
CDelimitedPathSegmentTest* self = CDelimitedPathSegmentTest::NewLC(aTestHarness);
|
sl@0
|
41 |
CleanupStack::Pop(self);
|
sl@0
|
42 |
return self;
|
sl@0
|
43 |
}
|
sl@0
|
44 |
|
sl@0
|
45 |
CDelimitedPathSegmentTest::CDelimitedPathSegmentTest(CIpuTestHarness* aTestHarness)
|
sl@0
|
46 |
: iTestHarness(aTestHarness)
|
sl@0
|
47 |
{
|
sl@0
|
48 |
}
|
sl@0
|
49 |
|
sl@0
|
50 |
void CDelimitedPathSegmentTest::ConstructL()
|
sl@0
|
51 |
{
|
sl@0
|
52 |
}
|
sl@0
|
53 |
|
sl@0
|
54 |
CDelimitedPathSegmentTest::~CDelimitedPathSegmentTest()
|
sl@0
|
55 |
{
|
sl@0
|
56 |
}
|
sl@0
|
57 |
|
sl@0
|
58 |
void CDelimitedPathSegmentTest::DoTestsL()
|
sl@0
|
59 |
{
|
sl@0
|
60 |
//
|
sl@0
|
61 |
//
|
sl@0
|
62 |
// Delimited PathSegment Tests
|
sl@0
|
63 |
//
|
sl@0
|
64 |
//
|
sl@0
|
65 |
|
sl@0
|
66 |
TestDelimitedPathSegmentExtractionL(KPathSegmentParse0, &KPathSegmentParse0Seg0(), &KPathSegmentParse0Seg1(),
|
sl@0
|
67 |
&KPathSegmentParse0Seg2(), NULL);
|
sl@0
|
68 |
TestDelimitedPathSegmentExtractionL(KPathSegmentParse1, &KPathSegmentParse1Seg0(), &KPathSegmentParse1Seg1(), &KPathSegmentParse1Seg2(),
|
sl@0
|
69 |
&KPathSegmentParse1Seg3(), NULL);
|
sl@0
|
70 |
TestDelimitedPathSegmentExtractionL(KPathSegmentParse2, &KPathSegmentParse2Seg0(), &KPathSegmentParse2Seg1(), &KPathSegmentParse2Seg2(),
|
sl@0
|
71 |
&KPathSegmentParse2Seg3(), &KPathSegmentParse2Seg4(), &KPathSegmentParse2Seg5(), &KPathSegmentParse2Seg6(),
|
sl@0
|
72 |
&KPathSegmentParse2Seg7(), NULL);
|
sl@0
|
73 |
|
sl@0
|
74 |
TestDelimitedPathSegmentReverseExtractionL(KPathSegmentParse0, &KPathSegmentParse0Seg2(),
|
sl@0
|
75 |
&KPathSegmentParse0Seg1(), &KPathSegmentParse0Seg0(), NULL);
|
sl@0
|
76 |
TestDelimitedPathSegmentReverseExtractionL(KPathSegmentParse1, &KPathSegmentParse1Seg3(), &KPathSegmentParse1Seg2(),
|
sl@0
|
77 |
&KPathSegmentParse1Seg1(), &KPathSegmentParse1Seg0(), NULL);
|
sl@0
|
78 |
TestDelimitedPathSegmentReverseExtractionL(KPathSegmentParse2, &KPathSegmentParse2Seg7(), &KPathSegmentParse2Seg6(),
|
sl@0
|
79 |
&KPathSegmentParse2Seg5(), &KPathSegmentParse2Seg4(), &KPathSegmentParse2Seg3(),
|
sl@0
|
80 |
&KPathSegmentParse2Seg2(), &KPathSegmentParse2Seg1(), &KPathSegmentParse2Seg0(), NULL);
|
sl@0
|
81 |
|
sl@0
|
82 |
TestDelimitedPathSegmentDelimiterPresenceL(KPathSegment_DelimPresence0, KPathSegment_FrontDelim0, KPathSegment_BackDelim0);
|
sl@0
|
83 |
TestDelimitedPathSegmentDelimiterPresenceL(KPathSegment_DelimPresence1, KPathSegment_FrontDelim1, KPathSegment_BackDelim1);
|
sl@0
|
84 |
TestDelimitedPathSegmentDelimiterPresenceL(KPathSegment_DelimPresence2, KPathSegment_FrontDelim2, KPathSegment_BackDelim2);
|
sl@0
|
85 |
TestDelimitedPathSegmentDelimiterPresenceL(KPathSegment_DelimPresence3, KPathSegment_FrontDelim3, KPathSegment_BackDelim3);
|
sl@0
|
86 |
|
sl@0
|
87 |
TestDelimitedPathSegmentRemainderL(KPathSegment_Rem_Forwards0_0, &KPathSegment_Rem_Forwards0_0(), &KPathSegment_Rem_Forwards0_1(),
|
sl@0
|
88 |
&KPathSegment_Rem_Forwards0_2(), &KPathSegment_Rem_Forwards0_3(), NULL);
|
sl@0
|
89 |
|
sl@0
|
90 |
TestDelimitedPathSegmentRemainderReverseL(KPathSegment_Rem_Backwards0_0, &KPathSegment_Rem_Backwards0_0(), &KPathSegment_Rem_Backwards0_1(),
|
sl@0
|
91 |
&KPathSegment_Rem_Backwards0_2(), &KPathSegment_Rem_Backwards0_3(), NULL);
|
sl@0
|
92 |
|
sl@0
|
93 |
TestDelimitedPathSegmentDesL(KPathSegment_Des0);
|
sl@0
|
94 |
|
sl@0
|
95 |
TestDelimitedPathSegmentPushFrontL(KPathSegment_PushPopFront0_0, &KPathSegment_Push0_a(), &KPathSegment_PushPopFront0_1(),
|
sl@0
|
96 |
&KPathSegment_Push0_b(), &KPathSegment_PushPopFront0_2(),
|
sl@0
|
97 |
&KPathSegment_Push0_c(), &KPathSegment_PushPopFront0_3(),
|
sl@0
|
98 |
&KPathSegment_Push0_d(), &KPathSegment_PushPopFront0_4(),
|
sl@0
|
99 |
&KPathSegment_Push0_e(), &KPathSegment_PushPopFront0_5(), NULL, NULL);
|
sl@0
|
100 |
|
sl@0
|
101 |
TestDelimitedPathSegmentPushBackL(KPathSegment_PushPopBack0_0, &KPathSegment_Push0_a(), &KPathSegment_PushPopBack0_1(),
|
sl@0
|
102 |
&KPathSegment_Push0_b(), &KPathSegment_PushPopBack0_2(),
|
sl@0
|
103 |
&KPathSegment_Push0_c(), &KPathSegment_PushPopBack0_3(),
|
sl@0
|
104 |
&KPathSegment_Push0_d(), &KPathSegment_PushPopBack0_4(),
|
sl@0
|
105 |
&KPathSegment_Push0_e(), &KPathSegment_PushPopBack0_5(), NULL, NULL);
|
sl@0
|
106 |
|
sl@0
|
107 |
TestDelimitedPathSegmentPopFrontL(KPathSegment_PushPopFront0_5, &KPathSegment_PushPopFront0_4(), &KPathSegment_PushPopFront0_3(),
|
sl@0
|
108 |
&KPathSegment_PushPopFront0_2(), &KPathSegment_PushPopFront0_1(), &KPathSegment_PushPopFront0_0(), NULL);
|
sl@0
|
109 |
|
sl@0
|
110 |
TestDelimitedPathSegmentPopBackL(KPathSegment_PushPopBack0_5, &KPathSegment_PushPopBack0_4(), &KPathSegment_PushPopBack0_3(),
|
sl@0
|
111 |
&KPathSegment_PushPopBack0_2(), &KPathSegment_PushPopBack0_1(), &KPathSegment_PushPopBack0_0(), NULL);
|
sl@0
|
112 |
|
sl@0
|
113 |
TestDelimitedPathSegmentAddAndTrimFrontAndBackDelimiterL(KPathSegment_AddTrimDelim0);
|
sl@0
|
114 |
|
sl@0
|
115 |
TestDelimitedPathSegmentInsertAndParseL(KPathSegmentInsertForwardsPos0, KPathSegment_InsertForwards0_0,
|
sl@0
|
116 |
&KPathSegment_Insert0_a(), &KPathSegment_InsertForwards0_1(),
|
sl@0
|
117 |
&KPathSegment_Insert0_b(), &KPathSegment_InsertForwards0_2(),
|
sl@0
|
118 |
&KPathSegment_Insert0_c(), &KPathSegment_InsertForwards0_3(),
|
sl@0
|
119 |
&KPathSegment_Insert0_d(), &KPathSegment_InsertForwards0_4(),
|
sl@0
|
120 |
&KPathSegment_Insert0_e(), &KPathSegment_InsertForwards0_5(), NULL, NULL);
|
sl@0
|
121 |
|
sl@0
|
122 |
TestDelimitedPathSegmentRemoveAndParseL(KPathSegmentRemoveForwardsPos0, KPathSegment_RemoveForwards0_0,
|
sl@0
|
123 |
&KPathSegment_RemoveForwards0_1(), &KPathSegment_RemoveForwards0_2(),
|
sl@0
|
124 |
&KPathSegment_RemoveForwards0_3(), &KPathSegment_RemoveForwards0_4(),
|
sl@0
|
125 |
&KPathSegment_RemoveForwards0_5(), NULL);
|
sl@0
|
126 |
|
sl@0
|
127 |
TestDelimitedPathSegmentInsertAndParseReverseL(KPathSegmentInsertBackwardsPos0, KPathSegment_InsertBackwards0_0,
|
sl@0
|
128 |
&KPathSegment_Insert0_a(), &KPathSegment_InsertBackwards0_1(),
|
sl@0
|
129 |
&KPathSegment_Insert0_b(), &KPathSegment_InsertBackwards0_2(),
|
sl@0
|
130 |
&KPathSegment_Insert0_c(), &KPathSegment_InsertBackwards0_3(),
|
sl@0
|
131 |
&KPathSegment_Insert0_d(), &KPathSegment_InsertBackwards0_4(),
|
sl@0
|
132 |
&KPathSegment_Insert0_e(), &KPathSegment_InsertBackwards0_5(), NULL, NULL);
|
sl@0
|
133 |
|
sl@0
|
134 |
TestDelimitedPathSegmentRemoveAndParseReverseL(KPathSegmentRemoveBackwardsPos0, KPathSegment_RemoveBackwards0_0,
|
sl@0
|
135 |
&KPathSegment_RemoveBackwards0_1(), &KPathSegment_RemoveBackwards0_2(),
|
sl@0
|
136 |
&KPathSegment_RemoveBackwards0_3(), &KPathSegment_RemoveBackwards0_4(),
|
sl@0
|
137 |
&KPathSegment_RemoveBackwards0_5(), NULL);
|
sl@0
|
138 |
|
sl@0
|
139 |
TestDelimitedPathSegmentInsertEscapeAndParseL(KPathSegmentInsertEscapeForwardsPos0, KPathSegment_InsertEscapeForwards0_0,
|
sl@0
|
140 |
&KPathSegment_InsertEscape0_a(), &KPathSegment_InsertEscapeForwards0_1(),
|
sl@0
|
141 |
&KPathSegment_InsertEscape0_b(), &KPathSegment_InsertEscapeForwards0_2(),
|
sl@0
|
142 |
&KPathSegment_InsertEscape0_c(), &KPathSegment_InsertEscapeForwards0_3(),
|
sl@0
|
143 |
&KPathSegment_InsertEscape0_d(), &KPathSegment_InsertEscapeForwards0_4(),
|
sl@0
|
144 |
&KPathSegment_InsertEscape0_e(), &KPathSegment_InsertEscapeForwards0_5(), NULL, NULL);
|
sl@0
|
145 |
|
sl@0
|
146 |
TestDelimitedPathSegmentInsertEscapeAndParseReverseL(KPathSegmentInsertEscapeBackwardsPos0, KPathSegment_InsertEscapeBackwards0_0,
|
sl@0
|
147 |
&KPathSegment_InsertEscape0_a(), &KPathSegment_InsertEscapeBackwards0_1(),
|
sl@0
|
148 |
&KPathSegment_InsertEscape0_b(), &KPathSegment_InsertEscapeBackwards0_2(),
|
sl@0
|
149 |
&KPathSegment_InsertEscape0_c(), &KPathSegment_InsertEscapeBackwards0_3(),
|
sl@0
|
150 |
&KPathSegment_InsertEscape0_d(), &KPathSegment_InsertEscapeBackwards0_4(),
|
sl@0
|
151 |
&KPathSegment_InsertEscape0_e(), &KPathSegment_InsertEscapeBackwards0_5(), NULL, NULL);
|
sl@0
|
152 |
|
sl@0
|
153 |
TestDelimitedPathSegmentPushAndEscapeFrontL(KPathSegment_PushEscapeFront0_0, &KPathSegment_PushEscape0_a(), &KPathSegment_PushEscapeFront0_1(),
|
sl@0
|
154 |
&KPathSegment_PushEscape0_b(), &KPathSegment_PushEscapeFront0_2(),
|
sl@0
|
155 |
&KPathSegment_PushEscape0_c(), &KPathSegment_PushEscapeFront0_3(),
|
sl@0
|
156 |
&KPathSegment_PushEscape0_d(), &KPathSegment_PushEscapeFront0_4(),
|
sl@0
|
157 |
&KPathSegment_PushEscape0_e(), &KPathSegment_PushEscapeFront0_5(), NULL, NULL);
|
sl@0
|
158 |
|
sl@0
|
159 |
TestDelimitedPathSegmentPushAndEscapeBackL(KPathSegment_PushEscapeBack0_0, &KPathSegment_PushEscape0_a(), &KPathSegment_PushEscapeBack0_1(),
|
sl@0
|
160 |
&KPathSegment_PushEscape0_b(), &KPathSegment_PushEscapeBack0_2(),
|
sl@0
|
161 |
&KPathSegment_PushEscape0_c(), &KPathSegment_PushEscapeBack0_3(),
|
sl@0
|
162 |
&KPathSegment_PushEscape0_d(), &KPathSegment_PushEscapeBack0_4(),
|
sl@0
|
163 |
&KPathSegment_PushEscape0_e(), &KPathSegment_PushEscapeBack0_5(), NULL, NULL);
|
sl@0
|
164 |
}
|
sl@0
|
165 |
|
sl@0
|
166 |
//
|
sl@0
|
167 |
//
|
sl@0
|
168 |
// Delimited PathSegment tests
|
sl@0
|
169 |
//
|
sl@0
|
170 |
//
|
sl@0
|
171 |
|
sl@0
|
172 |
void CDelimitedPathSegmentTest::TestDelimitedPathSegmentExtractionL(TRefByValue<const TDesC> aPath, ...) const
|
sl@0
|
173 |
{
|
sl@0
|
174 |
VA_LIST list1; VA_START(list1, aPath);
|
sl@0
|
175 |
VA_LIST list2; VA_START(list2, aPath);
|
sl@0
|
176 |
const TDesC& path = aPath;
|
sl@0
|
177 |
|
sl@0
|
178 |
TestDelimitedDataExtractionL(_L("Test TDelimitedPathSegmentParser Parse : GetNext, Dec, Inc, Peek and Eos"), iTestHarness, path, list1, list2);
|
sl@0
|
179 |
VA_END(list1); VA_END(list2);
|
sl@0
|
180 |
}
|
sl@0
|
181 |
|
sl@0
|
182 |
void CDelimitedPathSegmentTest::TestDelimitedPathSegmentReverseExtractionL(TRefByValue<const TDesC> aPath, ...) const
|
sl@0
|
183 |
{
|
sl@0
|
184 |
VA_LIST list1; VA_START(list1, aPath);
|
sl@0
|
185 |
VA_LIST list2; VA_START(list2, aPath);
|
sl@0
|
186 |
const TDesC& path = aPath;
|
sl@0
|
187 |
|
sl@0
|
188 |
TestDelimitedDataReverseExtractionL(_L("Test TDelimitedPathSegmentParser ParseReverse : GetNext, Dec, Inc, Peek and Eos"), iTestHarness, path, list1, list2);
|
sl@0
|
189 |
VA_END(list1); VA_END(list2);
|
sl@0
|
190 |
}
|
sl@0
|
191 |
|
sl@0
|
192 |
void CDelimitedPathSegmentTest::TestDelimitedPathSegmentDelimiterPresenceL(const TDesC& aPath, TBool aFrontDelim, TBool aBackDelim) const
|
sl@0
|
193 |
{
|
sl@0
|
194 |
TestDelimitedDataDelimiterPresenceL(_L("Test TDelimitedPathSegmentParser Delimiter Presence"), iTestHarness, aPath, aFrontDelim, aBackDelim);
|
sl@0
|
195 |
}
|
sl@0
|
196 |
|
sl@0
|
197 |
void CDelimitedPathSegmentTest::TestDelimitedPathSegmentRemainderL(TRefByValue<const TDesC> aPath, ...) const
|
sl@0
|
198 |
{
|
sl@0
|
199 |
VA_LIST list1; VA_START(list1, aPath);
|
sl@0
|
200 |
VA_LIST list2; VA_START(list2, aPath);
|
sl@0
|
201 |
const TDesC& path = aPath;
|
sl@0
|
202 |
|
sl@0
|
203 |
TestDelimitedDataRemainderL(_L("Test TDelimitedPathSegmentParser Remainder, Parse"), iTestHarness, path, list1, list2);
|
sl@0
|
204 |
VA_END(list1); VA_END(list2);
|
sl@0
|
205 |
}
|
sl@0
|
206 |
|
sl@0
|
207 |
void CDelimitedPathSegmentTest::TestDelimitedPathSegmentRemainderReverseL(TRefByValue<const TDesC> aPath, ...) const
|
sl@0
|
208 |
{
|
sl@0
|
209 |
VA_LIST list1; VA_START(list1, aPath);
|
sl@0
|
210 |
VA_LIST list2; VA_START(list2, aPath);
|
sl@0
|
211 |
const TDesC& path = aPath;
|
sl@0
|
212 |
|
sl@0
|
213 |
TestDelimitedDataRemainderReverseL(_L("Test TDelimitedPathSegmentParser Remainder, ParseReverse"), iTestHarness, path, list1, list2);
|
sl@0
|
214 |
VA_END(list1); VA_END(list2);
|
sl@0
|
215 |
}
|
sl@0
|
216 |
|
sl@0
|
217 |
void CDelimitedPathSegmentTest::TestDelimitedPathSegmentDesL(const TDesC& aPath) const
|
sl@0
|
218 |
{
|
sl@0
|
219 |
TestDelimitedDataDesL(_L("Test TDelimitedPathSegmentParser Des"), iTestHarness, aPath);
|
sl@0
|
220 |
}
|
sl@0
|
221 |
|
sl@0
|
222 |
void CDelimitedPathSegmentTest::TestDelimitedPathSegmentPushFrontL(TRefByValue<const TDesC> aPath, ...) const
|
sl@0
|
223 |
{
|
sl@0
|
224 |
VA_LIST list1; VA_START(list1, aPath);
|
sl@0
|
225 |
VA_LIST list2; VA_START(list2, aPath);
|
sl@0
|
226 |
const TDesC& path = aPath;
|
sl@0
|
227 |
|
sl@0
|
228 |
TestDelimitedDataPushFrontL(_L("Test CDelimitedPathSegment PushFront"), iTestHarness, path, list1, list2);
|
sl@0
|
229 |
VA_END(list1);
|
sl@0
|
230 |
VA_END(list2);
|
sl@0
|
231 |
}
|
sl@0
|
232 |
|
sl@0
|
233 |
void CDelimitedPathSegmentTest::TestDelimitedPathSegmentPushBackL(TRefByValue<const TDesC> aPath, ...) const
|
sl@0
|
234 |
{
|
sl@0
|
235 |
VA_LIST list1; VA_START(list1, aPath);
|
sl@0
|
236 |
VA_LIST list2; VA_START(list2, aPath);
|
sl@0
|
237 |
const TDesC& path = aPath;
|
sl@0
|
238 |
|
sl@0
|
239 |
TestDelimitedDataPushBackL(_L("Test CDelimitedPathSegment PushBack"), iTestHarness, path, list1, list2);
|
sl@0
|
240 |
VA_END(list1); VA_END(list2);
|
sl@0
|
241 |
}
|
sl@0
|
242 |
|
sl@0
|
243 |
void CDelimitedPathSegmentTest::TestDelimitedPathSegmentPopFrontL(TRefByValue<const TDesC> aPath, ...) const
|
sl@0
|
244 |
{
|
sl@0
|
245 |
VA_LIST list1; VA_START(list1, aPath);
|
sl@0
|
246 |
VA_LIST list2; VA_START(list2, aPath);
|
sl@0
|
247 |
const TDesC& path = aPath;
|
sl@0
|
248 |
|
sl@0
|
249 |
TestDelimitedDataPopFrontL(_L("Test CDelimitedPathSegment PopFront"), iTestHarness, path, list1, list2);
|
sl@0
|
250 |
VA_END(list1); VA_END(list2);
|
sl@0
|
251 |
}
|
sl@0
|
252 |
|
sl@0
|
253 |
void CDelimitedPathSegmentTest::TestDelimitedPathSegmentPopBackL(TRefByValue<const TDesC> aPath, ...) const
|
sl@0
|
254 |
{
|
sl@0
|
255 |
VA_LIST list1; VA_START(list1, aPath);
|
sl@0
|
256 |
VA_LIST list2; VA_START(list2, aPath);
|
sl@0
|
257 |
const TDesC& path = aPath;
|
sl@0
|
258 |
|
sl@0
|
259 |
TestDelimitedDataPopBackL(_L("Test CDelimitedPathSegment PopBack"), iTestHarness, path, list1, list2);
|
sl@0
|
260 |
VA_END(list1); VA_END(list2);
|
sl@0
|
261 |
}
|
sl@0
|
262 |
|
sl@0
|
263 |
void CDelimitedPathSegmentTest::TestDelimitedPathSegmentAddAndTrimFrontAndBackDelimiterL(const TDesC& aPath) const
|
sl@0
|
264 |
{
|
sl@0
|
265 |
TestDelimitedDataAddAndTrimFrontAndBackDelimiterL(_L("Test CDelimitedPathSegment Add and Trim Front and Back delimiter"), iTestHarness, aPath);
|
sl@0
|
266 |
}
|
sl@0
|
267 |
|
sl@0
|
268 |
void CDelimitedPathSegmentTest::TestDelimitedPathSegmentInsertAndParseL(TInt aStartPos, TRefByValue<const TDesC> aPath, ...) const
|
sl@0
|
269 |
{
|
sl@0
|
270 |
VA_LIST list1; VA_START(list1, aPath);
|
sl@0
|
271 |
VA_LIST list2; VA_START(list2, aPath);
|
sl@0
|
272 |
const TDesC& path = aPath;
|
sl@0
|
273 |
|
sl@0
|
274 |
TestDelimitedDataInsertAndParseL(_L("Test CDelimitedPathSegment InsertCurrent, Parse"), iTestHarness, path, list1, list2, aStartPos);
|
sl@0
|
275 |
VA_END(list1); VA_END(list2);
|
sl@0
|
276 |
}
|
sl@0
|
277 |
|
sl@0
|
278 |
void CDelimitedPathSegmentTest::TestDelimitedPathSegmentRemoveAndParseL(TInt aStartPos, TRefByValue<const TDesC> aPath, ...) const
|
sl@0
|
279 |
{
|
sl@0
|
280 |
VA_LIST list1; VA_START(list1, aPath);
|
sl@0
|
281 |
VA_LIST list2; VA_START(list2, aPath);
|
sl@0
|
282 |
const TDesC& path = aPath;
|
sl@0
|
283 |
|
sl@0
|
284 |
TestDelimitedDataRemoveAndParseL(_L("Test CDelimitedPathSegment RemoveCurrent, Parse"), iTestHarness, path, list1, list2, aStartPos);
|
sl@0
|
285 |
VA_END(list1); VA_END(list2);
|
sl@0
|
286 |
}
|
sl@0
|
287 |
|
sl@0
|
288 |
void CDelimitedPathSegmentTest::TestDelimitedPathSegmentInsertAndParseReverseL(TInt aStartPos, TRefByValue<const TDesC> aPath, ...) const
|
sl@0
|
289 |
{
|
sl@0
|
290 |
VA_LIST list1; VA_START(list1, aPath);
|
sl@0
|
291 |
VA_LIST list2; VA_START(list2, aPath);
|
sl@0
|
292 |
const TDesC& path = aPath;
|
sl@0
|
293 |
|
sl@0
|
294 |
TestDelimitedDataInsertAndParseReverseL(_L("Test CDelimitedPathSegment InsertCurrent, ParseReverse"), iTestHarness, path, list1, list2, aStartPos);
|
sl@0
|
295 |
VA_END(list1); VA_END(list2);
|
sl@0
|
296 |
}
|
sl@0
|
297 |
|
sl@0
|
298 |
void CDelimitedPathSegmentTest::TestDelimitedPathSegmentRemoveAndParseReverseL(TInt aStartPos, TRefByValue<const TDesC> aPath, ...) const
|
sl@0
|
299 |
{
|
sl@0
|
300 |
VA_LIST list1; VA_START(list1, aPath);
|
sl@0
|
301 |
VA_LIST list2; VA_START(list2, aPath);
|
sl@0
|
302 |
const TDesC& path = aPath;
|
sl@0
|
303 |
|
sl@0
|
304 |
TestDelimitedDataRemoveAndParseReverseL(_L("Test CDelimitedPathSegment RemoveCurrent, ParseReverse"), iTestHarness, path, list1, list2, aStartPos);
|
sl@0
|
305 |
VA_END(list1); VA_END(list2);
|
sl@0
|
306 |
}
|
sl@0
|
307 |
|
sl@0
|
308 |
void CDelimitedPathSegmentTest::TestDelimitedPathSegmentInsertEscapeAndParseL(TInt aStartPos, TRefByValue<const TDesC> aPath, ...) const
|
sl@0
|
309 |
{
|
sl@0
|
310 |
VA_LIST list1; VA_START(list1, aPath);
|
sl@0
|
311 |
VA_LIST list2; VA_START(list2, aPath);
|
sl@0
|
312 |
const TDesC& path = aPath;
|
sl@0
|
313 |
|
sl@0
|
314 |
TestDelimitedDataInsertEscapeAndParseL(_L("Test CDelimitedPathSegment InsertAndEscapeCurrent, Parse"), iTestHarness, path, list1, list2, aStartPos);
|
sl@0
|
315 |
VA_END(list1); VA_END(list2);
|
sl@0
|
316 |
}
|
sl@0
|
317 |
|
sl@0
|
318 |
void CDelimitedPathSegmentTest::TestDelimitedPathSegmentInsertEscapeAndParseReverseL(TInt aStartPos, TRefByValue<const TDesC> aPath, ...) const
|
sl@0
|
319 |
{
|
sl@0
|
320 |
VA_LIST list1; VA_START(list1, aPath);
|
sl@0
|
321 |
VA_LIST list2; VA_START(list2, aPath);
|
sl@0
|
322 |
const TDesC& path = aPath;
|
sl@0
|
323 |
|
sl@0
|
324 |
TestDelimitedDataInsertEscapeAndParseReverseL(_L("Test CDelimitedPathSegment InsertAndEscapeCurrent, ParseReverse"), iTestHarness, path, list1, list2, aStartPos);
|
sl@0
|
325 |
VA_END(list1); VA_END(list2);
|
sl@0
|
326 |
}
|
sl@0
|
327 |
|
sl@0
|
328 |
void CDelimitedPathSegmentTest::TestDelimitedPathSegmentPushAndEscapeFrontL(TRefByValue<const TDesC> aPath, ...) const
|
sl@0
|
329 |
{
|
sl@0
|
330 |
VA_LIST list1; VA_START(list1, aPath);
|
sl@0
|
331 |
VA_LIST list2; VA_START(list2, aPath);
|
sl@0
|
332 |
const TDesC& path = aPath;
|
sl@0
|
333 |
|
sl@0
|
334 |
TestDelimitedDataPushAndEscapeFrontL(_L("Test CDelimitedPathSegment PushAndEscapeFront"), iTestHarness, path, list1, list2);
|
sl@0
|
335 |
VA_END(list1); VA_END(list2);
|
sl@0
|
336 |
}
|
sl@0
|
337 |
|
sl@0
|
338 |
void CDelimitedPathSegmentTest::TestDelimitedPathSegmentPushAndEscapeBackL(TRefByValue<const TDesC> aPath, ...) const
|
sl@0
|
339 |
{
|
sl@0
|
340 |
VA_LIST list1; VA_START(list1, aPath);
|
sl@0
|
341 |
VA_LIST list2; VA_START(list2, aPath);
|
sl@0
|
342 |
const TDesC& path = aPath;
|
sl@0
|
343 |
|
sl@0
|
344 |
TestDelimitedDataPushAndEscapeBackL(_L("Test CDelimitedPathSegment PushAndEscapeBack"), iTestHarness, path, list1, list2);
|
sl@0
|
345 |
VA_END(list1); VA_END(list2);
|
sl@0
|
346 |
}
|
sl@0
|
347 |
//
|
sl@0
|
348 |
//
|
sl@0
|
349 |
// Implementation of LOCAL functions - test funcions
|
sl@0
|
350 |
//
|
sl@0
|
351 |
//
|
sl@0
|
352 |
|
sl@0
|
353 |
void TestDelimitedDataExtractionL(const TDesC& aTestTitle, CIpuTestHarness* aTestHarness,
|
sl@0
|
354 |
const TDesC& aData, VA_LIST& aList1, VA_LIST& aList2) {
|
sl@0
|
355 |
// Create title
|
sl@0
|
356 |
HBufC* title16Bit = HBufC::NewLC(aTestTitle.Length() + KTitle16Bit().Length());
|
sl@0
|
357 |
title16Bit->Des().Format(KTitle16Bit, &aTestTitle);
|
sl@0
|
358 |
aTestHarness->StartTestL(*title16Bit);
|
sl@0
|
359 |
|
sl@0
|
360 |
// Create TDelimitedPathSegmentParser object and do parsing
|
sl@0
|
361 |
TDelimitedPathSegmentParser16 parser16Bit;
|
sl@0
|
362 |
parser16Bit.Parse(aData);
|
sl@0
|
363 |
|
sl@0
|
364 |
TInt error = DoDelimitedDataParsingL<HBufC16, TPtrC16>(parser16Bit, aList1);
|
sl@0
|
365 |
|
sl@0
|
366 |
CleanupStack::PopAndDestroy(title16Bit); // title16Bit
|
sl@0
|
367 |
aTestHarness->EndTest(error);
|
sl@0
|
368 |
|
sl@0
|
369 |
// Make 8-bit copy
|
sl@0
|
370 |
HBufC8* dataBuf = HBufC8::NewLC(aData.Length());
|
sl@0
|
371 |
TPtr8 data8Bit = dataBuf->Des();
|
sl@0
|
372 |
data8Bit.Copy(aData);
|
sl@0
|
373 |
|
sl@0
|
374 |
HBufC* title8Bit = HBufC::NewLC(aTestTitle.Length() + KTitle8Bit().Length());
|
sl@0
|
375 |
title8Bit->Des().Format(KTitle8Bit, &aTestTitle);
|
sl@0
|
376 |
aTestHarness->StartTestL(*title8Bit);
|
sl@0
|
377 |
|
sl@0
|
378 |
// Create TDelimitedPathSegmentParser object and do parsing
|
sl@0
|
379 |
TDelimitedPathSegmentParser8 parser8Bit;
|
sl@0
|
380 |
parser8Bit.Parse(data8Bit);
|
sl@0
|
381 |
|
sl@0
|
382 |
error = DoDelimitedDataParsingL<HBufC8, TPtrC8>(parser8Bit, aList2);
|
sl@0
|
383 |
|
sl@0
|
384 |
aTestHarness->EndTest(error);
|
sl@0
|
385 |
CleanupStack::PopAndDestroy(2, dataBuf); // dataBuf, title8Bit
|
sl@0
|
386 |
}
|
sl@0
|
387 |
|
sl@0
|
388 |
void TestDelimitedDataReverseExtractionL(const TDesC& aTestTitle, CIpuTestHarness* aTestHarness,
|
sl@0
|
389 |
const TDesC& aData, VA_LIST& aList1, VA_LIST& aList2)
|
sl@0
|
390 |
{
|
sl@0
|
391 |
// Create title
|
sl@0
|
392 |
HBufC* title16Bit = HBufC::NewLC(aTestTitle.Length() + KTitle16Bit().Length());
|
sl@0
|
393 |
title16Bit->Des().Format(KTitle16Bit, &aTestTitle);
|
sl@0
|
394 |
aTestHarness->StartTestL(*title16Bit);
|
sl@0
|
395 |
|
sl@0
|
396 |
// Create TDelimitedPathSegmentParser object and do parsing
|
sl@0
|
397 |
TDelimitedPathSegmentParser16 parser16Bit;
|
sl@0
|
398 |
parser16Bit.ParseReverse(aData);
|
sl@0
|
399 |
|
sl@0
|
400 |
TInt error = DoDelimitedDataParsingL<HBufC16, TPtrC16>(parser16Bit, aList1);
|
sl@0
|
401 |
|
sl@0
|
402 |
CleanupStack::PopAndDestroy(title16Bit); // title16Bit
|
sl@0
|
403 |
aTestHarness->EndTest(error);
|
sl@0
|
404 |
|
sl@0
|
405 |
// Make 8-bit copy
|
sl@0
|
406 |
HBufC8* dataBuf = HBufC8::NewLC(aData.Length());
|
sl@0
|
407 |
TPtr8 data8Bit = dataBuf->Des();
|
sl@0
|
408 |
data8Bit.Copy(aData);
|
sl@0
|
409 |
|
sl@0
|
410 |
// Create title
|
sl@0
|
411 |
HBufC* title8Bit = HBufC::NewLC(aTestTitle.Length() + KTitle8Bit().Length());
|
sl@0
|
412 |
title8Bit->Des().Format(KTitle8Bit, &aTestTitle);
|
sl@0
|
413 |
aTestHarness->StartTestL(*title8Bit);
|
sl@0
|
414 |
|
sl@0
|
415 |
// Create TDelimitedPathSegmentParser object and do parsing
|
sl@0
|
416 |
TDelimitedPathSegmentParser8 parser8Bit;
|
sl@0
|
417 |
parser8Bit.ParseReverse(data8Bit);
|
sl@0
|
418 |
|
sl@0
|
419 |
error = DoDelimitedDataParsingL<HBufC8, TPtrC8>(parser8Bit, aList2);
|
sl@0
|
420 |
|
sl@0
|
421 |
aTestHarness->EndTest(error);
|
sl@0
|
422 |
CleanupStack::PopAndDestroy(2, dataBuf); // dataBuf, title8Bit
|
sl@0
|
423 |
}
|
sl@0
|
424 |
|
sl@0
|
425 |
void TestDelimitedDataDelimiterPresenceL(const TDesC& aTestTitle, CIpuTestHarness* aTestHarness,
|
sl@0
|
426 |
const TDesC& aData, TBool aFrontDelim, TBool aBackDelim)
|
sl@0
|
427 |
{
|
sl@0
|
428 |
// Create title
|
sl@0
|
429 |
HBufC* title16Bit = HBufC::NewLC(aTestTitle.Length() + KTitle16Bit().Length());
|
sl@0
|
430 |
title16Bit->Des().Format(KTitle16Bit, &aTestTitle);
|
sl@0
|
431 |
aTestHarness->StartTestL(*title16Bit);
|
sl@0
|
432 |
|
sl@0
|
433 |
// Create TDelimitedPathSegmentParser object
|
sl@0
|
434 |
TDelimitedPathSegmentParser16 parser16Bit;
|
sl@0
|
435 |
parser16Bit.Parse(aData);
|
sl@0
|
436 |
TInt error = DoDelimiterPresenceTest(parser16Bit, aFrontDelim, aBackDelim);
|
sl@0
|
437 |
|
sl@0
|
438 |
CleanupStack::PopAndDestroy(title16Bit); // title16Bit
|
sl@0
|
439 |
aTestHarness->EndTest(error);
|
sl@0
|
440 |
|
sl@0
|
441 |
// Make 8-bit copy
|
sl@0
|
442 |
HBufC8* dataBuf = HBufC8::NewLC(aData.Length());
|
sl@0
|
443 |
TPtr8 data8Bit = dataBuf->Des();
|
sl@0
|
444 |
data8Bit.Copy(aData);
|
sl@0
|
445 |
|
sl@0
|
446 |
// Create title
|
sl@0
|
447 |
HBufC* title8Bit = HBufC::NewLC(aTestTitle.Length() + KTitle8Bit().Length());
|
sl@0
|
448 |
title8Bit->Des().Format(KTitle8Bit, &aTestTitle);
|
sl@0
|
449 |
aTestHarness->StartTestL(*title8Bit);
|
sl@0
|
450 |
|
sl@0
|
451 |
// Create TDelimitedPathSegmentParser object
|
sl@0
|
452 |
TDelimitedPathSegmentParser8 parser8Bit;
|
sl@0
|
453 |
parser8Bit.Parse(data8Bit);
|
sl@0
|
454 |
error = DoDelimiterPresenceTest(parser8Bit, aFrontDelim, aBackDelim);
|
sl@0
|
455 |
|
sl@0
|
456 |
aTestHarness->EndTest(error);
|
sl@0
|
457 |
CleanupStack::PopAndDestroy(2, dataBuf); // dataBuf, title8Bit
|
sl@0
|
458 |
}
|
sl@0
|
459 |
|
sl@0
|
460 |
void TestDelimitedDataRemainderL(const TDesC& aTestTitle, CIpuTestHarness* aTestHarness,
|
sl@0
|
461 |
const TDesC& aData, VA_LIST& aList1, VA_LIST& aList2)
|
sl@0
|
462 |
{
|
sl@0
|
463 |
// Create title
|
sl@0
|
464 |
HBufC* title16Bit = HBufC::NewLC(aTestTitle.Length() + KTitle16Bit().Length());
|
sl@0
|
465 |
title16Bit->Des().Format(KTitle16Bit, &aTestTitle);
|
sl@0
|
466 |
aTestHarness->StartTestL(*title16Bit);
|
sl@0
|
467 |
|
sl@0
|
468 |
// Create TDelimiteddataParser object and do parsing
|
sl@0
|
469 |
TDelimitedPathSegmentParser16 parser16Bit;
|
sl@0
|
470 |
parser16Bit.Parse(aData);
|
sl@0
|
471 |
|
sl@0
|
472 |
TInt error = DoDelimitedDataRemainderTestL<HBufC16, TPtrC16>(parser16Bit, aList1);
|
sl@0
|
473 |
|
sl@0
|
474 |
CleanupStack::PopAndDestroy(title16Bit); // title16Bit
|
sl@0
|
475 |
aTestHarness->EndTest(error);
|
sl@0
|
476 |
|
sl@0
|
477 |
// Make 8-bit copy
|
sl@0
|
478 |
HBufC8* dataBuf = HBufC8::NewLC(aData.Length());
|
sl@0
|
479 |
TPtr8 data8Bit = dataBuf->Des();
|
sl@0
|
480 |
data8Bit.Copy(aData);
|
sl@0
|
481 |
|
sl@0
|
482 |
// Create title
|
sl@0
|
483 |
HBufC* title8Bit = HBufC::NewLC(aTestTitle.Length() + KTitle8Bit().Length());
|
sl@0
|
484 |
title8Bit->Des().Format(KTitle8Bit, &aTestTitle);
|
sl@0
|
485 |
aTestHarness->StartTestL(*title8Bit);
|
sl@0
|
486 |
|
sl@0
|
487 |
// Create TDelimiteddataParser object and do parsing
|
sl@0
|
488 |
TDelimitedPathSegmentParser8 parser8Bit;
|
sl@0
|
489 |
parser8Bit.Parse(data8Bit);
|
sl@0
|
490 |
|
sl@0
|
491 |
error = DoDelimitedDataRemainderTestL<HBufC8, TPtrC8>(parser8Bit, aList2);
|
sl@0
|
492 |
|
sl@0
|
493 |
aTestHarness->EndTest(error);
|
sl@0
|
494 |
CleanupStack::PopAndDestroy(2, dataBuf); // dataBuf, title8Bit
|
sl@0
|
495 |
}
|
sl@0
|
496 |
|
sl@0
|
497 |
void TestDelimitedDataRemainderReverseL(const TDesC& aTestTitle, CIpuTestHarness* aTestHarness,
|
sl@0
|
498 |
const TDesC& aData, VA_LIST& aList1, VA_LIST& aList2)
|
sl@0
|
499 |
{
|
sl@0
|
500 |
// Create title
|
sl@0
|
501 |
HBufC* title16Bit = HBufC::NewLC(aTestTitle.Length() + KTitle16Bit().Length());
|
sl@0
|
502 |
title16Bit->Des().Format(KTitle16Bit, &aTestTitle);
|
sl@0
|
503 |
aTestHarness->StartTestL(*title16Bit);
|
sl@0
|
504 |
|
sl@0
|
505 |
// Create TDelimitedPathSegmentParser object and do parsing
|
sl@0
|
506 |
TDelimitedPathSegmentParser16 parser16Bit;
|
sl@0
|
507 |
parser16Bit.ParseReverse(aData);
|
sl@0
|
508 |
|
sl@0
|
509 |
TInt error = DoDelimitedDataRemainderTestL<HBufC16, TPtrC16>(parser16Bit, aList1);
|
sl@0
|
510 |
|
sl@0
|
511 |
CleanupStack::PopAndDestroy(title16Bit); // title16Bit
|
sl@0
|
512 |
aTestHarness->EndTest(error);
|
sl@0
|
513 |
|
sl@0
|
514 |
// Make 8-bit copy
|
sl@0
|
515 |
HBufC8* dataBuf = HBufC8::NewLC(aData.Length());
|
sl@0
|
516 |
TPtr8 data8Bit = dataBuf->Des();
|
sl@0
|
517 |
data8Bit.Copy(aData);
|
sl@0
|
518 |
|
sl@0
|
519 |
// Create title
|
sl@0
|
520 |
HBufC* title8Bit = HBufC::NewLC(aTestTitle.Length() + KTitle8Bit().Length());
|
sl@0
|
521 |
title8Bit->Des().Format(KTitle8Bit, &aTestTitle);
|
sl@0
|
522 |
aTestHarness->StartTestL(*title8Bit);
|
sl@0
|
523 |
|
sl@0
|
524 |
// Create TDelimitedPathSegmentParser object and do parsing
|
sl@0
|
525 |
TDelimitedPathSegmentParser8 parser8Bit;
|
sl@0
|
526 |
parser8Bit.ParseReverse(data8Bit);
|
sl@0
|
527 |
|
sl@0
|
528 |
error = DoDelimitedDataRemainderTestL<HBufC8, TPtrC8>(parser8Bit, aList2);
|
sl@0
|
529 |
|
sl@0
|
530 |
aTestHarness->EndTest(error);
|
sl@0
|
531 |
CleanupStack::PopAndDestroy(2, dataBuf); // dataBuf, title8Bit
|
sl@0
|
532 |
}
|
sl@0
|
533 |
|
sl@0
|
534 |
void TestDelimitedDataDesL(const TDesC& aTestTitle, CIpuTestHarness* aTestHarness, const TDesC& aData)
|
sl@0
|
535 |
{
|
sl@0
|
536 |
// Create title
|
sl@0
|
537 |
HBufC* title16Bit = HBufC::NewLC(aTestTitle.Length() + KTitle16Bit().Length());
|
sl@0
|
538 |
title16Bit->Des().Format(KTitle16Bit, &aTestTitle);
|
sl@0
|
539 |
aTestHarness->StartTestL(*title16Bit);
|
sl@0
|
540 |
|
sl@0
|
541 |
// Create TDelimitedPathSegmentParser object and do parsing
|
sl@0
|
542 |
TDelimitedPathSegmentParser16 parser16Bit;
|
sl@0
|
543 |
parser16Bit.Parse(aData);
|
sl@0
|
544 |
|
sl@0
|
545 |
TInt error = DoDelimitedDataDes(parser16Bit, aData);
|
sl@0
|
546 |
|
sl@0
|
547 |
CleanupStack::PopAndDestroy(title16Bit); // title16Bit
|
sl@0
|
548 |
aTestHarness->EndTest(error);
|
sl@0
|
549 |
|
sl@0
|
550 |
// Make 8-bit copy
|
sl@0
|
551 |
HBufC8* dataBuf = HBufC8::NewLC(aData.Length());
|
sl@0
|
552 |
TPtr8 data8Bit = dataBuf->Des();
|
sl@0
|
553 |
data8Bit.Copy(aData);
|
sl@0
|
554 |
|
sl@0
|
555 |
// Create title
|
sl@0
|
556 |
HBufC* title8Bit = HBufC::NewLC(aTestTitle.Length() + KTitle8Bit().Length());
|
sl@0
|
557 |
title8Bit->Des().Format(KTitle8Bit, &aTestTitle);
|
sl@0
|
558 |
aTestHarness->StartTestL(*title8Bit);
|
sl@0
|
559 |
|
sl@0
|
560 |
// Create TDelimitedPathSegmentParser object and do parsing
|
sl@0
|
561 |
TDelimitedPathSegmentParser8 parser8Bit;
|
sl@0
|
562 |
parser8Bit.Parse(data8Bit);
|
sl@0
|
563 |
|
sl@0
|
564 |
error = DoDelimitedDataDes(parser8Bit, data8Bit);
|
sl@0
|
565 |
|
sl@0
|
566 |
aTestHarness->EndTest(error);
|
sl@0
|
567 |
CleanupStack::PopAndDestroy(2, dataBuf); // dataBuf, title8Bit
|
sl@0
|
568 |
}
|
sl@0
|
569 |
|
sl@0
|
570 |
void TestDelimitedDataPushFrontL(const TDesC& aTestTitle, CIpuTestHarness* aTestHarness,
|
sl@0
|
571 |
const TDesC& aData, VA_LIST& aList1, VA_LIST& aList2)
|
sl@0
|
572 |
{
|
sl@0
|
573 |
// Create title
|
sl@0
|
574 |
HBufC* title16Bit = HBufC::NewLC(aTestTitle.Length() + KTitle16Bit().Length());
|
sl@0
|
575 |
title16Bit->Des().Format(KTitle16Bit, &aTestTitle);
|
sl@0
|
576 |
aTestHarness->StartTestL(*title16Bit);
|
sl@0
|
577 |
|
sl@0
|
578 |
// Create TDelimitedPathSegmentParser object and do parsing
|
sl@0
|
579 |
CDelimitedPathSegment16* data16Bit = CDelimitedPathSegment16::NewL(aData); // Also excersies NewLC()
|
sl@0
|
580 |
CleanupStack::PushL(data16Bit);
|
sl@0
|
581 |
|
sl@0
|
582 |
TInt error = DoDelimitedDataPushFrontL<HBufC16>(data16Bit, aList1);
|
sl@0
|
583 |
|
sl@0
|
584 |
CleanupStack::PopAndDestroy(2, title16Bit); // title16Bit, data16Bit
|
sl@0
|
585 |
aTestHarness->EndTest(error);
|
sl@0
|
586 |
|
sl@0
|
587 |
// Make 8-bit copy
|
sl@0
|
588 |
HBufC8* dataBuf = HBufC8::NewLC(aData.Length());
|
sl@0
|
589 |
TPtr8 initData8Bit = dataBuf->Des();
|
sl@0
|
590 |
initData8Bit.Copy(aData);
|
sl@0
|
591 |
|
sl@0
|
592 |
// Create title
|
sl@0
|
593 |
HBufC* title8Bit = HBufC::NewLC(aTestTitle.Length() + KTitle8Bit().Length());
|
sl@0
|
594 |
title8Bit->Des().Format(KTitle8Bit, &aTestTitle);
|
sl@0
|
595 |
aTestHarness->StartTestL(*title8Bit);
|
sl@0
|
596 |
|
sl@0
|
597 |
// Create TDelimitedPathSegmentParser object and do parsing
|
sl@0
|
598 |
CDelimitedPathSegment8* data8Bit = CDelimitedPathSegment8::NewL(initData8Bit); // Also excersies NewLC()
|
sl@0
|
599 |
CleanupStack::PushL(data8Bit);
|
sl@0
|
600 |
|
sl@0
|
601 |
error = DoDelimitedDataPushFrontL<HBufC8>(data8Bit, aList2);
|
sl@0
|
602 |
|
sl@0
|
603 |
aTestHarness->EndTest(error);
|
sl@0
|
604 |
CleanupStack::PopAndDestroy(3, dataBuf); // dataBuf, title8Bit, data8Bit
|
sl@0
|
605 |
}
|
sl@0
|
606 |
|
sl@0
|
607 |
void TestDelimitedDataPushAndEscapeFrontL(const TDesC& aTestTitle, CIpuTestHarness* aTestHarness,
|
sl@0
|
608 |
const TDesC& aData, VA_LIST& aList1, VA_LIST& aList2)
|
sl@0
|
609 |
{
|
sl@0
|
610 |
// Create title
|
sl@0
|
611 |
HBufC* title16Bit = HBufC::NewLC(aTestTitle.Length() + KTitle16Bit().Length());
|
sl@0
|
612 |
title16Bit->Des().Format(KTitle16Bit, &aTestTitle);
|
sl@0
|
613 |
aTestHarness->StartTestL(*title16Bit);
|
sl@0
|
614 |
|
sl@0
|
615 |
// Create TDelimitedPathSegmentParser object and do parsing
|
sl@0
|
616 |
CDelimitedPathSegment16* data16Bit = CDelimitedPathSegment16::NewL(aData); // Also excersies NewLC()
|
sl@0
|
617 |
CleanupStack::PushL(data16Bit);
|
sl@0
|
618 |
|
sl@0
|
619 |
TInt error = DoDelimitedDataPushAndEscapeFrontL<HBufC16>(data16Bit, aList1);
|
sl@0
|
620 |
|
sl@0
|
621 |
CleanupStack::PopAndDestroy(2, title16Bit); // title16Bit, data16Bit
|
sl@0
|
622 |
aTestHarness->EndTest(error);
|
sl@0
|
623 |
|
sl@0
|
624 |
// Make 8-bit copy
|
sl@0
|
625 |
HBufC8* dataBuf = HBufC8::NewLC(aData.Length());
|
sl@0
|
626 |
TPtr8 initData8Bit = dataBuf->Des();
|
sl@0
|
627 |
initData8Bit.Copy(aData);
|
sl@0
|
628 |
|
sl@0
|
629 |
// Create title
|
sl@0
|
630 |
HBufC* title8Bit = HBufC::NewLC(aTestTitle.Length() + KTitle8Bit().Length());
|
sl@0
|
631 |
title8Bit->Des().Format(KTitle8Bit, &aTestTitle);
|
sl@0
|
632 |
aTestHarness->StartTestL(*title8Bit);
|
sl@0
|
633 |
|
sl@0
|
634 |
// Create TDelimitedPathSegmentParser object and do parsing
|
sl@0
|
635 |
CDelimitedPathSegment8* data8Bit = CDelimitedPathSegment8::NewL(initData8Bit); // Also excersies NewLC()
|
sl@0
|
636 |
CleanupStack::PushL(data8Bit);
|
sl@0
|
637 |
|
sl@0
|
638 |
error = DoDelimitedDataPushAndEscapeFrontL<HBufC8>(data8Bit, aList2);
|
sl@0
|
639 |
|
sl@0
|
640 |
aTestHarness->EndTest(error);
|
sl@0
|
641 |
CleanupStack::PopAndDestroy(3, dataBuf); // dataBuf, title8Bit, data8Bit
|
sl@0
|
642 |
}
|
sl@0
|
643 |
|
sl@0
|
644 |
void TestDelimitedDataPushBackL(const TDesC& aTestTitle, CIpuTestHarness* aTestHarness,
|
sl@0
|
645 |
const TDesC& aData, VA_LIST& aList1, VA_LIST& aList2)
|
sl@0
|
646 |
{
|
sl@0
|
647 |
// Create title
|
sl@0
|
648 |
HBufC* title16Bit = HBufC::NewLC(aTestTitle.Length() + KTitle16Bit().Length());
|
sl@0
|
649 |
title16Bit->Des().Format(KTitle16Bit, &aTestTitle);
|
sl@0
|
650 |
aTestHarness->StartTestL(*title16Bit);
|
sl@0
|
651 |
|
sl@0
|
652 |
// Create TDelimitedPathSegmentParser object and do parsing
|
sl@0
|
653 |
CDelimitedPathSegment16* data16Bit = CDelimitedPathSegment16::NewL(aData); // Also excersies NewLC()
|
sl@0
|
654 |
CleanupStack::PushL(data16Bit);
|
sl@0
|
655 |
|
sl@0
|
656 |
TInt error = DoDelimitedDataPushBackL<HBufC16>(data16Bit, aList1);
|
sl@0
|
657 |
|
sl@0
|
658 |
CleanupStack::PopAndDestroy(2, title16Bit); // title16Bit, data16Bit
|
sl@0
|
659 |
aTestHarness->EndTest(error);
|
sl@0
|
660 |
|
sl@0
|
661 |
// Make 8-bit copy
|
sl@0
|
662 |
HBufC8* dataBuf = HBufC8::NewLC(aData.Length());
|
sl@0
|
663 |
TPtr8 initData8Bit = dataBuf->Des();
|
sl@0
|
664 |
initData8Bit.Copy(aData);
|
sl@0
|
665 |
|
sl@0
|
666 |
// Create title
|
sl@0
|
667 |
HBufC* title8Bit = HBufC::NewLC(aTestTitle.Length() + KTitle8Bit().Length());
|
sl@0
|
668 |
title8Bit->Des().Format(KTitle8Bit, &aTestTitle);
|
sl@0
|
669 |
aTestHarness->StartTestL(*title8Bit);
|
sl@0
|
670 |
|
sl@0
|
671 |
// Create TDelimitedPathSegmentParser object and do parsing
|
sl@0
|
672 |
CDelimitedPathSegment8* data8Bit = CDelimitedPathSegment8::NewL(initData8Bit); // Also excersies NewLC()
|
sl@0
|
673 |
CleanupStack::PushL(data8Bit);
|
sl@0
|
674 |
|
sl@0
|
675 |
error = DoDelimitedDataPushBackL<HBufC8>(data8Bit, aList2);
|
sl@0
|
676 |
|
sl@0
|
677 |
aTestHarness->EndTest(error);
|
sl@0
|
678 |
CleanupStack::PopAndDestroy(3, dataBuf); // dataBuf, title8Bit, data8Bit
|
sl@0
|
679 |
}
|
sl@0
|
680 |
|
sl@0
|
681 |
void TestDelimitedDataPushAndEscapeBackL(const TDesC& aTestTitle, CIpuTestHarness* aTestHarness,
|
sl@0
|
682 |
const TDesC& aData, VA_LIST& aList1, VA_LIST& aList2)
|
sl@0
|
683 |
{
|
sl@0
|
684 |
// Create title
|
sl@0
|
685 |
HBufC* title16Bit = HBufC::NewLC(aTestTitle.Length() + KTitle16Bit().Length());
|
sl@0
|
686 |
title16Bit->Des().Format(KTitle16Bit, &aTestTitle);
|
sl@0
|
687 |
aTestHarness->StartTestL(*title16Bit);
|
sl@0
|
688 |
|
sl@0
|
689 |
// Create TDelimitedPathSegmentParser object and do parsing
|
sl@0
|
690 |
CDelimitedPathSegment16* data16Bit = CDelimitedPathSegment16::NewL(aData); // Also excersies NewLC()
|
sl@0
|
691 |
CleanupStack::PushL(data16Bit);
|
sl@0
|
692 |
|
sl@0
|
693 |
TInt error = DoDelimitedDataPushAndEscapeBackL<HBufC16>(data16Bit, aList1);
|
sl@0
|
694 |
|
sl@0
|
695 |
CleanupStack::PopAndDestroy(2, title16Bit); // title16Bit, data16Bit
|
sl@0
|
696 |
aTestHarness->EndTest(error);
|
sl@0
|
697 |
|
sl@0
|
698 |
// Make 8-bit copy
|
sl@0
|
699 |
HBufC8* dataBuf = HBufC8::NewLC(aData.Length());
|
sl@0
|
700 |
TPtr8 initData8Bit = dataBuf->Des();
|
sl@0
|
701 |
initData8Bit.Copy(aData);
|
sl@0
|
702 |
|
sl@0
|
703 |
// Create title
|
sl@0
|
704 |
HBufC* title8Bit = HBufC::NewLC(aTestTitle.Length() + KTitle8Bit().Length());
|
sl@0
|
705 |
title8Bit->Des().Format(KTitle8Bit, &aTestTitle);
|
sl@0
|
706 |
aTestHarness->StartTestL(*title8Bit);
|
sl@0
|
707 |
|
sl@0
|
708 |
// Create TDelimitedPathSegmentParser object and do parsing
|
sl@0
|
709 |
CDelimitedPathSegment8* data8Bit = CDelimitedPathSegment8::NewL(initData8Bit); // Also excersies NewLC()
|
sl@0
|
710 |
CleanupStack::PushL(data8Bit);
|
sl@0
|
711 |
|
sl@0
|
712 |
error = DoDelimitedDataPushAndEscapeBackL<HBufC8>(data8Bit, aList2);
|
sl@0
|
713 |
|
sl@0
|
714 |
aTestHarness->EndTest(error);
|
sl@0
|
715 |
CleanupStack::PopAndDestroy(3, dataBuf); // dataBuf, title8Bit, data8Bit
|
sl@0
|
716 |
}
|
sl@0
|
717 |
|
sl@0
|
718 |
void TestDelimitedDataPopFrontL(const TDesC& aTestTitle, CIpuTestHarness* aTestHarness,
|
sl@0
|
719 |
const TDesC& aData, VA_LIST& aList1, VA_LIST& aList2)
|
sl@0
|
720 |
{
|
sl@0
|
721 |
// Create title
|
sl@0
|
722 |
HBufC* title16Bit = HBufC::NewLC(aTestTitle.Length() + KTitle16Bit().Length());
|
sl@0
|
723 |
title16Bit->Des().Format(KTitle16Bit, &aTestTitle);
|
sl@0
|
724 |
aTestHarness->StartTestL(*title16Bit);
|
sl@0
|
725 |
|
sl@0
|
726 |
// Create TDelimitedPathSegmentParser object and do parsing
|
sl@0
|
727 |
CDelimitedPathSegment16* data16Bit = CDelimitedPathSegment16::NewL(aData); // Also excersies NewLC()
|
sl@0
|
728 |
CleanupStack::PushL(data16Bit);
|
sl@0
|
729 |
|
sl@0
|
730 |
TInt error = DoDelimitedDataPopFrontL<HBufC16>(data16Bit, aList1);
|
sl@0
|
731 |
|
sl@0
|
732 |
CleanupStack::PopAndDestroy(2, title16Bit); // title16Bit, data16Bit
|
sl@0
|
733 |
aTestHarness->EndTest(error);
|
sl@0
|
734 |
|
sl@0
|
735 |
// Make 8-bit copy
|
sl@0
|
736 |
HBufC8* dataBuf = HBufC8::NewLC(aData.Length());
|
sl@0
|
737 |
TPtr8 initData8Bit = dataBuf->Des();
|
sl@0
|
738 |
initData8Bit.Copy(aData);
|
sl@0
|
739 |
|
sl@0
|
740 |
// Create title
|
sl@0
|
741 |
HBufC* title8Bit = HBufC::NewLC(aTestTitle.Length() + KTitle8Bit().Length());
|
sl@0
|
742 |
title8Bit->Des().Format(KTitle8Bit, &aTestTitle);
|
sl@0
|
743 |
aTestHarness->StartTestL(*title8Bit);
|
sl@0
|
744 |
|
sl@0
|
745 |
// Create TDelimitedPathSegmentParser object and do parsing
|
sl@0
|
746 |
CDelimitedPathSegment8* data8Bit = CDelimitedPathSegment8::NewL(initData8Bit); // Also excersies NewLC()
|
sl@0
|
747 |
CleanupStack::PushL(data8Bit);
|
sl@0
|
748 |
|
sl@0
|
749 |
error = DoDelimitedDataPopFrontL<HBufC8>(data8Bit, aList2);
|
sl@0
|
750 |
|
sl@0
|
751 |
aTestHarness->EndTest(error);
|
sl@0
|
752 |
CleanupStack::PopAndDestroy(3, dataBuf); // dataBuf, title8Bit, data8Bit
|
sl@0
|
753 |
}
|
sl@0
|
754 |
|
sl@0
|
755 |
void TestDelimitedDataPopBackL(const TDesC& aTestTitle, CIpuTestHarness* aTestHarness,
|
sl@0
|
756 |
const TDesC& aData, VA_LIST& aList1, VA_LIST& aList2)
|
sl@0
|
757 |
{
|
sl@0
|
758 |
// Create title
|
sl@0
|
759 |
HBufC* title16Bit = HBufC::NewLC(aTestTitle.Length() + KTitle16Bit().Length());
|
sl@0
|
760 |
title16Bit->Des().Format(KTitle16Bit, &aTestTitle);
|
sl@0
|
761 |
aTestHarness->StartTestL(*title16Bit);
|
sl@0
|
762 |
|
sl@0
|
763 |
// Create TDelimitedPathSegmentParser object and do parsing
|
sl@0
|
764 |
CDelimitedPathSegment16* data16Bit = CDelimitedPathSegment16::NewL(aData); // Also excersies NewLC()
|
sl@0
|
765 |
CleanupStack::PushL(data16Bit);
|
sl@0
|
766 |
|
sl@0
|
767 |
TInt error = DoDelimitedDataPopBackL<HBufC16>(data16Bit, aList1);
|
sl@0
|
768 |
|
sl@0
|
769 |
CleanupStack::PopAndDestroy(2, title16Bit); // title16Bit, data16Bit
|
sl@0
|
770 |
aTestHarness->EndTest(error);
|
sl@0
|
771 |
|
sl@0
|
772 |
// Make 8-bit copy
|
sl@0
|
773 |
HBufC8* dataBuf = HBufC8::NewLC(aData.Length());
|
sl@0
|
774 |
TPtr8 initData8Bit = dataBuf->Des();
|
sl@0
|
775 |
initData8Bit.Copy(aData);
|
sl@0
|
776 |
|
sl@0
|
777 |
// Create title
|
sl@0
|
778 |
HBufC* title8Bit = HBufC::NewLC(aTestTitle.Length() + KTitle8Bit().Length());
|
sl@0
|
779 |
title8Bit->Des().Format(KTitle8Bit, &aTestTitle);
|
sl@0
|
780 |
aTestHarness->StartTestL(*title8Bit);
|
sl@0
|
781 |
|
sl@0
|
782 |
// Create TDelimitedPathSegmentParser object and do parsing
|
sl@0
|
783 |
CDelimitedPathSegment8* data8Bit = CDelimitedPathSegment8::NewL(initData8Bit); // Also excersies NewLC()
|
sl@0
|
784 |
CleanupStack::PushL(data8Bit);
|
sl@0
|
785 |
|
sl@0
|
786 |
error = DoDelimitedDataPopBackL<HBufC8>(data8Bit, aList2);
|
sl@0
|
787 |
|
sl@0
|
788 |
aTestHarness->EndTest(error);
|
sl@0
|
789 |
CleanupStack::PopAndDestroy(3, dataBuf); // dataBuf, title8Bit, data8Bit
|
sl@0
|
790 |
}
|
sl@0
|
791 |
|
sl@0
|
792 |
void TestDelimitedDataAddAndTrimFrontAndBackDelimiterL(const TDesC& aTestTitle, CIpuTestHarness* aTestHarness, const TDesC& aData)
|
sl@0
|
793 |
{
|
sl@0
|
794 |
// Create title
|
sl@0
|
795 |
HBufC* title16Bit = HBufC::NewLC(aTestTitle.Length() + KTitle16Bit().Length());
|
sl@0
|
796 |
title16Bit->Des().Format(KTitle16Bit, &aTestTitle);
|
sl@0
|
797 |
aTestHarness->StartTestL(*title16Bit);
|
sl@0
|
798 |
|
sl@0
|
799 |
// Create TDelimitedPathSegmentParser object and do parsing
|
sl@0
|
800 |
CDelimitedPathSegment16* data16Bit = CDelimitedPathSegment16::NewL(aData); // Also excersies NewLC()
|
sl@0
|
801 |
CleanupStack::PushL(data16Bit);
|
sl@0
|
802 |
|
sl@0
|
803 |
TInt error = DoDelimitedDataAddAndTrimFrontAndBackDelimiterL(data16Bit);
|
sl@0
|
804 |
|
sl@0
|
805 |
CleanupStack::PopAndDestroy(2, title16Bit); // title16Bit, data16Bit
|
sl@0
|
806 |
aTestHarness->EndTest(error);
|
sl@0
|
807 |
|
sl@0
|
808 |
// Make 8-bit copy
|
sl@0
|
809 |
HBufC8* dataBuf = HBufC8::NewLC(aData.Length());
|
sl@0
|
810 |
TPtr8 initData8Bit = dataBuf->Des();
|
sl@0
|
811 |
initData8Bit.Copy(aData);
|
sl@0
|
812 |
|
sl@0
|
813 |
// Create title
|
sl@0
|
814 |
HBufC* title8Bit = HBufC::NewLC(aTestTitle.Length() + KTitle8Bit().Length());
|
sl@0
|
815 |
title8Bit->Des().Format(KTitle8Bit, &aTestTitle);
|
sl@0
|
816 |
aTestHarness->StartTestL(*title8Bit);
|
sl@0
|
817 |
|
sl@0
|
818 |
// Create TDelimitedPathSegmentParser object and do parsing
|
sl@0
|
819 |
CDelimitedPathSegment8* data8Bit = CDelimitedPathSegment8::NewL(initData8Bit); // Also excersies NewLC()
|
sl@0
|
820 |
CleanupStack::PushL(data8Bit);
|
sl@0
|
821 |
|
sl@0
|
822 |
error = DoDelimitedDataAddAndTrimFrontAndBackDelimiterL(data8Bit);
|
sl@0
|
823 |
|
sl@0
|
824 |
aTestHarness->EndTest(error);
|
sl@0
|
825 |
CleanupStack::PopAndDestroy(3, dataBuf); // dataBuf, title8Bit, data8Bit
|
sl@0
|
826 |
}
|
sl@0
|
827 |
|
sl@0
|
828 |
void TestDelimitedDataInsertAndParseL(const TDesC& aTestTitle, CIpuTestHarness* aTestHarness,
|
sl@0
|
829 |
const TDesC& aData, VA_LIST& aList1, VA_LIST& aList2, TInt aStartPos)
|
sl@0
|
830 |
{
|
sl@0
|
831 |
// Create title
|
sl@0
|
832 |
HBufC* title16Bit = HBufC::NewLC(aTestTitle.Length() + KTitle16Bit().Length());
|
sl@0
|
833 |
title16Bit->Des().Format(KTitle16Bit, &aTestTitle);
|
sl@0
|
834 |
aTestHarness->StartTestL(*title16Bit);
|
sl@0
|
835 |
|
sl@0
|
836 |
// Create TDelimitedPathSegmentParser object and do parsing
|
sl@0
|
837 |
CDelimitedPathSegment16* data16Bit = CDelimitedPathSegment16::NewL(aData); // Also excersies NewLC()
|
sl@0
|
838 |
CleanupStack::PushL(data16Bit);
|
sl@0
|
839 |
|
sl@0
|
840 |
// Do initial parse and get to position
|
sl@0
|
841 |
data16Bit->Parse();
|
sl@0
|
842 |
TInt error = DoDelimitedDataParseToPosition(data16Bit, aStartPos);
|
sl@0
|
843 |
if( error == KErrNone )
|
sl@0
|
844 |
{
|
sl@0
|
845 |
error = DoDelimitedDataInsertL<HBufC16, TPtrC16>(data16Bit, aList1);
|
sl@0
|
846 |
}
|
sl@0
|
847 |
CleanupStack::PopAndDestroy(2, title16Bit); // title16Bit, data16Bit
|
sl@0
|
848 |
aTestHarness->EndTest(error);
|
sl@0
|
849 |
|
sl@0
|
850 |
// Make 8-bit copy
|
sl@0
|
851 |
HBufC8* dataBuf = HBufC8::NewLC(aData.Length());
|
sl@0
|
852 |
TPtr8 initData8Bit = dataBuf->Des();
|
sl@0
|
853 |
initData8Bit.Copy(aData);
|
sl@0
|
854 |
|
sl@0
|
855 |
// Create title
|
sl@0
|
856 |
HBufC* title8Bit = HBufC::NewLC(aTestTitle.Length() + KTitle8Bit().Length());
|
sl@0
|
857 |
title8Bit->Des().Format(KTitle8Bit, &aTestTitle);
|
sl@0
|
858 |
aTestHarness->StartTestL(*title8Bit);
|
sl@0
|
859 |
|
sl@0
|
860 |
// Create TDelimitedPathSegmentParser object and do parsing
|
sl@0
|
861 |
CDelimitedPathSegment8* data8Bit = CDelimitedPathSegment8::NewL(initData8Bit); // Also excersies NewLC()
|
sl@0
|
862 |
CleanupStack::PushL(data8Bit);
|
sl@0
|
863 |
|
sl@0
|
864 |
// Do initial parse and get to position
|
sl@0
|
865 |
data8Bit->Parse();
|
sl@0
|
866 |
error = DoDelimitedDataParseToPosition(data8Bit, aStartPos);
|
sl@0
|
867 |
if( error == KErrNone )
|
sl@0
|
868 |
{
|
sl@0
|
869 |
error = DoDelimitedDataInsertL<HBufC8, TPtrC8>(data8Bit, aList2);
|
sl@0
|
870 |
}
|
sl@0
|
871 |
aTestHarness->EndTest(error);
|
sl@0
|
872 |
CleanupStack::PopAndDestroy(3, dataBuf); // dataBuf, title8Bit, data8Bit
|
sl@0
|
873 |
}
|
sl@0
|
874 |
|
sl@0
|
875 |
void TestDelimitedDataRemoveAndParseL(const TDesC& aTestTitle, CIpuTestHarness* aTestHarness,
|
sl@0
|
876 |
const TDesC& aData, VA_LIST& aList1, VA_LIST& aList2, TInt aStartPos)
|
sl@0
|
877 |
{
|
sl@0
|
878 |
// Create title
|
sl@0
|
879 |
HBufC* title16Bit = HBufC::NewLC(aTestTitle.Length() + KTitle16Bit().Length());
|
sl@0
|
880 |
title16Bit->Des().Format(KTitle16Bit, &aTestTitle);
|
sl@0
|
881 |
aTestHarness->StartTestL(*title16Bit);
|
sl@0
|
882 |
|
sl@0
|
883 |
// Create TDelimitedPathSegmentParser object and do parsing
|
sl@0
|
884 |
CDelimitedPathSegment16* data16Bit = CDelimitedPathSegment16::NewL(aData); // Also excersies NewLC()
|
sl@0
|
885 |
CleanupStack::PushL(data16Bit);
|
sl@0
|
886 |
|
sl@0
|
887 |
// Do initial parse and get to position
|
sl@0
|
888 |
data16Bit->Parse();
|
sl@0
|
889 |
TInt error = DoDelimitedDataParseToPosition(data16Bit, aStartPos);
|
sl@0
|
890 |
if( error == KErrNone )
|
sl@0
|
891 |
{
|
sl@0
|
892 |
error = DoDelimitedDataRemoveL<HBufC16, TPtrC16>(data16Bit, aList1);
|
sl@0
|
893 |
}
|
sl@0
|
894 |
CleanupStack::PopAndDestroy(2, title16Bit); // title16Bit, data16Bit
|
sl@0
|
895 |
aTestHarness->EndTest(error);
|
sl@0
|
896 |
|
sl@0
|
897 |
// Make 8-bit copy
|
sl@0
|
898 |
HBufC8* dataBuf = HBufC8::NewLC(aData.Length());
|
sl@0
|
899 |
TPtr8 initData8Bit = dataBuf->Des();
|
sl@0
|
900 |
initData8Bit.Copy(aData);
|
sl@0
|
901 |
|
sl@0
|
902 |
// Create title
|
sl@0
|
903 |
HBufC* title8Bit = HBufC::NewLC(aTestTitle.Length() + KTitle8Bit().Length());
|
sl@0
|
904 |
title8Bit->Des().Format(KTitle8Bit, &aTestTitle);
|
sl@0
|
905 |
aTestHarness->StartTestL(*title8Bit);
|
sl@0
|
906 |
|
sl@0
|
907 |
// Create TDelimitedPathSegmentParser object and do parsing
|
sl@0
|
908 |
CDelimitedPathSegment8* data8Bit = CDelimitedPathSegment8::NewL(initData8Bit); // Also excersies NewLC()
|
sl@0
|
909 |
CleanupStack::PushL(data8Bit);
|
sl@0
|
910 |
|
sl@0
|
911 |
// Do initial parse and get to position
|
sl@0
|
912 |
data8Bit->Parse();
|
sl@0
|
913 |
error = DoDelimitedDataParseToPosition(data8Bit, aStartPos);
|
sl@0
|
914 |
if( error == KErrNone )
|
sl@0
|
915 |
{
|
sl@0
|
916 |
error = DoDelimitedDataRemoveL<HBufC8, TPtrC8>(data8Bit, aList2);
|
sl@0
|
917 |
}
|
sl@0
|
918 |
aTestHarness->EndTest(error);
|
sl@0
|
919 |
CleanupStack::PopAndDestroy(3, dataBuf); // dataBuf, title8Bit, data8Bit
|
sl@0
|
920 |
}
|
sl@0
|
921 |
|
sl@0
|
922 |
void TestDelimitedDataInsertAndParseReverseL(const TDesC& aTestTitle, CIpuTestHarness* aTestHarness,
|
sl@0
|
923 |
const TDesC& aData, VA_LIST& aList1, VA_LIST& aList2, TInt aStartPos)
|
sl@0
|
924 |
{
|
sl@0
|
925 |
// Create title
|
sl@0
|
926 |
HBufC* title16Bit = HBufC::NewLC(aTestTitle.Length() + KTitle16Bit().Length());
|
sl@0
|
927 |
title16Bit->Des().Format(KTitle16Bit, &aTestTitle);
|
sl@0
|
928 |
aTestHarness->StartTestL(*title16Bit);
|
sl@0
|
929 |
|
sl@0
|
930 |
// Create TDelimitedPathSegmentParser object and do parsing
|
sl@0
|
931 |
CDelimitedPathSegment16* data16Bit = CDelimitedPathSegment16::NewL(aData); // Also excersies NewLC()
|
sl@0
|
932 |
CleanupStack::PushL(data16Bit);
|
sl@0
|
933 |
|
sl@0
|
934 |
// Do initial parse and get to position
|
sl@0
|
935 |
data16Bit->ParseReverse();
|
sl@0
|
936 |
TInt error = DoDelimitedDataParseToPosition(data16Bit, aStartPos);
|
sl@0
|
937 |
if( error == KErrNone )
|
sl@0
|
938 |
{
|
sl@0
|
939 |
error = DoDelimitedDataInsertL<HBufC16, TPtrC16>(data16Bit, aList1);
|
sl@0
|
940 |
}
|
sl@0
|
941 |
CleanupStack::PopAndDestroy(2, title16Bit); // title16Bit, data16Bit
|
sl@0
|
942 |
aTestHarness->EndTest(error);
|
sl@0
|
943 |
|
sl@0
|
944 |
// Make 8-bit copy
|
sl@0
|
945 |
HBufC8* dataBuf = HBufC8::NewLC(aData.Length());
|
sl@0
|
946 |
TPtr8 initData8Bit = dataBuf->Des();
|
sl@0
|
947 |
initData8Bit.Copy(aData);
|
sl@0
|
948 |
|
sl@0
|
949 |
// Create title
|
sl@0
|
950 |
HBufC* title8Bit = HBufC::NewLC(aTestTitle.Length() + KTitle8Bit().Length());
|
sl@0
|
951 |
title8Bit->Des().Format(KTitle8Bit, &aTestTitle);
|
sl@0
|
952 |
aTestHarness->StartTestL(*title8Bit);
|
sl@0
|
953 |
|
sl@0
|
954 |
// Create TDelimitedPathSegmentParser object and do parsing
|
sl@0
|
955 |
CDelimitedPathSegment8* data8Bit = CDelimitedPathSegment8::NewL(initData8Bit); // Also excersies NewLC()
|
sl@0
|
956 |
CleanupStack::PushL(data8Bit);
|
sl@0
|
957 |
|
sl@0
|
958 |
// Do initial parse and get to position
|
sl@0
|
959 |
data8Bit->ParseReverse();
|
sl@0
|
960 |
error = DoDelimitedDataParseToPosition(data8Bit, aStartPos);
|
sl@0
|
961 |
if( error == KErrNone )
|
sl@0
|
962 |
{
|
sl@0
|
963 |
error = DoDelimitedDataInsertL<HBufC8, TPtrC8>(data8Bit, aList2);
|
sl@0
|
964 |
}
|
sl@0
|
965 |
aTestHarness->EndTest(error);
|
sl@0
|
966 |
CleanupStack::PopAndDestroy(3, dataBuf); // dataBuf, title8Bit, data8Bit
|
sl@0
|
967 |
}
|
sl@0
|
968 |
|
sl@0
|
969 |
void TestDelimitedDataRemoveAndParseReverseL(const TDesC& aTestTitle, CIpuTestHarness* aTestHarness,
|
sl@0
|
970 |
const TDesC& aData, VA_LIST& aList1, VA_LIST& aList2, TInt aStartPos)
|
sl@0
|
971 |
{
|
sl@0
|
972 |
// Create title
|
sl@0
|
973 |
HBufC* title16Bit = HBufC::NewLC(aTestTitle.Length() + KTitle16Bit().Length());
|
sl@0
|
974 |
title16Bit->Des().Format(KTitle16Bit, &aTestTitle);
|
sl@0
|
975 |
aTestHarness->StartTestL(*title16Bit);
|
sl@0
|
976 |
|
sl@0
|
977 |
// Create TDelimitedPathSegmentParser object and do parsing
|
sl@0
|
978 |
CDelimitedPathSegment16* data16Bit = CDelimitedPathSegment16::NewL(aData); // Also excersies NewLC()
|
sl@0
|
979 |
CleanupStack::PushL(data16Bit);
|
sl@0
|
980 |
|
sl@0
|
981 |
// Do initial parse and get to position
|
sl@0
|
982 |
data16Bit->ParseReverse();
|
sl@0
|
983 |
TInt error = DoDelimitedDataParseToPosition(data16Bit, aStartPos);
|
sl@0
|
984 |
if( error == KErrNone )
|
sl@0
|
985 |
{
|
sl@0
|
986 |
error = DoDelimitedDataRemoveL<HBufC16, TPtrC16>(data16Bit, aList1);
|
sl@0
|
987 |
}
|
sl@0
|
988 |
CleanupStack::PopAndDestroy(2, title16Bit); // title16Bit, data16Bit
|
sl@0
|
989 |
aTestHarness->EndTest(error);
|
sl@0
|
990 |
|
sl@0
|
991 |
// Make 8-bit copy
|
sl@0
|
992 |
HBufC8* dataBuf = HBufC8::NewLC(aData.Length());
|
sl@0
|
993 |
TPtr8 initData8Bit = dataBuf->Des();
|
sl@0
|
994 |
initData8Bit.Copy(aData);
|
sl@0
|
995 |
|
sl@0
|
996 |
// Create title
|
sl@0
|
997 |
HBufC* title8Bit = HBufC::NewLC(aTestTitle.Length() + KTitle8Bit().Length());
|
sl@0
|
998 |
title8Bit->Des().Format(KTitle8Bit, &aTestTitle);
|
sl@0
|
999 |
aTestHarness->StartTestL(*title8Bit);
|
sl@0
|
1000 |
|
sl@0
|
1001 |
// Create TDelimitedPathSegmentParser object and do parsing
|
sl@0
|
1002 |
CDelimitedPathSegment8* data8Bit = CDelimitedPathSegment8::NewL(initData8Bit); // Also excersies NewLC()
|
sl@0
|
1003 |
CleanupStack::PushL(data8Bit);
|
sl@0
|
1004 |
|
sl@0
|
1005 |
// Do initial parse and get to position
|
sl@0
|
1006 |
data8Bit->ParseReverse();
|
sl@0
|
1007 |
error = DoDelimitedDataParseToPosition(data8Bit, aStartPos);
|
sl@0
|
1008 |
if( error == KErrNone )
|
sl@0
|
1009 |
{
|
sl@0
|
1010 |
error = DoDelimitedDataRemoveL<HBufC8, TPtrC8>(data8Bit, aList2);
|
sl@0
|
1011 |
}
|
sl@0
|
1012 |
aTestHarness->EndTest(error);
|
sl@0
|
1013 |
CleanupStack::PopAndDestroy(3, dataBuf); // dataBuf, title8Bit, data8Bit
|
sl@0
|
1014 |
}
|
sl@0
|
1015 |
|
sl@0
|
1016 |
void TestDelimitedDataInsertEscapeAndParseL(const TDesC& aTestTitle, CIpuTestHarness* aTestHarness,
|
sl@0
|
1017 |
const TDesC& aData, VA_LIST& aList1, VA_LIST& aList2, TInt aStartPos)
|
sl@0
|
1018 |
{
|
sl@0
|
1019 |
// Create title
|
sl@0
|
1020 |
HBufC* title16Bit = HBufC::NewLC(aTestTitle.Length() + KTitle16Bit().Length());
|
sl@0
|
1021 |
title16Bit->Des().Format(KTitle16Bit, &aTestTitle);
|
sl@0
|
1022 |
aTestHarness->StartTestL(*title16Bit);
|
sl@0
|
1023 |
|
sl@0
|
1024 |
// Create TDelimitedPathSegmentParser object and do parsing
|
sl@0
|
1025 |
CDelimitedPathSegment16* data16Bit = CDelimitedPathSegment16::NewL(aData); // Also excersies NewLC()
|
sl@0
|
1026 |
CleanupStack::PushL(data16Bit);
|
sl@0
|
1027 |
|
sl@0
|
1028 |
// Do initial parse and get to position
|
sl@0
|
1029 |
data16Bit->Parse();
|
sl@0
|
1030 |
TInt error = DoDelimitedDataParseToPosition(data16Bit, aStartPos);
|
sl@0
|
1031 |
if( error == KErrNone )
|
sl@0
|
1032 |
{
|
sl@0
|
1033 |
error = DoDelimitedDataInsertAndEscapeL<HBufC16, TPtrC16>(data16Bit, aList1);
|
sl@0
|
1034 |
}
|
sl@0
|
1035 |
CleanupStack::PopAndDestroy(2, title16Bit); // title16Bit, data16Bit
|
sl@0
|
1036 |
aTestHarness->EndTest(error);
|
sl@0
|
1037 |
|
sl@0
|
1038 |
// Make 8-bit copy
|
sl@0
|
1039 |
HBufC8* dataBuf = HBufC8::NewLC(aData.Length());
|
sl@0
|
1040 |
TPtr8 initData8Bit = dataBuf->Des();
|
sl@0
|
1041 |
initData8Bit.Copy(aData);
|
sl@0
|
1042 |
|
sl@0
|
1043 |
// Create title
|
sl@0
|
1044 |
HBufC* title8Bit = HBufC::NewLC(aTestTitle.Length() + KTitle8Bit().Length());
|
sl@0
|
1045 |
title8Bit->Des().Format(KTitle8Bit, &aTestTitle);
|
sl@0
|
1046 |
aTestHarness->StartTestL(*title8Bit);
|
sl@0
|
1047 |
|
sl@0
|
1048 |
// Create TDelimitedPathSegmentParser object and do parsing
|
sl@0
|
1049 |
CDelimitedPathSegment8* data8Bit = CDelimitedPathSegment8::NewL(initData8Bit); // Also excersies NewLC()
|
sl@0
|
1050 |
CleanupStack::PushL(data8Bit);
|
sl@0
|
1051 |
|
sl@0
|
1052 |
// Do initial parse and get to position
|
sl@0
|
1053 |
data8Bit->Parse();
|
sl@0
|
1054 |
error = DoDelimitedDataParseToPosition(data8Bit, aStartPos);
|
sl@0
|
1055 |
if( error == KErrNone )
|
sl@0
|
1056 |
{
|
sl@0
|
1057 |
error = DoDelimitedDataInsertAndEscapeL<HBufC8, TPtrC8>(data8Bit, aList2);
|
sl@0
|
1058 |
}
|
sl@0
|
1059 |
aTestHarness->EndTest(error);
|
sl@0
|
1060 |
CleanupStack::PopAndDestroy(3, dataBuf); // dataBuf, title8Bit, data8Bit
|
sl@0
|
1061 |
}
|
sl@0
|
1062 |
|
sl@0
|
1063 |
void TestDelimitedDataInsertEscapeAndParseReverseL(const TDesC& aTestTitle, CIpuTestHarness* aTestHarness,
|
sl@0
|
1064 |
const TDesC& aData, VA_LIST& aList1, VA_LIST& aList2, TInt aStartPos)
|
sl@0
|
1065 |
{
|
sl@0
|
1066 |
// Create title
|
sl@0
|
1067 |
HBufC* title16Bit = HBufC::NewLC(aTestTitle.Length() + KTitle16Bit().Length());
|
sl@0
|
1068 |
title16Bit->Des().Format(KTitle16Bit, &aTestTitle);
|
sl@0
|
1069 |
aTestHarness->StartTestL(*title16Bit);
|
sl@0
|
1070 |
|
sl@0
|
1071 |
// Create TDelimitedPathSegmentParser object and do parsing
|
sl@0
|
1072 |
CDelimitedPathSegment16* data16Bit = CDelimitedPathSegment16::NewL(aData); // Also excersies NewLC()
|
sl@0
|
1073 |
CleanupStack::PushL(data16Bit);
|
sl@0
|
1074 |
|
sl@0
|
1075 |
// Do initial parse and get to position
|
sl@0
|
1076 |
data16Bit->ParseReverse();
|
sl@0
|
1077 |
TInt error = DoDelimitedDataParseToPosition(data16Bit, aStartPos);
|
sl@0
|
1078 |
if( error == KErrNone )
|
sl@0
|
1079 |
{
|
sl@0
|
1080 |
error = DoDelimitedDataInsertAndEscapeL<HBufC16, TPtrC16>(data16Bit, aList1);
|
sl@0
|
1081 |
}
|
sl@0
|
1082 |
CleanupStack::PopAndDestroy(2, title16Bit); // title16Bit, data16Bit
|
sl@0
|
1083 |
aTestHarness->EndTest(error);
|
sl@0
|
1084 |
|
sl@0
|
1085 |
// Make 8-bit copy
|
sl@0
|
1086 |
HBufC8* dataBuf = HBufC8::NewLC(aData.Length());
|
sl@0
|
1087 |
TPtr8 initData8Bit = dataBuf->Des();
|
sl@0
|
1088 |
initData8Bit.Copy(aData);
|
sl@0
|
1089 |
|
sl@0
|
1090 |
// Create title
|
sl@0
|
1091 |
HBufC* title8Bit = HBufC::NewLC(aTestTitle.Length() + KTitle8Bit().Length());
|
sl@0
|
1092 |
title8Bit->Des().Format(KTitle8Bit, &aTestTitle);
|
sl@0
|
1093 |
aTestHarness->StartTestL(*title8Bit);
|
sl@0
|
1094 |
|
sl@0
|
1095 |
// Create TDelimitedPathSegmentParser object and do parsing
|
sl@0
|
1096 |
CDelimitedPathSegment8* data8Bit = CDelimitedPathSegment8::NewL(initData8Bit); // Also excersies NewLC()
|
sl@0
|
1097 |
CleanupStack::PushL(data8Bit);
|
sl@0
|
1098 |
|
sl@0
|
1099 |
// Do initial parse and get to position
|
sl@0
|
1100 |
data8Bit->ParseReverse();
|
sl@0
|
1101 |
error = DoDelimitedDataParseToPosition(data8Bit, aStartPos);
|
sl@0
|
1102 |
if( error == KErrNone )
|
sl@0
|
1103 |
{
|
sl@0
|
1104 |
error = DoDelimitedDataInsertAndEscapeL<HBufC8, TPtrC8>(data8Bit, aList2);
|
sl@0
|
1105 |
}
|
sl@0
|
1106 |
aTestHarness->EndTest(error);
|
sl@0
|
1107 |
CleanupStack::PopAndDestroy(3, dataBuf); // dataBuf, title8Bit, data8Bit
|
sl@0
|
1108 |
}
|
sl@0
|
1109 |
|
sl@0
|
1110 |
//
|
sl@0
|
1111 |
//
|
sl@0
|
1112 |
// Implementation of LOCAL functions - helper functions
|
sl@0
|
1113 |
//
|
sl@0
|
1114 |
//
|
sl@0
|
1115 |
|
sl@0
|
1116 |
#include "TDelimitedDataCommon.cpp"
|
sl@0
|
1117 |
|