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 Jan 21, 2023
1 parent 34fea5d commit b93a9d7
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 @@ -303,6 +303,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 b93a9d7

Please sign in to comment.