Przeglądaj źródła

Use assert() instead of brutally exiting with EXIT_FAILURE.

Michele Orrù 11 lat temu
rodzic
commit
2f9cda05f4
1 zmienionych plików z 2 dodań i 2 usunięć
  1. 2 2
      src/questions/tests/test_pollard.c

+ 2 - 2
src/questions/tests/test_pollard.c

@@ -13,9 +13,9 @@ void test_pollard(void)
   RSA *rsa;
   FILE *fp = fopen("pollard.pem", "r");
 
-  if (!fp) exit(EXIT_FAILURE);
+  assert(fp);
   crt = PEM_read_X509(fp, NULL, 0, NULL);
-  if (!crt) exit(EXIT_FAILURE);
+  assert(crt);
 
   rsa = X509_get_pubkey(crt)->pkey.rsa;
   PollardQuestion.ask_rsa(rsa);