aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJethro Beekman <[email protected]>2015-06-30 18:52:17 -0700
committerJethro Beekman <[email protected]>2015-07-01 00:18:44 -0700
commitd5a4d48caba81ffcd46abc49d7373a2d81c370d9 (patch)
treecfcb21442ac5addbe32053ef0638448bc5de5204
parentTurn "dirty hack" into slightly less dirty hack, with potential to become non... (diff)
downloadrust-openssl-d5a4d48caba81ffcd46abc49d7373a2d81c370d9.tar.xz
rust-openssl-d5a4d48caba81ffcd46abc49d7373a2d81c370d9.zip
Turn assertions into unwraps such that tests provide useful output on panic.
-rw-r--r--openssl/src/x509/tests.rs10
1 files changed, 3 insertions, 7 deletions
diff --git a/openssl/src/x509/tests.rs b/openssl/src/x509/tests.rs
index 4e1c4f15..ca9ce68c 100644
--- a/openssl/src/x509/tests.rs
+++ b/openssl/src/x509/tests.rs
@@ -19,13 +19,9 @@ fn test_cert_gen() {
.set_usage(&[DigitalSignature, KeyEncipherment])
.set_ext_usage(&[ClientAuth, ServerAuth]);
- let res = gen.generate();
- assert!(res.is_ok());
-
- let (cert, pkey) = res.unwrap();
-
- assert!(cert.write_pem(&mut io::sink()).is_ok());
- assert!(pkey.write_pem(&mut io::sink()).is_ok());
+ let (cert, pkey) = gen.generate().unwrap();
+ cert.write_pem(&mut io::sink()).unwrap();
+ pkey.write_pem(&mut io::sink()).unwrap();
// FIXME: check data in result to be correct, needs implementation
// of X509 getters