Skip to content

Commit

Permalink
Allow zero-buffer tests to panic only on mac
Browse files Browse the repository at this point in the history
  • Loading branch information
oteffahi committed Dec 5, 2024
1 parent 0e863e2 commit 8e5904d
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions zenoh/tests/tcp_buffers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,19 @@ fn buffer_size_endpoint() {
zenoh::open(config).wait().unwrap();
}

#[cfg(target_os = "macos")]
#[test]
#[should_panic(expected = "Can not create a new TCP listener")]
fn buffer_size_override() {
buffer_size_config_override();
}

#[cfg(not(target_os = "macos"))]
#[test]
fn buffer_size_override() {
buffer_size_config_override();
}

#[test]
#[should_panic(expected = "Can not create a new TCP listener")]
fn buffer_size_config_override() {
Expand All @@ -75,8 +88,19 @@ fn buffer_size_config_override() {
zenoh::open(config).wait().unwrap();
}

#[cfg(target_os = "macos")]
#[test]
#[should_panic(expected = "Can not create a new TCP listener")]
fn buffer_size_zero() {
listen_zero_buffers();
}

#[cfg(not(target_os = "macos"))]
#[test]
fn buffer_size_zero() {
listen_zero_buffers();
}

fn listen_zero_buffers() {
let mut config = Config::default();
config
Expand Down

0 comments on commit 8e5904d

Please sign in to comment.