First public contribution.
1 // Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of the License "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // e32test\math\t_float.h
15 // Header file for T_FLOAT.CPP
20 #if !defined(__T_FLTCL_H__)
23 #if !defined(__E32STD_H__)
30 const TInt fixedLimitAndTriads=KRealFormatFixed | KGeneralLimit;
31 const TInt fixedNoTriads=KRealFormatFixed | KDoNotUseTriads;
32 const TInt fixedLimit=fixedNoTriads | KGeneralLimit;
33 const TInt fixedSpaceForSign=fixedNoTriads | KExtraSpaceForSign;
34 const TInt fixedTriadsAndSign=KRealFormatFixed | KExtraSpaceForSign;
35 const TInt fixedLimitAndSpaceForSign=fixedLimit |KExtraSpaceForSign;
36 const TInt exponentThreeDigitExp=KRealFormatExponent | KAllowThreeDigitExp;
37 const TInt exponentLimit=KRealFormatExponent | KGeneralLimit;
38 const TInt exponentLimitAndThreeDigExp=exponentLimit | KAllowThreeDigitExp;
39 const TInt generalSpaceForSign=KRealFormatGeneral | KExtraSpaceForSign;
40 const TInt generalThreeDigitExp=KRealFormatGeneral | KAllowThreeDigitExp;
41 const TInt generalLimit=KRealFormatGeneral | KGeneralLimit;
42 const TInt noExponentNoTriads=KRealFormatNoExponent | KDoNotUseTriads;
43 const TInt noExponentLimit=noExponentNoTriads | KGeneralLimit;
44 const TInt calculatorThreeDigitExp=KRealFormatCalculator | KAllowThreeDigitExp;
45 const TInt calculatorLimit=KRealFormatCalculator | KGeneralLimit;
46 const TInt calculatorLimitAndThreeDigExp=calculatorLimit | KAllowThreeDigitExp;
47 const TInt noExponentCalc=noExponentNoTriads | KExtraSpaceForSign;
50 const TInt exponentThreeDigitExpAndSigFigs=KRealFormatExponent | KAllowThreeDigitExp | KUseSigFigs;
51 const TInt exponentSigFigs=KRealFormatExponent | KUseSigFigs;
54 // classes used by T_FLOAT.CPP
59 TReal num; // input number
60 TInt plcs; // number of places to be rounded
61 TReal res; // expected result
68 RtoB_TEST(TReal aNum,TInt aType,TInt aWidth,TInt aDecimals,TChar aPoint,TChar aTriad,TInt aTrilen,const TText* aRes);
69 TReal num; // input number
70 TRealFormat format; // format
71 const TText* res; // expected result
77 ERR_TEST(TReal aNum,TInt aType,TInt aWidth,TInt aDecimals,TChar aPoint,TChar aTriad, TInt aTrilen,const TText* aRes=_S(""),TInt aErr=KErrGeneral);
85 DtoR_TEST64(const TDesC& aDes,const TReal aRes) : iLex(aDes),iRes(aRes) {}
86 TLex iLex ; // input string
87 TReal iRes; // expected result
93 DtoR_TEST32(const TDesC& aDes,const TReal32 aRes) : iLex(aDes),iRes(aRes) {}
94 TLex iLex ; // input string
95 TReal32 iRes; // expected result
101 DtoR_ERR_TEST(const TDesC& aDes,const TInt aErr) : iLex(aDes),iErr(aErr) {}
109 CALC_TEST(const TDesC& aDes,TInt aType,TInt aWidth,TInt aDecimals,TChar aPoint,TChar aTriad,TInt aTrilen,const TText* aRes);