mirror of
https://github.com/boostorg/date_time.git
synced 2026-02-24 03:52:16 +00:00
[SVN r53618]
This commit is contained in:
@@ -100,17 +100,17 @@ int main(){
|
||||
// default format tests: date, days, month, weekday, day, year
|
||||
std::istringstream iss("2005-Jan-15 21 Feb Tue 4 2002");
|
||||
iss >> d;
|
||||
check("Default format date", d == date(2005,Jan,15));
|
||||
check_equal("Default format date", d, date(2005,Jan,15));
|
||||
iss >> dd;
|
||||
check("Default (only) format positive days", dd == days(21));
|
||||
check_equal("Default (only) format positive days", dd, days(21));
|
||||
iss >> m;
|
||||
check("Default format month", m == greg_month(2));
|
||||
check_equal("Default format month", m, greg_month(2));
|
||||
iss >> gw;
|
||||
check("Default format weekday", gw == greg_weekday(2));
|
||||
check_equal("Default format weekday", gw, greg_weekday(2));
|
||||
iss >> gd;
|
||||
check("Default (only) format day of month", gd == greg_day(4));
|
||||
check_equal("Default (only) format day of month", gd, greg_day(4));
|
||||
iss >> gy;
|
||||
check("Default format year", gy == greg_year(2002));
|
||||
check_equal("Default format year", gy, greg_year(2002));
|
||||
// failure tests
|
||||
check("Input Misspelled in year (date) w/exceptions",
|
||||
failure_test(d, "205-Jan-15", e_bad_year, new date_input_facet()));
|
||||
@@ -151,15 +151,15 @@ int main(){
|
||||
iss.imbue(std::locale(std::locale::classic(), facet));
|
||||
|
||||
iss >> d;
|
||||
check("ISO format date", d == date(2005,Jan,15));
|
||||
check_equal("ISO format date", d, date(2005,Jan,15));
|
||||
iss >> dd;
|
||||
check("Default (only) format negative days", dd == days(-55));
|
||||
check_equal("Default (only) format negative days", dd, days(-55));
|
||||
iss >> m;
|
||||
check("Full format month", m == greg_month(2));
|
||||
check_equal("Full format month", m, greg_month(2));
|
||||
iss >> gw;
|
||||
check("Full format weekday", gw == greg_weekday(2));
|
||||
check_equal("Full format weekday", gw, greg_weekday(2));
|
||||
iss >> gy;
|
||||
check("2 digit format year", gy == greg_year(2002));
|
||||
check_equal("2 digit format year", gy, greg_year(2002));
|
||||
|
||||
date_input_facet* f1 = new date_input_facet();
|
||||
date_input_facet* f2 = new date_input_facet();
|
||||
@@ -177,41 +177,41 @@ int main(){
|
||||
date_input_facet* f = new date_input_facet("%%d %Y-%b-%d");
|
||||
std::stringstream ss;
|
||||
ss.imbue(std::locale(ss.getloc(), f));
|
||||
|
||||
|
||||
ss.str("%d 2005-Jun-14");
|
||||
ss >> d;
|
||||
check("Literal '%' in date format", d == date(2005,Jun,14));
|
||||
check_equal("Literal '%' in date format", d, date(2005,Jun,14));
|
||||
f->format("%%%d %Y-%b-%d");
|
||||
ss.str("%14 2005-Jun-14");
|
||||
ss >> d;
|
||||
check("Multiple literal '%'s in date format", d == date(2005,Jun,14));
|
||||
|
||||
check_equal("Multiple literal '%'s in date format", d, date(2005,Jun,14));
|
||||
|
||||
f->month_format("%%b %b");
|
||||
ss.str("%b Jun");
|
||||
ss >> m;
|
||||
check("Literal '%' in month format", m == greg_month(6));
|
||||
check_equal("Literal '%' in month format", m, greg_month(6));
|
||||
f->month_format("%%%b");
|
||||
ss.str("%Jun");
|
||||
ss >> m;
|
||||
check("Multiple literal '%'s in month format", m == greg_month(6));
|
||||
|
||||
check_equal("Multiple literal '%'s in month format", m, greg_month(6));
|
||||
|
||||
f->weekday_format("%%a %a");
|
||||
ss.str("%a Tue");
|
||||
ss >> gw;
|
||||
check("Literal '%' in weekday format", gw == greg_weekday(2));
|
||||
check_equal("Literal '%' in weekday format", gw, greg_weekday(2));
|
||||
f->weekday_format("%%%a");
|
||||
ss.str("%Tue");
|
||||
ss >> gw;
|
||||
check("Multiple literal '%'s in weekday format", gw == greg_weekday(2));
|
||||
|
||||
check_equal("Multiple literal '%'s in weekday format", gw, greg_weekday(2));
|
||||
|
||||
f->year_format("%%Y %Y");
|
||||
ss.str("%Y 2005");
|
||||
ss >> y;
|
||||
check("Literal '%' in year format", y == greg_year(2005));
|
||||
check_equal("Literal '%' in year format", y, greg_year(2005));
|
||||
f->year_format("%%%Y");
|
||||
ss.str("%2005");
|
||||
ss >> y;
|
||||
check("Multiple literal '%'s in year format", y == greg_year(2005));
|
||||
check_equal("Multiple literal '%'s in year format", y, greg_year(2005));
|
||||
}
|
||||
|
||||
// All days, month, weekday, day, and year formats have been tested
|
||||
@@ -219,22 +219,22 @@ int main(){
|
||||
facet->set_iso_extended_format();
|
||||
iss.str("2005-01-15");
|
||||
iss >> d;
|
||||
check("ISO Extended format date", d == date(2005,Jan,15));
|
||||
check_equal("ISO Extended format date", d, date(2005,Jan,15));
|
||||
|
||||
facet->format("%B %d, %Y");
|
||||
iss.str("March 15, 2006");
|
||||
iss >> d;
|
||||
check("Custom date format: \"%B %d, %Y\" => 'March 15, 2006'",
|
||||
d == date(2006,Mar,15));
|
||||
check_equal("Custom date format: \"%B %d, %Y\" => 'March 15, 2006'",
|
||||
d, date(2006,Mar,15));
|
||||
|
||||
facet->format("%Y-%j"); // Ordinal format ISO8601(2000 sect 5.2.2.1 extended)
|
||||
iss.str("2006-074");
|
||||
iss >> d;
|
||||
check("Custom date format: \"%Y-%j\" => '2006-074'",
|
||||
d == date(2006,Mar,15));
|
||||
check("Bad input Custom date format: \"%Y-%j\" => '2006-74' (w/exceptions)",
|
||||
check_equal("Custom date format: \"%Y-%j\" => '2006-074'",
|
||||
d, date(2006,Mar,15));
|
||||
check("Bad input Custom date format: \"%Y-%j\" => '2006-74' (w/exceptions)",
|
||||
failure_test(d, "2006-74", e_bad_day_of_year, facet));
|
||||
check("Bad input Custom date format: \"%Y-%j\" => '2006-74' (no exceptions)",
|
||||
check("Bad input Custom date format: \"%Y-%j\" => '2006-74' (no exceptions)",
|
||||
failure_test(d, "2006-74", facet));
|
||||
|
||||
// date_period tests
|
||||
@@ -250,7 +250,7 @@ int main(){
|
||||
iss.str("[2002-07-04/2002-07-24]");
|
||||
facet->set_iso_extended_format();
|
||||
iss >> dp;
|
||||
check("Default period (closed range)", dp == date_period(begin,len));
|
||||
check_equal("Default period (closed range)", dp, date_period(begin,len));
|
||||
{
|
||||
std::stringstream ss;
|
||||
date d(not_a_date_time);
|
||||
@@ -262,32 +262,32 @@ int main(){
|
||||
date_period dp3(d3, d4);
|
||||
ss << dp;
|
||||
ss >> dp2;
|
||||
check("Special values period (reversibility test)", dp == dp2);
|
||||
check_equal("Special values period (reversibility test)", dp, dp2);
|
||||
ss.str("[-infinity/+infinity]");
|
||||
ss >> dp2;
|
||||
check("Special values period (infinities)", dp3 == dp2);
|
||||
check_equal("Special values period (infinities)", dp3, dp2);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// open range
|
||||
period_parser pp(period_parser::AS_OPEN_RANGE);
|
||||
iss.str("[2002-07-04/2002-07-25)");
|
||||
facet->period_parser(pp);
|
||||
iss >> dp;
|
||||
check("Open range period", dp == date_period(begin,len));
|
||||
check_equal("Open range period", dp, date_period(begin,len));
|
||||
// custom period delimiters
|
||||
pp.delimiter_strings(" to ", "from ", " exclusive", " inclusive");
|
||||
iss.str("from 2002-07-04 to 2002-07-25 exclusive");
|
||||
facet->period_parser(pp);
|
||||
iss >> dp;
|
||||
check("Open range period - custom delimiters", dp == date_period(begin,len));
|
||||
check_equal("Open range period - custom delimiters", dp, date_period(begin,len));
|
||||
pp.range_option(period_parser::AS_CLOSED_RANGE);
|
||||
iss.str("from 2002-07-04 to 2002-07-24 inclusive");
|
||||
facet->period_parser(pp);
|
||||
iss >> dp;
|
||||
check("Closed range period - custom delimiters", dp == date_period(begin,len));
|
||||
check_equal("Closed range period - custom delimiters", dp, date_period(begin,len));
|
||||
|
||||
|
||||
|
||||
// date_generator tests
|
||||
|
||||
// date_generators use formats contained in the
|
||||
@@ -304,30 +304,30 @@ int main(){
|
||||
first_kday_after fka(Sunday);
|
||||
// using default date_generator_parser "nth_strings"
|
||||
iss.str("29 Feb");
|
||||
iss >> pd;
|
||||
iss >> pd;
|
||||
// Feb-29 is a valid date_generator, get_date() will fail in a non-leap year
|
||||
check("Default strings, partial_date",
|
||||
pd.get_date(2004) == date(2004,Feb,29));
|
||||
check_equal("Default strings, partial_date",
|
||||
pd.get_date(2004), date(2004,Feb,29));
|
||||
iss.str("second Mon of Mar");
|
||||
iss >> nkd;
|
||||
check("Default strings, nth_day_of_the_week_in_month",
|
||||
nkd.get_date(2004) == date(2004,Mar,8));
|
||||
check_equal("Default strings, nth_day_of_the_week_in_month",
|
||||
nkd.get_date(2004), date(2004,Mar,8));
|
||||
iss.str("first Tue of Apr");
|
||||
iss >> fkd;
|
||||
check("Default strings, first_day_of_the_week_in_month",
|
||||
fkd.get_date(2004) == date(2004,Apr,6));
|
||||
iss >> fkd;
|
||||
check_equal("Default strings, first_day_of_the_week_in_month",
|
||||
fkd.get_date(2004), date(2004,Apr,6));
|
||||
iss.str("last Wed of May");
|
||||
iss >> lkd;
|
||||
check("Default strings, last_day_of_the_week_in_month",
|
||||
lkd.get_date(2004) == date(2004,May,26));
|
||||
iss >> lkd;
|
||||
check_equal("Default strings, last_day_of_the_week_in_month",
|
||||
lkd.get_date(2004), date(2004,May,26));
|
||||
iss.str("Thu before");
|
||||
iss >> fkb;
|
||||
check("Default strings, first_day_of_the_week_before",
|
||||
fkb.get_date(date(2004,Feb,8)) == date(2004,Feb,5));
|
||||
iss >> fkb;
|
||||
check_equal("Default strings, first_day_of_the_week_before",
|
||||
fkb.get_date(date(2004,Feb,8)), date(2004,Feb,5));
|
||||
iss.str("Fri after");
|
||||
iss >> fka;
|
||||
check("Default strings, first_day_of_the_week_after",
|
||||
fka.get_date(date(2004,Feb,1)) == date(2004,Feb,6));
|
||||
iss >> fka;
|
||||
check_equal("Default strings, first_day_of_the_week_after",
|
||||
fka.get_date(date(2004,Feb,1)), date(2004,Feb,6));
|
||||
// failure tests
|
||||
check("Incorrect elements (date_generator) w/exceptions", // after/before type mixup
|
||||
failure_test(fkb, "Fri after", e_failure, new date_input_facet()));
|
||||
@@ -337,73 +337,73 @@ int main(){
|
||||
failure_test(lkd, "first Tue of Apr", e_failure, new date_input_facet()));
|
||||
check("Incorrect elements (date_generator) no exceptions", // first/last type mixup
|
||||
failure_test(lkd, "first Tue of Apr", new date_input_facet()));
|
||||
check("Incorrect elements (date_generator) w/exceptions", // 'in' is wrong
|
||||
check("Incorrect elements (date_generator) w/exceptions", // 'in' is wrong
|
||||
failure_test(nkd, "second Mon in Mar", e_failure, new date_input_facet()));
|
||||
check("Incorrect elements (date_generator) no exceptions", // 'in' is wrong
|
||||
check("Incorrect elements (date_generator) no exceptions", // 'in' is wrong
|
||||
failure_test(nkd, "second Mon in Mar", new date_input_facet()));
|
||||
|
||||
// date_generators - custom element strings
|
||||
facet->date_gen_element_strings("1st","2nd","3rd","4th","5th","final","prior to","past","in");
|
||||
iss.str("3rd Sat in Jul");
|
||||
iss >> nkd;
|
||||
check("Custom strings, nth_day_of_the_week_in_month",
|
||||
nkd.get_date(2004) == date(2004,Jul,17));
|
||||
check_equal("Custom strings, nth_day_of_the_week_in_month",
|
||||
nkd.get_date(2004), date(2004,Jul,17));
|
||||
iss.str("1st Wed in May");
|
||||
iss >> fkd;
|
||||
check("Custom strings, first_day_of_the_week_in_month",
|
||||
fkd.get_date(2004) == date(2004,May,5));
|
||||
iss >> fkd;
|
||||
check_equal("Custom strings, first_day_of_the_week_in_month",
|
||||
fkd.get_date(2004), date(2004,May,5));
|
||||
iss.str("final Tue in Apr");
|
||||
iss >> lkd;
|
||||
check("Custom strings, last_day_of_the_week_in_month",
|
||||
lkd.get_date(2004) == date(2004,Apr,27));
|
||||
iss >> lkd;
|
||||
check_equal("Custom strings, last_day_of_the_week_in_month",
|
||||
lkd.get_date(2004), date(2004,Apr,27));
|
||||
iss.str("Fri prior to");
|
||||
iss >> fkb;
|
||||
check("Custom strings, first_day_of_the_week_before",
|
||||
fkb.get_date(date(2004,Feb,8)) == date(2004,Feb,6));
|
||||
iss >> fkb;
|
||||
check_equal("Custom strings, first_day_of_the_week_before",
|
||||
fkb.get_date(date(2004,Feb,8)), date(2004,Feb,6));
|
||||
iss.str("Thu past");
|
||||
iss >> fka;
|
||||
check("Custom strings, first_day_of_the_week_after",
|
||||
fka.get_date(date(2004,Feb,1)) == date(2004,Feb,5));
|
||||
iss >> fka;
|
||||
check_equal("Custom strings, first_day_of_the_week_after",
|
||||
fka.get_date(date(2004,Feb,1)), date(2004,Feb,5));
|
||||
|
||||
// date_generators - special case with empty element string
|
||||
/* Doesn't work. Empty string returns -1 from string_parse_tree
|
||||
* because it attempts to match the next set of characters in the
|
||||
* stream to the wrong element. Ex. It attempts to match "Mar" to
|
||||
* the 'of' element in the test below.
|
||||
*
|
||||
*
|
||||
facet->date_gen_element_strings("1st","2nd","3rd","4th","5th","final","prior to","past",""); // the 'of' string is an empty string
|
||||
iss.str("final Mon Mar");
|
||||
iss >> lkd;
|
||||
check("Special case, empty element string",
|
||||
lkd.get_date(2005) == date(2005,Mar,28));
|
||||
iss >> lkd;
|
||||
check_equal("Special case, empty element string",
|
||||
lkd.get_date(2005), date(2005,Mar,28));
|
||||
*/
|
||||
|
||||
|
||||
|
||||
// special values tests (date and days only)
|
||||
iss.str("minimum-date-time +infinity");
|
||||
iss >> d;
|
||||
iss >> dd;
|
||||
check("Special values, default strings, min_date_time date",
|
||||
d == date(min_date_time));
|
||||
check("Special values, default strings, pos_infin days",
|
||||
dd == days(pos_infin));
|
||||
check_equal("Special values, default strings, min_date_time date",
|
||||
d, date(min_date_time));
|
||||
check_equal("Special values, default strings, pos_infin days",
|
||||
dd, days(pos_infin));
|
||||
iss.str("-infinity maximum-date-time");
|
||||
iss >> d;
|
||||
iss >> dd;
|
||||
check("Special values, default strings, neg_infin date",
|
||||
d == date(neg_infin));
|
||||
check("Special values, default strings, max_date_time days",
|
||||
dd == days(max_date_time));
|
||||
check_equal("Special values, default strings, neg_infin date",
|
||||
d, date(neg_infin));
|
||||
check_equal("Special values, default strings, max_date_time days",
|
||||
dd, days(max_date_time));
|
||||
iss.str("not-a-date-time");
|
||||
iss >> d;
|
||||
check("Special values, default strings, not_a_date_time date",
|
||||
d == date(not_a_date_time));
|
||||
check_equal("Special values, default strings, not_a_date_time date",
|
||||
d, date(not_a_date_time));
|
||||
|
||||
// in addition check that special_value_from_string also works correctly for other special values
|
||||
check("Special values, default strings, not_special test",
|
||||
special_value_from_string("not_special") == not_special);
|
||||
check("Special values, default strings, junk test",
|
||||
special_value_from_string("junk") == not_special);
|
||||
check_equal("Special values, default strings, not_special test",
|
||||
special_value_from_string("not_special"), not_special);
|
||||
check_equal("Special values, default strings, junk test",
|
||||
special_value_from_string("junk"), not_special);
|
||||
|
||||
// special values custom, strings
|
||||
special_values_parser svp("NADT", "MINF", "INF", "MINDT", "MAXDT");
|
||||
@@ -411,33 +411,33 @@ int main(){
|
||||
iss.str("MINDT INF");
|
||||
iss >> d;
|
||||
iss >> dd;
|
||||
check("Special values, custom strings, min_date_time date",
|
||||
d == date(min_date_time));
|
||||
check("Special values, custom strings, pos_infin days",
|
||||
dd == days(pos_infin));
|
||||
check_equal("Special values, custom strings, min_date_time date",
|
||||
d, date(min_date_time));
|
||||
check_equal("Special values, custom strings, pos_infin days",
|
||||
dd, days(pos_infin));
|
||||
iss.str("MINF MAXDT");
|
||||
iss >> d;
|
||||
iss >> dd;
|
||||
check("Special values, custom strings, neg_infin date",
|
||||
d == date(neg_infin));
|
||||
check("Special values, custom strings, max_date_time days",
|
||||
dd == days(max_date_time));
|
||||
check_equal("Special values, custom strings, neg_infin date",
|
||||
d, date(neg_infin));
|
||||
check_equal("Special values, custom strings, max_date_time days",
|
||||
dd, days(max_date_time));
|
||||
iss.str("NADT");
|
||||
iss >> dd;
|
||||
check("Special values, custom strings, not_a_date_time days",
|
||||
dd == days(not_a_date_time));
|
||||
check_equal("Special values, custom strings, not_a_date_time days",
|
||||
dd, days(not_a_date_time));
|
||||
// failure test
|
||||
check("Misspelled input, special_value date w/exceptions",
|
||||
check("Misspelled input, special_value date w/exceptions",
|
||||
failure_test(d, "NSDT", e_bad_year, new date_input_facet()));
|
||||
check("Misspelled input, special_value date no exceptions",
|
||||
check("Misspelled input, special_value date no exceptions",
|
||||
failure_test(d, "NSDT", new date_input_facet()));
|
||||
check("Misspelled input, special_value days w/exceptions",
|
||||
check("Misspelled input, special_value days w/exceptions",
|
||||
failure_test(dd, "NSDT", e_failure, new date_input_facet()));
|
||||
check("Misspelled input, special_value days no exceptions",
|
||||
check("Misspelled input, special_value days no exceptions",
|
||||
failure_test(dd, "NSDT", new date_input_facet()));
|
||||
|
||||
{
|
||||
// German names. Please excuse any errors, I don't speak German and
|
||||
// German names. Please excuse any errors, I don't speak German and
|
||||
// had to rely on an on-line translation service.
|
||||
// These tests check one of each (at least) from all sets of custom strings
|
||||
|
||||
@@ -460,7 +460,7 @@ int main(){
|
||||
wkdays_abbrev.assign(w_a, w_a+7);
|
||||
wkdays_full.assign(w_f, w_f+7);
|
||||
date_parser d_parser("%B %d %Y",
|
||||
months_abbrev, months_full,
|
||||
months_abbrev, months_full,
|
||||
wkdays_abbrev, wkdays_full);
|
||||
|
||||
// create a special_values parser
|
||||
@@ -478,7 +478,7 @@ int main(){
|
||||
"Fünft","Letzt","Vor","Nach","Von");
|
||||
|
||||
// create the date_input_facet
|
||||
date_input_facet* de_facet =
|
||||
date_input_facet* de_facet =
|
||||
new date_input_facet("%B %d %Y",
|
||||
d_parser,
|
||||
sv_parser,
|
||||
@@ -490,25 +490,25 @@ int main(){
|
||||
iss.str("Juni 06 2005 Dez Wenigstes Datum Die");
|
||||
iss >> d;
|
||||
iss >> m;
|
||||
check("German names: date", d == date(2005, Jun, 6));
|
||||
check("German names: month", m == greg_month(Dec));
|
||||
check_equal("German names: date", d, date(2005, Jun, 6));
|
||||
check_equal("German names: month", m, greg_month(Dec));
|
||||
iss >> d;
|
||||
iss >> gw;
|
||||
check("German names: special value date", d == date(min_date_time));
|
||||
check("German names: short weekday", gw == greg_weekday(Tuesday));
|
||||
check_equal("German names: special value date", d, date(min_date_time));
|
||||
check_equal("German names: short weekday", gw, greg_weekday(Tuesday));
|
||||
de_facet->weekday_format("%A"); // long weekday
|
||||
// Tuesday, Second Tuesday of Mar
|
||||
iss.str("Dienstag Zweitens Dienstag von Mar");
|
||||
iss >> gw;
|
||||
iss >> nkd;
|
||||
check("German names: long weekday", gw == greg_weekday(Tuesday));
|
||||
check("German names, nth_day_of_the_week_in_month",
|
||||
nkd.get_date(2005) == date(2005,Mar,8));
|
||||
check_equal("German names: long weekday", gw, greg_weekday(Tuesday));
|
||||
check_equal("German names, nth_day_of_the_week_in_month",
|
||||
nkd.get_date(2005), date(2005,Mar,8));
|
||||
// Tuesday after
|
||||
iss.str("Dienstag Nach");
|
||||
iss >> fka;
|
||||
check("German names, first_day_of_the_week_after",
|
||||
fka.get_date(date(2005,Apr,5)) == date(2005,Apr,12));
|
||||
iss >> fka;
|
||||
check_equal("German names, first_day_of_the_week_after",
|
||||
fka.get_date(date(2005,Apr,5)), date(2005,Apr,12));
|
||||
}
|
||||
|
||||
{
|
||||
@@ -525,25 +525,25 @@ int main(){
|
||||
"**October**","**November**","**December**"};
|
||||
const char* const weekday_short_names[]={"day1", "day2","day3","day4",
|
||||
"day5","day6","day7"};
|
||||
const char* const weekday_long_names[]= {"Sun-0", "Mon-1", "Tue-2",
|
||||
"Wed-3", "Thu-4",
|
||||
const char* const weekday_long_names[]= {"Sun-0", "Mon-1", "Tue-2",
|
||||
"Wed-3", "Thu-4",
|
||||
"Fri-5", "Sat-6"};
|
||||
|
||||
std::vector<std::basic_string<char> > short_weekday_names;
|
||||
std::vector<std::basic_string<char> > long_weekday_names;
|
||||
std::vector<std::basic_string<char> > short_month_names;
|
||||
std::vector<std::basic_string<char> > long_month_names;
|
||||
|
||||
std::copy(&weekday_short_names[0],
|
||||
|
||||
std::copy(&weekday_short_names[0],
|
||||
&weekday_short_names[7],
|
||||
std::back_inserter(short_weekday_names));
|
||||
std::copy(&weekday_long_names[0],
|
||||
std::copy(&weekday_long_names[0],
|
||||
&weekday_long_names[7],
|
||||
std::back_inserter(long_weekday_names));
|
||||
std::copy(&month_short_names[0],
|
||||
std::copy(&month_short_names[0],
|
||||
&month_short_names[12],
|
||||
std::back_inserter(short_month_names));
|
||||
std::copy(&month_long_names[0],
|
||||
std::copy(&month_long_names[0],
|
||||
&month_long_names[12],
|
||||
std::back_inserter(long_month_names));
|
||||
|
||||
@@ -558,20 +558,20 @@ int main(){
|
||||
facet->format("%a %b %d, %Y");
|
||||
ss.str("day7 *apr* 23, 2005");
|
||||
ss >> d;
|
||||
check("Short custom names, set via accessor function", d.day_of_week() == greg_weekday(6));
|
||||
check("Short custom names, set via accessor function", d.month() == greg_month(4));
|
||||
check_equal("Short custom names, set via accessor function", d.day_of_week(), greg_weekday(6));
|
||||
check_equal("Short custom names, set via accessor function", d.month(), greg_month(4));
|
||||
ss.str("");
|
||||
ss.str("Sun-0 **April** 24, 2005");
|
||||
facet->format("%A %B %d, %Y");
|
||||
ss >> d;
|
||||
check("Long custom names, set via accessor function", d.day_of_week() == greg_weekday(0));
|
||||
check("Long custom names, set via accessor function", d.month() == greg_month(4));
|
||||
check_equal("Long custom names, set via accessor function", d.day_of_week(), greg_weekday(0));
|
||||
check_equal("Long custom names, set via accessor function", d.month(), greg_month(4));
|
||||
|
||||
}
|
||||
#else
|
||||
check("This test is a nop for platforms with USE_DATE_TIME_PRE_1_33_FACET_IO",
|
||||
check("This test is a nop for platforms with USE_DATE_TIME_PRE_1_33_FACET_IO",
|
||||
true);
|
||||
#endif
|
||||
return printTestStats();
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user