]> git.saurik.com Git - apple/icu.git/blame - icuSources/test/intltest/numrgts.h
ICU-6.2.4.tar.gz
[apple/icu.git] / icuSources / test / intltest / numrgts.h
CommitLineData
374ca955 1/***********************************************************************
b75a7d8f 2 * COPYRIGHT:
374ca955
A
3 * Copyright (c) 1997-2004, International Business Machines Corporation
4 * and others. All Rights Reserved.
5 ***********************************************************************/
b75a7d8f
A
6
7#ifndef _NUMBERFORMATREGRESSIONTEST_
8#define _NUMBERFORMATREGRESSIONTEST_
9
10#include "unicode/utypes.h"
11
12#if !UCONFIG_NO_FORMATTING
13
14#include "unicode/unistr.h"
15#include "unicode/numfmt.h"
16#include "unicode/decimfmt.h"
17#include "intltest.h"
18
19/**
20 * Performs regression test for MessageFormat
21 **/
22class NumberFormatRegressionTest: public IntlTest {
23
24 // IntlTest override
25 void runIndexedTest( int32_t index, UBool exec, const char* &name, char* par );
26public:
27
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);
78
79 void Test4162198(void);
80 void Test4162852(void);
81
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);
92 void TestJ691(void);
93
94protected:
95 UBool failure(UErrorCode status, const UnicodeString& msg);
374ca955
A
96 UBool failure(UErrorCode status, const UnicodeString& msg, const char *l);
97 UBool failure(UErrorCode status, const UnicodeString& msg, const Locale& l);
b75a7d8f
A
98};
99
100class MyNumberFormatTest : public NumberFormat
101{
102public:
103
104 virtual UClassID getDynamicClassID(void) const;
105
106 virtual UnicodeString& format( double number,
107 UnicodeString& toAppendTo,
108 FieldPosition& pos,
109 UErrorCode& status) const
110 {
111 return NumberFormat::format(number, toAppendTo, pos, status);
112 }
113
114 /* Just keep this here to make some of the compilers happy */
115 virtual UnicodeString& format(const Formattable& obj,
116 UnicodeString& toAppendTo,
117 FieldPosition& pos,
118 UErrorCode& status) const
119 {
120 return NumberFormat::format(obj, toAppendTo, pos, status);
121 }
122
123 /* Just use one of the format functions */
124 virtual UnicodeString& format( double /* number */,
125 UnicodeString& toAppendTo,
126 FieldPosition& /* pos */) const
127 {
128 toAppendTo = "";
129 return toAppendTo;
130 }
131
132 /*
133 public Number parse(String text, ParsePosition parsePosition)
134 { return new Integer(0); }
135 */
136
137 /* Just use one of the parse functions */
138 virtual void parse( const UnicodeString& /* text */,
139 Formattable& result,
140 ParsePosition& /* parsePosition */) const
141 {
142 result.setLong((int32_t)0);
143 }
144
145 virtual void parse( const UnicodeString& text,
146 Formattable& result,
147 UErrorCode& status) const
148 {
149 NumberFormat::parse(text, result, status);
150 }
151 virtual Format* clone() const
152 { return NULL; }
374ca955 153
b75a7d8f
A
154 virtual UnicodeString& format(int32_t,
155 UnicodeString& foo,
156 FieldPosition&) const
157 { return foo.remove(); }
158
374ca955
A
159 virtual UnicodeString& format(int64_t,
160 UnicodeString& foo,
161 FieldPosition&) const
162 { return foo.remove(); }
163
b75a7d8f
A
164 virtual void applyPattern(const UnicodeString&, UParseError&, UErrorCode&){
165 }
166};
167
168#endif /* #if !UCONFIG_NO_FORMATTING */
169
170#endif // _NUMBERFORMATREGRESSIONTEST_
171//eof