diff -r 000000000000 -r e4d67989cc36 genericservices/httputils/Test/t_uriparser/CDelimitedPathSegmentTest.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/genericservices/httputils/Test/t_uriparser/CDelimitedPathSegmentTest.h Tue Feb 02 02:01:42 2010 +0200 @@ -0,0 +1,230 @@ +// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// + +#ifndef __CDELIMITEDPATHSEGMENTTEST_H__ +#define __CDELIMITEDPATHSEGMENTTEST_H__ + +#include + +#include "ctestbase.h" + +class CDelimitedPathSegmentTest : public CTestBase + { +public: + + // Static factory c'tor. + // + // Rtn: pointer to newly created object - ownership transfered to caller. + // + static CDelimitedPathSegmentTest* NewLC(CIpuTestHarness* aTestHarness); + + // Static factory c'tor. + // + // Rtn: pointer to newly created object - ownership transfered to caller. + // + static CDelimitedPathSegmentTest* NewL(CIpuTestHarness* aTestHarness); + + // D'tor + // + ~CDelimitedPathSegmentTest(); + + // Does the tests + // + void DoTestsL(); + +private: + + // C'tor + // + CDelimitedPathSegmentTest(CIpuTestHarness* aTestHarness); + + // 2nd phase construction + // + void ConstructL(); + +// +// +// DelimitedPathSegment Tests +// +// + + // Tests extraction of path segment params from left to right. + // + // In: + // aPathSegment - descriptor with path segment + // ... - list of one or more params + // + void TestDelimitedPathSegmentExtractionL(TRefByValue aPathSegment, ...) const; + + // Tests extraction of path segment params from right to left. + // + // In: + // aPathSegment - descriptor with path segment + // ... - list of one or more params + // + void TestDelimitedPathSegmentReverseExtractionL(TRefByValue aPathSegment, ...) const; + + // Tests for presence of front and back delimiters + // + // In: + // aPathSegment - the path segment + // aFrontDelim - indicated whethere there is a front delimiter or not + // aBackDelim - indicated whethere there is a back delimiter or not + // + void TestDelimitedPathSegmentDelimiterPresenceL(const TDesC& aPathSegment, TBool aFrontDelim, TBool aBackDelim) const; + + // Tests remainder functionality for forward parsing + // + // In: + // aPathSegment - the path segment + // ... - list of the expected remainders + // + void TestDelimitedPathSegmentRemainderL(TRefByValue aPathSegment, ...) const; + + // Tests remainder functionality for reverse parsing + // + // In: + // aPathSegment - the path segment + // ... - list of the expected remainders + // + void TestDelimitedPathSegmentRemainderReverseL(TRefByValue aPathSegment, ...) const; + + // Tests Des() function + // + // In: + // aPathSegment - the path segment + // + void TestDelimitedPathSegmentDesL(const TDesC& aPathSegment) const; + + // Tests PushFront(), NewL() and NewLC() + // + // In: + // aPathSegment - the path segment + // ... - list of the params and expected full path segment for each push + // + void TestDelimitedPathSegmentPushFrontL(TRefByValue aPathSegment, ...) const; + + // Tests PushBack(), NewL() and NewLC() + // + // In: + // aPathSegment - the path segment + // ... - list of the params and expected full path segment for each push + // + void TestDelimitedPathSegmentPushBackL(TRefByValue aPathSegment, ...) const; + + // Tests PopFront(), NewL() and NewLC() + // + // In: + // aPathSegment - the path segment + // ... - list of the expected full path segment for each pop + // + void TestDelimitedPathSegmentPopFrontL(TRefByValue aPathSegment, ...) const; + + // Tests PopBack(), NewL() and NewLC() + // + // In: + // aPathSegment - the path segment + // ... - list of the expected full path segment for each pop + // + void TestDelimitedPathSegmentPopBackL(TRefByValue aPathSegment, ...) const; + + // Tests adding and triming of fromt and back delimiters + // + // In: + // aPathSegment - the path segment + // + void TestDelimitedPathSegmentAddAndTrimFrontAndBackDelimiterL(const TDesC& aPathSegment) const; + + // Tests InsertCurrent(), Parse() + // + // In: + // aStartPos - position from the start of parsing of where to insert + // aPathSegment - the path segment + // ... - list of the params and expected full path segment for each insert + // + void TestDelimitedPathSegmentInsertAndParseL(TInt aStartPos, TRefByValue aPathSegment, ...) const; + + // Tests RemoveCurrent(), Parse() + // + // In: + // aStartPos - position from the start of parsing of where to remove + // aPathSegment - the path segment + // ... - list of the expected full path segment for each remove + // + void TestDelimitedPathSegmentRemoveAndParseL(TInt aStartPos, TRefByValue aPathSegment, ...) const; + + // Tests InsertCurrent(), ParseReverse() + // + // In: + // aStartPos - position from the start of parsing of where to insert + // aPathSegment - the path segment + // ... - list of the params and expected full path segment for each insert + // + void TestDelimitedPathSegmentInsertAndParseReverseL(TInt aStartPos, TRefByValue aPathSegment, ...) const; + + // Tests RemoveCurrent(), ParseReverse() + // + // In: + // aStartPos - position from the start of parsing of where to remove + // aPathSegment - the path segment + // ... - list of the expected full path segment for each remove + // + void TestDelimitedPathSegmentRemoveAndParseReverseL(TInt aStartPos, TRefByValue aPathSegment, ...) const; + + // Tests InsertAndEscapeCurrent(), Parse() + // + // In: + // aStartPos - position from the start of parsing of where to insert + // aPathSegment - the path segment + // ... - list of the params and expected full path segment for each insert + // + void TestDelimitedPathSegmentInsertEscapeAndParseL(TInt aStartPos, TRefByValue aPathSegment, ...) const; + + // Tests InsertAndEscapeCurrent(), ParseReverse() + // + // In: + // aStartPos - position from the start of parsing of where to insert + // aPathSegment - the path segment + // ... - list of the params and expected full path segment for each insert + // + void TestDelimitedPathSegmentInsertEscapeAndParseReverseL(TInt aStartPos, TRefByValue aPathSegment, ...) const; + + // Tests PushAndEscapeFront(), NewL() and NewLC() + // + // In: + // aPathSegment - the path segment + // ... - list of the params and expected full path segment for each push + // + void TestDelimitedPathSegmentPushAndEscapeFrontL(TRefByValue aPathSegment, ...) const; + + // Tests PushAndEscapeBack(), NewL() and NewLC() + // + // In: + // aPathSegment - the path segment + // ... - list of the params and expected full path segment for each push + // + void TestDelimitedPathSegmentPushAndEscapeBackL(TRefByValue aPathSegment, ...) const; + +private: // Attributes + + // Test harness + // + CIpuTestHarness* iTestHarness; + + }; + +#endif // __CDELIMITEDPATHSEGMENTTEST_H__ + +