Skip to content

Commit 733eaa0

Browse files
committed
few new things
1 parent 0cd11d9 commit 733eaa0

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

test/unit_tests/datetime_diff.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,13 +107,16 @@ int main() {
107107
intrvl.unsigned_total_sec(); /* total nsec in interval */
108108
const auto rndd = d1 + intrvl;
109109

110-
assert(std::abs(rndd.diff<DateTimeDifferenceType::FractionalDays>(d1) -
111-
to_fractional_days(isec) * intrvl.sign()) <=
112-
FDAY_PRECISION);
110+
assert(
111+
std::abs(
112+
rndd.diff<DateTimeDifferenceType::FractionalDays>(d1).seconds() -
113+
to_fractional_days(isec).seconds() * intrvl.sign()) <=
114+
FDAY_PRECISION);
113115

114116
/* better than nsec precision */
115-
assert(std::abs(rndd.diff<DateTimeDifferenceType::FractionalSeconds>(d1) -
116-
to_fractional_seconds(isec) * intrvl.sign()) <
117+
assert(std::abs(rndd.diff<DateTimeDifferenceType::FractionalSeconds>(d1)
118+
.seconds() -
119+
to_fractional_seconds(isec).seconds() * intrvl.sign()) <
117120
SEC_PRECISION);
118121

119122
++testnr;

0 commit comments

Comments
 (0)