blob: 7d6e8bbe2661d20124ea9bc0513f49f1855aeb5a [file] [log] [blame]
Neill Kapronea5ac402024-08-22 21:05:01 +00001// tests/tests.rs
2
3#[cfg(test)]
4mod tests {
5 use libbpf_sys::*;
6
7 unsafe extern "C" fn print_fn(
8 _level: libbpf_print_level,
9 _arg1: *const std::os::raw::c_char,
10 _ap: *mut __va_list_tag,
11 ) -> std::os::raw::c_int {
12 0
13 }
14
15 #[test]
16 fn test() {
17 unsafe {
18 // just tests that we can call into the library
19 assert!(libbpf_set_print(Some(print_fn as _)).is_some());
20 }
21 }
22}