Created
May 10, 2017 12:48
-
-
Save hhatto/42da9aa40940dbee261b79c3dd692a26 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extern "C" { | |
pub fn otama_open(otama: *mut *mut otama_t, | |
config_path: *const ::std::os::raw::c_char) | |
-> otama_status_t; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[cfg(test)] | |
mod tests { | |
use super::*; | |
use std::mem; | |
use std::ffi::CString; | |
#[test] | |
fn test_otama_open() { | |
let config = CString::new("path.yaml").unwrap(); | |
unsafe { | |
let &mut o = &mut mem::zeroed(); | |
otama_open(&mut o as *mut *mut otama_t, config.as_ptr()); | |
} | |
} | |
} |
Author
hhatto
commented
May 10, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment