()
| 506 | |
| 507 | #[test] |
| 508 | fn with_base_object() { |
| 509 | Python::attach(|py| { |
| 510 | let array = Array::<f64, _>::zeros((1, 2, 3)).into_pyarray(py); |
| 511 | |
| 512 | let base = unsafe { (*array.as_array_ptr()).base }; |
| 513 | assert!(!base.is_null()); |
| 514 | |
| 515 | let base_address = base_address(py, array.as_array_ptr()); |
| 516 | assert_ne!(base_address, array.as_ptr().cast()); |
| 517 | assert_eq!(base_address, base.cast::<c_void>()); |
| 518 | |
| 519 | let data_range = data_range(py, array.as_array_ptr()); |
| 520 | assert_eq!(data_range.0, array.data().cast::<c_char>()); |
| 521 | assert_eq!(data_range.1, unsafe { |
| 522 | array.data().add(6).cast::<c_char>() |
| 523 | }); |
| 524 | }); |
| 525 | } |
| 526 | |
| 527 | #[test] |
| 528 | fn view_without_base_object() { |
nothing calls this directly
no test coverage detected