Преглед на файлове

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.
Nick Mathewson преди 13 години
родител
ревизия
0317dc2bb2
променени са 1 файла, в които са добавени 4 реда и са изтрити 1 реда
  1. 4 1
      src/test/test.c

+ 4 - 1
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();