From 3e9ced74c4e5d20a1286d7400c3910fdaa2d2229 Mon Sep 17 00:00:00 2001 From: Sergey Magidovich Date: Fri, 11 Dec 2015 14:54:27 +0300 Subject: [PATCH] Fix extended hours detection. --- 3party/opening_hours/opening_hours.cpp | 2 +- .../opening_hours/opening_hours_tests/opening_hours_tests.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/3party/opening_hours/opening_hours.cpp b/3party/opening_hours/opening_hours.cpp index 49df936255..342a339153 100644 --- a/3party/opening_hours/opening_hours.cpp +++ b/3party/opening_hours/opening_hours.cpp @@ -299,7 +299,7 @@ bool Timespan::HasExtendedHours() const if (endHM.IsExtended()) return true; - return endHM.GetDurationCount() != 0 && (endHM.GetDuration() < startHM.GetDuration()); + return endHM.GetDuration() <= startHM.GetDuration(); } std::ostream & operator<<(std::ostream & ost, Timespan const & span) diff --git a/3party/opening_hours/opening_hours_tests/opening_hours_tests.cpp b/3party/opening_hours/opening_hours_tests/opening_hours_tests.cpp index e77f944131..d86ff88e91 100644 --- a/3party/opening_hours/opening_hours_tests/opening_hours_tests.cpp +++ b/3party/opening_hours/opening_hours_tests/opening_hours_tests.cpp @@ -312,7 +312,7 @@ BOOST_AUTO_TEST_CASE(OpeningHours_TestTimespan) span.SetStart(HourMinutes(10_h)); span.SetEnd(HourMinutes(00_h)); - BOOST_CHECK(!span.HasExtendedHours()); + BOOST_CHECK(span.HasExtendedHours()); BOOST_CHECK_EQUAL(ToString(span), "10:00-00:00"); }