summaryrefslogtreecommitdiff
path: root/libc-test/test/sigrt.rs
blob: 453dcb341d073baf3f70fb6aaf43b9783e3a6fd5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
//! Compare libc's SIGRTMAX and SIGRTMIN functions against the actual C macros

extern crate libc;

#[cfg(any(
    target_os = "linux",
    target_os = "l4re",
    target_os = "android",
    target_os = "emscripten"
))]
mod t {
    use libc;

    extern "C" {
        pub fn sigrtmax() -> libc::c_int;
        pub fn sigrtmin() -> libc::c_int;
    }

    #[test]
    fn test_sigrtmax() {
        unsafe {
            assert_eq!(libc::SIGRTMAX(), sigrtmax());
        }
    }

    #[test]
    fn test_sigrtmin() {
        unsafe {
            assert_eq!(libc::SIGRTMIN(), sigrtmin());
        }
    }
}