mirror of
https://github.com/mre/mos6502.git
synced 2025-01-21 23:30:34 +00:00
Add branch_if_positive_test().
This commit is contained in:
parent
a80c98b000
commit
eb27595cd5
@ -956,3 +956,16 @@ fn branch_if_minus_test() {
|
||||
assert_eq!(machine.registers.program_counter, Address(0xABCD));
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn branch_if_positive_test() {
|
||||
let mut machine = Machine::new();
|
||||
|
||||
machine.registers.status.insert(PS_NEGATIVE);
|
||||
machine.branch_if_positive(Address(0xABCD));
|
||||
assert_eq!(machine.registers.program_counter, Address(0));
|
||||
|
||||
machine.registers.status.remove(PS_NEGATIVE);
|
||||
machine.branch_if_positive(Address(0xABCD));
|
||||
assert_eq!(machine.registers.program_counter, Address(0xABCD));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user