Skip to content

Commit

Permalink
Ignore incompatible tests on Windows CI
Browse files Browse the repository at this point in the history
  • Loading branch information
prabhpreet committed Jun 5, 2024
1 parent 6b17d75 commit 0683767
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions memsec-test/tests/malloc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,12 @@ fn malloc_mprotect_1_test() {
}
}

procspawn::enable_test_support!();
#[cfg(unix)]
mod unix_only {

use std::ptr::NonNull;
procspawn::enable_test_support!();
use std::time::Duration;

use serde::{Deserialize, Serialize};

#[derive(Debug, Clone, Copy, Serialize, Deserialize)]
Expand All @@ -106,7 +108,6 @@ enum TestState {
Free,
}

#[cfg(unix)]
fn attempt_write_in_region(
offset: Offset,
end_process_normally: bool,
Expand Down Expand Up @@ -205,7 +206,6 @@ fn attempt_write_in_region(
assert!(r.is_ok() == end_process_normally);
}

#[cfg(unix)]
#[test]
fn malloc_probe_outside_normal() {
attempt_write_in_region(
Expand All @@ -220,7 +220,6 @@ fn malloc_probe_outside_normal() {
);
}

#[cfg(unix)]
#[test]
fn malloc_probe_outside_limits_canary() {
//Canary changes crash the process
Expand All @@ -236,7 +235,6 @@ fn malloc_probe_outside_limits_canary() {
);
}

#[cfg(unix)]
#[test]
fn malloc_probe_outside_limits_page_above() {
attempt_write_in_region(
Expand All @@ -246,7 +244,6 @@ fn malloc_probe_outside_limits_page_above() {
);
}

#[cfg(unix)]
#[test]
fn malloc_probe_outside_limits_two_pages_above() {
attempt_write_in_region(
Expand All @@ -256,7 +253,6 @@ fn malloc_probe_outside_limits_two_pages_above() {
);
}

#[cfg(unix)]
#[test]
fn malloc_probe_outside_limits_page_after_above() {
attempt_write_in_region(
Expand All @@ -265,3 +261,4 @@ fn malloc_probe_outside_limits_page_after_above() {
vec![TestState::Init, TestState::Allocate, TestState::Operation],
);
}
}

0 comments on commit 0683767

Please sign in to comment.