diff options
author | Sergey Magidovich <mgsergio@mapswithme.com> | 2015-12-11 14:54:27 +0300 |
---|---|---|
committer | Sergey Yershov <yershov@corp.mail.ru> | 2016-03-23 16:03:52 +0300 |
commit | 3e9ced74c4e5d20a1286d7400c3910fdaa2d2229 (patch) | |
tree | 8dc7e1eb7d620dce2616306d5edc90296e2b30cb /3party | |
parent | 9dfa0e5e286c789d5c19316ae26ee76d15d2efb1 (diff) |
Fix extended hours detection.
Diffstat (limited to '3party')
-rw-r--r-- | 3party/opening_hours/opening_hours.cpp | 2 | ||||
-rw-r--r-- | 3party/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"); } |