static int
NS(hid_serv_responsible_for_desc_id)(const char *id)
{
+ (void)id;
return hid_serv_responsible_for_desc_id_response;
}
/* SETUP */
init_mock_options();
mock_options->BridgeAuthoritativeDir = 1;
- mock_options->BridgePassword_AuthDigest_ = "digest";
+ mock_options->BridgePassword_AuthDigest_ = tor_strdup("digest");
conn = dir_connection_new(tor_addr_family(&MOCK_TOR_ADDR));
TO_CONN(conn)->linked = 1;
mock_routerinfo->cache_info.send_unencrypted = 1;
/* Setup descriptor */
- int annotation_len = strstr(TEST_DESCRIPTOR, "router ") - TEST_DESCRIPTOR;
- mock_routerinfo->cache_info.signed_descriptor_body = TEST_DESCRIPTOR;
+ long annotation_len = strstr(TEST_DESCRIPTOR, "router ") - TEST_DESCRIPTOR;
+ mock_routerinfo->cache_info.signed_descriptor_body =
+ tor_strdup(TEST_DESCRIPTOR);
mock_routerinfo->cache_info.signed_descriptor_len = strlen(TEST_DESCRIPTOR);
mock_routerinfo->cache_info.annotations_len = annotation_len;
mock_routerinfo->cache_info.send_unencrypted = 1;
/* Setup descriptor */
- int annotation_len = strstr(TEST_DESCRIPTOR, "router ") - TEST_DESCRIPTOR;
- mock_routerinfo->cache_info.signed_descriptor_body = TEST_DESCRIPTOR;
+ long annotation_len = strstr(TEST_DESCRIPTOR, "router ") - TEST_DESCRIPTOR;
+ mock_routerinfo->cache_info.signed_descriptor_body =
+ tor_strdup(TEST_DESCRIPTOR);
mock_routerinfo->cache_info.signed_descriptor_len = strlen(TEST_DESCRIPTOR);
mock_routerinfo->cache_info.annotations_len = annotation_len;
int
NS(geoip_get_country_by_addr)(const tor_addr_t *addr)
{
+ (void)addr;
CALLED(geoip_get_country_by_addr)++;
return 1;
}
tt_str_op("ab", OP_EQ, geoip_get_country_name(1));
conn = dir_connection_new(tor_addr_family(&MOCK_TOR_ADDR));
- TO_CONN(conn)->address = "127.0.0.1";
+ TO_CONN(conn)->address = tor_strdup("127.0.0.1");
tt_int_op(0, OP_EQ, directory_handle_command_get(conn,
GET("/tor/status-vote/current/consensus-ns"), NULL, 0));
const char*
NS(dirvote_get_pending_consensus)(consensus_flavor_t flav)
{
+ (void)flav;
return "pending consensus";
}