ICU-2710 Remove some obsolete code

X-SVN-Rev: 11248
This commit is contained in:
George Rhoten 2003-03-05 04:56:28 +00:00
parent 26c61ca37a
commit efda501285
7 changed files with 16 additions and 269 deletions

View File

@ -933,18 +933,6 @@ ucnv_openAllNames(UErrorCode *pErrorCode) {
return myEnum; return myEnum;
} }
#ifdef ICU_UNICODECONVERTER_USE_DEPRECATES
U_CFUNC void
ucnv_io_fillAvailableConverters(const char **aliases, UErrorCode *pErrorCode) {
if (haveAvailableConverterList(pErrorCode)) {
uint16_t count = 0;
while (count < gAvailableConverterCount) {
*aliases++=gAvailableConverters[count++];
}
}
}
#endif
U_CFUNC uint16_t U_CFUNC uint16_t
ucnv_io_countAvailableAliases(UErrorCode *pErrorCode) { ucnv_io_countAvailableAliases(UErrorCode *pErrorCode) {
if (haveAliasData(pErrorCode)) { if (haveAliasData(pErrorCode)) {

View File

@ -106,17 +106,6 @@ ucnv_io_countAvailableConverters(UErrorCode *pErrorCode);
U_CFUNC const char * U_CFUNC const char *
ucnv_io_getAvailableConverter(uint16_t n, UErrorCode *pErrorCode); ucnv_io_getAvailableConverter(uint16_t n, UErrorCode *pErrorCode);
#ifdef ICU_UNICODECONVERTER_USE_DEPRECATES
/**
* Fill an array const char *aliases[ucnv_io_countAvailableConverters()]
* with pointers to all converter names in mixed-case.
* @param aliases The alias array to be filled
* @param pErrorCode The error code
*/
U_CFUNC void
ucnv_io_fillAvailableConverters(const char **aliases, UErrorCode *pErrorCode);
#endif
/** /**
* Return the (n)th converter name in mixed case, or NULL * Return the (n)th converter name in mixed case, or NULL
* if there is none (typically, if the data cannot be loaded). * if there is none (typically, if the data cannot be loaded).

View File

@ -51,10 +51,6 @@ class UCharReference;
class StringCharacterIterator; class StringCharacterIterator;
class BreakIterator; // unicode/brkiter.h class BreakIterator; // unicode/brkiter.h
#ifdef ICU_UNICODECONVERTER_USE_DEPRECATES
class UnicodeConverter; // unicode/convert.h
#endif
/* The <iostream> include has been moved to unicode/ustream.h */ /* The <iostream> include has been moved to unicode/ustream.h */
/** /**
@ -3043,10 +3039,6 @@ private:
kWritableAlias=0 kWritableAlias=0
}; };
#ifdef ICU_UNICODECONVERTER_USE_DEPRECATES
friend class UnicodeConverter;
#endif
friend class StringCharacterIterator; friend class StringCharacterIterator;
friend class StringThreadTest; friend class StringThreadTest;

View File

@ -134,32 +134,6 @@ ures_openDirect(const char* path,
const char* locale, const char* locale,
UErrorCode* status); UErrorCode* status);
#ifdef ICU_URES_USE_DEPRECATES
/**
*Opens a UResourceBundle, from which users can extract strings by using
*their corresponding keys. This version of open requires the path
*string to be of type <TT>const wchar_t*</TT>.
*Note that the caller is responsible of calling <TT>ures_close</TT> on each succesfully
*opened resource bundle.
*@param path: string containing the full path pointing to the directory
* where the resources reside (should end with a directory
* separator.
* e.g. "/usr/resource/my_app/resources/" on a Unix system
* if NULL will use the system's current data directory
*@param locale: specifies the locale for which we want to open the resource
* if NULL will use the default locale
*
*@param status: fills in the outgoing error code.
*@see ures_close
*@return : a newly allocated resource bundle.
* @obsolete ICU 2.4. Use const char * pathnames instead since this API will be removed in that release.
*/
U_CAPI UResourceBundle* U_EXPORT2
ures_openW(const wchar_t* path,
const char* locale,
UErrorCode* status);
#endif /* ICU_URES_USE_DEPRECATES */
/** /**
* Same as ures_open() but takes a const UChar *path. * Same as ures_open() but takes a const UChar *path.
* This path will be converted to char * using the default converter, * This path will be converted to char * using the default converter,

View File

@ -127,18 +127,6 @@ void MajorTestLevel::runIndexedTest( int32_t index, UBool exec, const char* &nam
#endif #endif
break; break;
//% case 9: name = "convert";
//%/* Only the C API exists */
//%#ifdef ICU_UNICODECONVERTER_USE_DEPRECATES
//% if (exec) {
//% logln("TestSuite Convert---"); logln();
//% IntlTestConvert test;
//% callTest( test, par );
//% }
//%#endif /* ICU_UNICODECONVERTER_USE_DEPRECATES */
//% break;
//% case 10: name = "icuserv";
case 9: name = "icuserv"; case 9: name = "icuserv";
#if !UCONFIG_NO_SERVICE #if !UCONFIG_NO_SERVICE
if (exec) { if (exec) {

View File

@ -168,33 +168,31 @@ void LocaleTest::runIndexedTest( int32_t index, UBool exec, const char* &name, c
CASE(7, TestISO3Fallback) CASE(7, TestISO3Fallback)
CASE(8, TestGetLangsAndCountries) CASE(8, TestGetLangsAndCountries)
CASE(9, Test4126880) CASE(9, TestSimpleDisplayNames)
CASE(10, TestBug4135316) CASE(10, TestUninstalledISO3Names)
CASE(11, TestSimpleDisplayNames) CASE(11, TestAtypicalLocales)
CASE(12, TestUninstalledISO3Names)
CASE(13, TestAtypicalLocales)
#if !UCONFIG_NO_FORMATTING #if !UCONFIG_NO_FORMATTING
CASE(14, TestThaiCurrencyFormat) CASE(12, TestThaiCurrencyFormat)
CASE(15, TestEuroSupport) CASE(13, TestEuroSupport)
#endif #endif
CASE(16, TestToString) CASE(14, TestToString)
#if !UCONFIG_NO_FORMATTING #if !UCONFIG_NO_FORMATTING
CASE(17, Test4139940) CASE(15, Test4139940)
CASE(18, Test4143951) CASE(16, Test4143951)
#endif #endif
CASE(19, Test4147315) CASE(17, Test4147315)
CASE(20, Test4147317) CASE(18, Test4147317)
CASE(21, Test4147552) CASE(19, Test4147552)
CASE(22, TestVariantParsing) CASE(20, TestVariantParsing)
#if !UCONFIG_NO_FORMATTING #if !UCONFIG_NO_FORMATTING
CASE(23, Test4105828) CASE(21, Test4105828)
#endif #endif
CASE(24, TestSetIsBogus) CASE(22, TestSetIsBogus)
CASE(25, TestParallelAPIValues) CASE(23, TestParallelAPIValues)
// keep the last index in sync with the condition in default: // keep the last index in sync with the condition in default:
default: default:
if(index <= 25) { // keep this in sync with the last index! if(index <= 23) { // keep this in sync with the last index!
name = "switched off"; // UCONFIG_NO_FORMATTING name = "switched off"; // UCONFIG_NO_FORMATTING
} else { } else {
name = ""; name = "";
@ -240,42 +238,6 @@ void LocaleTest::TestBasicGetters() {
errln(" Variant code mismatch: something versus \"\""); errln(" Variant code mismatch: something versus \"\"");
} }
/*tests for the depracted API*/
#ifdef ICU_LOCID_USE_DEPRECATES
for (i = 0; i <= MAX_LOCALES; i++) {
Locale testLocale((UnicodeString)rawData[LANG][i], (UnicodeString)rawData[CTRY][i], (UnicodeString)rawData[VAR][i]);
logln("Testing " + (UnicodeString)testLocale.getName() + "...");
if ( testLocale.getLanguage(temp) != (UnicodeString)(dataTable[LANG][i]))
errln(" Language code mismatch: " + temp + " versus "
+ dataTable[LANG][i]);
if ( testLocale.getCountry(temp) != (UnicodeString)(dataTable[CTRY][i]))
errln(" Country code mismatch: " + temp + " versus "
+ dataTable[CTRY][i]);
if ( testLocale.getVariant(temp) != (UnicodeString)(dataTable[VAR][i]))
errln(" Variant code mismatch: " + temp + " versus "
+ dataTable[VAR][i]);
if ( testLocale.getName(temp) != (UnicodeString)(dataTable[NAME][i]))
errln(" Locale name mismatch: " + temp + " versus "
+ dataTable[NAME][i]);
}
logln("Same thing without variant codes...");
for (i = 0; i <= MAX_LOCALES; i++) {
Locale testLocale((UnicodeString)rawData[LANG][i], (UnicodeString)rawData[CTRY][i]);
logln("Testing " + (testLocale.getName(temp)) + "...");
if ( testLocale.getLanguage(temp) != (UnicodeString)(dataTable[LANG][i]))
errln(" Language code mismatch: " + temp + " versus "
+ dataTable[LANG][i]);
if ( testLocale.getCountry(temp) != (UnicodeString)(dataTable[CTRY][i]))
errln(" Country code mismatch: " + temp + " versus "
+ dataTable[CTRY][i]);
if (testLocale.getVariant(temp).length() != 0 )
errln(" Variant code mismatch: something versus \"\"");
}
#endif
logln("Testing long language names and getters"); logln("Testing long language names and getters");
Locale test8 = Locale::createFromName("x-klingon-zx.utf32be@special"); Locale test8 = Locale::createFromName("x-klingon-zx.utf32be@special");
@ -400,27 +362,6 @@ void LocaleTest::TestSimpleResourceInfo() {
err = U_ZERO_ERROR; err = U_ZERO_ERROR;
} }
/*tests for the deprecated API*/
#ifdef ICU_LOCID_USE_DEPRECATES
for (i = 0; i <= MAX_LOCALES; i++) {
Locale testLocale((UnicodeString)rawData[LANG][i], (UnicodeString)rawData[CTRY][i], (UnicodeString)rawData[VAR][i]);
logln("Testing " + (testLocale.getName(temp)) + "...");
if ( testLocale.getISO3Language(temp, err) != (UnicodeString)(dataTable[LANG3][i]))
errln(" ISO-3 language code mismatch: " + temp
+ " versus " + dataTable[LANG3][i]);
if ( testLocale.getISO3Country(temp, err) != (UnicodeString)(dataTable[CTRY3][i]))
errln(" ISO-3 country code mismatch: " + temp
+ " versus " + dataTable[CTRY3][i]);
if(U_FAILURE(err))
{
errln((UnicodeString)"Some error on number " + i + u_errorName(err));
}
err = U_ZERO_ERROR;
}
#endif
Locale locale("en"); Locale locale("en");
if(strcmp(locale.getName(), "en") != 0|| if(strcmp(locale.getName(), "en") != 0||
strcmp(locale.getLanguage(), "en") != 0) { strcmp(locale.getLanguage(), "en") != 0) {
@ -924,129 +865,6 @@ LocaleTest::TestGetLangsAndCountries()
} }
} }
/**
* @bug 4126880
*/
// since this returns const UnicodeString* in C++, is this test applicable?
void
LocaleTest::Test4126880()
{
#ifdef ICU_LOCID_USE_DEPRECATES
const UnicodeString *test;
int32_t testCount=0;
/*test = Locale::getISOCountries(testCount);
test[0] = "SUCKER!!!";
test = Locale::getISOCountries(testCount);
if (test[0] == "SUCKER!!!")
errln("Changed internal country code list!");
test = Locale::getISOLanguages(testCount);
test[0] = "HAHAHAHA!!!";
test = Locale::getISOLanguages(testCount);
if (test[0] == "HAHAHAHA!!!") // Fixed typo
errln("Changes internal language code list!");
*/
/*tests for deprecated API*/
test=Locale::getISOCountries(testCount);
if(testCount != 239){
errln((UnicodeString)"There is an error in getISOCountries " + testCount);
}
test=Locale::getISOLanguages(testCount);
if(testCount != 437){
errln((UnicodeString)"There is an error in getISOLanguages " + testCount);
}
/*----------*/
#else
logln("Skipping Test4126880 for deprecated API");
#endif
}
/**
* @bug 4135316
*/
// not applicable in C++ - const Locale*
void
LocaleTest::TestBug4135316()
{
/*
Locale[] locales1 = Locale.getAvailableLocales();
Locale[] locales2 = Locale.getAvailableLocales();
if (locales1 == locales2)
errln("Locale.getAvailableLocales() doesn't clone its internal storage!");
*/
}
/**
* @bug 4107953
*/
/*
test commented out pending API-change approval
public void TestGetLanguagesForCountry() {
UnicodeString[] languages = Locale.getLanguagesForCountry("US");
if (!searchStringArrayFor("en", languages))
errln("Didn't get en as a language for US");
languages = Locale.getLanguagesForCountry("FR");
if (!searchStringArrayFor("fr", languages))
errln("Didn't get fr as a language for FR");
languages = Locale.getLanguagesForCountry("CH");
if (!searchStringArrayFor("fr", languages))
errln("Didn't get fr as a language for CH");
if (!searchStringArrayFor("it", languages))
errln("Didn't get it as a language for CH");
if (!searchStringArrayFor("de", languages))
errln("Didn't get de as a language for CH");
languages = Locale.getLanguagesForCountry("JP");
if (!searchStringArrayFor("ja", languages))
errln("Didn't get ja as a language for JP");
}
*/
/*
private UBool searchStringArrayFor(UnicodeString s, UnicodeString[] array) {
for (int32_t i = 0; i < array.length; i++)
if (s.equals(array[i]))
return TRUE;
return FALSE;
}
*/
/**
* @bug 4110613
*/
// not applicable in C++
/*
void
LocaleTest::TestSerialization() throws ClassNotFoundException, OptionalDataException,
IOException, StreamCorruptedException
{
ObjectOutputStream ostream;
ByteArrayOutputStream obstream;
byte[] bytes = null;
obstream = new ByteArrayOutputStream();
ostream = new ObjectOutputStream(obstream);
Locale test1 = new Locale("zh", "TW", "");
int32_t dummy = test1.hashCode(); // fill in the cached hash-code value
ostream.writeObject(test1);
bytes = obstream.toByteArray();
ObjectInputStream istream = new ObjectInputStream(new ByteArrayInputStream(bytes));
Locale test2 = (Locale)(istream.readObject());
if (!test1.equals(test2) || test1.hashCode() != test2.hashCode())
errln("Locale failed to deserialize correctly.");
}
*/
/** /**
* @bug 4118587 * @bug 4118587
*/ */

View File

@ -52,8 +52,6 @@ public:
void TestISO3Fallback(void); void TestISO3Fallback(void);
void TestGetLangsAndCountries(void); void TestGetLangsAndCountries(void);
void Test4126880(void);
void TestBug4135316(void);
void TestSimpleDisplayNames(void); void TestSimpleDisplayNames(void);
void TestUninstalledISO3Names(void); void TestUninstalledISO3Names(void);
void TestAtypicalLocales(void); void TestAtypicalLocales(void);