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 __URIANDAUTHORITYTESTCOMMON_H__ sl@0: #define __URIANDAUTHORITYTESTCOMMON_H__ sl@0: sl@0: // System includes sl@0: // sl@0: #include sl@0: sl@0: template sl@0: TInt DoUriComponentExtraction(const TDesCType& aUri, const TDesCType& aScheme, sl@0: const TDesCType& aUserinfo, const TDesCType& aHost, sl@0: const TDesCType& aPort, const TDesCType& aPath, sl@0: const TDesCType& aQuery, const TDesCType& aFragment); sl@0: sl@0: void DoUriComponentExtractionL(const TDesC& aUri, const TDesC& aScheme, sl@0: const TDesC& aUserinfo, const TDesC& aHost, sl@0: const TDesC& aPort, const TDesC& aPath, sl@0: const TDesC& aQuery, const TDesC& aFragment); sl@0: sl@0: template sl@0: TInt DoAuthorityComponentExtraction(const TDesCType& aAuthority, const TDesCType& aUserInfo, sl@0: const TDesCType& aHost, const TDesCType& aPort); sl@0: sl@0: void DoAuthorityComponentExtractionL(const TDesC& aAuthority, const TDesC& aUserInfo, sl@0: const TDesC& aHost, const TDesC& aPort); sl@0: sl@0: sl@0: template sl@0: TInt DoTestResolve(const TDesCType& aBase, const TDesCType& aReference, const TDesCType& aExpected); sl@0: sl@0: template sl@0: TInt DoUriCompare(const TDesCType& aUri1, const TDesCType& aUri2, TInt aMatchFlags); sl@0: sl@0: // Compares the specific component against what is expected. The parser object is sl@0: // assumed to the been parsed already, otherwise it panics. sl@0: // sl@0: // In: sl@0: // aParser - parsed parser object sl@0: // aExpected - the expected component value sl@0: // aComponent - the specific component sl@0: // sl@0: // Rtn: the result of the comparision - 0 is a match, non-zero is not a match. sl@0: // sl@0: template sl@0: TInt TestComponent(const TParserType& aParser, const TDesCType& aExpected, TComponentType aComponent); sl@0: sl@0: template sl@0: TInt TestCompare(const TParserType& aFull, const TParserType& aPartial, TComponentType aComponent); sl@0: sl@0: template sl@0: TInt DoAuthorityCompare(const TDesCType& aAuthority1, const TDesCType& aAuthority2, TInt aMatchFlags); sl@0: sl@0: template sl@0: TInt DoUriComponentPresence(const TDesCType& aUri, TInt aPresenceFlags); sl@0: sl@0: template sl@0: TInt DoAuthorityComponentPresence(const TDesCType& aAuthority, TInt aPresenceFlags); sl@0: sl@0: template sl@0: TInt TestPresence(const TParserType& aData, TComponentType aComponent, TBool aExpectedPresence); sl@0: sl@0: template sl@0: TInt DoUriDes(const TDesCType& aUri); sl@0: sl@0: void DoUriDesL(const TDesC& aUri); sl@0: sl@0: template sl@0: TInt DoCompareUriDes(const TUriParserType& aParser, const TDesCType& aExpected); sl@0: sl@0: template sl@0: TInt DoAuthorityDes(const TDesCType& aAuthority); sl@0: sl@0: void DoAuthorityDesL(const TDesC& aAuthority); sl@0: sl@0: template sl@0: TInt DoUriSchemeValidation(const TDesCType& aUri, TBool aValidScheme); sl@0: sl@0: template sl@0: TInt DoUriWithoutFragment(const TDesCType& aUri, const TDesCType& aExpected); sl@0: sl@0: template sl@0: TInt DoUriConstruction(const TDesCType& aUri_Scheme, const TDesCType& aUri_Host, const TDesCType& aUri_Userinfo, sl@0: const TDesCType& aUri_Port, const TDesCType& aUri_Path, const TDesCType& aUri_Query, sl@0: const TDesCType& aUri_Fragment, const TDesCType& aScheme, const TDesCType& aHost, sl@0: const TDesCType& aUserinfo, const TDesCType& aPort, const TDesCType& aPath, sl@0: const TDesCType& aQuery, const TDesCType& aFragment); sl@0: sl@0: template sl@0: TInt DoUriSetAndCompareComponent(CUriType aUri, TUriComponent aComponent, const TDesCType& aData, const TDesCType& aExpected); sl@0: sl@0: template sl@0: TInt DoUriDestruction(const TDesCType& aUri_NoScheme, const TDesCType& aUri_NoHost, const TDesCType& aUri_NoUserinfo, sl@0: const TDesCType& aUri_NoPort, const TDesCType& aUri_NoPath, const TDesCType& aUri_NoQuery, sl@0: const TDesCType& aUri_NoFragment, const TDesCType& aUri_Whole); sl@0: sl@0: template sl@0: TInt DoUriRemoveAndCompareComponent(CUriType* aUri, TUriComponent aComponent, const TDesCType& aExpected); sl@0: sl@0: template sl@0: TInt DoAuthorityConstruction(const TDesCType& aAuthority_Host, const TDesCType& aAuthority_Userinfo, const TDesCType& aAuthority_Port, sl@0: const TDesCType& aHost, const TDesCType& aUserinfo, const TDesCType& aPort); sl@0: sl@0: template sl@0: TInt DoAuthoritySetAndCompareComponent(CAuthorityType* aUri, TAuthorityComponent aComponent, const TDesCType& aData, const TDesCType& aExpected); sl@0: sl@0: template sl@0: TInt DoAuthorityEscapedConstruction(const TDesCType& aAuthority_Host, const TDesCType& aAuthority_Userinfo, const TDesCType& aAuthority_Port, sl@0: const TDesCType& aHost, const TDesCType& aUserinfo, const TDesCType& aPort); sl@0: sl@0: template sl@0: TInt DoAuthoritySetAndEscapeAndCompareComponent(CAuthorityType* aAuthority, TAuthorityComponent aComponent, const TDesCType& aData, const TDesCType& aExpected); sl@0: sl@0: template sl@0: TInt DoAuthorityDestruction(const TDesCType& aAuthority_NoHost, const TDesCType& aAuthority_NoUserinfo, sl@0: const TDesCType& aAuthority_NoPort, const TDesCType& aAuthority_Whole); sl@0: sl@0: template sl@0: TInt DoAuthorityRemoveAndCompareComponent(CAuthorityType* aAuthority, TAuthorityComponent aComponent, const TDesCType& aExpected); sl@0: sl@0: #endif // __URIANDAUTHORITYTESTCOMMON_H__