1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/kernelhwsrv/kerneltest/e32test/math/t_float.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,115 @@
1.4 +// Copyright (c) 1995-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 the License "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 +// e32test\math\t_float.h
1.18 +// Header file for T_FLOAT.CPP
1.19 +//
1.20 +//
1.21 +
1.22 +
1.23 +#if !defined(__T_FLTCL_H__)
1.24 +#define __T_FLTCL_H__
1.25 +
1.26 +#if !defined(__E32STD_H__)
1.27 +#include <e32std.h>
1.28 +#endif
1.29 +
1.30 +#include "t_vals.h"
1.31 +
1.32 +//Added by AnnW
1.33 +const TInt fixedLimitAndTriads=KRealFormatFixed | KGeneralLimit;
1.34 +const TInt fixedNoTriads=KRealFormatFixed | KDoNotUseTriads;
1.35 +const TInt fixedLimit=fixedNoTriads | KGeneralLimit;
1.36 +const TInt fixedSpaceForSign=fixedNoTriads | KExtraSpaceForSign;
1.37 +const TInt fixedTriadsAndSign=KRealFormatFixed | KExtraSpaceForSign;
1.38 +const TInt fixedLimitAndSpaceForSign=fixedLimit |KExtraSpaceForSign;
1.39 +const TInt exponentThreeDigitExp=KRealFormatExponent | KAllowThreeDigitExp;
1.40 +const TInt exponentLimit=KRealFormatExponent | KGeneralLimit;
1.41 +const TInt exponentLimitAndThreeDigExp=exponentLimit | KAllowThreeDigitExp;
1.42 +const TInt generalSpaceForSign=KRealFormatGeneral | KExtraSpaceForSign;
1.43 +const TInt generalThreeDigitExp=KRealFormatGeneral | KAllowThreeDigitExp;
1.44 +const TInt generalLimit=KRealFormatGeneral | KGeneralLimit;
1.45 +const TInt noExponentNoTriads=KRealFormatNoExponent | KDoNotUseTriads;
1.46 +const TInt noExponentLimit=noExponentNoTriads | KGeneralLimit;
1.47 +const TInt calculatorThreeDigitExp=KRealFormatCalculator | KAllowThreeDigitExp;
1.48 +const TInt calculatorLimit=KRealFormatCalculator | KGeneralLimit;
1.49 +const TInt calculatorLimitAndThreeDigExp=calculatorLimit | KAllowThreeDigitExp;
1.50 +const TInt noExponentCalc=noExponentNoTriads | KExtraSpaceForSign;
1.51 +//
1.52 +// new - 17/3/97
1.53 +const TInt exponentThreeDigitExpAndSigFigs=KRealFormatExponent | KAllowThreeDigitExp | KUseSigFigs;
1.54 +const TInt exponentSigFigs=KRealFormatExponent | KUseSigFigs;
1.55 +
1.56 +
1.57 +// classes used by T_FLOAT.CPP
1.58 +
1.59 +class ROUND_TEST
1.60 + {
1.61 +public:
1.62 + TReal num; // input number
1.63 + TInt plcs; // number of places to be rounded
1.64 + TReal res; // expected result
1.65 + };
1.66 +
1.67 +class RtoB_TEST
1.68 + {
1.69 +public:
1.70 + RtoB_TEST();
1.71 + RtoB_TEST(TReal aNum,TInt aType,TInt aWidth,TInt aDecimals,TChar aPoint,TChar aTriad,TInt aTrilen,const TText* aRes);
1.72 + TReal num; // input number
1.73 + TRealFormat format; // format
1.74 + const TText* res; // expected result
1.75 + };
1.76 +
1.77 +class ERR_TEST
1.78 + {
1.79 +public:
1.80 + ERR_TEST(TReal aNum,TInt aType,TInt aWidth,TInt aDecimals,TChar aPoint,TChar aTriad, TInt aTrilen,const TText* aRes=_S(""),TInt aErr=KErrGeneral);
1.81 + RtoB_TEST rtob;
1.82 + TInt err;
1.83 + };
1.84 +
1.85 +class DtoR_TEST64
1.86 + {
1.87 +public:
1.88 + DtoR_TEST64(const TDesC& aDes,const TReal aRes) : iLex(aDes),iRes(aRes) {}
1.89 + TLex iLex ; // input string
1.90 + TReal iRes; // expected result
1.91 + };
1.92 +
1.93 +class DtoR_TEST32
1.94 + {
1.95 +public:
1.96 + DtoR_TEST32(const TDesC& aDes,const TReal32 aRes) : iLex(aDes),iRes(aRes) {}
1.97 + TLex iLex ; // input string
1.98 + TReal32 iRes; // expected result
1.99 + };
1.100 +
1.101 +class DtoR_ERR_TEST
1.102 + {
1.103 +public:
1.104 + DtoR_ERR_TEST(const TDesC& aDes,const TInt aErr) : iLex(aDes),iErr(aErr) {}
1.105 + TLex iLex;
1.106 + TInt iErr;
1.107 + };
1.108 +
1.109 +class CALC_TEST
1.110 + {
1.111 +public:
1.112 + CALC_TEST(const TDesC& aDes,TInt aType,TInt aWidth,TInt aDecimals,TChar aPoint,TChar aTriad,TInt aTrilen,const TText* aRes);
1.113 + TLex iLex;
1.114 + TRealFormat iFormat;
1.115 + const TText* iRes;
1.116 + };
1.117 +
1.118 +#endif