mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-14 17:24:01 +00:00
ICU-2699 fixed some gcc warnings in intltest
X-SVN-Rev: 11950
This commit is contained in:
parent
97b59dd571
commit
416e85bb33
6 changed files with 23 additions and 9 deletions
|
@ -1807,7 +1807,11 @@ UCollationResult TestCollator::compare(const UnicodeString& source,
|
|||
const UnicodeString& target,
|
||||
UErrorCode& status) const
|
||||
{
|
||||
if(U_SUCCESS(status)) {
|
||||
return UCollationResult(source.compare(target));
|
||||
} else {
|
||||
return UCOL_EQUAL;
|
||||
}
|
||||
}
|
||||
|
||||
UCollationResult TestCollator::compare(const UnicodeString& source,
|
||||
|
@ -1815,7 +1819,11 @@ UCollationResult TestCollator::compare(const UnicodeString& source,
|
|||
int32_t length,
|
||||
UErrorCode& status) const
|
||||
{
|
||||
return UCollationResult(source.compare(0, length, target));
|
||||
if(U_SUCCESS(status)) {
|
||||
return UCollationResult(source.compare(0, length, target));
|
||||
} else {
|
||||
return UCOL_EQUAL;
|
||||
}
|
||||
}
|
||||
|
||||
UCollationResult TestCollator::compare(const UChar* source,
|
||||
|
|
|
@ -1224,7 +1224,7 @@ LocaleTest::Test4143951()
|
|||
{
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
Calendar *cal = Calendar::createInstance(Locale("ru", "", ""), status);
|
||||
if (cal->getFirstDayOfWeek() != UCAL_MONDAY) {
|
||||
if (cal->getFirstDayOfWeek(status) != UCAL_MONDAY) {
|
||||
errln("Fail: First day of week in Russia should be Monday");
|
||||
}
|
||||
delete cal;
|
||||
|
|
|
@ -2162,6 +2162,7 @@ UBool TestSearch::operator!=(const TestSearch &that) const
|
|||
|
||||
int32_t TestSearch::handleNext(int32_t start, UErrorCode &status)
|
||||
{
|
||||
if(U_SUCCESS(status)) {
|
||||
int match = m_text_.indexOf(m_pattern_, start);
|
||||
if (match < 0) {
|
||||
m_offset_ = m_text_.length();
|
||||
|
@ -2173,10 +2174,14 @@ int32_t TestSearch::handleNext(int32_t start, UErrorCode &status)
|
|||
m_offset_ = match;
|
||||
setMatchLength(m_pattern_.length());
|
||||
return match;
|
||||
} else {
|
||||
return USEARCH_DONE;
|
||||
}
|
||||
}
|
||||
|
||||
int32_t TestSearch::handlePrev(int32_t start, UErrorCode &status)
|
||||
{
|
||||
if(U_SUCCESS(status)) {
|
||||
int match = m_text_.lastIndexOf(m_pattern_, 0, start);
|
||||
if (match < 0) {
|
||||
m_offset_ = 0;
|
||||
|
@ -2188,6 +2193,9 @@ int32_t TestSearch::handlePrev(int32_t start, UErrorCode &status)
|
|||
m_offset_ = match;
|
||||
setMatchLength(m_pattern_.length());
|
||||
return match;
|
||||
} else {
|
||||
return USEARCH_DONE;
|
||||
}
|
||||
}
|
||||
|
||||
TestSearch & TestSearch::operator=(const TestSearch &that)
|
||||
|
@ -2222,7 +2230,7 @@ void StringSearchTest::TestSubclass()
|
|||
search.reset();
|
||||
// comparing constructors
|
||||
|
||||
for (i = 0; i < sizeof(expected) / sizeof(int); i ++) {
|
||||
for (i = 0; i < (int)(sizeof(expected) / sizeof(expected[0])); i ++) {
|
||||
if (search.next(status) != expected[i]) {
|
||||
errln("Error getting next match");
|
||||
}
|
||||
|
@ -2233,7 +2241,7 @@ void StringSearchTest::TestSubclass()
|
|||
if (search.next(status) != USEARCH_DONE) {
|
||||
errln("Error should have reached the end of the iteration");
|
||||
}
|
||||
for (i = sizeof(expected) / sizeof(int) - 1; i >= 0; i --) {
|
||||
for (i = sizeof(expected) / sizeof(expected[0]) - 1; i >= 0; i --) {
|
||||
if (search.previous(status) != expected[i]) {
|
||||
errln("Error getting previous match");
|
||||
}
|
||||
|
|
|
@ -137,7 +137,7 @@ void CollationThaiTest::TestNamesList(void) {
|
|||
//
|
||||
UnicodeString lastWord, word;
|
||||
int32_t line = 0;
|
||||
int32_t failed = 0;
|
||||
//int32_t failed = 0;
|
||||
int32_t wordCount = 0;
|
||||
while (readLine(in, word, "UTF16LE")) {
|
||||
line++;
|
||||
|
|
|
@ -391,7 +391,7 @@ IntlTestCollator::doTestVariant(Collator* col, const UnicodeString &source, cons
|
|||
uiter_setString(&sIter, src, sLen);
|
||||
uiter_setString(&tIter, trg, tLen);
|
||||
compareResultIter = ucol_strcollIter(myCollation, &sIter, &tIter, &status);
|
||||
if(compareResultIter != result) {
|
||||
if(compareResultIter != (UCollationResult)result) {
|
||||
errln("Different result for iterative comparison "+source+" "+target);
|
||||
}
|
||||
}
|
||||
|
@ -447,7 +447,7 @@ IntlTestCollator::doTestVariant(Collator* col, const UnicodeString &source, cons
|
|||
log("%i ", partialSizes[i]);
|
||||
|
||||
partialSKResult = compareUsingPartials(myCollation, src, sLen, trg, tLen, partialSizes[i], status);
|
||||
if(partialSKResult != result) {
|
||||
if(partialSKResult != (UCollationResult)result) {
|
||||
errln("Partial sortkey comparison returned wrong result: "+source+", "+target+" (size "+partialSizes[i]+")");
|
||||
}
|
||||
|
||||
|
|
|
@ -877,7 +877,6 @@ public:
|
|||
lines(NULL),
|
||||
noLines(0)
|
||||
{
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
};
|
||||
void setCollator(UCollator *c, Line *l, int32_t nl)
|
||||
{
|
||||
|
@ -887,7 +886,6 @@ public:
|
|||
}
|
||||
virtual void run() {
|
||||
//sleep(10000);
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
int32_t line = 0;
|
||||
|
||||
uint8_t sk1[1024], sk2[1024];
|
||||
|
|
Loading…
Add table
Reference in a new issue