cspice_sys/
lib.rs

1#![allow(
2    clippy::missing_safety_doc,
3    clippy::unreadable_literal,
4    clippy::upper_case_acronyms,
5    dead_code,
6    non_camel_case_types,
7    non_snake_case,
8    non_upper_case_globals,
9    overflowing_literals,
10    unused_imports
11)]
12
13include!(concat!(env!("OUT_DIR"), "/bindgen.rs"));
14
15#[cfg(test)]
16mod tests {
17    use crate::*;
18    use std::ffi::CString;
19
20    /// Very basic test that we have successfully linked CSPICE and are able to call functions
21    #[test]
22    fn test() {
23        unsafe {
24            let set = CString::new("SET").unwrap().into_raw();
25            let report = CString::new("REPORT").unwrap().into_raw();
26            erract_c(set, 0, report);
27            let str_ptr = CString::new("2027-MAR-23 16:00:00").unwrap().into_raw();
28            let mut double = 0f64;
29            str2et_c(str_ptr, &mut double);
30            drop(CString::from_raw(set));
31            drop(CString::from_raw(report));
32            drop(CString::from_raw(str_ptr));
33        }
34    }
35}