ICU-4916 add tests for setMonths/Weekdays(FORMAT,WIDE/ABBREVIATED)

X-SVN-Rev: 18780
This commit is contained in:
John Emmons 2005-11-09 17:57:53 +00:00
parent 04fa3baeb1
commit 23a8fbcbfe

View File

@ -134,6 +134,12 @@ void IntlTestDateFormatSymbols::TestSymbols(/* char *par */)
errln("ERROR: Couldn't create French DateFormatSymbols " + (UnicodeString)u_errorName(status));
}
status = U_ZERO_ERROR;
DateFormatSymbols fr2(Locale::getFrench(), status);
if(U_FAILURE(status)) {
errln("ERROR: Couldn't create French DateFormatSymbols " + (UnicodeString)u_errorName(status));
}
status = U_ZERO_ERROR;
DateFormatSymbols en(Locale::getEnglish(), status);
if(U_FAILURE(status)) {
@ -170,6 +176,20 @@ void IntlTestDateFormatSymbols::TestSymbols(/* char *par */)
errln("ERROR: setShortMonths() failed");
}
const UnicodeString *wideMonths = en.getMonths(count,DateFormatSymbols::FORMAT,DateFormatSymbols::WIDE);
fr2.setMonths(wideMonths, count, DateFormatSymbols::FORMAT,DateFormatSymbols::WIDE);
if( *en.getMonths(count,DateFormatSymbols::FORMAT,DateFormatSymbols::WIDE) !=
*fr2.getMonths(count,DateFormatSymbols::FORMAT,DateFormatSymbols::WIDE )) {
errln("ERROR: setMonths(FORMAT,WIDE) failed");
}
const UnicodeString *abbrMonths = en.getMonths(count,DateFormatSymbols::FORMAT,DateFormatSymbols::ABBREVIATED);
fr2.setMonths(abbrMonths, count, DateFormatSymbols::FORMAT,DateFormatSymbols::ABBREVIATED);
if( *en.getMonths(count,DateFormatSymbols::FORMAT,DateFormatSymbols::ABBREVIATED) !=
*fr2.getMonths(count,DateFormatSymbols::FORMAT,DateFormatSymbols::ABBREVIATED )) {
errln("ERROR: setMonths(FORMAT,ABBREVIATED) failed");
}
const UnicodeString *narrowMonths = en.getMonths(count,DateFormatSymbols::FORMAT,DateFormatSymbols::NARROW);
fr.setMonths(narrowMonths, count, DateFormatSymbols::FORMAT,DateFormatSymbols::NARROW);
if( *en.getMonths(count,DateFormatSymbols::FORMAT,DateFormatSymbols::NARROW) !=
@ -210,6 +230,20 @@ void IntlTestDateFormatSymbols::TestSymbols(/* char *par */)
errln("ERROR: setShortWeekdays() failed");
}
const UnicodeString *wideWeekdays = en.getWeekdays(count,DateFormatSymbols::FORMAT,DateFormatSymbols::WIDE);
fr2.setWeekdays(wideWeekdays, count, DateFormatSymbols::FORMAT,DateFormatSymbols::WIDE);
if( *en.getWeekdays(count,DateFormatSymbols::FORMAT,DateFormatSymbols::WIDE) !=
*fr2.getWeekdays(count,DateFormatSymbols::FORMAT,DateFormatSymbols::WIDE )) {
errln("ERROR: setWeekdays(FORMAT,WIDE) failed");
}
const UnicodeString *abbrWeekdays = en.getWeekdays(count,DateFormatSymbols::FORMAT,DateFormatSymbols::ABBREVIATED);
fr2.setWeekdays(abbrWeekdays, count, DateFormatSymbols::FORMAT,DateFormatSymbols::ABBREVIATED);
if( *en.getWeekdays(count,DateFormatSymbols::FORMAT,DateFormatSymbols::ABBREVIATED) !=
*fr2.getWeekdays(count,DateFormatSymbols::FORMAT,DateFormatSymbols::ABBREVIATED )) {
errln("ERROR: setWeekdays(FORMAT,ABBREVIATED) failed");
}
const UnicodeString *narrowWeekdays = en.getWeekdays(count,DateFormatSymbols::FORMAT,DateFormatSymbols::NARROW);
fr.setWeekdays(narrowWeekdays, count, DateFormatSymbols::FORMAT,DateFormatSymbols::NARROW);
if( *en.getWeekdays(count,DateFormatSymbols::FORMAT,DateFormatSymbols::NARROW) !=