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 26, 2022
1 parent a4747fa commit b44c2f9
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 @@ -297,6 +297,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 b44c2f9

Please sign in to comment.