use super::*;
#[test]
fn install_sigterm_handler_is_idempotent_and_flag_accessible() {
install_sigterm_handler();
install_sigterm_handler();
let flag = sigterm_flag();
assert!(!flag.load(Ordering::SeqCst));
}
#[test]
fn signal_handler_sets_flag() {
SIGTERM_FLAG.store(false, Ordering::SeqCst);
on_sigterm(libc::SIGTERM);
assert!(SIGTERM_FLAG.load(Ordering::SeqCst));
SIGTERM_FLAG.store(false, Ordering::SeqCst);
}
#[test]
fn enter_own_process_group_is_an_idempotent_success() {
enter_own_process_group().unwrap();
enter_own_process_group().unwrap();
}