diff options
| author | Miquel Sabaté Solà <mssola@mssola.com> | 2026-09-07 16:38:48 +0200 |
|---|---|---|
| committer | Miquel Sabaté Solà <mssola@mssola.com> | 2026-09-07 16:38:48 +0200 |
| commit | 2f4caa8e39ac39969522c4a2a285256c9a13b2c6 (patch) | |
| tree | 35b3b2408472ee47c03ad2f562beff8dd4b0b13f /tests/vnf-tests/src | |
| parent | 44f98890a6d91cd9f0b64dec743a22a6e0013590 (diff) | |
| download | tools.nes-2f4caa8e39ac39969522c4a2a285256c9a13b2c6.tar.gz tools.nes-2f4caa8e39ac39969522c4a2a285256c9a13b2c6.zip | |
vnf: convert StatusRegister.break_mark to Option<u8>
Instead of assuming a default value, it's safer to just implement it in
Rust's native Option<_> type.
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
Diffstat (limited to 'tests/vnf-tests/src')
| -rw-r--r-- | tests/vnf-tests/src/main.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/vnf-tests/src/main.rs b/tests/vnf-tests/src/main.rs index 96e3b95..1f79655 100644 --- a/tests/vnf-tests/src/main.rs +++ b/tests/vnf-tests/src/main.rs @@ -88,10 +88,10 @@ fn run_break_mark_test(path: &Path) -> Result<(), String> { )); // Before vs after running 'brk'. - assert_eq!(machine.status_register.break_mark, 0); + assert!(machine.status_register.break_mark.is_none()); assert!(!machine.status_register.brk); let _ = machine.next_iteration(); - assert_eq!(machine.status_register.break_mark, 0x42); + assert_eq!(machine.status_register.break_mark.unwrap(), 0x42); assert!(machine.status_register.brk); // Skip instructions we don't care about here. @@ -104,12 +104,12 @@ fn run_break_mark_test(path: &Path) -> Result<(), String> { machine.current_instruction.identifier, InstructionIdentifier::Plp )); - assert_eq!(machine.status_register.break_mark, 0x42); + assert_eq!(machine.status_register.break_mark.unwrap(), 0x42); assert!(machine.status_register.brk); // After running 'plp'. let _ = machine.next_iteration(); - assert_eq!(machine.status_register.break_mark, 0x00); + assert!(machine.status_register.break_mark.is_none()); assert!(!machine.status_register.brk); Ok(()) |
