diff options
author | teor (Tim Wilson-Brown) <teor2345@gmail.com> | 2016-05-18 21:31:03 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2016-05-19 07:58:41 -0400 |
commit | d5c70d71027644efb31d16d17b46d43484b46b18 (patch) | |
tree | 31b16bbf1e323f5c82cd2117c013501edeed4aa3 /src/or | |
parent | 4254d0297c53155d582a51976b8e5bb41abfced6 (diff) | |
download | tor-d5c70d71027644efb31d16d17b46d43484b46b18.tar.gz tor-d5c70d71027644efb31d16d17b46d43484b46b18.zip |
Restore and improve download schedule unit tests
Diffstat (limited to 'src/or')
-rw-r--r-- | src/or/networkstatus.c | 8 | ||||
-rw-r--r-- | src/or/networkstatus.h | 6 |
2 files changed, 7 insertions, 7 deletions
diff --git a/src/or/networkstatus.c b/src/or/networkstatus.c index 5c9283004e..5fa7a857a8 100644 --- a/src/or/networkstatus.c +++ b/src/or/networkstatus.c @@ -1237,8 +1237,8 @@ networkstatus_get_reasonably_live_consensus(time_t now, int flavor) * If we have no consensus, or our consensus is unusably old, return 1. * As soon as we have received a consensus, return 0, even if we don't have * enough certificates to validate it. */ -int -networkstatus_consensus_is_bootstrapping(time_t now) +MOCK_IMPL(int, +networkstatus_consensus_is_bootstrapping,(time_t now)) { /* If we have a validated, reasonably live consensus, we're not * bootstrapping a consensus at all. */ @@ -1273,8 +1273,8 @@ networkstatus_consensus_can_use_multiple_directories( /** Check if we can use fallback directory mirrors for a consensus download. * If we have fallbacks and don't want to fetch from the authorities, * we can use them. */ -int -networkstatus_consensus_can_use_extra_fallbacks(const or_options_t *options) +MOCK_IMPL(int, +networkstatus_consensus_can_use_extra_fallbacks,(const or_options_t *options)) { /* The list length comparisons are a quick way to check if we have any * non-authority fallback directories. If we ever have any authorities that diff --git a/src/or/networkstatus.h b/src/or/networkstatus.h index 609fb85bcb..ac93e5de91 100644 --- a/src/or/networkstatus.h +++ b/src/or/networkstatus.h @@ -70,11 +70,11 @@ MOCK_DECL(networkstatus_t *,networkstatus_get_latest_consensus_by_flavor, networkstatus_t *networkstatus_get_live_consensus(time_t now); networkstatus_t *networkstatus_get_reasonably_live_consensus(time_t now, int flavor); -int networkstatus_consensus_is_bootstrapping(time_t now); +MOCK_DECL(int, networkstatus_consensus_is_bootstrapping,(time_t now)); int networkstatus_consensus_can_use_multiple_directories( const or_options_t *options); -int networkstatus_consensus_can_use_extra_fallbacks( - const or_options_t *options); +MOCK_DECL(int, networkstatus_consensus_can_use_extra_fallbacks,( + const or_options_t *options)); int networkstatus_consensus_is_already_downloading(const char *resource); #define NSSET_FROM_CACHE 1 |