diff options
| author | Cody P Schafer <[email protected]> | 2016-01-18 16:39:27 -0500 |
|---|---|---|
| committer | Cody P Schafer <[email protected]> | 2016-01-18 16:40:14 -0500 |
| commit | d1825c7a86717faf518e0abd08f0f5c1e94c0ca8 (patch) | |
| tree | 29b00d3bb5c5c1775fe1d9b25d5c206701bf29fc | |
| parent | ssl: fix refcounting of SslContext when set_ssl_context is used (diff) | |
| download | rust-openssl-d1825c7a86717faf518e0abd08f0f5c1e94c0ca8.tar.xz rust-openssl-d1825c7a86717faf518e0abd08f0f5c1e94c0ca8.zip | |
openssl/ssl/context: test that we are refcounting correctly
Not a perfect test, on failure it _might_ exit with this output:
Process didn't exit successfully:
`/home/cody/g/rust-openssl/openssl/target/debug/openssl-8e712036e3aac4fe`
(signal: 11)
But unclear if we can do any better.
| -rw-r--r-- | openssl/src/ssl/tests/mod.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/openssl/src/ssl/tests/mod.rs b/openssl/src/ssl/tests/mod.rs index a763f496..f5a42536 100644 --- a/openssl/src/ssl/tests/mod.rs +++ b/openssl/src/ssl/tests/mod.rs @@ -1045,3 +1045,16 @@ fn flush_panic() { let mut stream = SslStream::connect(&ctx, stream).unwrap(); let _ = stream.flush(); } + +#[test] +fn refcount_ssl_context() { + let ssl = { + let ctx = SslContext::new(SslMethod::Sslv23).unwrap(); + ssl::Ssl::new(&ctx).unwrap() + }; + + { + let new_ctx_a = SslContext::new(SslMethod::Sslv23).unwrap(); + let _new_ctx_b = ssl.set_ssl_context(&new_ctx_a); + } +} |