1
0
mirror of https://github.com/mre/mos6502.git synced 2024-11-28 22:51:26 +00:00

Add branch_if_overflow_set_test().

This commit is contained in:
Andrew Keeton 2014-11-13 18:49:43 -05:00
parent 5e0d4c68cc
commit c00e170285

View File

@ -1006,3 +1006,15 @@ fn branch_if_overflow_clear_test() {
machine.branch_if_overflow_clear(Address(0xABCD));
assert_eq!(machine.registers.program_counter, Address(0xABCD));
}
#[test]
fn branch_if_overflow_set_test() {
let mut machine = Machine::new();
machine.branch_if_overflow_set(Address(0xABCD));
assert_eq!(machine.registers.program_counter, Address(0));
machine.registers.status.insert(PS_OVERFLOW);
machine.branch_if_overflow_set(Address(0xABCD));
assert_eq!(machine.registers.program_counter, Address(0xABCD));
}