summaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
authorteor (Tim Wilson-Brown) <teor2345@gmail.com>2016-05-18 21:31:03 -0400
committerNick Mathewson <nickm@torproject.org>2016-05-19 07:58:41 -0400
commitd5c70d71027644efb31d16d17b46d43484b46b18 (patch)
tree31b16bbf1e323f5c82cd2117c013501edeed4aa3 /src/or
parent4254d0297c53155d582a51976b8e5bb41abfced6 (diff)
downloadtor-d5c70d71027644efb31d16d17b46d43484b46b18.tar.gz
tor-d5c70d71027644efb31d16d17b46d43484b46b18.zip
Restore and improve download schedule unit tests
Diffstat (limited to 'src/or')
-rw-r--r--src/or/networkstatus.c8
-rw-r--r--src/or/networkstatus.h6
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