ICU-3831 uconfig fixes

X-SVN-Rev: 15842
This commit is contained in:
Steven R. Loomis 2004-06-10 23:51:33 +00:00
parent 617cee06dd
commit 2f7efe7cc9
9 changed files with 40 additions and 11 deletions

View file

@ -372,6 +372,7 @@ u_getIntPropertyValue(UChar32 c, UProperty which) {
return c%JAMO_T_COUNT==0 ? U_HST_LV_SYLLABLE : U_HST_LVT_SYLLABLE;
}
return U_HST_NOT_APPLICABLE;
#if !UCONFIG_NO_NORMALIZATION
case UCHAR_NFD_QUICK_CHECK:
case UCHAR_NFKD_QUICK_CHECK:
case UCHAR_NFC_QUICK_CHECK:
@ -381,6 +382,7 @@ u_getIntPropertyValue(UChar32 c, UProperty which) {
return unorm_getFCD16FromCodePoint(c)>>8;
case UCHAR_TRAIL_CANONICAL_COMBINING_CLASS:
return unorm_getFCD16FromCodePoint(c)&0xff;
#endif
default:
return 0; /* undefined */
}
@ -441,12 +443,14 @@ u_getIntPropertyMaxValue(UProperty which) {
return max!=0 ? max : (int32_t)USCRIPT_CODE_LIMIT-1;
case UCHAR_HANGUL_SYLLABLE_TYPE:
return (int32_t)U_HST_COUNT-1;
#if !UCONFIG_NO_NORMALIZATION
case UCHAR_NFD_QUICK_CHECK:
case UCHAR_NFKD_QUICK_CHECK:
return (int32_t)UNORM_YES; /* these are never "maybe", only "no" or "yes" */
case UCHAR_NFC_QUICK_CHECK:
case UCHAR_NFKC_QUICK_CHECK:
return (int32_t)UNORM_MAYBE;
#endif
default:
return -1; /* undefined */
}

View file

@ -103,7 +103,9 @@ u_vsscanf_u(const UChar *buffer,
inStr.fConverter = NULL;
inStr.fFile = NULL;
inStr.fOwnFile = FALSE;
#if !UCONFIG_NO_TRANSLITERATION
inStr.fTranslit = NULL;
#endif
inStr.fUCBuffer[0] = 0;
inStr.str.fBuffer = (UChar *)buffer;
inStr.str.fPos = (UChar *)buffer;

View file

@ -354,6 +354,8 @@ u_fsetcodepage(const char *codepage,
*/
U_CAPI UConverter* U_EXPORT2 u_fgetConverter(UFILE *f);
#if !UCONFIG_NO_FORMATTING
/* Output functions */
/**
@ -415,7 +417,7 @@ U_CAPI int32_t U_EXPORT2
u_vfprintf_u(UFILE *f,
const UChar *patternSpecification,
va_list ap);
#endif
/**
* Write a Unicode to a UFILE. The null (U+0000) terminated UChar*
* <TT>s</TT> will be written to <TT>f</TT>, excluding the NULL terminator.
@ -459,6 +461,7 @@ u_file_write(const UChar *ustring,
/* Input functions */
#if !UCONFIG_NO_FORMATTING
/**
* Read formatted data from a UFILE.
@ -523,6 +526,7 @@ U_CAPI int32_t U_EXPORT2
u_vfscanf_u(UFILE *f,
const UChar *patternSpecification,
va_list ap);
#endif
/**
* Read one line of text into a UChar* string from a UFILE. The newline
@ -623,6 +627,7 @@ u_fsettransliterator(UFILE *file, UFileDirection direction,
/* Output string functions */
#if !UCONFIG_NO_FORMATTING
/**
@ -853,7 +858,7 @@ u_vsscanf_u(const UChar *buffer,
const UChar *patternSpecification,
va_list ap);
#endif
#endif

View file

@ -938,6 +938,7 @@ static void TestGetKeywordValues(void) {
UBool foundStandard = FALSE;
UErrorCode status = U_ZERO_ERROR;
const char *kw;
#if !UCONFIG_NO_COLLATION
kwVals = ures_getKeywordValues( U_ICUDATA_COLL, "collations", &status);
log_verbose("Testing getting collation keyword values:\n");
@ -960,23 +961,24 @@ static void TestGetKeywordValues(void) {
log_err("err %s getting collation values\n", u_errorName(status));
}
status = U_ZERO_ERROR;
#endif
foundStandard = FALSE;
kwVals = ures_getKeywordValues( "ICUDATA", "calendar", &status);
log_verbose("Testing getting calendar keyword values:\n");
while((kw=uenum_next(kwVals, NULL, &status))) {
log_verbose(" %s\n", kw);
if(!strcmp(kw,"standard")) {
if(!strcmp(kw,"japanese")) {
if(foundStandard == FALSE) {
foundStandard = TRUE;
} else {
log_err("'standard' was found twice in the calendar keyword list.\n");
log_err("'japanese' was found twice in the calendar keyword list.\n");
}
}
}
if(foundStandard == FALSE) {
log_err("'standard' was not found in the calendar keyword list.\n");
log_err("'japanese' was not found in the calendar keyword list.\n");
}
uenum_close(kwVals);
if(U_FAILURE(status)) {
@ -1048,9 +1050,12 @@ static void TestGetFunctionalEquivalent(void) {
NULL
};
#if !UCONFIG_NO_COLLATION
TestGetFunctionalEquivalentOf(U_ICUDATA_COLL, "collations", "collation", TRUE, collCases);
#endif
TestGetFunctionalEquivalentOf("ICUDATA", "calendar", "calendar", FALSE, calCases);
#if !UCONFIG_NO_COLLATION
log_verbose("Testing error conditions:\n");
{
char equivLocale[256] = "???";
@ -1069,5 +1074,6 @@ static void TestGetFunctionalEquivalent(void) {
equivLocale, gotAvail?'t':'f', u_errorName(status));
}
}
#endif
}

View file

@ -2025,11 +2025,8 @@ static void TestResourceLevelAliasing(void) {
const UChar *string = NULL, *sequence = NULL;
const uint8_t *binary = NULL, *binSequence = NULL;
int32_t strLen = 0, seqLen = 0, binLen = 0, binSeqLen = 0;
#if !UCONFIG_NO_COLLATION
char buffer[100];
char *s;
#endif
testdatapath=loadTestData(&status);
if(U_FAILURE(status))

View file

@ -1439,6 +1439,7 @@ UBool IntlTest::assertEquals(const char* message,
return TRUE;
}
#if !UCONFIG_NO_FORMATTING
UBool IntlTest::assertEquals(const char* message,
const Formattable& expected,
const Formattable& actual) {
@ -1455,6 +1456,7 @@ UBool IntlTest::assertEquals(const char* message,
#endif
return TRUE;
}
#endif
static char ASSERT_BUF[256];
@ -1490,11 +1492,13 @@ UBool IntlTest::assertEquals(const UnicodeString& message,
return assertEquals(extractToAssertBuf(message), expected, actual);
}
#if !UCONFIG_NO_FORMATTING
UBool IntlTest::assertEquals(const UnicodeString& message,
const Formattable& expected,
const Formattable& actual) {
return assertEquals(extractToAssertBuf(message), expected, actual);
}
#endif
/*
* Hey, Emacs, please set the following:

View file

@ -140,8 +140,12 @@ protected:
const UnicodeString& actual);
UBool assertEquals(const char* message, const char* expected,
const char* actual);
#if !UCONFIG_NO_FORMATTING
UBool assertEquals(const char* message, const Formattable& expected,
const Formattable& actual);
UBool assertEquals(const UnicodeString& message, const Formattable& expected,
const Formattable& actual);
#endif
UBool assertTrue(const UnicodeString& message, UBool condition, UBool quiet=FALSE);
UBool assertFalse(const UnicodeString& message, UBool condition, UBool quiet=FALSE);
UBool assertSuccess(const UnicodeString& message, UErrorCode ec);
@ -149,8 +153,6 @@ protected:
const UnicodeString& actual);
UBool assertEquals(const UnicodeString& message, const char* expected,
const char* actual);
UBool assertEquals(const UnicodeString& message, const Formattable& expected,
const Formattable& actual);
virtual void runIndexedTest( int32_t index, UBool exec, const char* &name, char* par = NULL ); // overide !

View file

@ -3132,6 +3132,8 @@ static void testBreakBoundPreceding(RBBITest *test, UnicodeString ustr,
void RBBITest::TestWordBreaks(void)
{
#if !UCONFIG_NO_REGULAR_EXPRESSIONS
// <data><>\u1d4a\u206e<?>\u0603\U0001d7ff<>\u2019<></data>
Locale locale("en");
UErrorCode status = U_ZERO_ERROR;
@ -3200,6 +3202,7 @@ void RBBITest::TestWordBreaks(void)
testBreakBoundPreceding(this, ustr, bi, expected, expectedcount);
}
delete bi;
#endif
}
void RBBITest::TestWordBoundary(void)
@ -3280,6 +3283,7 @@ void RBBITest::TestWordBoundary(void)
void RBBITest::TestLineBreaks(void)
{
#if !UCONFIG_NO_REGULAR_EXPRESSIONS
Locale locale("en");
UErrorCode status = U_ZERO_ERROR;
BreakIterator *bi = BreakIterator::createLineInstance(locale, status);
@ -3343,6 +3347,7 @@ void RBBITest::TestLineBreaks(void)
testBreakBoundPreceding(this, ustr, bi, expected, expectedcount);
}
delete bi;
#endif
}
void RBBITest::TestSentBreaks(void)

View file

@ -491,7 +491,11 @@ int32_t CollationServiceTest::checkStringEnumeration(const char* msg,
}
}
// can't get pesky operator+(const US&, foo) to cooperate; use toString
#if !UCONFIG_NO_FORMATTING
logln(UnicodeString() + msg + " = [" + buf + "] (" + toString(i) + ")");
#else
logln(UnicodeString() + msg + " = [" + buf + "] (??? NO_FORMATTING)");
#endif
assertTrue("count verified", i==n);
// did we see all expected strings?
if (((1<<expectedCount)-1) != seenMask) {