Lines Matching refs:fmt
95 NumberFormat *fmt = NULL;
99 fmt = NumberFormat::createInstance(status);
101 test(fmt);
103 delete fmt;
105 fmt = NumberFormat::createCurrencyInstance(status);
107 test(fmt);
109 delete fmt;
111 fmt = NumberFormat::createPercentInstance(status);
113 test(fmt);
115 delete fmt;
129 fmt = NumberFormat::createInstance(loc[i], status);
131 test(fmt);
132 delete fmt;
134 fmt = NumberFormat::createCurrencyInstance(loc[i], status);
136 test(fmt);
137 delete fmt;
139 fmt = NumberFormat::createPercentInstance(loc[i], status);
141 test(fmt);
142 delete fmt;
150 NumberFormatRoundTripTest::test(NumberFormat *fmt)
153 test(fmt, uprv_getNaN());
154 test(fmt, uprv_getInfinity());
155 test(fmt, -uprv_getInfinity());
158 test(fmt, (int32_t)500);
159 test(fmt, (int32_t)0);
160 test(fmt, (int32_t)-0);
161 test(fmt, 0.0);
163 test(fmt, negZero);
164 test(fmt, 9223372036854775808.0);
165 test(fmt, -9223372036854775809.0);
168 test(fmt, randomDouble(1));
169 test(fmt, randomDouble(10000));
170 test(fmt, uprv_floor((randomDouble(10000))));
171 test(fmt, randomDouble(1e50));
172 test(fmt, randomDouble(1e-50));
174 test(fmt, randomDouble(1e100));
176 test(fmt, randomDouble(1e75));
187 //if(fmt->getMultipler() == 1)
188 DecimalFormat *df = dynamic_cast<DecimalFormat *>(fmt);
193 test(fmt, randomDouble(DBL_MAX/2.0) / df->getMultiplier());
195 test(fmt, randomDouble(1e75) / df->getMultiplier());
197 test(fmt, randomDouble(1e65) / df->getMultiplier());
203 test(fmt, randomDouble(1e-292));
204 test(fmt, randomDouble(1e-100));
208 test(fmt, randomDouble(1e-78));
209 test(fmt, randomDouble(1e-78));
214 test(fmt, randomDouble(DBL_MIN)); /* Usually 2.2250738585072014e-308 */
215 test(fmt, randomDouble(1e-100));
221 NumberFormatRoundTripTest::test(NumberFormat *fmt, double value)
223 test(fmt, Formattable(value));
227 NumberFormatRoundTripTest::test(NumberFormat *fmt, int32_t value)
229 test(fmt, Formattable(value));
233 NumberFormatRoundTripTest::test(NumberFormat *fmt, const Formattable& value)
235 fmt->setMaximumFractionDigits(999);
236 DecimalFormat *df = dynamic_cast<DecimalFormat *>(fmt);
243 s = fmt->format(value.getDouble(), s);
245 s = fmt->format(value.getLong(), s);
252 fmt->parse(s, n, status);
255 const char* localeID = fmt->getLocaleID(ULOC_ACTUAL_LOCALE, infoStatus);
257 errln(UnicodeString("FAIL: fmt->parse failed, locale: ") + localeID + ", error: " + u_errorName(status));
263 s2 = fmt->format(n.getDouble(), s2);
265 s2 = fmt->format(n.getLong(), s2);