MCPcopy Create free account
hub / github.com/apache/arrow-rs / test_bool

Function test_bool

arrow-array/src/ffi.rs:955–975  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

953
954 #[test]
955 fn test_bool() -> Result<()> {
956 // create an array natively
957 let array = BooleanArray::from(vec![None, Some(true), Some(false)]);
958
959 // export it
960 let (array, schema) = to_ffi(&array.to_data())?;
961
962 // (simulate consumer) import it
963 let data = unsafe { from_ffi(array, &schema) }?;
964 let array = make_array(data);
965 let array = array.as_any().downcast_ref::<BooleanArray>().unwrap();
966
967 // verify
968 assert_eq!(
969 array,
970 &BooleanArray::from(vec![None, Some(true), Some(false)])
971 );
972
973 // (drop/release)
974 Ok(())
975 }
976
977 #[test]
978 fn test_time32() -> Result<()> {

Callers

nothing calls this directly

Calls 5

to_ffiFunction · 0.85
from_ffiFunction · 0.85
make_arrayFunction · 0.50
to_dataMethod · 0.45
as_anyMethod · 0.45

Tested by

no test coverage detected