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

Function test_time32

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

Source from the content-addressed store, hash-verified

976
977 #[test]
978 fn test_time32() -> Result<()> {
979 // create an array natively
980 let array = Time32MillisecondArray::from(vec![None, Some(1), Some(2)]);
981
982 // export it
983 let (array, schema) = to_ffi(&array.to_data())?;
984
985 // (simulate consumer) import it
986 let data = unsafe { from_ffi(array, &schema) }?;
987 let array = make_array(data);
988 let array = array
989 .as_any()
990 .downcast_ref::<Time32MillisecondArray>()
991 .unwrap();
992
993 // verify
994 assert_eq!(
995 array,
996 &Time32MillisecondArray::from(vec![None, Some(1), Some(2)])
997 );
998
999 // (drop/release)
1000 Ok(())
1001 }
1002
1003 #[test]
1004 fn test_timestamp() -> 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