ICU-4081 Ported more tests and fixed more problems revealed by tests

X-SVN-Rev: 22896
This commit is contained in:
Andrew J Macheret 2007-11-07 00:07:35 +00:00
parent ae68bce23b
commit 1f872827e3
2 changed files with 118 additions and 1 deletions

View File

@ -91,10 +91,12 @@ Calendar* ChineseCalendar::clone() const {
ChineseCalendar::ChineseCalendar(const Locale& aLocale, UErrorCode& success)
: Calendar(TimeZone::createDefault(), aLocale, success)
{
isLeapYear = FALSE;
setTimeInMillis(getNow(), success); // Call this again now that the vtable is set up properly.
}
ChineseCalendar::ChineseCalendar(const ChineseCalendar& other) : Calendar(other) {
isLeapYear = other.isLeapYear;
}
ChineseCalendar::~ChineseCalendar()

View File

@ -158,7 +158,7 @@ calendar:table(nofallback) {
"ERA=1,YEAR=2,MONTH=JUNE,DATE=4", // tw
},
//chinese
//chinese add tests
{ // normal
"en_US@calendar=chinese",
"EXTENDED_YEAR=4642,MONTH=2,DATE=15,IS_LEAP_MONTH=0", // ch
@ -229,6 +229,121 @@ calendar:table(nofallback) {
"MONTH=3", // month + 3
"EXTENDED_YEAR=4638,MONTH=5,DATE=29,IS_LEAP_MONTH=0", // ch
},
// chinese roll tests
{ // normal
"en_US@calendar=chinese",
"EXTENDED_YEAR=4642,MONTH=2,DATE=15,IS_LEAP_MONTH=0", // ch
"roll",
"MONTH=3", // month + 3
"EXTENDED_YEAR=4642,MONTH=5,DATE=15,IS_LEAP_MONTH=0", // ch
},
{ // normal
"en_US@calendar=chinese",
"EXTENDED_YEAR=4642,MONTH=2,DATE=15,IS_LEAP_MONTH=0", // ch
"roll",
"MONTH=11", // month + 11
"EXTENDED_YEAR=4642,MONTH=1,DATE=15,IS_LEAP_MONTH=0", // ch
},
{ // across year
"en_US@calendar=chinese",
"EXTENDED_YEAR=4639,MONTH=11,DATE=15,IS_LEAP_MONTH=0", // ch
"roll",
"MONTH=1", // month + 1
"EXTENDED_YEAR=4639,MONTH=0,DATE=15,IS_LEAP_MONTH=0", // ch
},
{ // across year
"en_US@calendar=chinese",
"EXTENDED_YEAR=4640,MONTH=0,DATE=15,IS_LEAP_MONTH=0", // ch
"roll",
"MONTH=-1", // month - 1
"EXTENDED_YEAR=4640,MONTH=11,DATE=15,IS_LEAP_MONTH=0", // ch
},
{ // month=3 is a leap month
"en_US@calendar=chinese",
"EXTENDED_YEAR=4638,MONTH=2,DATE=15,IS_LEAP_MONTH=0", // ch
"roll",
"MONTH=3", // month + 3
"EXTENDED_YEAR=4638,MONTH=4,DATE=15,IS_LEAP_MONTH=0", // ch
},
{ // month=3 is a leap month
"en_US@calendar=chinese",
"EXTENDED_YEAR=4638,MONTH=2,DATE=15,IS_LEAP_MONTH=0", // ch
"roll",
"MONTH=3", // month + 16
"EXTENDED_YEAR=4638,MONTH=4,DATE=15,IS_LEAP_MONTH=0", // ch
},
{ // month=3 is a leap month
"en_US@calendar=chinese",
"EXTENDED_YEAR=4638,MONTH=2,DATE=15,IS_LEAP_MONTH=0", // ch
"roll",
"MONTH=2", // month + 2
"EXTENDED_YEAR=4638,MONTH=3,DATE=15,IS_LEAP_MONTH=1", // ch
},
{ // month=3 is a leap month
"en_US@calendar=chinese",
"EXTENDED_YEAR=4638,MONTH=2,DATE=15,IS_LEAP_MONTH=0", // ch
"roll",
"MONTH=28", // month + 28
"EXTENDED_YEAR=4638,MONTH=3,DATE=15,IS_LEAP_MONTH=1", // ch
},
{ // month=3 is a leap month
"en_US@calendar=chinese",
"EXTENDED_YEAR=4638,MONTH=3,DATE=15,IS_LEAP_MONTH=0", // ch
"roll",
"MONTH=1", // month + 1
"EXTENDED_YEAR=4638,MONTH=3,DATE=15,IS_LEAP_MONTH=1", // ch
},
{ // month=3 is a leap month
"en_US@calendar=chinese",
"EXTENDED_YEAR=4638,MONTH=3,DATE=15,IS_LEAP_MONTH=0", // ch
"roll",
"MONTH=-12", // month - 12
"EXTENDED_YEAR=4638,MONTH=3,DATE=15,IS_LEAP_MONTH=1", // ch
},
{ // month=3 is a leap month
"en_US@calendar=chinese",
"EXTENDED_YEAR=4638,MONTH=3,DATE=15,IS_LEAP_MONTH=1", // ch
"roll",
"MONTH=1", // month + 1
"EXTENDED_YEAR=4638,MONTH=4,DATE=15,IS_LEAP_MONTH=0", // ch
},
{ // month=3 is a leap month
"en_US@calendar=chinese",
"EXTENDED_YEAR=4638,MONTH=3,DATE=15,IS_LEAP_MONTH=1", // ch
"roll",
"MONTH=-25", // month - 25
"EXTENDED_YEAR=4638,MONTH=4,DATE=15,IS_LEAP_MONTH=0", // ch
},
{ // dom should pin
"en_US@calendar=chinese",
"EXTENDED_YEAR=4638,MONTH=3,DATE=30,IS_LEAP_MONTH=0", // ch
"roll",
"MONTH=1", // month + 1
"EXTENDED_YEAR=4638,MONTH=3,DATE=29,IS_LEAP_MONTH=1", // ch
},
{ // dom should pin
"en_US@calendar=chinese",
"EXTENDED_YEAR=4638,MONTH=3,DATE=30,IS_LEAP_MONTH=0", // ch
"roll",
"MONTH=14", // month + 14
"EXTENDED_YEAR=4638,MONTH=3,DATE=29,IS_LEAP_MONTH=1", // ch
},
{ // no dom pin
"en_US@calendar=chinese",
"EXTENDED_YEAR=4638,MONTH=3,DATE=30,IS_LEAP_MONTH=0", // ch
"roll",
"MONTH=15", // month + 15
"EXTENDED_YEAR=4638,MONTH=4,DATE=30,IS_LEAP_MONTH=0", // ch
},
{ // dom should pin
"en_US@calendar=chinese",
"EXTENDED_YEAR=4638,MONTH=3,DATE=30,IS_LEAP_MONTH=0", // ch
"roll",
"MONTH=-10", // month - 10
"EXTENDED_YEAR=4638,MONTH=5,DATE=29,IS_LEAP_MONTH=0", // ch
},
}
}
}