Skip to content

Commit

Permalink
Fixup tests trying to get miri to work.
Browse files Browse the repository at this point in the history
Turns out it won't due to:

rust-lang/unsafe-code-guidelines#134

so disable that check
  • Loading branch information
jmchacon committed May 24, 2023
1 parent 0c21a2a commit 7ade788
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/safety.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
- name: cargo miri test
run: cargo miri test
env:
MIRIFLAGS: "-Zmiri-disable-isolation"
MIRIFLAGS: "-Zmiri-disable-isolation,-Zmiri-disable-stacked-borrows"
#loom:
# runs-on: ubuntu-latest
# steps:
Expand Down
9 changes: 2 additions & 7 deletions cpu/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,7 @@ macro_rules! init_test {
let mut cpu = setup($type, 0x1212, 0xEA, None, None, None, None);

// This should fail
{
assert!(cpu.reset().is_err(), "reset worked before power_on");
}
assert!(cpu.reset().is_err(), "reset worked before power_on");

// Now it should work.
cpu.power_on()?;
Expand All @@ -196,10 +194,7 @@ macro_rules! init_test {
}

// This should fail now.
{
let ret = cpu.power_on();
assert!(ret.is_err(), "power_on passes twice");
}
assert!(cpu.power_on().is_err(), "power_on passes twice");
}
if $rand {
assert!(track.len() == 2, "didn't get both decimal states");
Expand Down

0 comments on commit 7ade788

Please sign in to comment.