Skip to content

Commit

Permalink
[#390] Adjust non null tests
Browse files Browse the repository at this point in the history
  • Loading branch information
elfenpiff committed Oct 8, 2024
1 parent cc42176 commit 1304ce4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion iceoryx2-ffi/ffi/src/api/attachment_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
2 changes: 1 addition & 1 deletion iceoryx2-ffi/ffi/src/api/file_descriptor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions iceoryx2-ffi/ffi/src/api/waitset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down Expand Up @@ -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 _);
Expand Down Expand Up @@ -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 _);
Expand Down

0 comments on commit 1304ce4

Please sign in to comment.