aboutsummaryrefslogtreecommitdiff
path: root/ssl/tests.rs
diff options
context:
space:
mode:
authorSteven Fackler <[email protected]>2014-03-09 17:01:37 -0700
committerSteven Fackler <[email protected]>2014-03-09 17:01:37 -0700
commit49678805041cc2824ce54c9a0a8cf9fb5447838e (patch)
tree7328211dde9e811519515a9a651c9949e1859c98 /ssl/tests.rs
parentAdd SSLv2 support behind a cfg flag (diff)
downloadrust-openssl-49678805041cc2824ce54c9a0a8cf9fb5447838e.tar.xz
rust-openssl-49678805041cc2824ce54c9a0a8cf9fb5447838e.zip
Properly propogate errors
Diffstat (limited to 'ssl/tests.rs')
-rw-r--r--ssl/tests.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/ssl/tests.rs b/ssl/tests.rs
index 751ca7ab..c7f738f5 100644
--- a/ssl/tests.rs
+++ b/ssl/tests.rs
@@ -144,18 +144,18 @@ fn test_verify_trusted_get_error_err() {
fn test_write() {
let stream = TcpStream::connect(FromStr::from_str("127.0.0.1:15418").unwrap()).unwrap();
let mut stream = SslStream::new(&SslContext::new(Sslv23), stream);
- stream.write("hello".as_bytes());
- stream.flush();
- stream.write(" there".as_bytes());
- stream.flush();
+ stream.write("hello".as_bytes()).unwrap();
+ stream.flush().unwrap();
+ stream.write(" there".as_bytes()).unwrap();
+ stream.flush().unwrap();
}
#[test]
fn test_read() {
let stream = TcpStream::connect(FromStr::from_str("127.0.0.1:15418").unwrap()).unwrap();
let mut stream = SslStream::new(&SslContext::new(Sslv23), stream);
- stream.write("GET /\r\n\r\n".as_bytes());
- stream.flush();
+ stream.write("GET /\r\n\r\n".as_bytes()).unwrap();
+ stream.flush().unwrap();
let buf = stream.read_to_end().ok().expect("read error");
print!("{}", str::from_utf8(buf));
}