From 1304ce4d0e7a510583b5da31c82c9d8c4658294a Mon Sep 17 00:00:00 2001 From: Christian Eltzschig Date: Tue, 8 Oct 2024 11:02:10 +0200 Subject: [PATCH] [#390] Adjust non null tests --- iceoryx2-ffi/ffi/src/api/attachment_id.rs | 2 +- iceoryx2-ffi/ffi/src/api/file_descriptor.rs | 2 +- iceoryx2-ffi/ffi/src/api/waitset.rs | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/iceoryx2-ffi/ffi/src/api/attachment_id.rs b/iceoryx2-ffi/ffi/src/api/attachment_id.rs index fb0335c0f..ca290948b 100644 --- a/iceoryx2-ffi/ffi/src/api/attachment_id.rs +++ b/iceoryx2-ffi/ffi/src/api/attachment_id.rs @@ -267,7 +267,7 @@ pub unsafe extern "C" fn iox2_attachment_id_from_guard( attachment_id_handle_ptr: *mut iox2_attachment_id_h, ) { guard.assert_non_null(); - attachment_id_handle_ptr.assert_non_null(); + debug_assert!(!attachment_id_handle_ptr.is_null()); let guard = &*guard.as_type(); diff --git a/iceoryx2-ffi/ffi/src/api/file_descriptor.rs b/iceoryx2-ffi/ffi/src/api/file_descriptor.rs index c2af8bc5f..0023c1396 100644 --- a/iceoryx2-ffi/ffi/src/api/file_descriptor.rs +++ b/iceoryx2-ffi/ffi/src/api/file_descriptor.rs @@ -177,7 +177,7 @@ pub unsafe extern "C" fn iox2_file_descriptor_new( struct_ptr: *mut iox2_file_descriptor_t, handle_ptr: *mut iox2_file_descriptor_h, ) -> bool { - handle_ptr.assert_non_null(); + debug_assert!(!handle_ptr.is_null()); if FileDescriptor::non_owning_new(value).is_none() { return false; diff --git a/iceoryx2-ffi/ffi/src/api/waitset.rs b/iceoryx2-ffi/ffi/src/api/waitset.rs index 9e632771c..2ebeadfc7 100644 --- a/iceoryx2-ffi/ffi/src/api/waitset.rs +++ b/iceoryx2-ffi/ffi/src/api/waitset.rs @@ -330,7 +330,7 @@ pub unsafe extern "C" fn iox2_waitset_attach_notification( guard_handle_ptr: *mut iox2_guard_h, ) -> c_int { handle.assert_non_null(); - guard_handle_ptr.assert_non_null(); + debug_assert!(!guard_handle_ptr.is_null()); let waitset = &mut *handle.as_type(); @@ -411,7 +411,7 @@ pub unsafe extern "C" fn iox2_waitset_attach_deadline( guard_handle_ptr: *mut iox2_guard_h, ) -> c_int { handle.assert_non_null(); - guard_handle_ptr.assert_non_null(); + debug_assert!(!guard_handle_ptr.is_null()); let waitset = &mut *handle.as_type(); let interval = Duration::from_secs(seconds) + Duration::from_nanos(nanoseconds as _); @@ -495,7 +495,7 @@ pub unsafe extern "C" fn iox2_waitset_attach_interval( guard_handle_ptr: *mut iox2_guard_h, ) -> c_int { handle.assert_non_null(); - guard_handle_ptr.assert_non_null(); + debug_assert!(!guard_handle_ptr.is_null()); let waitset = &mut *handle.as_type(); let interval = Duration::from_secs(seconds) + Duration::from_nanos(nanoseconds as _);