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