1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/ossrv/genericservices/httputils/Test/t_uriparser/TextUtilsTests.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,105 @@
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 __TEXTUTILSTESTS_H__
1.20 +#define __TEXTUTILSTESTS_H__
1.21 +
1.22 +// System includes
1.23 +//
1.24 +#include <e32base.h>
1.25 +
1.26 +//
1.27 +//
1.28 +// TEXTUtils test data
1.29 +//
1.30 +//
1.31 +
1.32 +_LIT(KRemove0_base, " Hello there ");
1.33 +_LIT(KRemove0_left, "Hello there ");
1.34 +const TInt KRemove0_left_consumed = 4;
1.35 +_LIT(KRemove0_right, " Hello there");
1.36 +const TInt KRemove0_right_consumed = 3;
1.37 +_LIT(KRemove0_both, "Hello there");
1.38 +const TInt KRemove0_both_consumed = 7;
1.39 +
1.40 +const TInt KNumericValue0 = 1234567890;
1.41 +_LIT(KDecRep0, "1234567890");
1.42 +_LIT(KHexRep0, "499602d2");
1.43 +const TBool KIsValid0 = ETrue;
1.44 +
1.45 +const TInt KNumericValue1 = -543210;
1.46 +_LIT(KDecRep1, "-543210");
1.47 +_LIT(KHexRep1, "-849eA");
1.48 +const TBool KIsValid1 = ETrue;
1.49 +
1.50 +const TInt KNumericValue2 = 0;
1.51 +_LIT(KDecRep2, "");
1.52 +_LIT(KHexRep2, "");
1.53 +const TBool KIsValid2 = EFalse;
1.54 +
1.55 +const TInt KNumericValue3 = 0;
1.56 +_LIT(KDecRep3, "t500");
1.57 +_LIT(KHexRep3, "t1f4");
1.58 +const TBool KIsValid3 = EFalse;
1.59 +
1.60 +_LIT(KQuotedBuffer0, "this is the \"quoted string\" and this is not");
1.61 +_LIT(KQuotedString0, "quoted string");
1.62 +_LIT(KQuotedRemainder0, " and this is not");
1.63 +const TInt KExpectedError0 = KErrNone;
1.64 +
1.65 +_LIT(KQuotedBuffer1, "this is the \"quoted string\" and this is also \"string!\" but this is not");
1.66 +_LIT(KQuotedString1, "quoted string\" and this is also \"string!");
1.67 +_LIT(KQuotedRemainder1, " but this is not");
1.68 +const TInt KExpectedError1 = KErrNone;
1.69 +
1.70 +_LIT(KQuotedBuffer2, "this has no quoted string");
1.71 +_LIT(KQuotedString2, "");
1.72 +_LIT(KQuotedRemainder2, "this has no quoted string");
1.73 +const TInt KExpectedError2 = -5014;
1.74 +
1.75 +_LIT(KQuotedBuffer3, "this has no a malformed \"quoted string");
1.76 +_LIT(KQuotedString3, "");
1.77 +_LIT(KQuotedRemainder3, "this has no a malformed \"quoted string");
1.78 +const TInt KExpectedError3 = -5014;
1.79 +
1.80 +_LIT(KListBuffer0, "token0, token1 / token 2 is very long ");
1.81 +_LIT(KListToken0_0, "token0");
1.82 +_LIT(KListToken0_1, "token1");
1.83 +_LIT(KListToken0_2, "token 2 is very long");
1.84 +_LIT(KListRemainder0, "");
1.85 +_LIT(KListSeparator0, ",/");
1.86 +
1.87 +_LIT(KListBuffer1, "token0, token1 / token 2 # very long ");
1.88 +_LIT(KListToken1_0, "token0");
1.89 +_LIT(KListToken1_1, "token1");
1.90 +_LIT(KListToken1_2, "token 2");
1.91 +_LIT(KListRemainder1, " very long ");
1.92 +_LIT(KListSeparator1, ",/#");
1.93 +
1.94 +_LIT(KListBuffer2, "token0, token1 , token 2 is very long ");
1.95 +_LIT(KListToken2_0, "token0");
1.96 +_LIT(KListToken2_1, "token1");
1.97 +_LIT(KListToken2_2, "token 2 is very long");
1.98 +_LIT(KListRemainder2, "");
1.99 +const TUint KListSeparator2 = ',';
1.100 +
1.101 +_LIT(KListBuffer3, "token0/ token1 / token 2 / very long ");
1.102 +_LIT(KListToken3_0, "token0");
1.103 +_LIT(KListToken3_1, "token1");
1.104 +_LIT(KListToken3_2, "token 2");
1.105 +_LIT(KListRemainder3, " very long ");
1.106 +const TUint KListSeparator3 = '/';
1.107 +
1.108 +#endif // __TEXTUTILSTESTS_H__