diff options
Diffstat (limited to 'tests/test_cmath.rs')
-rw-r--r-- | tests/test_cmath.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/test_cmath.rs b/tests/test_cmath.rs new file mode 100644 index 00000000..73e2cef1 --- /dev/null +++ b/tests/test_cmath.rs @@ -0,0 +1,15 @@ +#[allow(dead_code)] +#[allow(non_snake_case)] +#[allow(non_camel_case_types)] +#[allow(non_upper_case_globals)] +#[allow(raw_pointer_deriving)] +pub mod ffi { bindgen!("/usr/include/math.h", link = "m"); } + +#[test] +fn floor_is_bound_and_callable() { + unsafe { + assert_eq!(ffi::floor( 2.7), 2.0); + assert_eq!(ffi::floor(-2.7), -3.0); + assert_eq!(ffi::floor(-0.0), 0.0); + } +} |