summaryrefslogtreecommitdiff
path: root/test/regress_rpc.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2014-01-08 11:51:22 -0500
committerNick Mathewson <nickm@torproject.org>2014-01-08 11:51:22 -0500
commit867f401f9bdb5d0f1dae6d5d7b96719ca0ef7600 (patch)
tree6e1318f525dd2ee47ca25a71c515c21b0adb7724 /test/regress_rpc.c
parent8d15f57f616bf23c6b20249f1f8777c36b939f40 (diff)
downloadlibevent-867f401f9bdb5d0f1dae6d5d7b96719ca0ef7600.tar.gz
Fix a pile of coverity warnings in the unit tests
Most of these problems can only trigger when the tests fail, but it's good hygiene to keep the code warning-free in any case.
Diffstat (limited to 'test/regress_rpc.c')
-rw-r--r--test/regress_rpc.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/test/regress_rpc.c b/test/regress_rpc.c
index 0a5c7a3f..01a058cb 100644
--- a/test/regress_rpc.c
+++ b/test/regress_rpc.c
@@ -463,12 +463,14 @@ rpc_basic_client(void)
!= NULL);
pool = rpc_pool_with_connection(port);
+ tt_assert(pool);
assert(evrpc_add_hook(pool, EVRPC_OUTPUT, rpc_hook_add_meta, NULL));
assert(evrpc_add_hook(pool, EVRPC_INPUT, rpc_hook_remove_header, (void*)"output"));
/* set up the basic message */
msg = msg_new();
+ tt_assert(msg);
EVTAG_ASSIGN(msg, from_name, "niels");
EVTAG_ASSIGN(msg, to_name, "tester");
@@ -539,9 +541,11 @@ rpc_basic_queued_client(void)
rpc_setup(&http, &port, &base);
pool = rpc_pool_with_connection(port);
+ tt_assert(pool);
/* set up the basic message */
msg = msg_new();
+ tt_assert(msg);
EVTAG_ASSIGN(msg, from_name, "niels");
EVTAG_ASSIGN(msg, to_name, "tester");
@@ -640,12 +644,13 @@ rpc_basic_client_with_pause(void)
assert(evrpc_add_hook(base, EVRPC_OUTPUT, rpc_hook_pause, base));
pool = rpc_pool_with_connection(port);
-
+ tt_assert(pool);
assert(evrpc_add_hook(pool, EVRPC_INPUT, rpc_hook_pause, pool));
assert(evrpc_add_hook(pool, EVRPC_OUTPUT, rpc_hook_pause, pool));
/* set up the basic message */
msg = msg_new();
+ tt_assert(msg);
EVTAG_ASSIGN(msg, from_name, "niels");
EVTAG_ASSIGN(msg, to_name, "tester");
@@ -688,12 +693,14 @@ rpc_client_timeout(void)
rpc_setup(&http, &port, &base);
pool = rpc_pool_with_connection(port);
+ tt_assert(pool);
/* set the timeout to 1 second. */
evrpc_pool_set_timeout(pool, 1);
/* set up the basic message */
msg = msg_new();
+ tt_assert(msg);
EVTAG_ASSIGN(msg, from_name, "niels");
EVTAG_ASSIGN(msg, to_name, "tester");