Skip to content

Commit

Permalink
add test for null ptr
Browse files Browse the repository at this point in the history
  • Loading branch information
russelltg committed Jun 23, 2022
1 parent 0b48e29 commit 9d2229e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,14 @@ fn test_unique_to_shared_ptr_cpp_type() {
assert_eq!(&*shared as *const _, ptr);
}

#[test]
fn test_unique_to_shared_ptr_null() {
let unique = cxx::UniquePtr::<ffi::C>::null();
assert!(unique.is_null());
let shared = unique.to_shared();
assert!(shared.is_null());
}

#[test]
fn test_c_ns_method_calls() {
let unique_ptr = ffi2::ns_c_return_unique_ptr_ns();
Expand Down

0 comments on commit 9d2229e

Please sign in to comment.