Skip to main content

lucid_arena_sys/
lib.rs

1#![allow(non_upper_case_globals)]
2#![allow(non_camel_case_types)]
3#![allow(non_snake_case)]
4
5include!("bindings.rs");
6
7#[cfg(test)]
8mod tests {
9    use super::*;
10    use std::mem;
11
12    #[test]
13    fn system_open_close() {
14        unsafe {
15            let mut sys = mem::zeroed();
16
17            let err = acOpenSystem(&mut sys);
18            assert!(err == AC_ERROR_LIST_AC_ERR_SUCCESS);
19
20            let mut num_devices: usize = 0;
21
22            let err = acSystemUpdateDevices(sys, 200);
23            assert!(err == AC_ERROR_LIST_AC_ERR_SUCCESS);
24
25            let err = acSystemGetNumDevices(sys, &mut num_devices);
26            assert!(err == AC_ERROR_LIST_AC_ERR_SUCCESS);
27
28            println!("Device count: {}", num_devices);
29
30            let err = acCloseSystem(sys);
31            assert!(err == AC_ERROR_LIST_AC_ERR_SUCCESS);
32        }
33    }
34}