Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/src/feature/dirauth/clipboard.c b/src/feature/dirauth/clipboard.c
- new file mode 100644
- index 000000000..e69de29bb
- diff --git a/src/feature/dirauth/dirvote.c b/src/feature/dirauth/dirvote.c
- index 274c794e0..d7027cd43 100644
- --- a/src/feature/dirauth/dirvote.c
- +++ b/src/feature/dirauth/dirvote.c
- @@ -4158,7 +4158,7 @@ dirserv_get_bandwidth_for_router_kb(const routerinfo_t *ri)
- * non-authority; a running router is more useful than a non-running router;
- * and a router with more bandwidth is more useful than one with less.)
- **/
- -static int
- +STATIC int
- compare_routerinfo_by_ip_and_bw_(const void **a, const void **b)
- {
- routerinfo_t *first = *(routerinfo_t **)a, *second = *(routerinfo_t **)b;
- @@ -4166,7 +4166,6 @@ compare_routerinfo_by_ip_and_bw_(const void **a, const void **b)
- uint32_t bw_kb_first, bw_kb_second;
- const node_t *node_first, *node_second;
- int first_is_running, second_is_running;
- - printf("%d\n", 4);
- tor_addr_t *first_ipv6 = &(first->ipv6_addr);
- tor_addr_t *second_ipv6 = &(second->ipv6_addr);
- sa_family_t first_family, second_family;
- diff --git a/src/feature/dirauth/dirvote.h b/src/feature/dirauth/dirvote.h
- index f695e93ab..a333774b5 100644
- --- a/src/feature/dirauth/dirvote.h
- +++ b/src/feature/dirauth/dirvote.h
- @@ -230,6 +230,8 @@ char *networkstatus_get_detached_signatures(smartlist_t *consensuses);
- STATIC microdesc_t *dirvote_create_microdescriptor(const routerinfo_t *ri,
- int consensus_method);
- +STATIC int
- +compare_routerinfo_by_ip_and_bw_(const void **a, const void **b);
- #endif /* defined(DIRVOTE_PRIVATE) */
- #endif /* !defined(TOR_DIRVOTE_H) */
- diff --git a/src/test/include.am b/src/test/include.am
- index 90e50752c..2faa5d324 100644
- --- a/src/test/include.am
- +++ b/src/test/include.am
- @@ -361,6 +361,7 @@ noinst_HEADERS+= \
- src/test/ptr_helpers.h \
- src/test/test_helpers.h \
- src/test/test_dir_common.h \
- + src/test/test_dirvote.c \
- src/test/test_connection.h \
- src/test/test_tortls.h \
- src/test/test_descriptors.inc \
- diff --git a/src/test/test.c b/src/test/test.c
- index 1742f1d95..0dbbfb49b 100644
- --- a/src/test/test.c
- +++ b/src/test/test.c
- @@ -700,6 +700,7 @@ struct testgroup_t testgroups[] = {
- { "dir/", dir_tests },
- { "dir/auth/process_descs/", process_descs_tests },
- { "dir/md/", microdesc_tests },
- + { "dirauth/dirvote", dirvote_tests},
- { "dir/voting/flags/", voting_flags_tests },
- { "dir/voting/schedule/", voting_schedule_tests },
- { "dir_handle_get/", dir_handle_get_tests },
- diff --git a/src/test/test.h b/src/test/test.h
- index 63e2faff9..e204bb283 100644
- --- a/src/test/test.h
- +++ b/src/test/test.h
- @@ -122,6 +122,7 @@ extern struct testcase_t crypto_rng_tests[];
- extern struct testcase_t crypto_tests[];
- extern struct testcase_t dir_handle_get_tests[];
- extern struct testcase_t dir_tests[];
- +extern struct testcase_t dirvote_tests[];
- extern struct testcase_t dispatch_tests[];
- extern struct testcase_t dns_tests[];
- extern struct testcase_t dos_tests[];
- diff --git a/src/test/test_dirvote.c b/src/test/test_dirvote.c
- new file mode 100644
- index 000000000..da6fcab89
- --- /dev/null
- +++ b/src/test/test_dirvote.c
- @@ -0,0 +1,17 @@
- +#define DIRVOTE_PRIVATE
- +
- +#include "feature/dirauth/dirvote.h"
- +static void
- +test_dirvote_compare_routerinfo_by_ip_and_bw_(void *arg)
- +{
- + compare_routerinfo_by_ip_and_bw(1,2);
- +}
- +
- +
- +#define DIRVOTE(name, flags) \
- + { #name, test_dirvote_##name, (flags), NULL, NULL}
- +
- +struct testcase_t dirvote_tests[] = {
- + DIRVOTE(compare_routerinfo_by_ip_and_bw, TT_FORK),
- + END_OF_TESTCASES
- +};
- ===================================================================================
- output of 'make' command
- ===================================================================================
- make all-am
- make[1]: Entering directory '/home/lulwat/Development/S5_project/tor'
- CCLD src/test/test
- Makefile:9761: recipe for target 'src/test/test' failed
- make[1]: Leaving directory '/home/lulwat/Development/S5_project/tor'
- Makefile:6091: recipe for target 'all' failed
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement