From 3daf54af404757f7a36d9774026cab01a6e003f3 Mon Sep 17 00:00:00 2001 From: Michael Ow Date: Sat, 15 Mar 2014 06:08:42 +0000 Subject: [PATCH] ICU-10740 Fix uconfig test errors X-SVN-Rev: 35480 --- icu4c/source/i18n/quantityformatter.cpp | 4 ++++ icu4c/source/i18n/rbnf.cpp | 4 ++++ icu4c/source/i18n/reldtfmt.cpp | 4 ++++ icu4c/source/i18n/smpdtfmt.cpp | 8 ++++++-- icu4c/source/i18n/unicode/measfmt.h | 5 ++++- icu4c/source/test/cintltst/cnumtst.c | 3 ++- icu4c/source/test/hdrtst/cxxfiles.txt | 3 ++- icu4c/source/test/intltest/regextst.cpp | 4 +++- icu4c/source/test/letest/cletest.c | 4 +++- icu4c/source/test/letest/letest.cpp | 4 +++- 10 files changed, 35 insertions(+), 8 deletions(-) diff --git a/icu4c/source/i18n/quantityformatter.cpp b/icu4c/source/i18n/quantityformatter.cpp index 5b01f650ed3..4138aee030b 100644 --- a/icu4c/source/i18n/quantityformatter.cpp +++ b/icu4c/source/i18n/quantityformatter.cpp @@ -19,6 +19,8 @@ #define LENGTHOF(array) (int32_t)(sizeof(array) / sizeof((array)[0])) +#if !UCONFIG_NO_FORMATTING + U_NAMESPACE_BEGIN // other must always be first. @@ -175,3 +177,5 @@ UnicodeString &QuantityFormatter::format( } U_NAMESPACE_END + +#endif /* #if !UCONFIG_NO_FORMATTING */ diff --git a/icu4c/source/i18n/rbnf.cpp b/icu4c/source/i18n/rbnf.cpp index 37c28866702..894e6b6d2a3 100644 --- a/icu4c/source/i18n/rbnf.cpp +++ b/icu4c/source/i18n/rbnf.cpp @@ -863,7 +863,9 @@ RuleBasedNumberFormat::operator=(const RuleBasedNumberFormat& rhs) capitalizationInfoSet = rhs.capitalizationInfoSet; capitalizationForUIListMenu = rhs.capitalizationForUIListMenu; capitalizationForStandAlone = rhs.capitalizationForStandAlone; +#if !UCONFIG_NO_BREAK_ITERATION capitalizationBrkIter = (rhs.capitalizationBrkIter!=NULL)? rhs.capitalizationBrkIter->clone(): NULL; +#endif return *this; } @@ -1616,8 +1618,10 @@ RuleBasedNumberFormat::dispose() delete lenientParseRules; lenientParseRules = NULL; +#if !UCONFIG_NO_BREAK_ITERATION delete capitalizationBrkIter; capitalizationBrkIter = NULL; +#endif if (localizations) localizations = localizations->unref(); } diff --git a/icu4c/source/i18n/reldtfmt.cpp b/icu4c/source/i18n/reldtfmt.cpp index 5cbb295553b..81fb77749a5 100644 --- a/icu4c/source/i18n/reldtfmt.cpp +++ b/icu4c/source/i18n/reldtfmt.cpp @@ -62,9 +62,11 @@ RelativeDateFormat::RelativeDateFormat(const RelativeDateFormat& other) : fDates = (URelativeString*) uprv_malloc(sizeof(fDates[0])*fDatesLen); uprv_memcpy(fDates, other.fDates, sizeof(fDates[0])*fDatesLen); } +#if !UCONFIG_NO_BREAK_ITERATION if (other.fCapitalizationBrkIter != NULL) { fCapitalizationBrkIter = (other.fCapitalizationBrkIter)->clone(); } +#endif } RelativeDateFormat::RelativeDateFormat( UDateFormatStyle timeStyle, UDateFormatStyle dateStyle, @@ -124,7 +126,9 @@ RelativeDateFormat::~RelativeDateFormat() { delete fDateTimeFormatter; delete fCombinedFormat; uprv_free(fDates); +#if !UCONFIG_NO_BREAK_ITERATION delete fCapitalizationBrkIter; +#endif } diff --git a/icu4c/source/i18n/smpdtfmt.cpp b/icu4c/source/i18n/smpdtfmt.cpp index c29b55c2959..4752de5e8a9 100644 --- a/icu4c/source/i18n/smpdtfmt.cpp +++ b/icu4c/source/i18n/smpdtfmt.cpp @@ -239,8 +239,10 @@ SimpleDateFormat::~SimpleDateFormat() delete cur->nf; uprv_free(cur); } - + +#if !UCONFIG_NO_BREAK_ITERATION delete fCapitalizationBrkIter; +#endif } //---------------------------------------------------------------------- @@ -501,10 +503,12 @@ SimpleDateFormat& SimpleDateFormat::operator=(const SimpleDateFormat& other) fTimeZoneFormat = NULL; // forces lazy instantiation with the other locale fLocale = other.fLocale; } - + +#if !UCONFIG_NO_BREAK_ITERATION if (other.fCapitalizationBrkIter != NULL) { fCapitalizationBrkIter = (other.fCapitalizationBrkIter)->clone(); } +#endif return *this; } diff --git a/icu4c/source/i18n/unicode/measfmt.h b/icu4c/source/i18n/unicode/measfmt.h index 1f39a6ab66f..2a93b6e7f92 100644 --- a/icu4c/source/i18n/unicode/measfmt.h +++ b/icu4c/source/i18n/unicode/measfmt.h @@ -245,6 +245,7 @@ class U_I18N_API MeasureFormat : public Format { #ifndef U_HIDE_INTERNAL_API +#ifndef U_HIDE_DRAFT_API /** * ICU use only. * Initialize or change MeasureFormat class from subclass. @@ -255,7 +256,7 @@ class U_I18N_API MeasureFormat : public Format { UMeasureFormatWidth width, NumberFormat *nfToAdopt, UErrorCode &status); - +#endif /** * ICU use only. * Allows subclass to change locale. Note that this method also changes @@ -302,7 +303,9 @@ class U_I18N_API MeasureFormat : public Format { const MeasureFormatCacheData *cache; const SharedNumberFormat *numberFormat; const SharedPluralRules *pluralRules; +#ifndef U_HIDE_DRAFT_API UMeasureFormatWidth width; +#endif // Declared outside of MeasureFormatSharedData because ListFormatter // objects are relatively cheap to copy; therefore, they don't need to be diff --git a/icu4c/source/test/cintltst/cnumtst.c b/icu4c/source/test/cintltst/cnumtst.c index 84590441fe8..a6420ffa31b 100644 --- a/icu4c/source/test/cintltst/cnumtst.c +++ b/icu4c/source/test/cintltst/cnumtst.c @@ -2496,7 +2496,7 @@ static void TestContext(void) { } else { log_data_err("unum_open UNUM_SPELLOUT for en fails with status %s\n", myErrorName(status)); } - +#if !UCONFIG_NO_NORMALIZATION && !UCONFIG_NO_BREAK_ITERATION for (itemPtr = tcItems; itemPtr->locale != NULL; itemPtr++) { UChar ubufResult[kUBufMax]; int32_t ulenRes; @@ -2526,6 +2526,7 @@ static void TestContext(void) { } unum_close(unum); } +#endif /* #if !UCONFIG_NO_NORMALIZATION && !UCONFIG_NO_BREAK_ITERATION */ } #endif /* #if !UCONFIG_NO_FORMATTING */ diff --git a/icu4c/source/test/hdrtst/cxxfiles.txt b/icu4c/source/test/hdrtst/cxxfiles.txt index 60c09cceabc..796b1e72dac 100644 --- a/icu4c/source/test/hdrtst/cxxfiles.txt +++ b/icu4c/source/test/hdrtst/cxxfiles.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2001-2013 International Business Machines +# Copyright (c) 2001-2014 International Business Machines # Corporation and others. All Rights Reserved. # Begin temporary addition. # These are very bad "C" APIs that do not work with a C compiler and @@ -44,6 +44,7 @@ dtrule.h enumset.h errorcode.h fieldpos.h +filteredbrk.h fmtable.h format.h fpositer.h diff --git a/icu4c/source/test/intltest/regextst.cpp b/icu4c/source/test/intltest/regextst.cpp index fe0d8f609a5..9c09d4f6c55 100644 --- a/icu4c/source/test/intltest/regextst.cpp +++ b/icu4c/source/test/intltest/regextst.cpp @@ -1,6 +1,6 @@ /******************************************************************** * COPYRIGHT: - * Copyright (c) 2002-2013, International Business Machines Corporation and + * Copyright (c) 2002-2014, International Business Machines Corporation and * others. All Rights Reserved. ********************************************************************/ @@ -5209,6 +5209,7 @@ void RegexTest::Bug7029() { // for details on what to do in case of a failure of this test. // void RegexTest::Bug9283() { +#if !UCONFIG_NO_NORMALIZATION UErrorCode status = U_ZERO_ERROR; UnicodeSet supplementalsWithCaseFolding("[[:CWCF:]&[\\U00010000-\\U0010FFFF]]", status); REGEX_CHECK_STATUS; @@ -5222,6 +5223,7 @@ void RegexTest::Bug9283() { UnicodeString cf = UnicodeString(c).foldCase(); REGEX_ASSERT(cf.length() >= 2); } +#endif /* #if !UCONFIG_NO_NORMALIZATION */ } diff --git a/icu4c/source/test/letest/cletest.c b/icu4c/source/test/letest/cletest.c index ed426d821e7..ca4e96d570e 100644 --- a/icu4c/source/test/letest/cletest.c +++ b/icu4c/source/test/letest/cletest.c @@ -1,7 +1,7 @@ /* ******************************************************************************* * - * Copyright (C) 1999-2008, International Business Machines + * Copyright (C) 1999-2014, International Business Machines * Corporation and others. All Rights Reserved. * ******************************************************************************* @@ -511,6 +511,7 @@ static void U_CALLCONV DataDrivenTest(void) */ static void U_CALLCONV GlyphToCharTest(void) { +#if !UCONFIG_NO_BREAK_ITERATION LEErrorCode status = LE_NO_ERROR; le_font *font; pl_fontRuns *fontRuns; @@ -728,6 +729,7 @@ close_font: finish: return; +#endif } U_CFUNC void addCTests(TestNode **root) diff --git a/icu4c/source/test/letest/letest.cpp b/icu4c/source/test/letest/letest.cpp index 97393c155eb..6ab32dd12b8 100644 --- a/icu4c/source/test/letest/letest.cpp +++ b/icu4c/source/test/letest/letest.cpp @@ -1,7 +1,7 @@ /* ******************************************************************************* * - * Copyright (C) 1999-2013, International Business Machines + * Copyright (C) 1999-2014, International Business Machines * Corporation and others. All Rights Reserved. * ******************************************************************************* @@ -748,6 +748,7 @@ U_CDECL_BEGIN */ static void U_CALLCONV GlyphToCharTest(void) { +#if !UCONFIG_NO_BREAK_ITERATION LEErrorCode status = LE_NO_ERROR; LEFontInstance *font; FontRuns fontRuns(0); @@ -958,6 +959,7 @@ close_font: finish: return; +#endif } U_CDECL_END