From 2cbb73d1518f4411261dc2a1fa9c72485c032aaa Mon Sep 17 00:00:00 2001 From: Jeff Garland Date: Fri, 2 Mar 2007 05:19:06 +0000 Subject: [PATCH] SF tracker 1672139 - fix end time in au_dst_traits to 3 hours instead of 2 [SVN r37130] --- .../boost/date_time/local_timezone_defs.hpp | 2 +- test/posix_time/testdst_rules.cpp | 36 +++++++++---------- xmldoc/changes.xml | 7 ++++ 3 files changed, 26 insertions(+), 19 deletions(-) diff --git a/include/boost/date_time/local_timezone_defs.hpp b/include/boost/date_time/local_timezone_defs.hpp index aba985e..7675252 100644 --- a/include/boost/date_time/local_timezone_defs.hpp +++ b/include/boost/date_time/local_timezone_defs.hpp @@ -166,7 +166,7 @@ namespace boost { static day_of_week_type end_day(year_type) {return Sunday;} static month_type end_month(year_type) {return Mar;} static int dst_start_offset_minutes() { return 120;} - static int dst_end_offset_minutes() { return 120; } + static int dst_end_offset_minutes() { return 180; } static int dst_shift_length_minutes() { return 60; } static date_type local_dst_start_day(year_type year) { diff --git a/test/posix_time/testdst_rules.cpp b/test/posix_time/testdst_rules.cpp index baf7bd0..7ec7423 100644 --- a/test/posix_time/testdst_rules.cpp +++ b/test/posix_time/testdst_rules.cpp @@ -120,7 +120,7 @@ main() boost::date_time::time_is_dst_result a1 = dstcalc::local_is_dst(date(2002,May,1),hours(3), dst_start2, 120, - dst_end2, 120, + dst_end2, 180, 60); check("check southern not dst", a1==boost::date_time::is_not_in_dst); @@ -128,7 +128,7 @@ main() boost::date_time::time_is_dst_result a2 = dstcalc::local_is_dst(date(2002,Jan,1),hours(3), dst_start2, 120, - dst_end2, 120, + dst_end2, 180, 60); check("check southern is dst", a2==boost::date_time::is_in_dst); @@ -136,50 +136,50 @@ main() boost::date_time::time_is_dst_result a3 = dstcalc::local_is_dst(date(2002,Oct,28),hours(3), dst_start2, 120, - dst_end2, 120, + dst_end2, 180, 60); check("check southern is dst", a3==boost::date_time::is_in_dst); boost::date_time::time_is_dst_result a4 = dstcalc::local_is_dst(date(2002,Oct,27),time_duration(1,59,59), dst_start2, 120, - dst_end2, 120, + dst_end2, 180, 60); check("check southern boundary-not dst", a4==boost::date_time::is_not_in_dst); boost::date_time::time_is_dst_result a5 = dstcalc::local_is_dst(date(2002,Oct,27),hours(3), dst_start2, 120, - dst_end2, 120, + dst_end2, 180, 60); check("check southern boundary-is dst", a5==boost::date_time::is_in_dst); boost::date_time::time_is_dst_result a6 = dstcalc::local_is_dst(date(2002,Oct,27),hours(2), dst_start2, 120, - dst_end2, 120, + dst_end2, 180, 60); check("check southern boundary-invalid time", a6==boost::date_time::invalid_time_label); boost::date_time::time_is_dst_result a7 = - dstcalc::local_is_dst(date(2002,Mar,31),time_duration(0,59,59), + dstcalc::local_is_dst(date(2002,Mar,31),time_duration(1,59,59), dst_start2, 120, - dst_end2, 120, + dst_end2, 180, 60); check("check southern boundary-is dst", a7==boost::date_time::is_in_dst); boost::date_time::time_is_dst_result a8 = - dstcalc::local_is_dst(date(2002,Mar,31),time_duration(1,0,0), + dstcalc::local_is_dst(date(2002,Mar,31),time_duration(2,0,0), dst_start2, 120, - dst_end2, 120, + dst_end2, 180, 60); check("check southern boundary-ambiguous", a8==boost::date_time::ambiguous); boost::date_time::time_is_dst_result a9 = - dstcalc::local_is_dst(date(2002,Mar,31),time_duration(1,59,59), + dstcalc::local_is_dst(date(2002,Mar,31),time_duration(2,59,59), dst_start2, 120, - dst_end2, 120, + dst_end2, 180, 60); check("check southern boundary-ambiguous", a9==boost::date_time::ambiguous); boost::date_time::time_is_dst_result a10 = - dstcalc::local_is_dst(date(2002,Mar,31),time_duration(2,0,0), + dstcalc::local_is_dst(date(2002,Mar,31),time_duration(3,0,0), dst_start2, 120, - dst_end2, 120, + dst_end2, 180, 60); check("check southern boundary-not", a10==boost::date_time::is_not_in_dst); @@ -406,10 +406,10 @@ main() ptime acst_invalid2(acst_dst_start, time_duration(2,59,59)); //invalid time label ptime acst_notdst1(acst_dst_start, time_duration(1,59,59)); //not ds ptime acst_isdst1(acst_dst_start, time_duration(3,0,0)); //always dst - ptime acst_isdst2(acst_dst_end, time_duration(0,59,59)); //is dst - ptime acst_amgbig1(acst_dst_end, time_duration(1,0,0)); //ambiguous - ptime acst_amgbig2(acst_dst_end, time_duration(1,59,59)); //ambiguous - ptime acst_notdst2(acst_dst_end, time_duration(2,0,0)); //always not dst + ptime acst_isdst2(acst_dst_end, time_duration(1,59,59)); //is dst + ptime acst_amgbig1(acst_dst_end, time_duration(2,0,0)); //ambiguous + ptime acst_amgbig2(acst_dst_end, time_duration(2,59,59)); //ambiguous + ptime acst_notdst2(acst_dst_end, time_duration(3,0,0)); //always not dst // std::cout << "acst dst_start: " << acst_dst_calc::local_dst_start_day(2002) // << std::endl; diff --git a/xmldoc/changes.xml b/xmldoc/changes.xml index 54c89aa..46ad7e6 100644 --- a/xmldoc/changes.xml +++ b/xmldoc/changes.xml @@ -53,6 +53,13 @@ + + Bug Fix + Fix DST traits for Austrialia (sf# 1672139) to set end of DST at 3:00 am instead of 2:00 am. + + + + Bug Fix Fix a problem with potential linking error with multiple definitions due