mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-13 08:53:20 +00:00
ICU-21900 Fix issues found while running samples.
This commit is contained in:
parent
3aa8f9fda1
commit
fcca13200f
4 changed files with 7 additions and 7 deletions
|
@ -988,7 +988,7 @@ void IntlCalendarTest::TestConsistencyEthiopicAmeteAlem() {
|
|||
}
|
||||
void IntlCalendarTest::checkConsistency(const char* locale) {
|
||||
// Check 2.5 years in quick mode and 8000 years in exhaustive mode.
|
||||
int32_t numOfDaysToTest = (quick ? 2.5 : 8000) * 365;
|
||||
int32_t numOfDaysToTest = static_cast<int32_t>((quick ? 2.5 : 8000) * 365);
|
||||
constexpr int32_t msInADay = 1000*60*60*24;
|
||||
std::string msg("TestConsistency");
|
||||
IcuTestErrorCode status(*this, (msg + locale).c_str());
|
||||
|
|
|
@ -317,7 +317,7 @@ void DecimalQuantityTest::testUseApproximateDoubleWhenAble() {
|
|||
{1.235, 3, RoundingMode::UNUM_ROUND_CEILING, true}};
|
||||
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
for (TestCase cas : cases) {
|
||||
for (const TestCase& cas : cases) {
|
||||
DecimalQuantity fq;
|
||||
fq.setToDouble(cas.d);
|
||||
assertTrue("Should be using approximate double", !fq.isExplicitExactDouble());
|
||||
|
@ -623,7 +623,7 @@ void DecimalQuantityTest::testScientificAndCompactSuppressedExponent() {
|
|||
// test the actual computed values of the plural operands
|
||||
|
||||
double expectedNOperand = cas.expectedDouble;
|
||||
double expectedIOperand = cas.expectedLong;
|
||||
double expectedIOperand = static_cast<double>(cas.expectedLong);
|
||||
double expectedEOperand = cas.expectedSuppressedScientificExponent;
|
||||
double expectedCOperand = cas.expectedSuppressedCompactExponent;
|
||||
double actualNOperand = dq.getPluralOperand(PLURAL_OPERAND_N);
|
||||
|
|
|
@ -919,7 +919,7 @@ PluralRulesTest::testDoubleValue() {
|
|||
const int64_t inputNum = cas.inputNum;
|
||||
const double expVal = cas.expVal;
|
||||
|
||||
FixedDecimal fd(inputNum);
|
||||
FixedDecimal fd(static_cast<double>(inputNum));
|
||||
UnicodeString message(u"FixedDecimal::doubleValue() for" + Int64ToUnicodeString(inputNum));
|
||||
assertEquals(message, expVal, fd.doubleValue());
|
||||
}
|
||||
|
@ -963,7 +963,7 @@ PluralRulesTest::testLongValue() {
|
|||
const int64_t inputNum = cas.inputNum;
|
||||
const int64_t expVal = cas.expVal;
|
||||
|
||||
FixedDecimal fd(inputNum);
|
||||
FixedDecimal fd(static_cast<double>(inputNum));
|
||||
UnicodeString message(u"FixedDecimal::longValue() for" + Int64ToUnicodeString(inputNum));
|
||||
assertEquals(message, expVal, fd.longValue());
|
||||
}
|
||||
|
@ -982,7 +982,7 @@ PluralRulesTest::testLongValue() {
|
|||
const double inputNum = cas.inputNum;
|
||||
const int64_t expVal = cas.expVal;
|
||||
|
||||
FixedDecimal fd(inputNum);
|
||||
FixedDecimal fd(static_cast<double>(inputNum));
|
||||
UnicodeString message(u"FixedDecimal::longValue() for" + DoubleToUnicodeString(inputNum));
|
||||
assertEquals(message, expVal, fd.longValue());
|
||||
}
|
||||
|
|
|
@ -2364,7 +2364,7 @@ void UnicodeStringTest::TestLargeAppend() {
|
|||
} else if (total <= INT32_MAX) {
|
||||
// Check that a string of exactly the maximum size works
|
||||
UnicodeString str2;
|
||||
int32_t remain = INT32_MAX - total;
|
||||
int32_t remain = static_cast<int32_t>(INT32_MAX - total);
|
||||
char16_t *buf2 = str2.getBuffer(remain);
|
||||
if (buf2 == nullptr) {
|
||||
// if somehow memory allocation fail, return the test
|
||||
|
|
Loading…
Add table
Reference in a new issue