llama_cpp_bindings/ffi_status_is_ok.rs
1#[must_use]
2pub const fn status_is_ok(status: llama_cpp_bindings_sys::llama_rs_status) -> bool {
3 status == llama_cpp_bindings_sys::LLAMA_RS_STATUS_OK
4}
5
6#[cfg(test)]
7mod tests {
8 use super::status_is_ok;
9
10 #[test]
11 fn ok_status() {
12 assert!(status_is_ok(llama_cpp_bindings_sys::LLAMA_RS_STATUS_OK));
13 }
14
15 #[test]
16 fn error_status() {
17 assert!(!status_is_ok(1));
18 assert!(!status_is_ok(-1));
19 }
20}