aboutsummaryrefslogtreecommitdiff
path: root/openssl/src/x509/tests.rs
diff options
context:
space:
mode:
authorSteven Fackler <[email protected]>2016-05-01 09:09:51 -0700
committerSteven Fackler <[email protected]>2016-05-01 09:09:51 -0700
commit2cfb25136f6c09c76c3ff173edf3a22e64ba72ca (patch)
treeff996ebde8d64cf052d2d874bbafbb01d417b4d8 /openssl/src/x509/tests.rs
parentImplement IntoIterator for &GeneralNames (diff)
downloadrust-openssl-2cfb25136f6c09c76c3ff173edf3a22e64ba72ca.tar.xz
rust-openssl-2cfb25136f6c09c76c3ff173edf3a22e64ba72ca.zip
Document SAN APIs and tweak accessor names
Diffstat (limited to 'openssl/src/x509/tests.rs')
-rw-r--r--openssl/src/x509/tests.rs14
1 files changed, 8 insertions, 6 deletions
diff --git a/openssl/src/x509/tests.rs b/openssl/src/x509/tests.rs
index aa41bfc6..0032d108 100644
--- a/openssl/src/x509/tests.rs
+++ b/openssl/src/x509/tests.rs
@@ -165,9 +165,10 @@ fn test_subject_alt_name() {
let subject_alt_names = cert.subject_alt_names().unwrap();
assert_eq!(3, subject_alt_names.len());
- assert_eq!(Some("foobar.com"), subject_alt_names.get(0).dns());
- assert_eq!(subject_alt_names.get(1).ipadd(), Some(&[127, 0, 0, 1][..]));
- assert_eq!(subject_alt_names.get(2).ipadd(), Some(&b"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x01"[..]));
+ assert_eq!(Some("foobar.com"), subject_alt_names.get(0).dnsname());
+ assert_eq!(subject_alt_names.get(1).ipaddress(), Some(&[127, 0, 0, 1][..]));
+ assert_eq!(subject_alt_names.get(2).ipaddress(),
+ Some(&b"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x01"[..]));
}
#[test]
@@ -177,8 +178,9 @@ fn test_subject_alt_name_iter() {
let subject_alt_names = cert.subject_alt_names().unwrap();
let mut subject_alt_names_iter = subject_alt_names.iter();
- assert_eq!(subject_alt_names_iter.next().unwrap().dns(), Some("foobar.com"));
- assert_eq!(subject_alt_names_iter.next().unwrap().ipadd(), Some(&[127, 0, 0, 1][..]));
- assert_eq!(subject_alt_names_iter.next().unwrap().ipadd(), Some(&b"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x01"[..]));
+ assert_eq!(subject_alt_names_iter.next().unwrap().dnsname(), Some("foobar.com"));
+ assert_eq!(subject_alt_names_iter.next().unwrap().ipaddress(), Some(&[127, 0, 0, 1][..]));
+ assert_eq!(subject_alt_names_iter.next().unwrap().ipaddress(),
+ Some(&b"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x01"[..]));
assert!(subject_alt_names_iter.next().is_none());
}