ICU-10842 Fix header test failures, fix no data test errors, and update file properties
X-SVN-Rev: 35982
This commit is contained in:
parent
9ecbb465f2
commit
b1de9c0f30
5
.gitattributes
vendored
5
.gitattributes
vendored
@ -74,10 +74,6 @@ icu4c/source/extra/uconv/uconv.vcxproj -text
|
|||||||
icu4c/source/extra/uconv/uconv.vcxproj.filters -text
|
icu4c/source/extra/uconv/uconv.vcxproj.filters -text
|
||||||
icu4c/source/i18n/i18n.vcxproj -text
|
icu4c/source/i18n/i18n.vcxproj -text
|
||||||
icu4c/source/i18n/i18n.vcxproj.filters -text
|
icu4c/source/i18n/i18n.vcxproj.filters -text
|
||||||
icu4c/source/i18n/scientificformathelper.cpp -text
|
|
||||||
icu4c/source/i18n/sharedbreakiterator.cpp -text
|
|
||||||
icu4c/source/i18n/sharedbreakiterator.h -text
|
|
||||||
icu4c/source/i18n/unicode/scientificformathelper.h -text
|
|
||||||
icu4c/source/io/io.vcxproj -text
|
icu4c/source/io/io.vcxproj -text
|
||||||
icu4c/source/io/io.vcxproj.filters -text
|
icu4c/source/io/io.vcxproj.filters -text
|
||||||
icu4c/source/layout/layout.vcxproj -text
|
icu4c/source/layout/layout.vcxproj -text
|
||||||
@ -146,7 +142,6 @@ icu4c/source/test/cintltst/cintltst.vcxproj.filters -text
|
|||||||
icu4c/source/test/depstest/icu-dependencies-mode.el -text
|
icu4c/source/test/depstest/icu-dependencies-mode.el -text
|
||||||
icu4c/source/test/intltest/intltest.vcxproj -text
|
icu4c/source/test/intltest/intltest.vcxproj -text
|
||||||
icu4c/source/test/intltest/intltest.vcxproj.filters -text
|
icu4c/source/test/intltest/intltest.vcxproj.filters -text
|
||||||
icu4c/source/test/intltest/scientificformathelpertest.cpp -text
|
|
||||||
icu4c/source/test/iotest/iotest.vcxproj -text
|
icu4c/source/test/iotest/iotest.vcxproj -text
|
||||||
icu4c/source/test/iotest/iotest.vcxproj.filters -text
|
icu4c/source/test/iotest/iotest.vcxproj.filters -text
|
||||||
icu4c/source/test/letest/cletest.vcxproj -text
|
icu4c/source/test/letest/cletest.vcxproj -text
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
#include "unicode/reldatefmt.h"
|
#include "unicode/reldatefmt.h"
|
||||||
|
|
||||||
#if !UCONFIG_NO_FORMATTING
|
#if !UCONFIG_NO_FORMATTING && !UCONFIG_NO_BREAK_ITERATION
|
||||||
|
|
||||||
#include "unicode/localpointer.h"
|
#include "unicode/localpointer.h"
|
||||||
#include "quantityformatter.h"
|
#include "quantityformatter.h"
|
||||||
|
@ -11,6 +11,8 @@
|
|||||||
#include "sharedbreakiterator.h"
|
#include "sharedbreakiterator.h"
|
||||||
#include "unicode/brkiter.h"
|
#include "unicode/brkiter.h"
|
||||||
|
|
||||||
|
#if !UCONFIG_NO_BREAK_ITERATION
|
||||||
|
|
||||||
U_NAMESPACE_BEGIN
|
U_NAMESPACE_BEGIN
|
||||||
|
|
||||||
SharedBreakIterator::SharedBreakIterator(
|
SharedBreakIterator::SharedBreakIterator(
|
||||||
@ -22,3 +24,4 @@ SharedBreakIterator::~SharedBreakIterator() {
|
|||||||
|
|
||||||
U_NAMESPACE_END
|
U_NAMESPACE_END
|
||||||
|
|
||||||
|
#endif /* #if !UCONFIG_NO_BREAK_ITERATION */
|
||||||
|
@ -12,6 +12,8 @@
|
|||||||
#include "unicode/utypes.h"
|
#include "unicode/utypes.h"
|
||||||
#include "sharedobject.h"
|
#include "sharedobject.h"
|
||||||
|
|
||||||
|
#if !UCONFIG_NO_BREAK_ITERATION
|
||||||
|
|
||||||
U_NAMESPACE_BEGIN
|
U_NAMESPACE_BEGIN
|
||||||
|
|
||||||
class BreakIterator;
|
class BreakIterator;
|
||||||
@ -41,3 +43,5 @@ private:
|
|||||||
U_NAMESPACE_END
|
U_NAMESPACE_END
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
* \brief C++ API: Formats relative dates such as "1 day ago" or "tomorrow"
|
* \brief C++ API: Formats relative dates such as "1 day ago" or "tomorrow"
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if !UCONFIG_NO_FORMATTING
|
#if !UCONFIG_NO_FORMATTING && !UCONFIG_NO_BREAK_ITERATION
|
||||||
|
|
||||||
#ifndef U_HIDE_DRAFT_API
|
#ifndef U_HIDE_DRAFT_API
|
||||||
|
|
||||||
@ -494,5 +494,5 @@ U_NAMESPACE_END
|
|||||||
|
|
||||||
#endif /* U_HIDE_DRAFT_API */
|
#endif /* U_HIDE_DRAFT_API */
|
||||||
|
|
||||||
#endif /* !UCONFIG_NO_FORMATTING */
|
#endif /* !UCONFIG_NO_FORMATTING && !UCONFIG_NO_BREAK_ITERATION*/
|
||||||
#endif
|
#endif
|
||||||
|
@ -2560,6 +2560,7 @@ static void TestCurrencyUsage(void) {
|
|||||||
if (U_FAILURE(status)) {
|
if (U_FAILURE(status)) {
|
||||||
log_data_err("FAIL: unum_open, locale %s, style %d - %s\n",
|
log_data_err("FAIL: unum_open, locale %s, style %d - %s\n",
|
||||||
localeString, (int)style, myErrorName(status));
|
localeString, (int)style, myErrorName(status));
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(i == 0){ // this is for the getter/setter
|
if(i == 0){ // this is for the getter/setter
|
||||||
|
@ -74,6 +74,7 @@ region.h
|
|||||||
rep.h
|
rep.h
|
||||||
resbund.h
|
resbund.h
|
||||||
schriter.h
|
schriter.h
|
||||||
|
scientificformathelper.h
|
||||||
search.h
|
search.h
|
||||||
selfmt.h
|
selfmt.h
|
||||||
simpletz.h
|
simpletz.h
|
||||||
|
@ -2437,16 +2437,24 @@ void CollationAPITest::TestBadKeywords() {
|
|||||||
errorCode = U_ZERO_ERROR;
|
errorCode = U_ZERO_ERROR;
|
||||||
coll.adoptInstead(Collator::createInstance(localeID, errorCode));
|
coll.adoptInstead(Collator::createInstance(localeID, errorCode));
|
||||||
if(errorCode != U_UNSUPPORTED_ERROR) {
|
if(errorCode != U_UNSUPPORTED_ERROR) {
|
||||||
errln("Collator::createInstance(%s) did not fail as expected - %s",
|
if (errorCode == U_FILE_ACCESS_ERROR) {
|
||||||
localeID, u_errorName(errorCode));
|
dataerrln("Collator::createInstance(it@colHiraganaQuaternary=true) : %s", u_errorName(errorCode));
|
||||||
|
} else {
|
||||||
|
errln("Collator::createInstance(%s) did not fail as expected - %s",
|
||||||
|
localeID, u_errorName(errorCode));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
localeID = "it-u-vt-u24";
|
localeID = "it-u-vt-u24";
|
||||||
errorCode = U_ZERO_ERROR;
|
errorCode = U_ZERO_ERROR;
|
||||||
coll.adoptInstead(Collator::createInstance(localeID, errorCode));
|
coll.adoptInstead(Collator::createInstance(localeID, errorCode));
|
||||||
if(errorCode != U_UNSUPPORTED_ERROR) {
|
if(errorCode != U_UNSUPPORTED_ERROR) {
|
||||||
errln("Collator::createInstance(%s) did not fail as expected - %s",
|
if (errorCode == U_ILLEGAL_ARGUMENT_ERROR) {
|
||||||
localeID, u_errorName(errorCode));
|
dataerrln("Collator::createInstance(it-u-vt-u24) : %s", u_errorName(errorCode));
|
||||||
|
} else {
|
||||||
|
errln("Collator::createInstance(%s) did not fail as expected - %s",
|
||||||
|
localeID, u_errorName(errorCode));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1683,7 +1683,7 @@ void DateFormatRegressionTest::TestT10855(void) {
|
|||||||
|
|
||||||
SimpleDateFormat dateFmt(items[x].pattern, status);
|
SimpleDateFormat dateFmt(items[x].pattern, status);
|
||||||
if(U_FAILURE(status)) {
|
if(U_FAILURE(status)) {
|
||||||
errln(u_errorName(status));
|
errcheckln(status, "Failed dateFmt: %s", u_errorName(status));
|
||||||
++x;
|
++x;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -4419,6 +4419,10 @@ void DateFormatTest::TestParseLeniencyAPIs() {
|
|||||||
UErrorCode status = U_ZERO_ERROR;
|
UErrorCode status = U_ZERO_ERROR;
|
||||||
LocalPointer<DateFormat> dateFormat(DateFormat::createDateInstance());
|
LocalPointer<DateFormat> dateFormat(DateFormat::createDateInstance());
|
||||||
DateFormat *fmt = dateFormat.getAlias();
|
DateFormat *fmt = dateFormat.getAlias();
|
||||||
|
if (fmt == NULL) {
|
||||||
|
dataerrln("Failed calling dateFormat.getAlias()");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
assertTrue("isLenient default", fmt->isLenient());
|
assertTrue("isLenient default", fmt->isLenient());
|
||||||
assertTrue("isCalendarLenient default", fmt->isCalendarLenient());
|
assertTrue("isCalendarLenient default", fmt->isCalendarLenient());
|
||||||
|
@ -61,7 +61,9 @@
|
|||||||
|
|
||||||
extern IntlTest *createCompactDecimalFormatTest();
|
extern IntlTest *createCompactDecimalFormatTest();
|
||||||
extern IntlTest *createGenderInfoTest();
|
extern IntlTest *createGenderInfoTest();
|
||||||
|
#if !UCONFIG_NO_BREAK_ITERATION
|
||||||
extern IntlTest *createRelativeDateTimeFormatterTest();
|
extern IntlTest *createRelativeDateTimeFormatterTest();
|
||||||
|
#endif
|
||||||
extern IntlTest *createMeasureFormatTest();
|
extern IntlTest *createMeasureFormatTest();
|
||||||
extern IntlTest *createScientificFormatHelperTest();
|
extern IntlTest *createScientificFormatHelperTest();
|
||||||
|
|
||||||
@ -161,6 +163,7 @@ void IntlTestFormat::runIndexedTest( int32_t index, UBool exec, const char* &nam
|
|||||||
break;
|
break;
|
||||||
TESTCLASS(45,RegionTest);
|
TESTCLASS(45,RegionTest);
|
||||||
case 46:
|
case 46:
|
||||||
|
#if !UCONFIG_NO_BREAK_ITERATION
|
||||||
name = "RelativeDateTimeFormatterTest";
|
name = "RelativeDateTimeFormatterTest";
|
||||||
if (exec) {
|
if (exec) {
|
||||||
logln("RelativeDateTimeFormatterTest test---");
|
logln("RelativeDateTimeFormatterTest test---");
|
||||||
@ -168,6 +171,7 @@ void IntlTestFormat::runIndexedTest( int32_t index, UBool exec, const char* &nam
|
|||||||
LocalPointer<IntlTest> test(createRelativeDateTimeFormatterTest());
|
LocalPointer<IntlTest> test(createRelativeDateTimeFormatterTest());
|
||||||
callTest(*test, par);
|
callTest(*test, par);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
case 47:
|
case 47:
|
||||||
name = "MeasureFormatTest";
|
name = "MeasureFormatTest";
|
||||||
|
@ -7641,7 +7641,9 @@ void NumberFormatTest::TestCurrencyUsage() {
|
|||||||
status = U_ZERO_ERROR;
|
status = U_ZERO_ERROR;
|
||||||
if(i == 0){
|
if(i == 0){
|
||||||
fmt = (DecimalFormat *) NumberFormat::createInstance(enUS_TWD, UNUM_CURRENCY, status);
|
fmt = (DecimalFormat *) NumberFormat::createInstance(enUS_TWD, UNUM_CURRENCY, status);
|
||||||
assertSuccess("en_US@currency=TWD/CURRECY", status);
|
if (assertSuccess("en_US@currency=TWD/CURRECY", status, TRUE) == FALSE) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
UnicodeString original;
|
UnicodeString original;
|
||||||
fmt->format(agent,original);
|
fmt->format(agent,original);
|
||||||
@ -7654,7 +7656,9 @@ void NumberFormatTest::TestCurrencyUsage() {
|
|||||||
fmt->setCurrencyUsage(UCURR_USAGE_CASH, &status);
|
fmt->setCurrencyUsage(UCURR_USAGE_CASH, &status);
|
||||||
}else{
|
}else{
|
||||||
fmt = (DecimalFormat *) NumberFormat::createInstance(enUS_TWD, UNUM_CASH_CURRENCY, status);
|
fmt = (DecimalFormat *) NumberFormat::createInstance(enUS_TWD, UNUM_CASH_CURRENCY, status);
|
||||||
assertSuccess("en_US@currency=TWD/CASH", status);
|
if (assertSuccess("en_US@currency=TWD/CASH", status, TRUE) == FALSE) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// must be usage = cash
|
// must be usage = cash
|
||||||
@ -7674,7 +7678,9 @@ void NumberFormatTest::TestCurrencyUsage() {
|
|||||||
status = U_ZERO_ERROR;
|
status = U_ZERO_ERROR;
|
||||||
if(i == 0){
|
if(i == 0){
|
||||||
fmt = (DecimalFormat *) NumberFormat::createInstance(enUS_CAD, UNUM_CURRENCY, status);
|
fmt = (DecimalFormat *) NumberFormat::createInstance(enUS_CAD, UNUM_CURRENCY, status);
|
||||||
assertSuccess("en_US@currency=CAD/CURRECY", status);
|
if (assertSuccess("en_US@currency=CAD/CURRECY", status, TRUE) == FALSE) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
UnicodeString original_rounding;
|
UnicodeString original_rounding;
|
||||||
fmt->format(agent, original_rounding);
|
fmt->format(agent, original_rounding);
|
||||||
@ -7682,7 +7688,9 @@ void NumberFormatTest::TestCurrencyUsage() {
|
|||||||
fmt->setCurrencyUsage(UCURR_USAGE_CASH, &status);
|
fmt->setCurrencyUsage(UCURR_USAGE_CASH, &status);
|
||||||
}else{
|
}else{
|
||||||
fmt = (DecimalFormat *) NumberFormat::createInstance(enUS_CAD, UNUM_CASH_CURRENCY, status);
|
fmt = (DecimalFormat *) NumberFormat::createInstance(enUS_CAD, UNUM_CASH_CURRENCY, status);
|
||||||
assertSuccess("en_US@currency=CAD/CASH", status);
|
if (assertSuccess("en_US@currency=CAD/CASH", status, TRUE) == FALSE) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
UnicodeString cash_rounding_currency;
|
UnicodeString cash_rounding_currency;
|
||||||
@ -7698,11 +7706,15 @@ void NumberFormatTest::TestCurrencyUsage() {
|
|||||||
status = U_ZERO_ERROR;
|
status = U_ZERO_ERROR;
|
||||||
if(i == 0){
|
if(i == 0){
|
||||||
fmt = (DecimalFormat *) NumberFormat::createInstance(enUS_CAD, UNUM_CURRENCY, status);
|
fmt = (DecimalFormat *) NumberFormat::createInstance(enUS_CAD, UNUM_CURRENCY, status);
|
||||||
assertSuccess("en_US@currency=CAD/CURRECY", status);
|
if (assertSuccess("en_US@currency=CAD/CURRECY", status, TRUE) == FALSE) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
fmt->setCurrencyUsage(UCURR_USAGE_CASH, &status);
|
fmt->setCurrencyUsage(UCURR_USAGE_CASH, &status);
|
||||||
}else{
|
}else{
|
||||||
fmt = (DecimalFormat *) NumberFormat::createInstance(enUS_CAD, UNUM_CASH_CURRENCY, status);
|
fmt = (DecimalFormat *) NumberFormat::createInstance(enUS_CAD, UNUM_CASH_CURRENCY, status);
|
||||||
assertSuccess("en_US@currency=CAD/CASH", status);
|
if (assertSuccess("en_US@currency=CAD/CASH", status, TRUE) == FALSE) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
UnicodeString cur_original;
|
UnicodeString cur_original;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* COPYRIGHT:
|
* COPYRIGHT:
|
||||||
* Copyright (c) 2013, International Business Machines Corporation
|
* Copyright (c) 2013-2014, International Business Machines Corporation
|
||||||
* and others. All Rights Reserved.
|
* and others. All Rights Reserved.
|
||||||
***********************************************************************/
|
***********************************************************************/
|
||||||
|
|
||||||
@ -415,13 +415,13 @@ void RegionTest::TestGetInstanceString() {
|
|||||||
UErrorCode status = U_ZERO_ERROR;
|
UErrorCode status = U_ZERO_ERROR;
|
||||||
const Region *r = Region::getInstance((const char *)NULL,status);
|
const Region *r = Region::getInstance((const char *)NULL,status);
|
||||||
if ( status != U_ILLEGAL_ARGUMENT_ERROR ) {
|
if ( status != U_ILLEGAL_ARGUMENT_ERROR ) {
|
||||||
errln("Calling Region::getInstance(NULL) should have triggered an U_ILLEGAL_ARGUMENT_ERROR, but didn't.");
|
errcheckln(status, "Calling Region::getInstance(NULL) should have triggered an U_ILLEGAL_ARGUMENT_ERROR, but didn't. - %s", u_errorName(status));
|
||||||
}
|
}
|
||||||
|
|
||||||
status = U_ZERO_ERROR;
|
status = U_ZERO_ERROR;
|
||||||
r = Region::getInstance("BOGUS",status);
|
r = Region::getInstance("BOGUS",status);
|
||||||
if ( status != U_ILLEGAL_ARGUMENT_ERROR ) {
|
if ( status != U_ILLEGAL_ARGUMENT_ERROR ) {
|
||||||
errln("Calling Region::getInstance(\"BOGUS\") should have triggered an U_ILLEGAL_ARGUMENT_ERROR, but didn't.");
|
errcheckln(status, "Calling Region::getInstance(\"BOGUS\") should have triggered an U_ILLEGAL_ARGUMENT_ERROR, but didn't. - %s", u_errorName(status));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -466,7 +466,7 @@ void RegionTest::TestGetInstanceInt() {
|
|||||||
UErrorCode status = U_ZERO_ERROR;
|
UErrorCode status = U_ZERO_ERROR;
|
||||||
Region::getInstance(-123,status);
|
Region::getInstance(-123,status);
|
||||||
if ( status != U_ILLEGAL_ARGUMENT_ERROR ) {
|
if ( status != U_ILLEGAL_ARGUMENT_ERROR ) {
|
||||||
errln("Calling Region::getInstance(-123) should have triggered an U_ILLEGAL_ARGUMENT_ERROR, but didn't.");
|
errcheckln(status, "Calling Region::getInstance(-123) should have triggered an U_ILLEGAL_ARGUMENT_ERROR, but didn't. - %s", u_errorName(status));
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int32_t i = 0 ; i < LENGTHOF(testData) ; i++ ) {
|
for (int32_t i = 0 ; i < LENGTHOF(testData) ; i++ ) {
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
#include "intltest.h"
|
#include "intltest.h"
|
||||||
|
|
||||||
#if !UCONFIG_NO_FORMATTING
|
#if !UCONFIG_NO_FORMATTING && !UCONFIG_NO_BREAK_ITERATION
|
||||||
|
|
||||||
#include "unicode/localpointer.h"
|
#include "unicode/localpointer.h"
|
||||||
#include "unicode/numfmt.h"
|
#include "unicode/numfmt.h"
|
||||||
@ -628,6 +628,10 @@ void RelativeDateTimeFormatterTest::TestEnglishCaps() {
|
|||||||
UDAT_STYLE_LONG,
|
UDAT_STYLE_LONG,
|
||||||
UDISPCTX_CAPITALIZATION_FOR_BEGINNING_OF_SENTENCE,
|
UDISPCTX_CAPITALIZATION_FOR_BEGINNING_OF_SENTENCE,
|
||||||
status);
|
status);
|
||||||
|
if (U_FAILURE(status)) {
|
||||||
|
dataerrln("Failed call to RelativeDateTimeFormatter(\"en\", NULL, UDAT_STYLE_LONG, UDISPCTX_CAPITALIZATION_FOR_BEGINNING_OF_SENTENCE, status); : %s", u_errorName(status));
|
||||||
|
return;
|
||||||
|
}
|
||||||
RelativeDateTimeFormatter fmt3(status);
|
RelativeDateTimeFormatter fmt3(status);
|
||||||
|
|
||||||
// Test assignment and copy constructor with capitalization on.
|
// Test assignment and copy constructor with capitalization on.
|
||||||
@ -665,7 +669,9 @@ void RelativeDateTimeFormatterTest::TestEnglishNoQuantityCaps() {
|
|||||||
UDAT_STYLE_LONG,
|
UDAT_STYLE_LONG,
|
||||||
UDISPCTX_CAPITALIZATION_FOR_BEGINNING_OF_SENTENCE,
|
UDISPCTX_CAPITALIZATION_FOR_BEGINNING_OF_SENTENCE,
|
||||||
status);
|
status);
|
||||||
assertSuccess("", status);
|
if (assertSuccess("RelativeDateTimeFormatter", status, TRUE) == FALSE) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
RunTest(
|
RunTest(
|
||||||
fmt,
|
fmt,
|
||||||
kEnglishNoQuantityCaps,
|
kEnglishNoQuantityCaps,
|
||||||
@ -750,6 +756,10 @@ void RelativeDateTimeFormatterTest::TestGetters() {
|
|||||||
UDAT_STYLE_NARROW,
|
UDAT_STYLE_NARROW,
|
||||||
UDISPCTX_CAPITALIZATION_FOR_MIDDLE_OF_SENTENCE,
|
UDISPCTX_CAPITALIZATION_FOR_MIDDLE_OF_SENTENCE,
|
||||||
status);
|
status);
|
||||||
|
if (U_FAILURE(status)) {
|
||||||
|
dataerrln("Failed call to RelativeDateTimeFormatter(\"en\", NULL, UDAT_STYLE_NARROW, UDISPCTX_CAPITALIZATION_FOR_MIDDLE_OF_SENTENCE, status);) : %s", u_errorName(status));
|
||||||
|
return;
|
||||||
|
}
|
||||||
RelativeDateTimeFormatter fmt3(status);
|
RelativeDateTimeFormatter fmt3(status);
|
||||||
|
|
||||||
// copy and assignment.
|
// copy and assignment.
|
||||||
|
@ -49,6 +49,10 @@ void ScientificFormatHelperTest::runIndexedTest(
|
|||||||
void ScientificFormatHelperTest::TestBasic() {
|
void ScientificFormatHelperTest::TestBasic() {
|
||||||
UErrorCode status = U_ZERO_ERROR;
|
UErrorCode status = U_ZERO_ERROR;
|
||||||
LocalPointer<DecimalFormat> decfmt((DecimalFormat *) NumberFormat::createScientificInstance("en", status));
|
LocalPointer<DecimalFormat> decfmt((DecimalFormat *) NumberFormat::createScientificInstance("en", status));
|
||||||
|
if (U_FAILURE(status)) {
|
||||||
|
dataerrln("Failed call NumberFormat::createScientificInstance(\"en\", status) - %s", u_errorName(status));
|
||||||
|
return;
|
||||||
|
}
|
||||||
UnicodeString appendTo("String: ");
|
UnicodeString appendTo("String: ");
|
||||||
FieldPositionIterator fpositer;
|
FieldPositionIterator fpositer;
|
||||||
decfmt->format(1.23456e-78, appendTo, &fpositer, status);
|
decfmt->format(1.23456e-78, appendTo, &fpositer, status);
|
||||||
@ -80,6 +84,10 @@ void ScientificFormatHelperTest::TestBasic() {
|
|||||||
void ScientificFormatHelperTest::TestFarsi() {
|
void ScientificFormatHelperTest::TestFarsi() {
|
||||||
UErrorCode status = U_ZERO_ERROR;
|
UErrorCode status = U_ZERO_ERROR;
|
||||||
LocalPointer<DecimalFormat> decfmt((DecimalFormat *) NumberFormat::createScientificInstance("fa", status));
|
LocalPointer<DecimalFormat> decfmt((DecimalFormat *) NumberFormat::createScientificInstance("fa", status));
|
||||||
|
if (U_FAILURE(status)) {
|
||||||
|
dataerrln("Failed call NumberFormat::createScientificInstance(\"fa\", status) - %s", u_errorName(status));
|
||||||
|
return;
|
||||||
|
}
|
||||||
UnicodeString appendTo("String: ");
|
UnicodeString appendTo("String: ");
|
||||||
FieldPositionIterator fpositer;
|
FieldPositionIterator fpositer;
|
||||||
decfmt->format(1.23456e-78, appendTo, &fpositer, status);
|
decfmt->format(1.23456e-78, appendTo, &fpositer, status);
|
||||||
@ -96,6 +104,10 @@ void ScientificFormatHelperTest::TestFarsi() {
|
|||||||
void ScientificFormatHelperTest::TestPlusSignInExponentMarkup() {
|
void ScientificFormatHelperTest::TestPlusSignInExponentMarkup() {
|
||||||
UErrorCode status = U_ZERO_ERROR;
|
UErrorCode status = U_ZERO_ERROR;
|
||||||
LocalPointer<DecimalFormat> decfmt((DecimalFormat *) NumberFormat::createScientificInstance("en", status));
|
LocalPointer<DecimalFormat> decfmt((DecimalFormat *) NumberFormat::createScientificInstance("en", status));
|
||||||
|
if (U_FAILURE(status)) {
|
||||||
|
dataerrln("Failed call NumberFormat::createScientificInstance(\"en\", status) - %s", u_errorName(status));
|
||||||
|
return;
|
||||||
|
}
|
||||||
decfmt->applyPattern("0.00E+0", status);
|
decfmt->applyPattern("0.00E+0", status);
|
||||||
assertSuccess("", status);
|
assertSuccess("", status);
|
||||||
UnicodeString appendTo;
|
UnicodeString appendTo;
|
||||||
@ -114,6 +126,10 @@ void ScientificFormatHelperTest::TestPlusSignInExponentMarkup() {
|
|||||||
void ScientificFormatHelperTest::TestPlusSignInExponentSuperscript() {
|
void ScientificFormatHelperTest::TestPlusSignInExponentSuperscript() {
|
||||||
UErrorCode status = U_ZERO_ERROR;
|
UErrorCode status = U_ZERO_ERROR;
|
||||||
LocalPointer<DecimalFormat> decfmt((DecimalFormat *) NumberFormat::createScientificInstance("en", status));
|
LocalPointer<DecimalFormat> decfmt((DecimalFormat *) NumberFormat::createScientificInstance("en", status));
|
||||||
|
if (U_FAILURE(status)) {
|
||||||
|
dataerrln("Failed call NumberFormat::createScientificInstance(\"en\", status) - %s", u_errorName(status));
|
||||||
|
return;
|
||||||
|
}
|
||||||
decfmt->applyPattern("0.00E+0", status);
|
decfmt->applyPattern("0.00E+0", status);
|
||||||
assertSuccess("", status);
|
assertSuccess("", status);
|
||||||
UnicodeString appendTo;
|
UnicodeString appendTo;
|
||||||
@ -132,7 +148,9 @@ void ScientificFormatHelperTest::TestPlusSignInExponentSuperscript() {
|
|||||||
void ScientificFormatHelperTest::TestFixedDecimalMarkup() {
|
void ScientificFormatHelperTest::TestFixedDecimalMarkup() {
|
||||||
UErrorCode status = U_ZERO_ERROR;
|
UErrorCode status = U_ZERO_ERROR;
|
||||||
LocalPointer<DecimalFormat> decfmt((DecimalFormat *) NumberFormat::createInstance("en", status));
|
LocalPointer<DecimalFormat> decfmt((DecimalFormat *) NumberFormat::createInstance("en", status));
|
||||||
assertSuccess("", status);
|
if (assertSuccess("NumberFormat::createInstance", status, TRUE) == FALSE) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
UnicodeString appendTo;
|
UnicodeString appendTo;
|
||||||
FieldPositionIterator fpositer;
|
FieldPositionIterator fpositer;
|
||||||
decfmt->format(123456.0, appendTo, &fpositer, status);
|
decfmt->format(123456.0, appendTo, &fpositer, status);
|
||||||
@ -148,7 +166,9 @@ void ScientificFormatHelperTest::TestFixedDecimalMarkup() {
|
|||||||
void ScientificFormatHelperTest::TestFixedDecimalSuperscript() {
|
void ScientificFormatHelperTest::TestFixedDecimalSuperscript() {
|
||||||
UErrorCode status = U_ZERO_ERROR;
|
UErrorCode status = U_ZERO_ERROR;
|
||||||
LocalPointer<DecimalFormat> decfmt((DecimalFormat *) NumberFormat::createInstance("en", status));
|
LocalPointer<DecimalFormat> decfmt((DecimalFormat *) NumberFormat::createInstance("en", status));
|
||||||
assertSuccess("", status);
|
if (assertSuccess("NumberFormat::createInstance", status, TRUE) == FALSE) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
UnicodeString appendTo;
|
UnicodeString appendTo;
|
||||||
FieldPositionIterator fpositer;
|
FieldPositionIterator fpositer;
|
||||||
decfmt->format(123456.0, appendTo, &fpositer, status);
|
decfmt->format(123456.0, appendTo, &fpositer, status);
|
||||||
|
Loading…
Reference in New Issue
Block a user