blob: 0641e132c29319a2be037a96cf1634ebcf0f2b3c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
#![allow(non_upper_case_globals)]
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
include!(concat!(env!("OUT_DIR"), "/bindings.rs"));
#[cfg(test)]
mod tests {
use super::*;
use std::ffi::CString;
#[test]
fn login_auto() {
unsafe {
assert_eq!(0, NK_login_auto());
}
}
#[test]
fn login() {
unsafe {
// Unconnected
assert_eq!(0, NK_login(CString::new("S").unwrap().as_ptr()));
assert_eq!(0, NK_login(CString::new("P").unwrap().as_ptr()));
// Unsupported model
assert_eq!(0, NK_login(CString::new("T").unwrap().as_ptr()));
}
}
}
|