| 1 | #![allow(non_upper_case_globals)] |
| 2 | #![allow(non_camel_case_types)] |
| 3 | #![allow(non_snake_case)] |
| 4 | |
| 5 | include!(concat!(env!("OUT_DIR"), "/bindings.rs")); |
| 6 | |
| 7 | #[cfg(test)] |
| 8 | mod tests { |
| 9 | use super::{pixFreeData, pixGetHeight, pixGetWidth, pixRead}; |
| 10 | |
| 11 | #[test] |
| 12 | fn image_size() { |
| 13 | unsafe { |
| 14 | let image = pixRead(b"../test image.png\0".as_ptr().cast()); |
| 15 | assert_eq!(pixGetWidth(image), 1000); |
| 16 | assert_eq!(pixGetHeight(image), 500); |
| 17 | pixFreeData(image); |
| 18 | } |
| 19 | } |
| 20 | |
| 21 | #[test] |
| 22 | #[allow(path_statements)] |
| 23 | fn defined_constants() { |
| 24 | super::IFF_UNKNOWN; |
| 25 | super::IFF_BMP; |
| 26 | } |
| 27 | |
| 28 | #[test] |
| 29 | #[allow(path_statements)] |
| 30 | fn defined_functions() { |
| 31 | super::boxCreateValid; |
| 32 | super::boxDestroy; |
| 33 | super::boxGetGeometry; |
| 34 | } |
| 35 | } |