Skip to content

Commit e894853

Browse files
committed
Add simple unit test for portio devices
Fixes #2 This is a trivial test that just verifies that we have the testing logic set up correctly for mythril_core
1 parent 1a8d9fe commit e894853

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

mythril_core/src/device.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,3 +114,15 @@ impl EmulatedDevice for ComDevice {
114114
Ok(())
115115
}
116116
}
117+
118+
#[cfg(test)]
119+
mod test {
120+
use super::*;
121+
122+
#[test]
123+
fn test_memmap_write_to_portio_fails() {
124+
let mut com = ComDevice::new(0);
125+
let addr = GuestPhysAddr::new(0);
126+
assert_eq!(com.on_mem_write(addr, &[0, 0, 0, 0]).is_err(), true);
127+
}
128+
}

0 commit comments

Comments
 (0)