From c300fd7e65b699c3d2704737cd0c73276ca0a346 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Fri, 21 Apr 2017 14:31:35 -0400 Subject: Have directory_get_from_all_authorities use requests. --- src/test/test_dir.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'src/test/test_dir.c') 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) { -- cgit v1.2.3-54-g00ecf