summaryrefslogtreecommitdiff
path: root/src/test/test_hs_service.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-12-21 13:26:57 -0500
committerNick Mathewson <nickm@torproject.org>2017-12-21 13:26:57 -0500
commit713a71702201d80b95605a2af1392a7fb7ab0227 (patch)
tree16b7bac62481c20f666d7a1d7f10dcfeb234c803 /src/test/test_hs_service.c
parenteb00840ab88f07820397e00cdc2a62b87a0f52cd (diff)
downloadtor-713a71702201d80b95605a2af1392a7fb7ab0227.tar.gz
tor-713a71702201d80b95605a2af1392a7fb7ab0227.zip
scan-build: Replace some test-assertions with fatal assertions
Using tt_assert in these helpers was implying to scan-build that our 'new' functions might be returning NULL, which in turn would make it warn about null-pointer use.
Diffstat (limited to 'src/test/test_hs_service.c')
-rw-r--r--src/test/test_hs_service.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/test/test_hs_service.c b/src/test/test_hs_service.c
index 73200a5a63..3e3a7d8e0d 100644
--- a/src/test/test_hs_service.c
+++ b/src/test/test_hs_service.c
@@ -194,7 +194,7 @@ helper_create_origin_circuit(int purpose, int flags)
origin_circuit_t *circ = NULL;
circ = origin_circuit_init(purpose, flags);
- tt_assert(circ);
+ tor_assert(circ);
circ->cpath = tor_malloc_zero(sizeof(crypt_path_t));
circ->cpath->magic = CRYPT_PATH_MAGIC;
circ->cpath->state = CPATH_STATE_OPEN;
@@ -206,7 +206,6 @@ helper_create_origin_circuit(int purpose, int flags)
/* Create a default HS identifier. */
circ->hs_ident = tor_malloc_zero(sizeof(hs_ident_circuit_t));
- done:
return circ;
}
@@ -219,7 +218,7 @@ helper_create_service(void)
{
/* Set a service for this circuit. */
hs_service_t *service = hs_service_new(get_options());
- tt_assert(service);
+ tor_assert(service);
service->config.version = HS_VERSION_THREE;
ed25519_secret_key_generate(&service->keys.identity_sk, 0);
ed25519_public_key_generate(&service->keys.identity_pk,
@@ -241,7 +240,7 @@ helper_create_service_ip(void)
{
hs_desc_link_specifier_t *ls;
hs_service_intro_point_t *ip = service_intro_point_new(NULL, 0);
- tt_assert(ip);
+ tor_assert(ip);
/* Add a first unused link specifier. */
ls = tor_malloc_zero(sizeof(*ls));
ls->type = LS_IPV4;
@@ -252,7 +251,6 @@ helper_create_service_ip(void)
memset(ls->u.legacy_id, 'A', sizeof(ls->u.legacy_id));
smartlist_add(ip->base.link_specifiers, ls);
- done:
return ip;
}