1 /***********************************************************************
3 * Copyright (c) 1997-2004, International Business Machines Corporation
4 * and others. All Rights Reserved.
5 ***********************************************************************/
7 #ifndef _NUMBERFORMATREGRESSIONTEST_
8 #define _NUMBERFORMATREGRESSIONTEST_
10 #include "unicode/utypes.h"
12 #if !UCONFIG_NO_FORMATTING
14 #include "unicode/unistr.h"
15 #include "unicode/numfmt.h"
16 #include "unicode/decimfmt.h"
20 * Performs regression test for MessageFormat
22 class NumberFormatRegressionTest
: public IntlTest
{
25 void runIndexedTest( int32_t index
, UBool exec
, const char* &name
, char* par
);
28 void Test4075713(void);
29 void Test4074620(void) ;
30 void Test4088161 (void);
31 void Test4087245 (void);
32 void Test4087535 (void);
33 void Test4088503 (void);
34 void Test4066646 (void);
35 float assignFloatValue(float returnfloat
);
36 void Test4059870(void);
37 void Test4083018 (void);
38 void Test4071492 (void);
39 void Test4086575(void);
40 void Test4068693(void);
41 void Test4069754(void);
42 void Test4087251 (void);
43 void Test4090489 (void);
44 void Test4090504 (void);
45 void Test4095713 (void);
46 void Test4092561 (void);
47 void Test4092480 (void);
48 void Test4087244 (void);
49 void Test4070798 (void);
50 void Test4071005 (void);
51 void Test4071014 (void);
52 void Test4071859 (void);
53 void Test4093610(void);
54 void roundingTest(DecimalFormat
*df
, double x
, UnicodeString
& expected
);
55 void Test4098741(void);
56 void Test4074454(void);
57 void Test4099404(void);
58 void Test4101481(void);
59 void Test4052223(void);
60 void Test4061302(void);
61 void Test4062486(void);
62 void Test4108738(void);
63 void Test4106658(void);
64 void Test4106662(void);
65 void Test4114639(void);
66 void Test4106664(void);
67 void Test4106667(void);
68 void Test4110936(void);
69 void Test4122840(void);
70 void Test4125885(void);
71 void Test4134034(void);
72 void Test4134300(void);
73 void Test4140009(void);
74 void Test4141750(void);
75 void Test4145457(void);
76 void Test4147295(void);
77 void Test4147706(void);
79 void Test4162198(void);
80 void Test4162852(void);
82 void Test4167494(void);
83 void Test4170798(void);
84 void Test4176114(void);
85 void Test4179818(void);
86 void Test4212072(void);
87 void Test4216742(void);
88 void Test4217661(void);
89 void Test4161100(void);
90 void Test4243011(void);
91 void Test4243108(void);
95 UBool
failure(UErrorCode status
, const UnicodeString
& msg
);
96 UBool
failure(UErrorCode status
, const UnicodeString
& msg
, const char *l
);
97 UBool
failure(UErrorCode status
, const UnicodeString
& msg
, const Locale
& l
);
100 class MyNumberFormatTest
: public NumberFormat
104 virtual UClassID
getDynamicClassID(void) const;
106 virtual UnicodeString
& format( double number
,
107 UnicodeString
& toAppendTo
,
109 UErrorCode
& status
) const
111 return NumberFormat::format(number
, toAppendTo
, pos
, status
);
114 /* Just keep this here to make some of the compilers happy */
115 virtual UnicodeString
& format(const Formattable
& obj
,
116 UnicodeString
& toAppendTo
,
118 UErrorCode
& status
) const
120 return NumberFormat::format(obj
, toAppendTo
, pos
, status
);
123 /* Just use one of the format functions */
124 virtual UnicodeString
& format( double /* number */,
125 UnicodeString
& toAppendTo
,
126 FieldPosition
& /* pos */) const
133 public Number parse(String text, ParsePosition parsePosition)
134 { return new Integer(0); }
137 /* Just use one of the parse functions */
138 virtual void parse( const UnicodeString
& /* text */,
140 ParsePosition
& /* parsePosition */) const
142 result
.setLong((int32_t)0);
145 virtual void parse( const UnicodeString
& text
,
147 UErrorCode
& status
) const
149 NumberFormat::parse(text
, result
, status
);
151 virtual Format
* clone() const
154 virtual UnicodeString
& format(int32_t,
156 FieldPosition
&) const
157 { return foo
.remove(); }
159 virtual UnicodeString
& format(int64_t,
161 FieldPosition
&) const
162 { return foo
.remove(); }
164 virtual void applyPattern(const UnicodeString
&, UParseError
&, UErrorCode
&){
168 #endif /* #if !UCONFIG_NO_FORMATTING */
170 #endif // _NUMBERFORMATREGRESSIONTEST_