| 1 | #![allow(non_upper_case_globals)] |
| 2 | #![allow(non_camel_case_types)] |
| 3 | #![allow(non_snake_case)] |
| 4 | |
| 5 | mod ffirust-analyzer cargo nitrokey-sys 3.4.3 ffi/; |
| 6 | |
| 7 | pub use craterust-analyzer cargo nitrokey-sys 3.4.3 crate/::ffirust-analyzer cargo nitrokey-sys 3.4.3 ffi/::*; |
| 8 | |
| 9 | #[cfg(test)] |
| 10 | mod testsrust-analyzer cargo nitrokey-sys 3.4.3 tests/ { |
| 11 | use superrust-analyzer cargo nitrokey-sys 3.4.3 crate/::*; |
| 12 | use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::ffirust-analyzer cargo std https://github.com/rust-lang/rust/library/std ffi/::CStringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc ffi/c_str/CString#; |
| 13 | |
| 14 | #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 15 | fn login_autorust-analyzer cargo nitrokey-sys 3.4.3 tests/login_auto().() { |
| 16 | unsafe { |
| 17 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(0, NK_login_autorust-analyzer cargo nitrokey-sys 3.4.3 NK_login_auto().()); |
| 18 | } |
| 19 | } |
| 20 | |
| 21 | #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 22 | fn loginrust-analyzer cargo nitrokey-sys 3.4.3 tests/login().() { |
| 23 | unsafe { |
| 24 | // Unconnected |
| 25 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(0, NK_loginrust-analyzer cargo nitrokey-sys 3.4.3 NK_login().(CStringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc ffi/c_str/CString#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc ffi/c_str/impl#[CString]new().("S").unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().().as_ptrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ffi/c_str/impl#[CStr]as_ptr().())); |
| 26 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(0, NK_loginrust-analyzer cargo nitrokey-sys 3.4.3 NK_login().(CStringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc ffi/c_str/CString#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc ffi/c_str/impl#[CString]new().("P").unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().().as_ptrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ffi/c_str/impl#[CStr]as_ptr().())); |
| 27 | // Unsupported model |
| 28 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(0, NK_loginrust-analyzer cargo nitrokey-sys 3.4.3 NK_login().(CStringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc ffi/c_str/CString#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc ffi/c_str/impl#[CString]new().("T").unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().().as_ptrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ffi/c_str/impl#[CStr]as_ptr().())); |
| 29 | } |
| 30 | } |
| 31 | } |