summaryrefslogtreecommitdiff
path: root/src/test/test.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2011-07-01 11:56:09 -0400
committerNick Mathewson <nickm@torproject.org>2011-07-01 11:56:09 -0400
commit0317dc2bb2223dd8a51fc8b54a69765764d094d3 (patch)
tree13a7a80c6cbd2f8833178548f2a5e609c7bf6cad /src/test/test.c
parenteca982d3eb1e715394b2c67d8f420bcbe4a8486d (diff)
downloadtor-0317dc2bb2223dd8a51fc8b54a69765764d094d3.tar.gz
tor-0317dc2bb2223dd8a51fc8b54a69765764d094d3.zip
Check return value of crypto_global_init in test.c
This will let the unit tests fail in a less mystifying way if the crypto subsystem is b0rken, and will also make Coverity happier. CID # 429.
Diffstat (limited to 'src/test/test.c')
-rw-r--r--src/test/test.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/test/test.c b/src/test/test.c
index 1db1546639..02d238e26d 100644
--- a/src/test/test.c
+++ b/src/test/test.c
@@ -1318,7 +1318,10 @@ main(int c, const char **v)
}
options->command = CMD_RUN_UNITTESTS;
- crypto_global_init(0, NULL, NULL);
+ if (crypto_global_init(0, NULL, NULL)) {
+ printf("Can't initialize crypto subsystem; exiting.\n");
+ return 1;
+ }
rep_hist_init();
network_init();
setup_directory();