mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-06 05:55:35 +00:00
ICU-3837 Add UCONFIG_NO_SERVICE
X-SVN-Rev: 16036
This commit is contained in:
parent
011fe48d05
commit
017c34c872
8 changed files with 24 additions and 2 deletions
|
@ -31,6 +31,7 @@
|
|||
|
||||
U_NAMESPACE_BEGIN
|
||||
|
||||
#if !UCONFIG_NO_SERVICE
|
||||
class NumberFormatFactory;
|
||||
class StringEnumeration;
|
||||
|
||||
|
@ -38,6 +39,7 @@ class StringEnumeration;
|
|||
* @internal
|
||||
*/
|
||||
typedef const void* URegistryKey;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Abstract base class for all number formats. Provides interface for
|
||||
|
|
|
@ -4337,12 +4337,14 @@ static void TestSeparateTrees(void) {
|
|||
|
||||
static const char* KWVAL[] = { "phonebook", "stroke" };
|
||||
|
||||
#if !UCONFIG_NO_SERVICE
|
||||
e = ucol_openAvailableLocales(&ec);
|
||||
assertSuccess("ucol_openAvailableLocales", &ec);
|
||||
assertTrue("ucol_openAvailableLocales!=0", e!=0);
|
||||
n = checkUEnumeration("ucol_openAvailableLocales", e, AVAIL, LEN(AVAIL));
|
||||
/* Don't need to check n because we check list */
|
||||
uenum_close(e);
|
||||
#endif
|
||||
|
||||
e = ucol_getKeywords(&ec);
|
||||
assertSuccess("ucol_getKeywords", &ec);
|
||||
|
|
|
@ -382,6 +382,7 @@ void IntlCalendarTest::TestBuddhistFormat() {
|
|||
|
||||
simpleTest(loc, expect, expectDate, status);
|
||||
}
|
||||
status = U_ZERO_ERROR;
|
||||
{
|
||||
UnicodeString expect = CharsToUnicodeString("\\u0E27\\u0E31\\u0E19\\u0E40\\u0E2A\\u0E32\\u0E23\\u0E4C\\u0E17\\u0E35\\u0E48"
|
||||
" 8 \\u0E01\\u0E31\\u0e19\\u0e22\\u0e32\\u0e22\\u0e19 \\u0e1e.\\u0e28. 2544");
|
||||
|
@ -390,6 +391,7 @@ void IntlCalendarTest::TestBuddhistFormat() {
|
|||
|
||||
simpleTest(loc, expect, expectDate, status);
|
||||
}
|
||||
status = U_ZERO_ERROR;
|
||||
{
|
||||
UnicodeString expect = CharsToUnicodeString("\\u0E27\\u0E31\\u0E19\\u0E40\\u0E2A\\u0E32\\u0E23\\u0E4C\\u0E17\\u0E35\\u0E48"
|
||||
" 8 \\u0E01\\u0E31\\u0e19\\u0e22\\u0e32\\u0e22\\u0e19 \\u0e04.\\u0e28. 2001");
|
||||
|
@ -398,6 +400,7 @@ void IntlCalendarTest::TestBuddhistFormat() {
|
|||
|
||||
simpleTest(loc, expect, expectDate, status);
|
||||
}
|
||||
status = U_ZERO_ERROR;
|
||||
{
|
||||
UnicodeString expect = CharsToUnicodeString("\\u0E27\\u0E31\\u0E19\\u0E40\\u0E2A\\u0E32\\u0E23\\u0E4C\\u0E17\\u0E35\\u0E48"
|
||||
" 8 \\u0E01\\u0E31\\u0e19\\u0e22\\u0e32\\u0e22\\u0e19 \\u0e04.\\u0e28. 2001");
|
||||
|
|
|
@ -1750,6 +1750,7 @@ void LocaleTest::_checklocs(const char* label,
|
|||
}
|
||||
|
||||
void LocaleTest::TestGetLocale(void) {
|
||||
#if !UCONFIG_NO_SERVICE
|
||||
UErrorCode ec = U_ZERO_ERROR;
|
||||
const char *req;
|
||||
Locale valid, actual, reqLoc;
|
||||
|
@ -1953,6 +1954,7 @@ void LocaleTest::TestGetLocale(void) {
|
|||
}
|
||||
delete coll;
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
void LocaleTest::TestVariantWithOutCountry(void) {
|
||||
|
|
|
@ -284,7 +284,7 @@ char NFTestFactory::gID = 0;
|
|||
void
|
||||
IntlTestNumberFormatAPI::testRegistration()
|
||||
{
|
||||
|
||||
#if !UCONFIG_NO_SERVICE
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
|
||||
NumberFormat* f0 = NumberFormat::createInstance(SWAP_LOC, status);
|
||||
|
@ -384,6 +384,7 @@ IntlTestNumberFormatAPI::testRegistration()
|
|||
}
|
||||
|
||||
delete locs;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1348,6 +1348,7 @@ void NumberFormatTest::TestCurrencyPatterns(void) {
|
|||
}
|
||||
|
||||
void NumberFormatTest::TestRegCurrency(void) {
|
||||
#if !UCONFIG_NO_SERVICE
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
UChar USD[4];
|
||||
ucurr_forLocale("en_US", USD, 4, &status);
|
||||
|
@ -1409,6 +1410,7 @@ void NumberFormatTest::TestRegCurrency(void) {
|
|||
errln("FAIL: didn't return EUR for en_US_EURO after unregister of en_US_EURO");
|
||||
}
|
||||
status = U_ZERO_ERROR; // reset
|
||||
#endif
|
||||
}
|
||||
|
||||
void NumberFormatTest::TestCurrencyNames(void) {
|
||||
|
|
|
@ -799,6 +799,7 @@ void RBBIAPITest::TestBug2190() {
|
|||
|
||||
|
||||
void RBBIAPITest::TestRegistration() {
|
||||
#if !UCONFIG_NO_SERVICE
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
BreakIterator* thai_word = BreakIterator::createWordInstance("th_TH", status);
|
||||
|
||||
|
@ -923,6 +924,7 @@ void RBBIAPITest::TestRegistration() {
|
|||
delete thai_char;
|
||||
delete root_word;
|
||||
delete root_char;
|
||||
#endif
|
||||
}
|
||||
|
||||
void RBBIAPITest::RoundtripRule(const char *dataFile) {
|
||||
|
|
|
@ -31,7 +31,8 @@ void CollationServiceTest::runIndexedTest(int32_t index, UBool exec, const char*
|
|||
|
||||
void CollationServiceTest::TestRegister()
|
||||
{
|
||||
// register a singleton
|
||||
#if !UCONFIG_NO_SERVICE
|
||||
// register a singleton
|
||||
const Locale& FR = Locale::getFrance();
|
||||
const Locale& FRENCH = Locale::getFrench();
|
||||
const Locale& US = Locale::getUS();
|
||||
|
@ -200,10 +201,12 @@ void CollationServiceTest::TestRegister()
|
|||
delete ncol; ncol = NULL;
|
||||
delete fucol; fucol = NULL;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
// ------------------
|
||||
|
||||
#if !UCONFIG_NO_SERVICE
|
||||
struct CollatorInfo {
|
||||
Locale locale;
|
||||
Collator* collator;
|
||||
|
@ -329,9 +332,11 @@ private:
|
|||
};
|
||||
|
||||
char TestFactory::gClassID = 0;
|
||||
#endif
|
||||
|
||||
void CollationServiceTest::TestRegisterFactory(void)
|
||||
{
|
||||
#if !UCONFIG_NO_SERVICE
|
||||
int32_t n1, n2, n3;
|
||||
Locale fu_FU("fu", "FU", "");
|
||||
Locale fu_FU_FOO("fu", "FU", "FOO");
|
||||
|
@ -456,6 +461,7 @@ void CollationServiceTest::TestRegisterFactory(void)
|
|||
|
||||
delete fucol;
|
||||
delete uscol;
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -512,6 +518,7 @@ int32_t CollationServiceTest::checkStringEnumeration(const char* msg,
|
|||
* Check the integrity of the results of Collator::getAvailableLocales().
|
||||
* Return the number of items returned.
|
||||
*/
|
||||
#if !UCONFIG_NO_SERVICE
|
||||
int32_t CollationServiceTest::checkAvailable(const char* msg) {
|
||||
StringEnumeration *iter = Collator::getAvailableLocales();
|
||||
if (!assertTrue("getAvailableLocales != NULL", iter!=NULL)) return -1;
|
||||
|
@ -519,6 +526,7 @@ int32_t CollationServiceTest::checkAvailable(const char* msg) {
|
|||
delete iter;
|
||||
return n;
|
||||
}
|
||||
#endif
|
||||
|
||||
static const char* KW[] = {
|
||||
"collation"
|
||||
|
|
Loading…
Add table
Reference in a new issue