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 #ifndef __CDELIMITEDPATHSEGMENTTEST_H__
17 #define __CDELIMITEDPATHSEGMENTTEST_H__
21 #include "ctestbase.h"
23 class CDelimitedPathSegmentTest : public CTestBase
27 // Static factory c'tor.
29 // Rtn: pointer to newly created object - ownership transfered to caller.
31 static CDelimitedPathSegmentTest* NewLC(CIpuTestHarness* aTestHarness);
33 // Static factory c'tor.
35 // Rtn: pointer to newly created object - ownership transfered to caller.
37 static CDelimitedPathSegmentTest* NewL(CIpuTestHarness* aTestHarness);
41 ~CDelimitedPathSegmentTest();
51 CDelimitedPathSegmentTest(CIpuTestHarness* aTestHarness);
53 // 2nd phase construction
59 // DelimitedPathSegment Tests
63 // Tests extraction of path segment params from left to right.
66 // aPathSegment - descriptor with path segment
67 // ... - list of one or more params
69 void TestDelimitedPathSegmentExtractionL(TRefByValue<const TDesC> aPathSegment, ...) const;
71 // Tests extraction of path segment params from right to left.
74 // aPathSegment - descriptor with path segment
75 // ... - list of one or more params
77 void TestDelimitedPathSegmentReverseExtractionL(TRefByValue<const TDesC> aPathSegment, ...) const;
79 // Tests for presence of front and back delimiters
82 // aPathSegment - the path segment
83 // aFrontDelim - indicated whethere there is a front delimiter or not
84 // aBackDelim - indicated whethere there is a back delimiter or not
86 void TestDelimitedPathSegmentDelimiterPresenceL(const TDesC& aPathSegment, TBool aFrontDelim, TBool aBackDelim) const;
88 // Tests remainder functionality for forward parsing
91 // aPathSegment - the path segment
92 // ... - list of the expected remainders
94 void TestDelimitedPathSegmentRemainderL(TRefByValue<const TDesC> aPathSegment, ...) const;
96 // Tests remainder functionality for reverse parsing
99 // aPathSegment - the path segment
100 // ... - list of the expected remainders
102 void TestDelimitedPathSegmentRemainderReverseL(TRefByValue<const TDesC> aPathSegment, ...) const;
104 // Tests Des() function
107 // aPathSegment - the path segment
109 void TestDelimitedPathSegmentDesL(const TDesC& aPathSegment) const;
111 // Tests PushFront(), NewL() and NewLC()
114 // aPathSegment - the path segment
115 // ... - list of the params and expected full path segment for each push
117 void TestDelimitedPathSegmentPushFrontL(TRefByValue<const TDesC> aPathSegment, ...) const;
119 // Tests PushBack(), NewL() and NewLC()
122 // aPathSegment - the path segment
123 // ... - list of the params and expected full path segment for each push
125 void TestDelimitedPathSegmentPushBackL(TRefByValue<const TDesC> aPathSegment, ...) const;
127 // Tests PopFront(), NewL() and NewLC()
130 // aPathSegment - the path segment
131 // ... - list of the expected full path segment for each pop
133 void TestDelimitedPathSegmentPopFrontL(TRefByValue<const TDesC> aPathSegment, ...) const;
135 // Tests PopBack(), NewL() and NewLC()
138 // aPathSegment - the path segment
139 // ... - list of the expected full path segment for each pop
141 void TestDelimitedPathSegmentPopBackL(TRefByValue<const TDesC> aPathSegment, ...) const;
143 // Tests adding and triming of fromt and back delimiters
146 // aPathSegment - the path segment
148 void TestDelimitedPathSegmentAddAndTrimFrontAndBackDelimiterL(const TDesC& aPathSegment) const;
150 // Tests InsertCurrent(), Parse()
153 // aStartPos - position from the start of parsing of where to insert
154 // aPathSegment - the path segment
155 // ... - list of the params and expected full path segment for each insert
157 void TestDelimitedPathSegmentInsertAndParseL(TInt aStartPos, TRefByValue<const TDesC> aPathSegment, ...) const;
159 // Tests RemoveCurrent(), Parse()
162 // aStartPos - position from the start of parsing of where to remove
163 // aPathSegment - the path segment
164 // ... - list of the expected full path segment for each remove
166 void TestDelimitedPathSegmentRemoveAndParseL(TInt aStartPos, TRefByValue<const TDesC> aPathSegment, ...) const;
168 // Tests InsertCurrent(), ParseReverse()
171 // aStartPos - position from the start of parsing of where to insert
172 // aPathSegment - the path segment
173 // ... - list of the params and expected full path segment for each insert
175 void TestDelimitedPathSegmentInsertAndParseReverseL(TInt aStartPos, TRefByValue<const TDesC> aPathSegment, ...) const;
177 // Tests RemoveCurrent(), ParseReverse()
180 // aStartPos - position from the start of parsing of where to remove
181 // aPathSegment - the path segment
182 // ... - list of the expected full path segment for each remove
184 void TestDelimitedPathSegmentRemoveAndParseReverseL(TInt aStartPos, TRefByValue<const TDesC> aPathSegment, ...) const;
186 // Tests InsertAndEscapeCurrent(), Parse()
189 // aStartPos - position from the start of parsing of where to insert
190 // aPathSegment - the path segment
191 // ... - list of the params and expected full path segment for each insert
193 void TestDelimitedPathSegmentInsertEscapeAndParseL(TInt aStartPos, TRefByValue<const TDesC> aPathSegment, ...) const;
195 // Tests InsertAndEscapeCurrent(), ParseReverse()
198 // aStartPos - position from the start of parsing of where to insert
199 // aPathSegment - the path segment
200 // ... - list of the params and expected full path segment for each insert
202 void TestDelimitedPathSegmentInsertEscapeAndParseReverseL(TInt aStartPos, TRefByValue<const TDesC> aPathSegment, ...) const;
204 // Tests PushAndEscapeFront(), NewL() and NewLC()
207 // aPathSegment - the path segment
208 // ... - list of the params and expected full path segment for each push
210 void TestDelimitedPathSegmentPushAndEscapeFrontL(TRefByValue<const TDesC> aPathSegment, ...) const;
212 // Tests PushAndEscapeBack(), NewL() and NewLC()
215 // aPathSegment - the path segment
216 // ... - list of the params and expected full path segment for each push
218 void TestDelimitedPathSegmentPushAndEscapeBackL(TRefByValue<const TDesC> aPathSegment, ...) const;
220 private: // Attributes
224 CIpuTestHarness* iTestHarness;
228 #endif // __CDELIMITEDPATHSEGMENTTEST_H__