1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/ossrv/genericservices/httputils/Test/t_uriparser/CDelimitedPathTest.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,228 @@
1.4 +// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +//
1.18 +
1.19 +#ifndef __CDELIMITEDPATHTEST_H__
1.20 +#define __CDELIMITEDPATHTEST_H__
1.21 +
1.22 +#include <e32base.h>
1.23 +
1.24 +#include "ctestbase.h"
1.25 +
1.26 +class CDelimitedPathTest : public CTestBase
1.27 + {
1.28 +public:
1.29 +
1.30 + // Static factory c'tor.
1.31 + //
1.32 + // Rtn: pointer to newly created object - ownership transfered to caller.
1.33 + //
1.34 + static CDelimitedPathTest* NewLC(CIpuTestHarness* aTestHarness);
1.35 +
1.36 + // Static factory c'tor.
1.37 + //
1.38 + // Rtn: pointer to newly created object - ownership transfered to caller.
1.39 + //
1.40 + static CDelimitedPathTest* NewL(CIpuTestHarness* aTestHarness);
1.41 +
1.42 + // D'tor
1.43 + //
1.44 + ~CDelimitedPathTest();
1.45 +
1.46 + // Does the tests
1.47 + //
1.48 + void DoTestsL();
1.49 +
1.50 +private:
1.51 +
1.52 + // C'tor
1.53 + //
1.54 + CDelimitedPathTest(CIpuTestHarness* aTestHarness);
1.55 +
1.56 + // 2nd phase construction
1.57 + //
1.58 + void ConstructL();
1.59 +
1.60 +//
1.61 +//
1.62 +// DelimitedPath Tests
1.63 +//
1.64 +//
1.65 +
1.66 + // Tests extraction of path segments from left to right.
1.67 + //
1.68 + // In:
1.69 + // aPath - descriptor with path
1.70 + // ... - list of one or more segments
1.71 + //
1.72 + void TestDelimitedPathExtractionL(TRefByValue<const TDesC> aPath, ...) const;
1.73 +
1.74 + // Tests extraction of path segments from right to left.
1.75 + //
1.76 + // In:
1.77 + // aPath - descriptor with path
1.78 + // ... - list of one or more segments
1.79 + //
1.80 + void TestDelimitedPathReverseExtractionL(TRefByValue<const TDesC> aPath, ...) const;
1.81 +
1.82 + // Tests for presence of front and back delimiters
1.83 + //
1.84 + // In:
1.85 + // aPath - the path
1.86 + // aFrontDelim - indicated whethere there is a front delimiter or not
1.87 + // aBackDelim - indicated whethere there is a back delimiter or not
1.88 + //
1.89 + void TestDelimitedPathDelimiterPresenceL(const TDesC& aPath, TBool aFrontDelim, TBool aBackDelim) const;
1.90 +
1.91 + // Tests remainder functionality for forward parsing
1.92 + //
1.93 + // In:
1.94 + // aPath - the path
1.95 + // ... - list of the expected remainders
1.96 + //
1.97 + void TestDelimitedPathRemainderL(TRefByValue<const TDesC> aPath, ...) const;
1.98 +
1.99 + // Tests remainder functionality for reverse parsing
1.100 + //
1.101 + // In:
1.102 + // aPath - the path
1.103 + // ... - list of the expected remainders
1.104 + //
1.105 + void TestDelimitedPathRemainderReverseL(TRefByValue<const TDesC> aPath, ...) const;
1.106 +
1.107 + // Tests Des() function
1.108 + //
1.109 + // In:
1.110 + // aPath - the path
1.111 + //
1.112 + void TestDelimitedPathDesL(const TDesC& aPath) const;
1.113 +
1.114 + // Tests PushFront(), NewL() and NewLC()
1.115 + //
1.116 + // In:
1.117 + // aPath - the path
1.118 + // ... - list of the path segments and expected full path for each push
1.119 + //
1.120 + void TestDelimitedPathPushFrontL(TRefByValue<const TDesC> aPath, ...) const;
1.121 +
1.122 + // Tests PushBack(), NewL() and NewLC()
1.123 + //
1.124 + // In:
1.125 + // aPath - the path
1.126 + // ... - list of the path segments and expected full path for each push
1.127 + //
1.128 + void TestDelimitedPathPushBackL(TRefByValue<const TDesC> aPath, ...) const;
1.129 +
1.130 + // Tests PopFront(), NewL() and NewLC()
1.131 + //
1.132 + // In:
1.133 + // aPath - the path
1.134 + // ... - list of the expected full path for each pop
1.135 + //
1.136 + void TestDelimitedPathPopFrontL(TRefByValue<const TDesC> aPath, ...) const;
1.137 +
1.138 + // Tests PopBack(), NewL() and NewLC()
1.139 + //
1.140 + // In:
1.141 + // aPath - the path
1.142 + // ... - list of the expected full path for each pop
1.143 + //
1.144 + void TestDelimitedPathPopBackL(TRefByValue<const TDesC> aPath, ...) const;
1.145 +
1.146 + // Tests adding and triming of fromt and back delimiters
1.147 + //
1.148 + // In:
1.149 + // aPath - the path
1.150 + //
1.151 + void TestDelimitedPathAddAndTrimFrontAndBackDelimiterL(const TDesC& aPath) const;
1.152 +
1.153 + // Tests InsertCurrent(), Parse()
1.154 + //
1.155 + // In:
1.156 + // aStartPos - position from the start of parsing of where to insert
1.157 + // aPath - the path
1.158 + // ... - list of the path segments and expected full path for each insert
1.159 + //
1.160 + void TestDelimitedPathInsertAndParseL(TInt aStartPos, TRefByValue<const TDesC> aPath, ...) const;
1.161 +
1.162 + // Tests RemoveCurrent(), Parse()
1.163 + //
1.164 + // In:
1.165 + // aStartPos - position from the start of parsing of where to insert
1.166 + // aPath - the path
1.167 + // ... - list of the expected full path for each remove
1.168 + //
1.169 + void TestDelimitedPathRemoveAndParseL(TInt aStartPos, TRefByValue<const TDesC> aPath, ...) const;
1.170 +
1.171 + // Tests InsertCurrent(), ParseReverse()
1.172 + //
1.173 + // In:
1.174 + // aStartPos - position from the start of parsing of where to insert
1.175 + // aPath - the path
1.176 + // ... - list of the path segments and expected full path for each insert
1.177 + //
1.178 + void TestDelimitedPathInsertAndParseReverseL(TInt aStartPos, TRefByValue<const TDesC> aPath, ...) const;
1.179 +
1.180 + // Tests RemoveCurrent(), ParseReverse()
1.181 + //
1.182 + // In:
1.183 + // aStartPos - position from the start of parsing of where to insert
1.184 + // aPath - the path
1.185 + // ... - list of the expected full path for each remove
1.186 + //
1.187 + void TestDelimitedPathRemoveAndParseReverseL(TInt aStartPos, TRefByValue<const TDesC> aPath, ...) const;
1.188 +
1.189 + // Tests InsertAndEscapeCurrent(), Parse()
1.190 + //
1.191 + // In:
1.192 + // aStartPos - position from the start of parsing of where to insert
1.193 + // aPath - the path
1.194 + // ... - list of the path segments and expected full path for each insert
1.195 + //
1.196 + void TestDelimitedPathInsertEscapeAndParseL(TInt aStartPos, TRefByValue<const TDesC> aPath, ...) const;
1.197 +
1.198 + // Tests InsertAndEscapeCurrent(), ParseReverse()
1.199 + //
1.200 + // In:
1.201 + // aStartPos - position from the start of parsing of where to insert
1.202 + // aPath - the path
1.203 + // ... - list of the path segments and expected full path for each insert
1.204 + //
1.205 + void TestDelimitedPathInsertEscapeAndParseReverseL(TInt aStartPos, TRefByValue<const TDesC> aPath, ...) const;
1.206 +
1.207 + // Tests PushAndEscapeFront(), NewL() and NewLC()
1.208 + //
1.209 + // In:
1.210 + // aPath - the path
1.211 + // ... - list of the path segments and expected full path for each push
1.212 + //
1.213 + void TestDelimitedPathPushAndEscapeFrontL(TRefByValue<const TDesC> aPath, ...) const;
1.214 +
1.215 + // Tests PushAndEscapeBack(), NewL() and NewLC()
1.216 + //
1.217 + // In:
1.218 + // aPath - the path
1.219 + // ... - list of the path segments and expected full path for each push
1.220 + //
1.221 + void TestDelimitedPathPushAndEscapeBackL(TRefByValue<const TDesC> aPath, ...) const;
1.222 +
1.223 +private: // Attributes
1.224 +
1.225 + // Test harness
1.226 + //
1.227 + CIpuTestHarness* iTestHarness;
1.228 +
1.229 + };
1.230 +
1.231 +#endif // __CDELIMITEDPATHTEST_H__