1
0
mirror of https://github.com/mre/mos6502.git synced 2024-06-13 15:29:33 +00:00

Add branch_if_carry_clear_test().

This commit is contained in:
Andrew Keeton 2014-11-06 19:30:05 -05:00
parent 690907f1c4
commit ecb3f07459

View File

@ -860,6 +860,19 @@ fn jump_test() {
assert_eq!(machine.registers.program_counter, addr);
}
#[test]
fn branch_if_carry_clear_test() {
let mut machine = Machine::new();
machine.execute_instruction((instruction::SEC, instruction::UseImplied));
machine.branch_if_carry_clear(Address(0xABCD));
assert_eq!(machine.registers.program_counter, Address(0));
machine.execute_instruction((instruction::CLC, instruction::UseImplied));
machine.branch_if_carry_clear(Address(0xABCD));
assert_eq!(machine.registers.program_counter, Address(0xABCD));
}
#[test]
fn branch_if_minus_test() {
{