aboutsummaryrefslogtreecommitdiff
path: root/src/test/test_dir.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-04-21 14:31:35 -0400
committerNick Mathewson <nickm@torproject.org>2017-04-21 14:31:35 -0400
commitc300fd7e65b699c3d2704737cd0c73276ca0a346 (patch)
tree54786454ba7ab18c690b4f40b29b904a5189dfac /src/test/test_dir.c
parenta55bd00b0f41afca767a57e2da4a3dc6a26d2110 (diff)
downloadtor-c300fd7e65b699c3d2704737cd0c73276ca0a346.tar.gz
tor-c300fd7e65b699c3d2704737cd0c73276ca0a346.zip
Have directory_get_from_all_authorities use requests.
Diffstat (limited to 'src/test/test_dir.c')
-rw-r--r--src/test/test_dir.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/test/test_dir.c b/src/test/test_dir.c
index e0c92a74c5..048b714b63 100644
--- a/src/test/test_dir.c
+++ b/src/test/test_dir.c
@@ -4541,6 +4541,8 @@ directory_initiate_command_routerstatus, (const routerstatus_t *status,
size_t payload_len,
time_t if_modified_since,
circuit_guard_state_t *guardstate));
+NS_DECL(void,
+directory_initiate_request, (directory_request_t *req));
static void
test_dir_should_not_init_request_to_ourselves(void *data)
@@ -4616,7 +4618,7 @@ test_dir_should_init_request_to_dir_auths(void *data)
dir_server_t *ds = NULL;
(void) data;
- NS_MOCK(directory_initiate_command_routerstatus);
+ NS_MOCK(directory_initiate_request);
clear_dir_servers();
routerlist_free_all();
@@ -4627,11 +4629,11 @@ test_dir_should_init_request_to_dir_auths(void *data)
dir_server_add(ds);
directory_get_from_all_authorities(DIR_PURPOSE_FETCH_STATUS_VOTE, 0, NULL);
- tt_int_op(CALLED(directory_initiate_command_routerstatus), OP_EQ, 1);
+ tt_int_op(CALLED(directory_initiate_request), OP_EQ, 1);
directory_get_from_all_authorities(DIR_PURPOSE_FETCH_DETACHED_SIGNATURES, 0,
NULL);
- tt_int_op(CALLED(directory_initiate_command_routerstatus), OP_EQ, 2);
+ tt_int_op(CALLED(directory_initiate_request), OP_EQ, 2);
done:
NS_UNMOCK(directory_initiate_command_routerstatus);
@@ -4662,6 +4664,13 @@ NS(directory_initiate_command_routerstatus)(const routerstatus_t *status,
CALLED(directory_initiate_command_routerstatus)++;
}
+void
+NS(directory_initiate_request)(directory_request_t *req)
+{
+ (void)req;
+ CALLED(directory_initiate_request)++;
+}
+
static void
test_dir_choose_compression_level(void* data)
{