0
|
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".
|
|
7 |
//
|
|
8 |
// Initial Contributors:
|
|
9 |
// Nokia Corporation - initial contribution.
|
|
10 |
//
|
|
11 |
// Contributors:
|
|
12 |
//
|
|
13 |
// Description:
|
|
14 |
// e32test\math\t_float.h
|
|
15 |
// Header file for T_FLOAT.CPP
|
|
16 |
//
|
|
17 |
//
|
|
18 |
|
|
19 |
|
|
20 |
#if !defined(__T_FLTCL_H__)
|
|
21 |
#define __T_FLTCL_H__
|
|
22 |
|
|
23 |
#if !defined(__E32STD_H__)
|
|
24 |
#include <e32std.h>
|
|
25 |
#endif
|
|
26 |
|
|
27 |
#include "t_vals.h"
|
|
28 |
|
|
29 |
//Added by AnnW
|
|
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;
|
|
48 |
//
|
|
49 |
// new - 17/3/97
|
|
50 |
const TInt exponentThreeDigitExpAndSigFigs=KRealFormatExponent | KAllowThreeDigitExp | KUseSigFigs;
|
|
51 |
const TInt exponentSigFigs=KRealFormatExponent | KUseSigFigs;
|
|
52 |
|
|
53 |
|
|
54 |
// classes used by T_FLOAT.CPP
|
|
55 |
|
|
56 |
class ROUND_TEST
|
|
57 |
{
|
|
58 |
public:
|
|
59 |
TReal num; // input number
|
|
60 |
TInt plcs; // number of places to be rounded
|
|
61 |
TReal res; // expected result
|
|
62 |
};
|
|
63 |
|
|
64 |
class RtoB_TEST
|
|
65 |
{
|
|
66 |
public:
|
|
67 |
RtoB_TEST();
|
|
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
|
|
72 |
};
|
|
73 |
|
|
74 |
class ERR_TEST
|
|
75 |
{
|
|
76 |
public:
|
|
77 |
ERR_TEST(TReal aNum,TInt aType,TInt aWidth,TInt aDecimals,TChar aPoint,TChar aTriad, TInt aTrilen,const TText* aRes=_S(""),TInt aErr=KErrGeneral);
|
|
78 |
RtoB_TEST rtob;
|
|
79 |
TInt err;
|
|
80 |
};
|
|
81 |
|
|
82 |
class DtoR_TEST64
|
|
83 |
{
|
|
84 |
public:
|
|
85 |
DtoR_TEST64(const TDesC& aDes,const TReal aRes) : iLex(aDes),iRes(aRes) {}
|
|
86 |
TLex iLex ; // input string
|
|
87 |
TReal iRes; // expected result
|
|
88 |
};
|
|
89 |
|
|
90 |
class DtoR_TEST32
|
|
91 |
{
|
|
92 |
public:
|
|
93 |
DtoR_TEST32(const TDesC& aDes,const TReal32 aRes) : iLex(aDes),iRes(aRes) {}
|
|
94 |
TLex iLex ; // input string
|
|
95 |
TReal32 iRes; // expected result
|
|
96 |
};
|
|
97 |
|
|
98 |
class DtoR_ERR_TEST
|
|
99 |
{
|
|
100 |
public:
|
|
101 |
DtoR_ERR_TEST(const TDesC& aDes,const TInt aErr) : iLex(aDes),iErr(aErr) {}
|
|
102 |
TLex iLex;
|
|
103 |
TInt iErr;
|
|
104 |
};
|
|
105 |
|
|
106 |
class CALC_TEST
|
|
107 |
{
|
|
108 |
public:
|
|
109 |
CALC_TEST(const TDesC& aDes,TInt aType,TInt aWidth,TInt aDecimals,TChar aPoint,TChar aTriad,TInt aTrilen,const TText* aRes);
|
|
110 |
TLex iLex;
|
|
111 |
TRealFormat iFormat;
|
|
112 |
const TText* iRes;
|
|
113 |
};
|
|
114 |
|
|
115 |
#endif
|