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/i18n/i18n.vcxproj -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.filters -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/intltest/intltest.vcxproj -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.filters -text
|
||||
icu4c/source/test/letest/cletest.vcxproj -text
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
#include "unicode/reldatefmt.h"
|
||||
|
||||
#if !UCONFIG_NO_FORMATTING
|
||||
#if !UCONFIG_NO_FORMATTING && !UCONFIG_NO_BREAK_ITERATION
|
||||
|
||||
#include "unicode/localpointer.h"
|
||||
#include "quantityformatter.h"
|
||||
|
@ -11,6 +11,8 @@
|
||||
#include "sharedbreakiterator.h"
|
||||
#include "unicode/brkiter.h"
|
||||
|
||||
#if !UCONFIG_NO_BREAK_ITERATION
|
||||
|
||||
U_NAMESPACE_BEGIN
|
||||
|
||||
SharedBreakIterator::SharedBreakIterator(
|
||||
@ -22,3 +24,4 @@ SharedBreakIterator::~SharedBreakIterator() {
|
||||
|
||||
U_NAMESPACE_END
|
||||
|
||||
#endif /* #if !UCONFIG_NO_BREAK_ITERATION */
|
||||
|
@ -12,6 +12,8 @@
|
||||
#include "unicode/utypes.h"
|
||||
#include "sharedobject.h"
|
||||
|
||||
#if !UCONFIG_NO_BREAK_ITERATION
|
||||
|
||||
U_NAMESPACE_BEGIN
|
||||
|
||||
class BreakIterator;
|
||||
@ -41,3 +43,5 @@ private:
|
||||
U_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@ -22,7 +22,7 @@
|
||||
* \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
|
||||
|
||||
@ -494,5 +494,5 @@ U_NAMESPACE_END
|
||||
|
||||
#endif /* U_HIDE_DRAFT_API */
|
||||
|
||||
#endif /* !UCONFIG_NO_FORMATTING */
|
||||
#endif /* !UCONFIG_NO_FORMATTING && !UCONFIG_NO_BREAK_ITERATION*/
|
||||
#endif
|
||||
|
@ -2560,6 +2560,7 @@ static void TestCurrencyUsage(void) {
|
||||
if (U_FAILURE(status)) {
|
||||
log_data_err("FAIL: unum_open, locale %s, style %d - %s\n",
|
||||
localeString, (int)style, myErrorName(status));
|
||||
continue;
|
||||
}
|
||||
|
||||
if(i == 0){ // this is for the getter/setter
|
||||
|
@ -74,6 +74,7 @@ region.h
|
||||
rep.h
|
||||
resbund.h
|
||||
schriter.h
|
||||
scientificformathelper.h
|
||||
search.h
|
||||
selfmt.h
|
||||
simpletz.h
|
||||
|
@ -2437,16 +2437,24 @@ void CollationAPITest::TestBadKeywords() {
|
||||
errorCode = U_ZERO_ERROR;
|
||||
coll.adoptInstead(Collator::createInstance(localeID, errorCode));
|
||||
if(errorCode != U_UNSUPPORTED_ERROR) {
|
||||
errln("Collator::createInstance(%s) did not fail as expected - %s",
|
||||
localeID, u_errorName(errorCode));
|
||||
if (errorCode == U_FILE_ACCESS_ERROR) {
|
||||
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";
|
||||
errorCode = U_ZERO_ERROR;
|
||||
coll.adoptInstead(Collator::createInstance(localeID, errorCode));
|
||||
if(errorCode != U_UNSUPPORTED_ERROR) {
|
||||
errln("Collator::createInstance(%s) did not fail as expected - %s",
|
||||
localeID, u_errorName(errorCode));
|
||||
if (errorCode == U_ILLEGAL_ARGUMENT_ERROR) {
|
||||
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);
|
||||
if(U_FAILURE(status)) {
|
||||
errln(u_errorName(status));
|
||||
errcheckln(status, "Failed dateFmt: %s", u_errorName(status));
|
||||
++x;
|
||||
continue;
|
||||
}
|
||||
|
@ -4419,6 +4419,10 @@ void DateFormatTest::TestParseLeniencyAPIs() {
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
LocalPointer<DateFormat> dateFormat(DateFormat::createDateInstance());
|
||||
DateFormat *fmt = dateFormat.getAlias();
|
||||
if (fmt == NULL) {
|
||||
dataerrln("Failed calling dateFormat.getAlias()");
|
||||
return;
|
||||
}
|
||||
|
||||
assertTrue("isLenient default", fmt->isLenient());
|
||||
assertTrue("isCalendarLenient default", fmt->isCalendarLenient());
|
||||
|
@ -61,7 +61,9 @@
|
||||
|
||||
extern IntlTest *createCompactDecimalFormatTest();
|
||||
extern IntlTest *createGenderInfoTest();
|
||||
#if !UCONFIG_NO_BREAK_ITERATION
|
||||
extern IntlTest *createRelativeDateTimeFormatterTest();
|
||||
#endif
|
||||
extern IntlTest *createMeasureFormatTest();
|
||||
extern IntlTest *createScientificFormatHelperTest();
|
||||
|
||||
@ -161,6 +163,7 @@ void IntlTestFormat::runIndexedTest( int32_t index, UBool exec, const char* &nam
|
||||
break;
|
||||
TESTCLASS(45,RegionTest);
|
||||
case 46:
|
||||
#if !UCONFIG_NO_BREAK_ITERATION
|
||||
name = "RelativeDateTimeFormatterTest";
|
||||
if (exec) {
|
||||
logln("RelativeDateTimeFormatterTest test---");
|
||||
@ -168,6 +171,7 @@ void IntlTestFormat::runIndexedTest( int32_t index, UBool exec, const char* &nam
|
||||
LocalPointer<IntlTest> test(createRelativeDateTimeFormatterTest());
|
||||
callTest(*test, par);
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
case 47:
|
||||
name = "MeasureFormatTest";
|
||||
|
@ -7641,7 +7641,9 @@ void NumberFormatTest::TestCurrencyUsage() {
|
||||
status = U_ZERO_ERROR;
|
||||
if(i == 0){
|
||||
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;
|
||||
fmt->format(agent,original);
|
||||
@ -7654,7 +7656,9 @@ void NumberFormatTest::TestCurrencyUsage() {
|
||||
fmt->setCurrencyUsage(UCURR_USAGE_CASH, &status);
|
||||
}else{
|
||||
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
|
||||
@ -7674,7 +7678,9 @@ void NumberFormatTest::TestCurrencyUsage() {
|
||||
status = U_ZERO_ERROR;
|
||||
if(i == 0){
|
||||
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;
|
||||
fmt->format(agent, original_rounding);
|
||||
@ -7682,7 +7688,9 @@ void NumberFormatTest::TestCurrencyUsage() {
|
||||
fmt->setCurrencyUsage(UCURR_USAGE_CASH, &status);
|
||||
}else{
|
||||
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;
|
||||
@ -7698,11 +7706,15 @@ void NumberFormatTest::TestCurrencyUsage() {
|
||||
status = U_ZERO_ERROR;
|
||||
if(i == 0){
|
||||
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);
|
||||
}else{
|
||||
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;
|
||||
|
@ -1,6 +1,6 @@
|
||||
/***********************************************************************
|
||||
* COPYRIGHT:
|
||||
* Copyright (c) 2013, International Business Machines Corporation
|
||||
* Copyright (c) 2013-2014, International Business Machines Corporation
|
||||
* and others. All Rights Reserved.
|
||||
***********************************************************************/
|
||||
|
||||
@ -415,13 +415,13 @@ void RegionTest::TestGetInstanceString() {
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
const Region *r = Region::getInstance((const char *)NULL,status);
|
||||
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;
|
||||
r = Region::getInstance("BOGUS",status);
|
||||
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;
|
||||
Region::getInstance(-123,status);
|
||||
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++ ) {
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
#include "intltest.h"
|
||||
|
||||
#if !UCONFIG_NO_FORMATTING
|
||||
#if !UCONFIG_NO_FORMATTING && !UCONFIG_NO_BREAK_ITERATION
|
||||
|
||||
#include "unicode/localpointer.h"
|
||||
#include "unicode/numfmt.h"
|
||||
@ -628,6 +628,10 @@ void RelativeDateTimeFormatterTest::TestEnglishCaps() {
|
||||
UDAT_STYLE_LONG,
|
||||
UDISPCTX_CAPITALIZATION_FOR_BEGINNING_OF_SENTENCE,
|
||||
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);
|
||||
|
||||
// Test assignment and copy constructor with capitalization on.
|
||||
@ -665,7 +669,9 @@ void RelativeDateTimeFormatterTest::TestEnglishNoQuantityCaps() {
|
||||
UDAT_STYLE_LONG,
|
||||
UDISPCTX_CAPITALIZATION_FOR_BEGINNING_OF_SENTENCE,
|
||||
status);
|
||||
assertSuccess("", status);
|
||||
if (assertSuccess("RelativeDateTimeFormatter", status, TRUE) == FALSE) {
|
||||
return;
|
||||
}
|
||||
RunTest(
|
||||
fmt,
|
||||
kEnglishNoQuantityCaps,
|
||||
@ -750,6 +756,10 @@ void RelativeDateTimeFormatterTest::TestGetters() {
|
||||
UDAT_STYLE_NARROW,
|
||||
UDISPCTX_CAPITALIZATION_FOR_MIDDLE_OF_SENTENCE,
|
||||
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);
|
||||
|
||||
// copy and assignment.
|
||||
|
@ -49,6 +49,10 @@ void ScientificFormatHelperTest::runIndexedTest(
|
||||
void ScientificFormatHelperTest::TestBasic() {
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
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: ");
|
||||
FieldPositionIterator fpositer;
|
||||
decfmt->format(1.23456e-78, appendTo, &fpositer, status);
|
||||
@ -80,6 +84,10 @@ void ScientificFormatHelperTest::TestBasic() {
|
||||
void ScientificFormatHelperTest::TestFarsi() {
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
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: ");
|
||||
FieldPositionIterator fpositer;
|
||||
decfmt->format(1.23456e-78, appendTo, &fpositer, status);
|
||||
@ -96,6 +104,10 @@ void ScientificFormatHelperTest::TestFarsi() {
|
||||
void ScientificFormatHelperTest::TestPlusSignInExponentMarkup() {
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
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);
|
||||
assertSuccess("", status);
|
||||
UnicodeString appendTo;
|
||||
@ -114,6 +126,10 @@ void ScientificFormatHelperTest::TestPlusSignInExponentMarkup() {
|
||||
void ScientificFormatHelperTest::TestPlusSignInExponentSuperscript() {
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
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);
|
||||
assertSuccess("", status);
|
||||
UnicodeString appendTo;
|
||||
@ -132,7 +148,9 @@ void ScientificFormatHelperTest::TestPlusSignInExponentSuperscript() {
|
||||
void ScientificFormatHelperTest::TestFixedDecimalMarkup() {
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
LocalPointer<DecimalFormat> decfmt((DecimalFormat *) NumberFormat::createInstance("en", status));
|
||||
assertSuccess("", status);
|
||||
if (assertSuccess("NumberFormat::createInstance", status, TRUE) == FALSE) {
|
||||
return;
|
||||
}
|
||||
UnicodeString appendTo;
|
||||
FieldPositionIterator fpositer;
|
||||
decfmt->format(123456.0, appendTo, &fpositer, status);
|
||||
@ -148,7 +166,9 @@ void ScientificFormatHelperTest::TestFixedDecimalMarkup() {
|
||||
void ScientificFormatHelperTest::TestFixedDecimalSuperscript() {
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
LocalPointer<DecimalFormat> decfmt((DecimalFormat *) NumberFormat::createInstance("en", status));
|
||||
assertSuccess("", status);
|
||||
if (assertSuccess("NumberFormat::createInstance", status, TRUE) == FALSE) {
|
||||
return;
|
||||
}
|
||||
UnicodeString appendTo;
|
||||
FieldPositionIterator fpositer;
|
||||
decfmt->format(123456.0, appendTo, &fpositer, status);
|
||||
|
Loading…
Reference in New Issue
Block a user