When handling negative times (double value) the fractional part (i.e. nanoseconds) is subtracted from the seconds to make the nanoseconds positive. However the subtraction happened on a temporary value, not the result struct leading to off-by-one errors
Also add some more tests to fully cover date_time.cpp (which led to the discovery of the above bug),
especially the date_time constructors taking a calendar and the handling of the "active" time-zone were not sufficiently tested
When handling negative times (
double
value) the fractional part (i.e. nanoseconds) is subtracted from the seconds to make the nanoseconds positive. However the subtraction happened on a temporary value, not the result struct leading to off-by-one errorsAlso add some more tests to fully cover
date_time.cpp
(which led to the discovery of the above bug), especially thedate_time
constructors taking acalendar
and the handling of the "active" time-zone were not sufficiently tested