diff options
| author | Steven Fackler <[email protected]> | 2018-08-08 12:44:16 -0700 |
|---|---|---|
| committer | Steven Fackler <[email protected]> | 2018-08-08 13:19:55 -0700 |
| commit | 1396143c661a9f9775328d60bc38b6fdec2a4c8a (patch) | |
| tree | 176d7cd23ede4490083db0dcfa64b10c5c4b1299 /openssl/src/ssl/test.rs | |
| parent | Merge pull request #972 from sfackler/err-unspecified-cfg (diff) | |
| download | rust-openssl-1396143c661a9f9775328d60bc38b6fdec2a4c8a.tar.xz rust-openssl-1396143c661a9f9775328d60bc38b6fdec2a4c8a.zip | |
Add get_shutdown and set_shutdown
Diffstat (limited to 'openssl/src/ssl/test.rs')
| -rw-r--r-- | openssl/src/ssl/test.rs | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/openssl/src/ssl/test.rs b/openssl/src/ssl/test.rs index 08a93b97..a8d69295 100644 --- a/openssl/src/ssl/test.rs +++ b/openssl/src/ssl/test.rs @@ -22,8 +22,9 @@ use ssl; #[cfg(any(ossl110, ossl111, libressl261))] use ssl::SslVersion; use ssl::{ - Error, HandshakeError, MidHandshakeSslStream, ShutdownResult, Ssl, SslAcceptor, SslConnector, - SslContext, SslFiletype, SslMethod, SslSessionCacheMode, SslStream, SslVerifyMode, StatusType, + Error, HandshakeError, MidHandshakeSslStream, ShutdownResult, ShutdownState, Ssl, SslAcceptor, + SslConnector, SslContext, SslFiletype, SslMethod, SslSessionCacheMode, SslStream, + SslVerifyMode, StatusType, }; #[cfg(any(ossl102, ossl110))] use x509::verify::X509CheckFlags; @@ -1013,8 +1014,14 @@ fn shutdown() { stream.read_exact(&mut buf).unwrap(); assert_eq!(b"hello", &buf); + assert_eq!(stream.get_shutdown(), ShutdownState::empty()); assert_eq!(stream.shutdown().unwrap(), ShutdownResult::Sent); + assert_eq!(stream.get_shutdown(), ShutdownState::SENT); assert_eq!(stream.shutdown().unwrap(), ShutdownResult::Received); + assert_eq!( + stream.get_shutdown(), + ShutdownState::SENT | ShutdownState::RECEIVED + ); guard.join().unwrap(); } |