]>
git.saurik.com Git - apple/icu.git/blob - icuSources/test/intltest/numbertest_doubleconversion.cpp
1 // © 2017 and later: Unicode, Inc. and others.
2 // License & terms of use: http://www.unicode.org/copyright.html
4 #include "unicode/utypes.h"
6 #if !UCONFIG_NO_FORMATTING
8 #include "numbertest.h"
9 #include "double-conversion.h"
11 using namespace double_conversion
;
13 void DoubleConversionTest::runIndexedTest(int32_t index
, UBool exec
, const char *&name
, char *) {
15 logln("TestSuite DoubleConversionTest: ");
18 TESTCASE_AUTO(testDoubleConversionApi
);
22 void DoubleConversionTest::testDoubleConversionApi() {
24 char buffer
[DoubleToStringConverter::kBase10MaximalLength
+ 1];
29 DoubleToStringConverter::DoubleToAscii(
31 DoubleToStringConverter::DtoaMode::SHORTEST
,
40 UnicodeString
result(buffer
, length
);
41 assertEquals("Digits", u
"8765", result
);
42 assertEquals("Scale", 2, point
);
45 #endif /* #if !UCONFIG_NO_FORMATTING */