aboutsummaryrefslogtreecommitdiff
path: root/src/or/voting_schedule.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-05-06 20:42:18 -0400
committerNick Mathewson <nickm@torproject.org>2018-05-06 20:42:18 -0400
commitd14c245a0f3733fa6b33d3c7c44fc7fe0bfc302e (patch)
tree22ec019ac0043d6e004404af728037d033dbe7d5 /src/or/voting_schedule.c
parentf36656cada48a2d9f51c857d8477a8060cb89b9d (diff)
downloadtor-d14c245a0f3733fa6b33d3c7c44fc7fe0bfc302e.tar.gz
tor-d14c245a0f3733fa6b33d3c7c44fc7fe0bfc302e.zip
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.
Diffstat (limited to 'src/or/voting_schedule.c')
-rw-r--r--src/or/voting_schedule.c2
1 files changed, 2 insertions, 0 deletions
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);