ICU-2710 remove @obsolete ICU 2.6 and earlier code

X-SVN-Rev: 11748
This commit is contained in:
Markus Scherer 2003-05-01 01:31:28 +00:00
parent 46973d4837
commit 41c2ebf526
16 changed files with 85 additions and 195 deletions

View file

@ -448,6 +448,7 @@ ChoiceFormat::toPattern(UnicodeString& result) const
return result;
}
#ifdef U_USE_CHOICE_FORMAT_DEPRECATES
// -------------------------------------
// Adopts the limit and format arrays.
@ -487,6 +488,7 @@ ChoiceFormat::adoptChoices(double *limits,
}
}
}
#endif
// -------------------------------------
// Sets the limit and format arrays.

View file

@ -34,7 +34,7 @@ class TransliteratorRegistry;
* Transliterator} for details.
*
* @author Alan Liu
* @obsolete ICU 2.4. Use transliterator factory methods instead since this class will be removed in that release.
* @internal Use transliterator factory methods instead since this class will be removed in that release.
*/
class U_I18N_API CompoundTransliterator : public Transliterator {
@ -65,7 +65,7 @@ public:
* <tt>filter.contains()</tt> returns <tt>false</tt> will not be
* altered by this transliterator. If <tt>filter</tt> is
* <tt>null</tt> then no filtering is applied.
* @obsolete ICU 2.4. Use transliterator factory methods instead since this class will be removed in that release.
* @internal Use transliterator factory methods instead since this class will be removed in that release.
*/
CompoundTransliterator(Transliterator* const transliterators[],
int32_t transliteratorCount,
@ -77,7 +77,7 @@ public:
* @param dir either UTRANS_FORWARD or UTRANS_REVERSE
* @param adoptedFilter a global filter for this compound transliterator
* or NULL
* @obsolete ICU 2.4. Use transliterator factory methods instead since this class will be removed in that release.
* @internal Use transliterator factory methods instead since this class will be removed in that release.
*/
CompoundTransliterator(const UnicodeString& id,
UTransDirection dir,
@ -88,39 +88,39 @@ public:
/**
* Constructs a new compound transliterator in the FORWARD
* direction with a NULL filter.
* @obsolete ICU 2.4. Use transliterator factory methods instead since this class will be removed in that release.
* @internal Use transliterator factory methods instead since this class will be removed in that release.
*/
CompoundTransliterator(const UnicodeString& id,
UParseError& parseError,
UErrorCode& status);
/**
* Destructor.
* @obsolete ICU 2.4. Use transliterator factory methods instead since this class will be removed in that release.
* @internal Use transliterator factory methods instead since this class will be removed in that release.
*/
virtual ~CompoundTransliterator();
/**
* Copy constructor.
* @obsolete ICU 2.4. Use transliterator factory methods instead since this class will be removed in that release.
* @internal Use transliterator factory methods instead since this class will be removed in that release.
*/
CompoundTransliterator(const CompoundTransliterator&);
/**
* Assignment operator.
* @obsolete ICU 2.4. Use transliterator factory methods instead since this class will be removed in that release.
* @internal Use transliterator factory methods instead since this class will be removed in that release.
*/
CompoundTransliterator& operator=(const CompoundTransliterator&);
/**
* Transliterator API.
* @obsolete ICU 2.4. Use transliterator factory methods instead since this class will be removed in that release.
* @internal Use transliterator factory methods instead since this class will be removed in that release.
*/
Transliterator* clone(void) const;
/**
* Returns the number of transliterators in this chain.
* @return number of transliterators in this chain.
* @obsolete ICU 2.4. Use transliterator factory methods instead since this class will be removed in that release.
* @internal Use transliterator factory methods instead since this class will be removed in that release.
*/
virtual int32_t getCount(void) const;
@ -128,20 +128,20 @@ public:
* Returns the transliterator at the given index in this chain.
* @param index index into chain, from 0 to <code>getCount() - 1</code>
* @return transliterator at the given index
* @obsolete ICU 2.4. Use transliterator factory methods instead since this class will be removed in that release.
* @internal Use transliterator factory methods instead since this class will be removed in that release.
*/
virtual const Transliterator& getTransliterator(int32_t index) const;
/**
* Sets the transliterators.
* @obsolete ICU 2.4. Use transliterator factory methods instead since this class will be removed in that release.
* @internal Use transliterator factory methods instead since this class will be removed in that release.
*/
void setTransliterators(Transliterator* const transliterators[],
int32_t count);
/**
* Adopts the transliterators.
* @obsolete ICU 2.4. Use transliterator factory methods instead since this class will be removed in that release.
* @internal Use transliterator factory methods instead since this class will be removed in that release.
*/
void adoptTransliterators(Transliterator* adoptedTransliterators[],
int32_t count);
@ -156,7 +156,7 @@ public:
* character to their hex escape representations, \uxxxx or
* \Uxxxxxxxx. Unprintable characters are those other than
* U+000A, U+0020..U+007E.
* @obsolete ICU 2.4. Use transliterator factory methods instead since this class will be removed in that release.
* @internal Use transliterator factory methods instead since this class will be removed in that release.
*/
virtual UnicodeString& toRules(UnicodeString& result,
UBool escapeUnprintable) const;
@ -176,7 +176,7 @@ public:
protected:
/**
* Implements {@link Transliterator#handleTransliterate}.
* @obsolete ICU 2.4. Use transliterator factory methods instead since this class will be removed in that release.
* @internal Use transliterator factory methods instead since this class will be removed in that release.
*/
virtual void handleTransliterate(Replaceable& text, UTransPosition& index,
UBool incremental) const;

View file

@ -28,7 +28,7 @@ U_NAMESPACE_BEGIN
* applyPattern() for details.
*
* @author Alan Liu
* @obsolete ICU 2.4. Use transliterator factory methods instead since this class will be removed in that release.
* @internal Use transliterator factory methods instead since this class will be removed in that release.
*/
class U_I18N_API HexToUnicodeTransliterator : public Transliterator {
@ -78,14 +78,14 @@ public:
* Constructs a transliterator that recognizes the standard
* prefixes "&#92;u", "&#92;U", "u+", and "U+", each with no
* suffix.
* @obsolete ICU 2.4. Use transliterator factory methods instead since this class will be removed in that release.
* @internal Use transliterator factory methods instead since this class will be removed in that release.
*/
HexToUnicodeTransliterator(UnicodeFilter* adoptedFilter = 0);
/**
* Constructs a custom transliterator with the given pattern.
* @see #applyPattern
* @obsolete ICU 2.4. Use transliterator factory methods instead since this class will be removed in that release.
* @internal Use transliterator factory methods instead since this class will be removed in that release.
*/
HexToUnicodeTransliterator(const UnicodeString& pattern,
UErrorCode& status);
@ -94,7 +94,7 @@ public:
* Constructs a custom transliterator with the given pattern
* and filter.
* @see #applyPattern
* @obsolete ICU 2.4. Use transliterator factory methods instead since this class will be removed in that release.
* @internal Use transliterator factory methods instead since this class will be removed in that release.
*/
HexToUnicodeTransliterator(const UnicodeString& pattern,
UnicodeFilter* adoptedFilter,
@ -102,25 +102,25 @@ public:
/**
* Destructor.
* @obsolete ICU 2.4. Use transliterator factory methods instead since this class will be removed in that release.
* @internal Use transliterator factory methods instead since this class will be removed in that release.
*/
virtual ~HexToUnicodeTransliterator();
/**
* Copy constructor.
* @obsolete ICU 2.4. Use transliterator factory methods instead since this class will be removed in that release.
* @internal Use transliterator factory methods instead since this class will be removed in that release.
*/
HexToUnicodeTransliterator(const HexToUnicodeTransliterator&);
/**
* Assignment operator.
* @obsolete ICU 2.4. Use transliterator factory methods instead since this class will be removed in that release.
* @internal Use transliterator factory methods instead since this class will be removed in that release.
*/
HexToUnicodeTransliterator& operator=(const HexToUnicodeTransliterator&);
/**
* Transliterator API.
* @obsolete ICU 2.4. Use transliterator factory methods instead since this class will be removed in that release.
* @internal Use transliterator factory methods instead since this class will be removed in that release.
*/
Transliterator* clone(void) const;
@ -149,19 +149,19 @@ public:
* suffix-char := [^special-char] | '\\' special-char
* special-char := ';' | '0' | '#' | '\\'
* </pre>
* @obsolete ICU 2.4. Use transliterator factory methods instead since this class will be removed in that release.
* @internal Use transliterator factory methods instead since this class will be removed in that release.
*/
void applyPattern(const UnicodeString& thePattern, UErrorCode& status);
/**
* Return this transliterator's pattern.
* @obsolete ICU 2.4. Use transliterator factory methods instead since this class will be removed in that release.
* @internal Use transliterator factory methods instead since this class will be removed in that release.
*/
const UnicodeString& toPattern(void) const;
/**
* Implements {@link Transliterator#handleTransliterate}.
* @obsolete ICU 2.4. Use transliterator factory methods instead since this class will be removed in that release.
* @internal Use transliterator factory methods instead since this class will be removed in that release.
*/
virtual void handleTransliterate(Replaceable& text, UTransPosition& offset,
UBool isIncremental) const;

View file

@ -21,7 +21,7 @@ U_NAMESPACE_BEGIN
/**
* A transliterator that leaves text unchanged.
* @author Alan Liu
* @obsolete ICU 2.4. Use transliterator factory methods instead since this class will be removed in that release.
* @internal Use transliterator factory methods instead since this class will be removed in that release.
*/
class U_I18N_API NullTransliterator : public Transliterator {
@ -29,37 +29,37 @@ public:
/**
* ID for this transliterator.
* @obsolete ICU 2.4. Use transliterator factory methods instead since this class will be removed in that release.
* @internal Use transliterator factory methods instead since this class will be removed in that release.
*/
static const UChar ID[]; // public for Transliterator
/**
* ID for this transliterator.
* @obsolete ICU 2.4. Use transliterator factory methods instead since this class will be removed in that release.
* @internal Use transliterator factory methods instead since this class will be removed in that release.
*/
static const UChar SHORT_ID[]; // public for Transliterator
/**
* Constructs a transliterator.
* @obsolete ICU 2.4. Use transliterator factory methods instead since this class will be removed in that release.
* @internal Use transliterator factory methods instead since this class will be removed in that release.
*/
NullTransliterator();
/**
* Destructor.
* @obsolete ICU 2.4. Use transliterator factory methods instead since this class will be removed in that release.
* @internal Use transliterator factory methods instead since this class will be removed in that release.
*/
virtual ~NullTransliterator();
/**
* Transliterator API.
* @obsolete ICU 2.4. Use transliterator factory methods instead since this class will be removed in that release.
* @internal Use transliterator factory methods instead since this class will be removed in that release.
*/
Transliterator* clone(void) const;
/**
* Implements {@link Transliterator#handleTransliterate}.
* @obsolete ICU 2.4. Use transliterator factory methods instead since this class will be removed in that release.
* @internal Use transliterator factory methods instead since this class will be removed in that release.
*/
virtual void handleTransliterate(Replaceable& text, UTransPosition& offset,
UBool isIncremental) const;

View file

@ -281,7 +281,7 @@ class TransliterationRuleData;
* rule <em>masks</em> the second rule. </p>
*
* @author Alan Liu
* @obsolete ICU 2.4. Use transliterator factory methods instead since this class will be removed in that release.
* @internal Use transliterator factory methods instead since this class will be removed in that release.
*/
class U_I18N_API RuleBasedTransliterator : public Transliterator {
@ -303,7 +303,7 @@ public:
* @param rules rules, separated by ';'
* @param direction either FORWARD or REVERSE.
* @exception IllegalArgumentException if rules are malformed.
* @obsolete ICU 2.4. Use transliterator factory methods instead since this class will be removed in that release.
* @internal Use transliterator factory methods instead since this class will be removed in that release.
*/
RuleBasedTransliterator(const UnicodeString& id,
const UnicodeString& rules,
@ -317,7 +317,7 @@ public:
* @param rules rules, separated by ';'
* @param direction either FORWARD or REVERSE.
* @exception IllegalArgumentException if rules are malformed.
* @obsolete ICU 2.4. Use transliterator factory methods instead since this class will be removed in that release.
* @internal Use transliterator factory methods instead since this class will be removed in that release.
*/
RuleBasedTransliterator(const UnicodeString& id,
const UnicodeString& rules,
@ -327,7 +327,7 @@ public:
/**
* Covenience constructor with no filter.
* @obsolete ICU 2.4. Use transliterator factory methods instead since this class will be removed in that release.
* @internal Use transliterator factory methods instead since this class will be removed in that release.
*/
RuleBasedTransliterator(const UnicodeString& id,
const UnicodeString& rules,
@ -336,7 +336,7 @@ public:
/**
* Covenience constructor with no filter and FORWARD direction.
* @obsolete ICU 2.4. Use transliterator factory methods instead since this class will be removed in that release.
* @internal Use transliterator factory methods instead since this class will be removed in that release.
*/
RuleBasedTransliterator(const UnicodeString& id,
const UnicodeString& rules,
@ -344,7 +344,7 @@ public:
/**
* Covenience constructor with FORWARD direction.
* @obsolete ICU 2.4. Use transliterator factory methods instead since this class will be removed in that release.
* @internal Use transliterator factory methods instead since this class will be removed in that release.
*/
RuleBasedTransliterator(const UnicodeString& id,
const UnicodeString& rules,
@ -380,7 +380,7 @@ public:
/**
* Copy constructor.
* @obsolete ICU 2.4. Use transliterator factory methods instead since this class will be removed in that release.
* @internal Use transliterator factory methods instead since this class will be removed in that release.
*/
RuleBasedTransliterator(const RuleBasedTransliterator&);
@ -388,14 +388,14 @@ public:
/**
* Implement Transliterator API.
* @obsolete ICU 2.4. Use transliterator factory methods instead since this class will be removed in that release.
* @internal Use transliterator factory methods instead since this class will be removed in that release.
*/
Transliterator* clone(void) const;
protected:
/**
* Implements {@link Transliterator#handleTransliterate}.
* @obsolete ICU 2.4. Use transliterator factory methods instead since this class will be removed in that release.
* @internal Use transliterator factory methods instead since this class will be removed in that release.
*/
virtual void handleTransliterate(Replaceable& text, UTransPosition& offsets,
UBool isIncremental) const;
@ -411,7 +411,7 @@ public:
* character to their hex escape representations, \uxxxx or
* \Uxxxxxxxx. Unprintable characters are those other than
* U+000A, U+0020..U+007E.
* @obsolete ICU 2.4. Use transliterator factory methods instead since this class will be removed in that release.
* @internal Use transliterator factory methods instead since this class will be removed in that release.
*/
virtual UnicodeString& toRules(UnicodeString& result,
UBool escapeUnprintable) const;
@ -437,7 +437,7 @@ public:
* . Derived::getStaticClassID()) ...
* </pre>
* @return The class ID for all objects of this class.
* @obsolete ICU 2.4. Use transliterator factory methods instead since this class will be removed in that release.
* @internal Use transliterator factory methods instead since this class will be removed in that release.
*/
static UClassID getStaticClassID(void) { return (UClassID)&fgClassID; }

View file

@ -277,6 +277,7 @@ CollationKey::ensureCapacity(int32_t newSize)
return *this;
}
#ifdef U_USE_COLLATION_KEY_DEPRECATES
// Create a copy of the byte array.
uint8_t*
CollationKey::toByteArray(int32_t& count) const
@ -295,6 +296,7 @@ CollationKey::toByteArray(int32_t& count) const
return result;
}
#endif
int32_t
CollationKey::hashCode() const

View file

@ -368,6 +368,7 @@ public:
*/
virtual UnicodeString& toPattern(UnicodeString &pattern) const;
#ifdef U_USE_CHOICE_FORMAT_DEPRECATES
/**
* Set the choices to be used in formatting. The arrays are adopted and
* should not be deleted by the caller.
@ -399,7 +400,8 @@ public:
UBool* closuresToAdopt,
UnicodeString* formatsToAdopt,
int32_t count);
#endif
/**
* Set the choices to be used in formatting.
*

View file

@ -165,6 +165,7 @@ public:
*/
const uint8_t* getByteArray(int32_t& count) const;
#ifdef U_USE_COLLATION_KEY_DEPRECATES
/**
* Extracts the collation key values into a new array. The caller owns
* this storage and should free it.
@ -173,6 +174,7 @@ public:
* @obsolete ICU 2.6. Use getByteArray instead since this API will be removed in that release.
*/
uint8_t* toByteArray(int32_t& count) const;
#endif
/**
* Convenience method which does a string(bit-wise) comparison of the

View file

@ -39,7 +39,7 @@ class UnicodeFilter;
* default is uppercase.
*
* @author Alan Liu
* @obsolete ICU 2.4. Use transliterator factory methods instead since this class will be removed in that release.
* @internal Use transliterator factory methods instead since this class will be removed in that release.
*/
class U_I18N_API UnicodeToHexTransliterator : public Transliterator {
@ -104,7 +104,7 @@ public:
* NULL if none. Adopted by this transliterator.
* @param status Error code indicating success or failure
* to parse pattern.
* @obsolete ICU 2.4. Use transliterator factory methods instead since this class will be removed in that release.
* @internal Use transliterator factory methods instead since this class will be removed in that release.
*/
UnicodeToHexTransliterator(const UnicodeString& pattern,
UBool isUppercase,
@ -117,7 +117,7 @@ public:
* applyPattern() for pattern syntax.
* @param status Error code indicating success or failure
* to parse pattern.
* @obsolete ICU 2.4. Use transliterator factory methods instead since this class will be removed in that release.
* @internal Use transliterator factory methods instead since this class will be removed in that release.
*/
UnicodeToHexTransliterator(const UnicodeString& pattern,
UErrorCode& status);
@ -125,19 +125,19 @@ public:
/**
* Constructs a transliterator with the default prefix "\u"
* that outputs uppercase hex digits.
* @obsolete ICU 2.4. Use transliterator factory methods instead since this class will be removed in that release.
* @internal Use transliterator factory methods instead since this class will be removed in that release.
*/
UnicodeToHexTransliterator(UnicodeFilter* adoptedFilter = 0);
/**
* Destructor.
* @obsolete ICU 2.4. Use transliterator factory methods instead since this class will be removed in that release.
* @internal Use transliterator factory methods instead since this class will be removed in that release.
*/
virtual ~UnicodeToHexTransliterator();
/**
* Copy constructor.
* @obsolete ICU 2.4. Use transliterator factory methods instead since this class will be removed in that release.
* @internal Use transliterator factory methods instead since this class will be removed in that release.
*/
UnicodeToHexTransliterator(const UnicodeToHexTransliterator&);
@ -149,7 +149,7 @@ public:
/**
* Transliterator API.
* @obsolete ICU 2.4. Use transliterator factory methods instead since this class will be removed in that release.
* @internal Use transliterator factory methods instead since this class will be removed in that release.
*/
virtual Transliterator* clone(void) const;
@ -178,31 +178,31 @@ public:
* <p>Limitations: There is no way to set the uppercase attribute
* in the pattern. (applyPattern() does not alter the uppercase
* attribute.)
* @obsolete ICU 2.4. Use transliterator factory methods instead since this class will be removed in that release.
* @internal Use transliterator factory methods instead since this class will be removed in that release.
*/
void applyPattern(const UnicodeString& thePattern, UErrorCode& status);
/**
* Return this transliterator's pattern.
* @obsolete ICU 2.4. Use transliterator factory methods instead since this class will be removed in that release.
* @internal Use transliterator factory methods instead since this class will be removed in that release.
*/
const UnicodeString& toPattern(void) const;
/**
* Returns true if this transliterator outputs uppercase hex digits.
* @obsolete ICU 2.4. Use transliterator factory methods instead since this class will be removed in that release.
* @internal Use transliterator factory methods instead since this class will be removed in that release.
*/
virtual UBool isUppercase(void) const;
/**
* Sets if this transliterator outputs uppercase hex digits.
* @obsolete ICU 2.4. Use transliterator factory methods instead since this class will be removed in that release.
* @internal Use transliterator factory methods instead since this class will be removed in that release.
*/
virtual void setUppercase(UBool outputUppercase);
/**
* Implements {@link Transliterator#handleTransliterate}.
* @obsolete ICU 2.4. Use transliterator factory methods instead since this class will be removed in that release.
* @internal Use transliterator factory methods instead since this class will be removed in that release.
*/
virtual void handleTransliterate(Replaceable& text, UTransPosition& offsets,
UBool isIncremental) const;

View file

@ -24,7 +24,7 @@ void printUnicodeString(const UnicodeString &s) {
void printTextRange( BreakIterator& iterator,
UTextOffset start, UTextOffset end )
int32_t start, int32_t end )
{
CharacterIterator *strIter = iterator.getText().clone();
UnicodeString s;
@ -40,8 +40,8 @@ void printTextRange( BreakIterator& iterator,
/* Print each element in order: */
void printEachForward( BreakIterator& boundary)
{
UTextOffset start = boundary.first();
for (UTextOffset end = boundary.next();
int32_t start = boundary.first();
for (int32_t end = boundary.next();
end != BreakIterator::DONE;
start = end, end = boundary.next())
{
@ -52,8 +52,8 @@ void printEachForward( BreakIterator& boundary)
/* Print each element in reverse order: */
void printEachBackward( BreakIterator& boundary)
{
UTextOffset end = boundary.last();
for (UTextOffset start = boundary.previous();
int32_t end = boundary.last();
for (int32_t start = boundary.previous();
start != BreakIterator::DONE;
end = start, start = boundary.previous())
{
@ -64,24 +64,24 @@ void printEachBackward( BreakIterator& boundary)
/* Print the first element */
void printFirst(BreakIterator& boundary)
{
UTextOffset start = boundary.first();
UTextOffset end = boundary.next();
int32_t start = boundary.first();
int32_t end = boundary.next();
printTextRange( boundary, start, end );
}
/* Print the last element */
void printLast(BreakIterator& boundary)
{
UTextOffset end = boundary.last();
UTextOffset start = boundary.previous();
int32_t end = boundary.last();
int32_t start = boundary.previous();
printTextRange( boundary, start, end );
}
/* Print the element at a specified position */
void printAt(BreakIterator &boundary, UTextOffset pos )
void printAt(BreakIterator &boundary, int32_t pos )
{
UTextOffset end = boundary.following(pos);
UTextOffset start = boundary.previous();
int32_t end = boundary.following(pos);
int32_t start = boundary.previous();
printTextRange( boundary, start, end );
}

View file

@ -269,14 +269,6 @@ void TestProperty()
doAssert( (ucol_getStrength(col) != UCOL_PRIMARY), "collation object's strength is primary difference");
doAssert( (ucol_getStrength(col) == UCOL_SECONDARY), "collation object has the wrong strength");
#ifdef ICU_NORMALIZER_USE_DEPRECATES
log_verbose("testing ucol_setDecomposition() method ...\n");
ucol_setNormalization(col, UNORM_NONE);
doAssert( (ucol_getNormalization(col) != UNORM_NFC), "collation object's normalization mode is Canonical decomposition followed by canonical composition");
doAssert( (ucol_getNormalization(col) != UNORM_NFD), "collation object's normalization mode is canonical decomposition");
doAssert( (ucol_getNormalization(col) == UNORM_NONE), "collation object has the wrong normalization mode");
#endif
log_verbose("Get display name for the default collation in German : \n");
@ -552,28 +544,9 @@ void TestDecomposition() {
log_err("ERROR: en_US collation had cannonical decomposition for normalization!\n");
}
#ifdef ICU_NORMALIZER_USE_DEPRECATES
/* there is no reason to have canonical decomposition in en_US OR default locale */
if(ucol_getNormalization(vi_VN) != UNORM_NFD)
{
log_err("ERROR: vi_VN collation did not have cannonical decomposition for normalization!\n");
}
if(ucol_getNormalization(el_GR) != UNORM_NFD)
{
log_err("ERROR: el_GR collation did not have cannonical decomposition for normalization!\n");
}
if(ucol_getNormalization(en_US) != UNORM_NONE)
{
log_err("ERROR: en_US collation had cannonical decomposition for normalization!\n");
}
#endif
ucol_close(en_US);
ucol_close(el_GR);
ucol_close(vi_VN);
}
#define CLONETEST_COLLATOR_COUNT 3

View file

@ -448,7 +448,7 @@ static void TestLetterNumber()
}
}
/* Tests for isDefined(u_isdefined)(, isBaseForm(u_isbase()), isSpaceChar(u_isspace()), isWhiteSpace(), u_CharDigitValue(),u_CharCellWidth() */
/* Tests for isDefined(u_isdefined)(, isBaseForm(u_isbase()), isSpaceChar(u_isspace()), isWhiteSpace(), u_CharDigitValue() */
static void TestMisc()
{
const UChar sampleSpaces[] = {0x0020, 0x00a0, 0x2000, 0x2001, 0x2005};
@ -469,20 +469,6 @@ static void TestMisc()
uint32_t mask;
enum ECellWidths /* pasted in here from unicode.h */
{
ZERO_WIDTH = 0,
HALF_WIDTH = 1,
FULL_WIDTH = 2,
NEUTRAL = 3
};
const uint16_t sampleCellWidth[] = { ZERO_WIDTH,
HALF_WIDTH,
FULL_WIDTH,
NEUTRAL,
U_HALF_WIDTH,
U_ZERO_WIDTH};
int i;
char icuVersion[U_MAX_VERSION_STRING_LENGTH];
UVersionInfo realVersion;
@ -530,14 +516,6 @@ static void TestMisc()
}
}
log_verbose("Testing for charcellwidth\n");
for (i = 0; i < 5; i++) {
if (u_charCellWidth(sampleChars[i]) != sampleCellWidth[i])
{
log_err("Cell width char test error : U+%04x \n", (int32_t)sampleChars[i]);
}
}
log_verbose("Testing for isdigit \n");
for (i = 0; i < 4; i++) {
if ((u_isdigit(sampleDigits[i]) &&

View file

@ -149,15 +149,6 @@ CollationAPITest::TestProperty(/* char* par */)
doAssert((col->getStrength() != Collator::PRIMARY), "collation object's strength is primary difference");
doAssert((col->getStrength() == Collator::SECONDARY), "collation object has the wrong strength");
#ifdef ICU_NORMALIZER_USE_DEPRECATES
/* The replacement API is tested in TestAttribute() */
logln("testing Collator::setDecomposition() method ...");
col->setDecomposition(Normalizer::NO_OP);
doAssert((col->getDecomposition() != Normalizer::DECOMP), "collation object's strength is secondary difference");
doAssert((col->getDecomposition() != Normalizer::DECOMP_COMPAT), "collation object's strength is primary difference");
doAssert((col->getDecomposition() == Normalizer::NO_OP), "collation object has the wrong strength");
#endif
UnicodeString name;
logln("Get display name for the US English collation in German : ");
@ -381,23 +372,6 @@ CollationAPITest::TestDecomposition() {
return;
}
#ifdef ICU_NORMALIZER_USE_DEPRECATES
/* there is no reason to have canonical decomposition in en_US OR default locale */
if (vi_VN->getDecomposition() != Normalizer::DECOMP)
{
errln("ERROR: vi_VN collation did not have cannonical decomposition for normalization!\n");
}
if (el_GR->getDecomposition() != Normalizer::DECOMP)
{
errln("ERROR: el_GR collation did not have cannonical decomposition for normalization!\n");
}
if (en_US->getDecomposition() != Normalizer::NO_OP)
{
errln("ERROR: en_US collation had cannonical decomposition for normalization!\n");
}
#else
/* there is no reason to have canonical decomposition in en_US OR default locale */
if (vi_VN->getAttribute(UCOL_NORMALIZATION_MODE, status) != UCOL_ON)
{
@ -413,7 +387,6 @@ CollationAPITest::TestDecomposition() {
{
errln("ERROR: en_US collation had cannonical decomposition for normalization!\n");
}
#endif
delete en_US;
delete el_GR;
@ -572,12 +545,10 @@ CollationAPITest::TestCollationKey(/* char* par */)
doAssert(sortkEmpty.compareTo(sortkEmpty) == Collator::EQUAL, "Result should be (empty key) == (empty key)");
int32_t cnt1, cnt2, cnt3, cnt4;
uint8_t* byteArray1 = 0;
byteArray1 = sortk1.toByteArray(cnt1);
uint8_t* byteArray2 = 0;
const uint8_t* byteArray1 = sortk1.getByteArray(cnt1);
const uint8_t* byteArray2 = sortk2.getByteArray(cnt2);
byteArray2 = sortk2.toByteArray(cnt2);
/*
this is a bad test since it is dependent on the version of uca data,
which changes
@ -616,9 +587,7 @@ CollationAPITest::TestCollationKey(/* char* par */)
doAssert(sortk2 == sortk7, "sortk2 == sortk7 Failed.");
doAssert(sortk1 != sortk7, "sortk1 != sortk7 Failed.");
uprv_free(byteArray1);
byteArray1 = 0;
uprv_free(byteArray2);
byteArray2 = 0;
sortk3 = sortk1;
@ -1988,12 +1957,10 @@ void CollationAPITest::TestSubclass()
UErrorCode status = U_ZERO_ERROR;
col1.getCollationKey(abc, key, status);
int32_t length = 0;
char *bytearray = (char *)key.toByteArray(length);
UnicodeString keyarray(bytearray, length, NULL, status);
UnicodeString keyarray((const char *)key.getByteArray(length), length, NULL, status);
if (abc != keyarray) {
errln("TestCollator collationkey API is returning wrong values");
}
uprv_free(bytearray);
UnicodeSet expectedset(0, 0x10FFFF);
UnicodeSet *defaultset = col1.getTailoredSet(status);

View file

@ -79,6 +79,7 @@ TestChoiceFormat::TestSimpleExample( void )
}
delete formequal;
#ifdef U_USE_CHOICE_FORMAT_DEPRECATES
//Testing adoptChoices()
double *limitsToAdopt = (double *)uprv_malloc(7 * sizeof(double));
UnicodeString *monthNamesToAdopt = new UnicodeString[7];
@ -90,6 +91,7 @@ TestChoiceFormat::TestSimpleExample( void )
if(!(*formnew == *form)){
errln("ERROR: ==Operator or adoptChoices failed\n");
}
#endif
delete formnew;
@ -350,6 +352,7 @@ TestChoiceFormat::TestComplexExample( void )
it_errln("*** ChoiceFormat contructor( newPattern, status) or toPattern result!");
}
#ifdef U_USE_CHOICE_FORMAT_DEPRECATES
double* d_a = (double *)uprv_malloc(2 * sizeof(double));
if (!d_a) { it_errln("*** allocation error."); return; }
d_a[0] = 1.0; d_a[1] = 2.0;
@ -366,6 +369,7 @@ TestChoiceFormat::TestComplexExample( void )
}else{
it_errln("*** ChoiceFormat adoptChoices result!");
}
#endif
double d_a2[] = { 3.0, 4.0 };
UnicodeString s_a2[] = { "third", "forth" };

View file

@ -46,13 +46,12 @@ void UnicodeStringTest::runIndexedTest( int32_t index, UBool exec, const char* &
case 6: name = "TestSpacePadding"; if (exec) TestSpacePadding(); break;
case 7: name = "TestPrefixAndSuffix"; if (exec) TestPrefixAndSuffix(); break;
case 8: name = "TestFindAndReplace"; if (exec) TestFindAndReplace(); break;
case 9: name = "TestCellWidth"; if (exec) TestCellWidth(); break;
case 9: name = "TestBogus"; if (exec) TestBogus(); break;
case 10: name = "TestReverse"; if (exec) TestReverse(); break;
case 11: name = "TestMiscellaneous"; if (exec) TestMiscellaneous(); break;
case 12: name = "TestStackAllocation"; if (exec) TestStackAllocation(); break;
case 13: name = "TestUnescape"; if (exec) TestUnescape(); break;
case 14: name = "TestCountChar32"; if (exec) TestCountChar32(); break;
case 15: name = "TestBogus"; if (exec) TestBogus(); break;
default: name = ""; break; //needed to end loop
}
@ -575,11 +574,7 @@ UnicodeStringTest::TestRemoveReplace()
for (int32_t i = 0; i < test1.length(); i++) {
if (test5[i] != 0x53 && test5[i] != 0x50 && test5[i] != 0x41 && test5[i] != 0x4d && test5[i] != 0x20) {
#ifdef U_USE_DEPRECATED_UCHAR_REFERENCE
test1[i] = 0x78;
#else
test1.setCharAt(i, 0x78);
#endif
}
}
@ -887,37 +882,6 @@ UnicodeStringTest::TestFindAndReplace()
errln("findAndReplace failed: expected \"" + expectedValue + "\", got \"" + test1 + "\".");
}
void
UnicodeStringTest::TestCellWidth()
{
UChar testData2[] = { 0x4d, 0x6f, 0x308, 0x74, 0x6c, 0x65, 0x79, 0x20, 0x43, 0x72, 0x75, 0x308, 0x65, 0x0000 };
UChar testData3[] = { 0x31, 0x39, 0x39, 0x37, 0x5e74, 0x20, 0x516d, 0x6708, 0x20, 0x30, 0x33, 0x65e5, 0x5e73, 0x6210, 0x0000 };
UChar testData4[] = { 0x39, 0x37, 0xb144, 0x36, 0xc6d4, 0x30, 0x33, 0xc77c, 0x0000 };
UChar testData5[] = { 0x39, 0x37, 0x1103, 0x1167, 0x11ab, 0x36, 0x110b, 0x117b, 0x11af, 0x30, 0x33, 0x110b, 0x1175, 0x11af, 0x0000 };
UnicodeString test1("The rain in Spain stays mainly on the plain.");
UnicodeString test2(testData2);
UnicodeString test3(testData3);
UnicodeString test4(testData4);
UnicodeString test5(testData5);
int32_t testVal = test1.numDisplayCells();
if (testVal != 44)
errln("test1.numDisplayCells() failed: expected 44, got %d", testVal);
testVal = test2.numDisplayCells();
if (testVal != 11)
errln("test2.numDisplayCells() failed: expected 11, got %d", testVal);
testVal = test3.numDisplayCells();
if (testVal != 20)
errln("test3.numDisplayCells() failed: expected 20, got %d", testVal);
testVal = test4.numDisplayCells();
if (testVal != 11)
errln("test4.numDisplayCells() failed: expected 11, got %d", testVal);
testVal = test5.numDisplayCells();
if (testVal != 11)
errln("test5.numDisplayCells() failed: expected 11, got %d", testVal);
}
void
UnicodeStringTest::TestReverse()
{

View file

@ -51,10 +51,6 @@ public:
* Test method findAndReplace
**/
void TestFindAndReplace(void);
/**
* Test method numDisplayCells
**/
void TestCellWidth(void);
/**
* Test method reverse
**/