From 35dbaaf3e84540ba8cb63bbc00de551e1eca4812 Mon Sep 17 00:00:00 2001 From: Rafael Caricio Date: Fri, 10 Apr 2020 20:53:41 +0200 Subject: [PATCH] Basic sanity check test --- lvgl-sys/src/lib.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/lvgl-sys/src/lib.rs b/lvgl-sys/src/lib.rs index bd0b4ed..266f842 100644 --- a/lvgl-sys/src/lib.rs +++ b/lvgl-sys/src/lib.rs @@ -3,3 +3,21 @@ #![allow(non_upper_case_globals)] include!(concat!(env!("OUT_DIR"), "/bindings.rs")); + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn basic_sanity_check() { + unsafe { + lv_init(); + + let hres = lv_disp_get_hor_res(std::ptr::null_mut()); + assert_eq!(hres, 480); + + let vres = lv_disp_get_ver_res(std::ptr::null_mut()); + assert_eq!(vres, 320); + } + } +}