Skip to content

Commit

Permalink
acceptor: remove simple test helper
Browse files Browse the repository at this point in the history
The `make_acceptor()` test helper is only used in 2 places, and just
directly invokes a simple constructor. Let's do that in the call-sites
directly instead of adding unhelpful indirection.
  • Loading branch information
cpu committed Dec 17, 2024
1 parent f5e2626 commit bdef19a
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/acceptor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -533,10 +533,6 @@ mod tests {
rustls_acceptor::rustls_acceptor_free(acceptor);
}

fn make_acceptor() -> *mut rustls_acceptor {
rustls_acceptor::rustls_acceptor_new()
}

unsafe extern "C" fn vecdeque_read(
userdata: *mut c_void,
buf: *mut u8,
Expand Down Expand Up @@ -570,7 +566,7 @@ mod tests {
// Send junk data to a rustls_acceptor, expect MessageInvalidContentType from accept().
#[test]
fn test_acceptor_corrupt_message() {
let acceptor = make_acceptor();
let acceptor = rustls_acceptor::rustls_acceptor_new();

let mut accepted = null_mut();
let mut accepted_alert = null_mut();
Expand Down Expand Up @@ -712,7 +708,7 @@ mod tests {
#[cfg_attr(miri, ignore)]
#[test]
fn test_acceptor_success() {
let acceptor = make_acceptor();
let acceptor = rustls_acceptor::rustls_acceptor_new();

let mut accepted = null_mut();
let mut accepted_alert = null_mut();
Expand Down

0 comments on commit bdef19a

Please sign in to comment.