Skip to content

Commit

Permalink
Place memory tests in the right place
Browse files Browse the repository at this point in the history
  • Loading branch information
LeoRiether committed Sep 12, 2021
1 parent 091511b commit ee971b5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
15 changes: 15 additions & 0 deletions src/simulator/memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,3 +211,18 @@ impl Memory {
Some(bytes_read)
}
}

#[cfg(test)]
mod test {
use super::*;

#[test]
fn test_has_zero_byte() {
assert!(has_zero_byte(0xff00ff00));
assert!(!has_zero_byte(0x10203040));
assert!(has_zero_byte(0x0011ff22));
assert!(!has_zero_byte(0x12345678));
assert!(has_zero_byte(0x12005678));
assert!(has_zero_byte(0x11223300));
}
}
15 changes: 0 additions & 15 deletions src/simulator/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -598,18 +598,3 @@ impl Simulator {
}
}

// as if this file wasn't big enough already
#[cfg(test)]
mod test {
use super::*;

#[test]
fn test_has_zero_byte() {
assert!(has_zero_byte(0xff00ff00));
assert!(!has_zero_byte(0x10203040));
assert!(has_zero_byte(0x0011ff22));
assert!(!has_zero_byte(0x12345678));
assert!(has_zero_byte(0x12005678));
assert!(has_zero_byte(0x11223300));
}
}

0 comments on commit ee971b5

Please sign in to comment.