1
0
mirror of https://github.com/mre/mos6502.git synced 2024-11-28 07:49:19 +00:00

Add branch_if_carry_set_test().

This commit is contained in:
Andrew Keeton 2014-11-06 19:38:56 -05:00
parent 8c0e4949a9
commit eb5c3f3c2a

View File

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