os/kernelhwsrv/kerneltest/e32test/math/t_float.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
sl@0
     1
// Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     2
// All rights reserved.
sl@0
     3
// This component and the accompanying materials are made available
sl@0
     4
// under the terms of the License "Eclipse Public License v1.0"
sl@0
     5
// which accompanies this distribution, and is available
sl@0
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     7
//
sl@0
     8
// Initial Contributors:
sl@0
     9
// Nokia Corporation - initial contribution.
sl@0
    10
//
sl@0
    11
// Contributors:
sl@0
    12
//
sl@0
    13
// Description:
sl@0
    14
// e32test\math\t_float.h
sl@0
    15
// Header file for T_FLOAT.CPP
sl@0
    16
// 
sl@0
    17
//
sl@0
    18
sl@0
    19
sl@0
    20
#if !defined(__T_FLTCL_H__)
sl@0
    21
#define __T_FLTCL_H__
sl@0
    22
sl@0
    23
#if !defined(__E32STD_H__)
sl@0
    24
#include <e32std.h> 
sl@0
    25
#endif
sl@0
    26
sl@0
    27
#include "t_vals.h"
sl@0
    28
sl@0
    29
//Added by AnnW
sl@0
    30
const TInt fixedLimitAndTriads=KRealFormatFixed | KGeneralLimit;
sl@0
    31
const TInt fixedNoTriads=KRealFormatFixed | KDoNotUseTriads;
sl@0
    32
const TInt fixedLimit=fixedNoTriads | KGeneralLimit;
sl@0
    33
const TInt fixedSpaceForSign=fixedNoTriads | KExtraSpaceForSign;
sl@0
    34
const TInt fixedTriadsAndSign=KRealFormatFixed | KExtraSpaceForSign; 
sl@0
    35
const TInt fixedLimitAndSpaceForSign=fixedLimit |KExtraSpaceForSign;
sl@0
    36
const TInt exponentThreeDigitExp=KRealFormatExponent | KAllowThreeDigitExp;
sl@0
    37
const TInt exponentLimit=KRealFormatExponent | KGeneralLimit;
sl@0
    38
const TInt exponentLimitAndThreeDigExp=exponentLimit | KAllowThreeDigitExp;
sl@0
    39
const TInt generalSpaceForSign=KRealFormatGeneral | KExtraSpaceForSign;
sl@0
    40
const TInt generalThreeDigitExp=KRealFormatGeneral | KAllowThreeDigitExp;
sl@0
    41
const TInt generalLimit=KRealFormatGeneral | KGeneralLimit;
sl@0
    42
const TInt noExponentNoTriads=KRealFormatNoExponent | KDoNotUseTriads;
sl@0
    43
const TInt noExponentLimit=noExponentNoTriads | KGeneralLimit;
sl@0
    44
const TInt calculatorThreeDigitExp=KRealFormatCalculator | KAllowThreeDigitExp;
sl@0
    45
const TInt calculatorLimit=KRealFormatCalculator | KGeneralLimit;
sl@0
    46
const TInt calculatorLimitAndThreeDigExp=calculatorLimit | KAllowThreeDigitExp;
sl@0
    47
const TInt noExponentCalc=noExponentNoTriads | KExtraSpaceForSign;
sl@0
    48
//
sl@0
    49
// new - 17/3/97
sl@0
    50
const TInt exponentThreeDigitExpAndSigFigs=KRealFormatExponent | KAllowThreeDigitExp | KUseSigFigs;
sl@0
    51
const TInt exponentSigFigs=KRealFormatExponent | KUseSigFigs;
sl@0
    52
sl@0
    53
sl@0
    54
// classes used by T_FLOAT.CPP
sl@0
    55
sl@0
    56
class ROUND_TEST
sl@0
    57
	{
sl@0
    58
public:
sl@0
    59
    TReal num; // input number 
sl@0
    60
    TInt plcs; // number of places to be rounded 
sl@0
    61
    TReal res; // expected result 
sl@0
    62
    };
sl@0
    63
sl@0
    64
class RtoB_TEST
sl@0
    65
    {
sl@0
    66
public: 
sl@0
    67
	RtoB_TEST();
sl@0
    68
	RtoB_TEST(TReal aNum,TInt aType,TInt aWidth,TInt aDecimals,TChar aPoint,TChar aTriad,TInt aTrilen,const TText* aRes);
sl@0
    69
    TReal num; // input number 
sl@0
    70
    TRealFormat format; // format 
sl@0
    71
    const TText* res; // expected result 
sl@0
    72
    };
sl@0
    73
sl@0
    74
class ERR_TEST
sl@0
    75
	{
sl@0
    76
public:
sl@0
    77
	ERR_TEST(TReal aNum,TInt aType,TInt aWidth,TInt aDecimals,TChar aPoint,TChar aTriad, TInt aTrilen,const TText* aRes=_S(""),TInt aErr=KErrGeneral);
sl@0
    78
	RtoB_TEST rtob;
sl@0
    79
	TInt err;
sl@0
    80
	};
sl@0
    81
sl@0
    82
class DtoR_TEST64
sl@0
    83
    {
sl@0
    84
public:
sl@0
    85
	DtoR_TEST64(const TDesC& aDes,const TReal aRes) : iLex(aDes),iRes(aRes) {}
sl@0
    86
    TLex iLex ;	// input string
sl@0
    87
    TReal iRes;	// expected result
sl@0
    88
    };
sl@0
    89
sl@0
    90
class DtoR_TEST32
sl@0
    91
    {
sl@0
    92
public:
sl@0
    93
	DtoR_TEST32(const TDesC& aDes,const TReal32 aRes) : iLex(aDes),iRes(aRes) {}
sl@0
    94
    TLex iLex ;	// input string
sl@0
    95
    TReal32 iRes;	// expected result
sl@0
    96
    };
sl@0
    97
sl@0
    98
class DtoR_ERR_TEST
sl@0
    99
	{
sl@0
   100
public:
sl@0
   101
	DtoR_ERR_TEST(const TDesC& aDes,const TInt aErr) : iLex(aDes),iErr(aErr) {}
sl@0
   102
	TLex iLex;
sl@0
   103
	TInt iErr;
sl@0
   104
	};
sl@0
   105
sl@0
   106
class CALC_TEST
sl@0
   107
	{
sl@0
   108
public:
sl@0
   109
	CALC_TEST(const TDesC& aDes,TInt aType,TInt aWidth,TInt aDecimals,TChar aPoint,TChar aTriad,TInt aTrilen,const TText* aRes);
sl@0
   110
	TLex iLex;
sl@0
   111
	TRealFormat iFormat; 
sl@0
   112
    const TText* iRes; 
sl@0
   113
	};
sl@0
   114
sl@0
   115
#endif