fn normal_exit()

in reverie-process/src/exit_status.rs [210:238]


    fn normal_exit() {
        assert_eq!(
            run_forked(|| { unsafe { libc::_exit(0) } }),
            Ok(ExitStatus::Exited(0))
        );

        assert_eq!(
            run_forked(|| { unsafe { libc::_exit(42) } }),
            Ok(ExitStatus::Exited(42))
        );

        // Thread exit
        assert_eq!(
            run_forked(|| {
                unsafe { libc::syscall(libc::SYS_exit, 42) };
                unreachable!();
            }),
            Ok(ExitStatus::Exited(42))
        );

        // exit_group. Should be identical to `libc::_exit`.
        assert_eq!(
            run_forked(|| {
                unsafe { libc::syscall(libc::SYS_exit_group, 42) };
                unreachable!();
            }),
            Ok(ExitStatus::Exited(42))
        );
    }