hxcadaptor_sys/
lib.rs

1#![allow(non_upper_case_globals)]
2#![allow(non_camel_case_types)]
3#![allow(non_snake_case)]
4
5include!(concat!(env!("OUT_DIR"), "/bindings.rs"));
6
7#[cfg(test)]
8mod test {
9    use std::ffi::CString;
10
11    use crate::hxc_strupper;
12
13    #[test]
14    fn test_string() {
15        unsafe {
16            let lower = CString::new("lower").unwrap();
17            let upper = CString::new("LOWER").unwrap();
18
19            let res = hxc_strupper(lower.into_raw());
20            let res = CString::from_raw(res);
21            assert_eq!(upper, res);
22        }
23    }
24}