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 |
#ifndef __CDELIMITEDPATHSEGMENTTEST_H__
|
sl@0
|
17 |
#define __CDELIMITEDPATHSEGMENTTEST_H__
|
sl@0
|
18 |
|
sl@0
|
19 |
#include <e32base.h>
|
sl@0
|
20 |
|
sl@0
|
21 |
#include "ctestbase.h"
|
sl@0
|
22 |
|
sl@0
|
23 |
class CDelimitedPathSegmentTest : public CTestBase
|
sl@0
|
24 |
{
|
sl@0
|
25 |
public:
|
sl@0
|
26 |
|
sl@0
|
27 |
// Static factory c'tor.
|
sl@0
|
28 |
//
|
sl@0
|
29 |
// Rtn: pointer to newly created object - ownership transfered to caller.
|
sl@0
|
30 |
//
|
sl@0
|
31 |
static CDelimitedPathSegmentTest* NewLC(CIpuTestHarness* aTestHarness);
|
sl@0
|
32 |
|
sl@0
|
33 |
// Static factory c'tor.
|
sl@0
|
34 |
//
|
sl@0
|
35 |
// Rtn: pointer to newly created object - ownership transfered to caller.
|
sl@0
|
36 |
//
|
sl@0
|
37 |
static CDelimitedPathSegmentTest* NewL(CIpuTestHarness* aTestHarness);
|
sl@0
|
38 |
|
sl@0
|
39 |
// D'tor
|
sl@0
|
40 |
//
|
sl@0
|
41 |
~CDelimitedPathSegmentTest();
|
sl@0
|
42 |
|
sl@0
|
43 |
// Does the tests
|
sl@0
|
44 |
//
|
sl@0
|
45 |
void DoTestsL();
|
sl@0
|
46 |
|
sl@0
|
47 |
private:
|
sl@0
|
48 |
|
sl@0
|
49 |
// C'tor
|
sl@0
|
50 |
//
|
sl@0
|
51 |
CDelimitedPathSegmentTest(CIpuTestHarness* aTestHarness);
|
sl@0
|
52 |
|
sl@0
|
53 |
// 2nd phase construction
|
sl@0
|
54 |
//
|
sl@0
|
55 |
void ConstructL();
|
sl@0
|
56 |
|
sl@0
|
57 |
//
|
sl@0
|
58 |
//
|
sl@0
|
59 |
// DelimitedPathSegment Tests
|
sl@0
|
60 |
//
|
sl@0
|
61 |
//
|
sl@0
|
62 |
|
sl@0
|
63 |
// Tests extraction of path segment params from left to right.
|
sl@0
|
64 |
//
|
sl@0
|
65 |
// In:
|
sl@0
|
66 |
// aPathSegment - descriptor with path segment
|
sl@0
|
67 |
// ... - list of one or more params
|
sl@0
|
68 |
//
|
sl@0
|
69 |
void TestDelimitedPathSegmentExtractionL(TRefByValue<const TDesC> aPathSegment, ...) const;
|
sl@0
|
70 |
|
sl@0
|
71 |
// Tests extraction of path segment params from right to left.
|
sl@0
|
72 |
//
|
sl@0
|
73 |
// In:
|
sl@0
|
74 |
// aPathSegment - descriptor with path segment
|
sl@0
|
75 |
// ... - list of one or more params
|
sl@0
|
76 |
//
|
sl@0
|
77 |
void TestDelimitedPathSegmentReverseExtractionL(TRefByValue<const TDesC> aPathSegment, ...) const;
|
sl@0
|
78 |
|
sl@0
|
79 |
// Tests for presence of front and back delimiters
|
sl@0
|
80 |
//
|
sl@0
|
81 |
// In:
|
sl@0
|
82 |
// aPathSegment - the path segment
|
sl@0
|
83 |
// aFrontDelim - indicated whethere there is a front delimiter or not
|
sl@0
|
84 |
// aBackDelim - indicated whethere there is a back delimiter or not
|
sl@0
|
85 |
//
|
sl@0
|
86 |
void TestDelimitedPathSegmentDelimiterPresenceL(const TDesC& aPathSegment, TBool aFrontDelim, TBool aBackDelim) const;
|
sl@0
|
87 |
|
sl@0
|
88 |
// Tests remainder functionality for forward parsing
|
sl@0
|
89 |
//
|
sl@0
|
90 |
// In:
|
sl@0
|
91 |
// aPathSegment - the path segment
|
sl@0
|
92 |
// ... - list of the expected remainders
|
sl@0
|
93 |
//
|
sl@0
|
94 |
void TestDelimitedPathSegmentRemainderL(TRefByValue<const TDesC> aPathSegment, ...) const;
|
sl@0
|
95 |
|
sl@0
|
96 |
// Tests remainder functionality for reverse parsing
|
sl@0
|
97 |
//
|
sl@0
|
98 |
// In:
|
sl@0
|
99 |
// aPathSegment - the path segment
|
sl@0
|
100 |
// ... - list of the expected remainders
|
sl@0
|
101 |
//
|
sl@0
|
102 |
void TestDelimitedPathSegmentRemainderReverseL(TRefByValue<const TDesC> aPathSegment, ...) const;
|
sl@0
|
103 |
|
sl@0
|
104 |
// Tests Des() function
|
sl@0
|
105 |
//
|
sl@0
|
106 |
// In:
|
sl@0
|
107 |
// aPathSegment - the path segment
|
sl@0
|
108 |
//
|
sl@0
|
109 |
void TestDelimitedPathSegmentDesL(const TDesC& aPathSegment) const;
|
sl@0
|
110 |
|
sl@0
|
111 |
// Tests PushFront(), NewL() and NewLC()
|
sl@0
|
112 |
//
|
sl@0
|
113 |
// In:
|
sl@0
|
114 |
// aPathSegment - the path segment
|
sl@0
|
115 |
// ... - list of the params and expected full path segment for each push
|
sl@0
|
116 |
//
|
sl@0
|
117 |
void TestDelimitedPathSegmentPushFrontL(TRefByValue<const TDesC> aPathSegment, ...) const;
|
sl@0
|
118 |
|
sl@0
|
119 |
// Tests PushBack(), NewL() and NewLC()
|
sl@0
|
120 |
//
|
sl@0
|
121 |
// In:
|
sl@0
|
122 |
// aPathSegment - the path segment
|
sl@0
|
123 |
// ... - list of the params and expected full path segment for each push
|
sl@0
|
124 |
//
|
sl@0
|
125 |
void TestDelimitedPathSegmentPushBackL(TRefByValue<const TDesC> aPathSegment, ...) const;
|
sl@0
|
126 |
|
sl@0
|
127 |
// Tests PopFront(), NewL() and NewLC()
|
sl@0
|
128 |
//
|
sl@0
|
129 |
// In:
|
sl@0
|
130 |
// aPathSegment - the path segment
|
sl@0
|
131 |
// ... - list of the expected full path segment for each pop
|
sl@0
|
132 |
//
|
sl@0
|
133 |
void TestDelimitedPathSegmentPopFrontL(TRefByValue<const TDesC> aPathSegment, ...) const;
|
sl@0
|
134 |
|
sl@0
|
135 |
// Tests PopBack(), NewL() and NewLC()
|
sl@0
|
136 |
//
|
sl@0
|
137 |
// In:
|
sl@0
|
138 |
// aPathSegment - the path segment
|
sl@0
|
139 |
// ... - list of the expected full path segment for each pop
|
sl@0
|
140 |
//
|
sl@0
|
141 |
void TestDelimitedPathSegmentPopBackL(TRefByValue<const TDesC> aPathSegment, ...) const;
|
sl@0
|
142 |
|
sl@0
|
143 |
// Tests adding and triming of fromt and back delimiters
|
sl@0
|
144 |
//
|
sl@0
|
145 |
// In:
|
sl@0
|
146 |
// aPathSegment - the path segment
|
sl@0
|
147 |
//
|
sl@0
|
148 |
void TestDelimitedPathSegmentAddAndTrimFrontAndBackDelimiterL(const TDesC& aPathSegment) const;
|
sl@0
|
149 |
|
sl@0
|
150 |
// Tests InsertCurrent(), Parse()
|
sl@0
|
151 |
//
|
sl@0
|
152 |
// In:
|
sl@0
|
153 |
// aStartPos - position from the start of parsing of where to insert
|
sl@0
|
154 |
// aPathSegment - the path segment
|
sl@0
|
155 |
// ... - list of the params and expected full path segment for each insert
|
sl@0
|
156 |
//
|
sl@0
|
157 |
void TestDelimitedPathSegmentInsertAndParseL(TInt aStartPos, TRefByValue<const TDesC> aPathSegment, ...) const;
|
sl@0
|
158 |
|
sl@0
|
159 |
// Tests RemoveCurrent(), Parse()
|
sl@0
|
160 |
//
|
sl@0
|
161 |
// In:
|
sl@0
|
162 |
// aStartPos - position from the start of parsing of where to remove
|
sl@0
|
163 |
// aPathSegment - the path segment
|
sl@0
|
164 |
// ... - list of the expected full path segment for each remove
|
sl@0
|
165 |
//
|
sl@0
|
166 |
void TestDelimitedPathSegmentRemoveAndParseL(TInt aStartPos, TRefByValue<const TDesC> aPathSegment, ...) const;
|
sl@0
|
167 |
|
sl@0
|
168 |
// Tests InsertCurrent(), ParseReverse()
|
sl@0
|
169 |
//
|
sl@0
|
170 |
// In:
|
sl@0
|
171 |
// aStartPos - position from the start of parsing of where to insert
|
sl@0
|
172 |
// aPathSegment - the path segment
|
sl@0
|
173 |
// ... - list of the params and expected full path segment for each insert
|
sl@0
|
174 |
//
|
sl@0
|
175 |
void TestDelimitedPathSegmentInsertAndParseReverseL(TInt aStartPos, TRefByValue<const TDesC> aPathSegment, ...) const;
|
sl@0
|
176 |
|
sl@0
|
177 |
// Tests RemoveCurrent(), ParseReverse()
|
sl@0
|
178 |
//
|
sl@0
|
179 |
// In:
|
sl@0
|
180 |
// aStartPos - position from the start of parsing of where to remove
|
sl@0
|
181 |
// aPathSegment - the path segment
|
sl@0
|
182 |
// ... - list of the expected full path segment for each remove
|
sl@0
|
183 |
//
|
sl@0
|
184 |
void TestDelimitedPathSegmentRemoveAndParseReverseL(TInt aStartPos, TRefByValue<const TDesC> aPathSegment, ...) const;
|
sl@0
|
185 |
|
sl@0
|
186 |
// Tests InsertAndEscapeCurrent(), Parse()
|
sl@0
|
187 |
//
|
sl@0
|
188 |
// In:
|
sl@0
|
189 |
// aStartPos - position from the start of parsing of where to insert
|
sl@0
|
190 |
// aPathSegment - the path segment
|
sl@0
|
191 |
// ... - list of the params and expected full path segment for each insert
|
sl@0
|
192 |
//
|
sl@0
|
193 |
void TestDelimitedPathSegmentInsertEscapeAndParseL(TInt aStartPos, TRefByValue<const TDesC> aPathSegment, ...) const;
|
sl@0
|
194 |
|
sl@0
|
195 |
// Tests InsertAndEscapeCurrent(), ParseReverse()
|
sl@0
|
196 |
//
|
sl@0
|
197 |
// In:
|
sl@0
|
198 |
// aStartPos - position from the start of parsing of where to insert
|
sl@0
|
199 |
// aPathSegment - the path segment
|
sl@0
|
200 |
// ... - list of the params and expected full path segment for each insert
|
sl@0
|
201 |
//
|
sl@0
|
202 |
void TestDelimitedPathSegmentInsertEscapeAndParseReverseL(TInt aStartPos, TRefByValue<const TDesC> aPathSegment, ...) const;
|
sl@0
|
203 |
|
sl@0
|
204 |
// Tests PushAndEscapeFront(), NewL() and NewLC()
|
sl@0
|
205 |
//
|
sl@0
|
206 |
// In:
|
sl@0
|
207 |
// aPathSegment - the path segment
|
sl@0
|
208 |
// ... - list of the params and expected full path segment for each push
|
sl@0
|
209 |
//
|
sl@0
|
210 |
void TestDelimitedPathSegmentPushAndEscapeFrontL(TRefByValue<const TDesC> aPathSegment, ...) const;
|
sl@0
|
211 |
|
sl@0
|
212 |
// Tests PushAndEscapeBack(), NewL() and NewLC()
|
sl@0
|
213 |
//
|
sl@0
|
214 |
// In:
|
sl@0
|
215 |
// aPathSegment - the path segment
|
sl@0
|
216 |
// ... - list of the params and expected full path segment for each push
|
sl@0
|
217 |
//
|
sl@0
|
218 |
void TestDelimitedPathSegmentPushAndEscapeBackL(TRefByValue<const TDesC> aPathSegment, ...) const;
|
sl@0
|
219 |
|
sl@0
|
220 |
private: // Attributes
|
sl@0
|
221 |
|
sl@0
|
222 |
// Test harness
|
sl@0
|
223 |
//
|
sl@0
|
224 |
CIpuTestHarness* iTestHarness;
|
sl@0
|
225 |
|
sl@0
|
226 |
};
|
sl@0
|
227 |
|
sl@0
|
228 |
#endif // __CDELIMITEDPATHSEGMENTTEST_H__
|
sl@0
|
229 |
|
sl@0
|
230 |
|