From d14c245a0f3733fa6b33d3c7c44fc7fe0bfc302e Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Sun, 6 May 2018 20:42:18 -0400 Subject: Add unit test for ..get_start_of_next_voting_interval(). This functionality was covered only accidentally by our voting-test code, and as such wasn't actually tested at all. The tests that called it made its coverage nondeterministic, depending on what time of day you ran the tests. Closes ticket 26014. --- src/or/voting_schedule.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/or') diff --git a/src/or/voting_schedule.c b/src/or/voting_schedule.c index b7676d5e79..1d66b5e225 100644 --- a/src/or/voting_schedule.c +++ b/src/or/voting_schedule.c @@ -39,7 +39,9 @@ voting_schedule_get_start_of_next_interval(time_t now, int interval, tm.tm_sec = 0; if (tor_timegm(&tm, &midnight_today) < 0) { + // LCOV_EXCL_START log_warn(LD_BUG, "Ran into an invalid time when trying to find midnight."); + // LCOV_EXCL_STOP } midnight_tomorrow = midnight_today + (24*60*60); -- cgit v1.2.3-54-g00ecf