From 8e5904da3fc370defb657aa9b592d13bd4132b1c Mon Sep 17 00:00:00 2001 From: Oussama Teffahi Date: Thu, 5 Dec 2024 13:20:38 +0100 Subject: [PATCH] Allow zero-buffer tests to panic only on mac --- zenoh/tests/tcp_buffers.rs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/zenoh/tests/tcp_buffers.rs b/zenoh/tests/tcp_buffers.rs index 22c7e40f0..8794c5e4a 100644 --- a/zenoh/tests/tcp_buffers.rs +++ b/zenoh/tests/tcp_buffers.rs @@ -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() { @@ -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