Lines Matching refs:fmt
94 NumberFormat *fmt = NULL;
98 fmt = NumberFormat::createInstance(status);
100 test(fmt);
102 delete fmt;
104 fmt = NumberFormat::createCurrencyInstance(status);
106 test(fmt);
108 delete fmt;
110 fmt = NumberFormat::createPercentInstance(status);
112 test(fmt);
114 delete fmt;
128 fmt = NumberFormat::createInstance(loc[i], status);
130 test(fmt);
131 delete fmt;
133 fmt = NumberFormat::createCurrencyInstance(loc[i], status);
135 test(fmt);
136 delete fmt;
138 fmt = NumberFormat::createPercentInstance(loc[i], status);
140 test(fmt);
141 delete fmt;
149 NumberFormatRoundTripTest::test(NumberFormat *fmt)
152 test(fmt, uprv_getNaN());
153 test(fmt, uprv_getInfinity());
154 test(fmt, -uprv_getInfinity());
157 test(fmt, (int32_t)500);
158 test(fmt, (int32_t)0);
159 test(fmt, (int32_t)-0);
160 test(fmt, 0.0);
162 test(fmt, negZero);
163 test(fmt, 9223372036854775808.0);
164 test(fmt, -9223372036854775809.0);
167 test(fmt, randomDouble(1));
168 test(fmt, randomDouble(10000));
169 test(fmt, uprv_floor((randomDouble(10000))));
170 test(fmt, randomDouble(1e50));
171 test(fmt, randomDouble(1e-50));
173 test(fmt, randomDouble(1e100));
175 test(fmt, randomDouble(1e75));
186 //if(fmt->getMultipler() == 1)
187 DecimalFormat *df = dynamic_cast<DecimalFormat *>(fmt);
192 test(fmt, randomDouble(DBL_MAX/2.0) / df->getMultiplier());
194 test(fmt, randomDouble(1e75) / df->getMultiplier());
196 test(fmt, randomDouble(1e65) / df->getMultiplier());
202 test(fmt, randomDouble(1e-292));
203 test(fmt, randomDouble(1e-100));
207 test(fmt, randomDouble(1e-78));
208 test(fmt, randomDouble(1e-78));
213 test(fmt, randomDouble(DBL_MIN)); /* Usually 2.2250738585072014e-308 */
214 test(fmt, randomDouble(1e-100));
220 NumberFormatRoundTripTest::test(NumberFormat *fmt, double value)
222 test(fmt, Formattable(value));
226 NumberFormatRoundTripTest::test(NumberFormat *fmt, int32_t value)
228 test(fmt, Formattable(value));
232 NumberFormatRoundTripTest::test(NumberFormat *fmt, const Formattable& value)
234 fmt->setMaximumFractionDigits(999);
235 DecimalFormat *df = dynamic_cast<DecimalFormat *>(fmt);
242 s = fmt->format(value.getDouble(), s);
244 s = fmt->format(value.getLong(), s);
251 fmt->parse(s, n, status);
252 failure(status, "fmt->parse");
257 s2 = fmt->format(n.getDouble(), s2);
259 s2 = fmt->format(n.getLong(), s2);