mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-24 12:23:32 +01:00
Fix various GCC LTO warnings in the unit tests.
This commit is contained in:
parent
7c8f20ba44
commit
6925b61cfd
@ -534,6 +534,7 @@ test_load_keys_with_client_auth(void *arg)
|
||||
tt_int_op(get_hs_service_map_size(), OP_EQ, 1);
|
||||
|
||||
service = get_first_service();
|
||||
tt_assert(service);
|
||||
tt_assert(service->config.clients);
|
||||
tt_int_op(smartlist_len(service->config.clients), OP_EQ,
|
||||
smartlist_len(pubkey_b32_list));
|
||||
|
@ -1496,6 +1496,7 @@ NS(test_main)(void *arg)
|
||||
int r;
|
||||
(void)arg;
|
||||
|
||||
memset(&NS(mock_node), 0, sizeof(NS(mock_node)));
|
||||
NS(mock_node).ri = NULL;
|
||||
NS(mock_node).rs = NULL;
|
||||
|
||||
@ -1529,6 +1530,7 @@ NS(test_main)(void *arg)
|
||||
|
||||
strncpy(rs.nickname, nickname, sizeof(rs.nickname) - 1);
|
||||
rs.nickname[sizeof(rs.nickname) - 1] = '\0';
|
||||
memset(&NS(mock_node), 0, sizeof(NS(mock_node)));
|
||||
NS(mock_node).ri = NULL;
|
||||
NS(mock_node).rs = &rs;
|
||||
|
||||
@ -1560,6 +1562,7 @@ NS(test_main)(void *arg)
|
||||
strmap_set_lc(set->names, nickname, (void *)1);
|
||||
|
||||
ri.nickname = (char *)nickname;
|
||||
memset(&mock_node, 0, sizeof(mock_node));
|
||||
mock_node.ri = &ri;
|
||||
mock_node.rs = NULL;
|
||||
|
||||
|
@ -283,7 +283,7 @@ test_storagedir_save_labeled(void *arg)
|
||||
int r = storage_dir_save_labeled_to_file(d, labels, inp, 8192, &fname);
|
||||
tt_int_op(r, OP_EQ, 0);
|
||||
|
||||
size_t n;
|
||||
size_t n = 0;
|
||||
saved = storage_dir_read(d, fname, 1, &n);
|
||||
tt_assert(memchr(saved, '\0', n));
|
||||
tt_str_op((char*)saved, OP_EQ, expected); /* NUL guarantees strcmp works */
|
||||
|
@ -238,6 +238,7 @@ test_tortls_x509_cert_get_id_digests(void *ignored)
|
||||
cert->pkey_digests_set = 1;
|
||||
cert->pkey_digests = *d;
|
||||
res = tor_x509_cert_get_id_digests(cert);
|
||||
tt_assert(res);
|
||||
tt_int_op(res->d[0][0], OP_EQ, 42);
|
||||
|
||||
done:
|
||||
|
Loading…
Reference in New Issue
Block a user