From 6919bfcb39c4df829edc82dcd30968a4aca3fbee Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 30 Dec 2022 18:12:33 +0100 Subject: Change the behaviour of LocalTime::operator== to make the same time in different time zones equal. Previously different offsets would mean that the times compared as not-equal. --- test/local_time_test.cc | 3 +++ 1 file changed, 3 insertions(+) (limited to 'test/local_time_test.cc') diff --git a/test/local_time_test.cc b/test/local_time_test.cc index 72390862..63083947 100644 --- a/test/local_time_test.cc +++ b/test/local_time_test.cc @@ -250,4 +250,7 @@ BOOST_AUTO_TEST_CASE(local_time_comparison_test) BOOST_CHECK(dcp::LocalTime("2014-10-10T10:00:01+01:00") > dcp::LocalTime("2014-10-10T10:00:00+01:00")); BOOST_CHECK(dcp::LocalTime("2014-01-01T10:00:00") != dcp::LocalTime("2014-01-01T10:05:00")); + BOOST_CHECK(dcp::LocalTime("2014-01-01T10:00:00") == dcp::LocalTime("2014-01-01T10:00:00")); + BOOST_CHECK(dcp::LocalTime("2014-01-01T10:00:00+02:00") == dcp::LocalTime("2014-01-01T08:00:00")); + BOOST_CHECK(dcp::LocalTime("2014-01-01T10:00:00+02:00") == dcp::LocalTime("2014-01-01T11:00:00+03:00")); } -- cgit v1.2.3