+// © 2016 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
/********************************************************************
- * Copyright (c) 1997-2013, International Business Machines
+ * Copyright (c) 1997-2016, International Business Machines
* Corporation and others. All Rights Reserved.
********************************************************************/
// *****************************************************************************
// class TimeZoneRegressionTest
// *****************************************************************************
-/* length of an array */
-#define ARRAY_LENGTH(array) (sizeof(array)/sizeof(array[0]))
#define CASE(id,test) case id: name = #test; if (exec) { logln(#test "---"); logln((UnicodeString)""); test(); } break
void
}
UnicodeString output;
- FieldPosition pos(0);
+ FieldPosition pos(FieldPosition::DONT_CARE);
output = testTZ->getID(output) + " " + sdf->format(testDate, output, pos) +
" Offset(" + tzOffsetFloat + ")" +
" RawOffset(" + tzRawOffsetFloat + ")" +
BAD, GOOD_ERA, GOOD_YEAR, GOOD_MONTH, GOOD_DAY, GOOD_DOW, 24*3600000,
};
- int32_t dataLen = (int32_t)(sizeof(DATA) / sizeof(DATA[0]));
+ int32_t dataLen = UPRV_LENGTHOF(DATA);
UErrorCode status = U_ZERO_ERROR;
TimeZone *tz = TimeZone::createDefault();
UnicodeString temp;
logln(tz->getID(temp) + ":");
for (int32_t i = 0; i < 4; ++i) {
- FieldPosition pos(0);
+ FieldPosition pos(FieldPosition::DONT_CARE);
zone[i].remove();
zone[i] = fmt->format(d+ i*ONE_HOUR, zone[i], pos);
logln(UnicodeString("") + i + ": " + d + " / " + zone[i]);
"DateFormat.format(dst)/dst zone", fmt2->format(dst, l), "GMT+2:15",
};
- for (int32_t idx=0; idx<(int32_t)ARRAY_LENGTH(DATA); idx+=3) {
+ for (int32_t idx=0; idx<UPRV_LENGTHOF(DATA); idx+=3) {
if (DATA[idx+1]!=(DATA[idx+2])) {
errln("FAIL: " + DATA[idx] + " -> " + DATA[idx+1] + ", exp " + DATA[idx+2]);
}