erfa_sys/
lib.rs

1// This Source Code Form is subject to the terms of the Mozilla Public
2// License, v. 2.0. If a copy of the MPL was not distributed with this
3// file, You can obtain one at http://mozilla.org/MPL/2.0/.
4
5//! Provide Rust bindings to the ERFA C library.
6
7#![allow(non_snake_case)]
8#![allow(clippy::approx_constant)]
9#![allow(clippy::excessive_precision)]
10// deref_nullptr hides clippy warnings from erfa.rs, which was produced by bindgen.
11#![allow(deref_nullptr)]
12
13include!("erfa.rs");
14
15#[cfg(test)]
16mod tests {
17    use super::*;
18
19    /// eraEform takes a C int for its ellipsoid type. This test helps to ensure
20    /// that when the ellipsoid ints are read with bindgen that they are the
21    /// right integer type.
22    #[test]
23    fn test_eraEform_works() {
24        unsafe {
25            let mut a = 0.0;
26            let mut f = 0.0;
27            let j = eraEform(ERFA_WGS84, &mut a, &mut f);
28            assert_eq!(j, 0);
29            let j = eraEform(ERFA_GRS80, &mut a, &mut f);
30            assert_eq!(j, 0);
31            let j = eraEform(ERFA_WGS72, &mut a, &mut f);
32            assert_eq!(j, 0);
33        }
34    }
35}