Skip to content

Commit

Permalink
Move comment for Windows-only constant into the match arm section
Browse files Browse the repository at this point in the history
  • Loading branch information
c6c7 committed Jul 11, 2024
1 parent 3bd708e commit 46ff5ff
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions library/test/src/test_result.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@ pub use self::TestResult::*;
// it means.
pub const TR_OK: i32 = 50;

// On Windows we use __fastfail to abort, which is documented to use this
// exception code.
#[cfg(windows)]
const STATUS_ABORTED: i32 = 0xC0000409u32 as i32;

#[derive(Debug, Clone, PartialEq)]
pub enum TestResult {
TrOk,
Expand Down Expand Up @@ -95,8 +90,10 @@ pub fn get_result_from_exit_code(
) -> TestResult {
let result = match status.code() {
Some(TR_OK) => TestResult::TrOk,
// On Windows we use __fastfail to abort, which is documented to use this
// exception code.
#[cfg(windows)]
Some(STATUS_ABORTED) => TestResult::TrFailed,
Some(0xC0000409) => TestResult::TrFailed,
#[cfg(unix)]
None => match status.signal() {
Some(libc::SIGABRT) => TestResult::TrFailed,
Expand Down

0 comments on commit 46ff5ff

Please sign in to comment.