1
0
mirror of https://github.com/mre/mos6502.git synced 2024-12-23 03:29:51 +00:00

beef up test

This commit is contained in:
Alex Weisberger 2014-10-07 23:56:27 -04:00
parent d132f040f2
commit 8fd38026aa

View File

@ -323,4 +323,30 @@ fn dec_x_test() {
assert_eq!(machine.registers.status.contains(ps_zero), false);
assert_eq!(machine.registers.status.contains(ps_negative), true);
assert_eq!(machine.registers.status.contains(ps_overflow), false);
machine.load_x_register(5);
machine.dec_x();
assert_eq!(machine.registers.index_x, 4);
assert_eq!(machine.registers.status.contains(ps_carry), false);
assert_eq!(machine.registers.status.contains(ps_zero), false);
assert_eq!(machine.registers.status.contains(ps_negative), false);
assert_eq!(machine.registers.status.contains(ps_overflow), false);
machine.dec_x();
machine.dec_x();
machine.dec_x();
machine.dec_x();
assert_eq!(machine.registers.index_x, 0);
assert_eq!(machine.registers.status.contains(ps_carry), false);
assert_eq!(machine.registers.status.contains(ps_zero), true);
assert_eq!(machine.registers.status.contains(ps_negative), false);
assert_eq!(machine.registers.status.contains(ps_overflow), false);
machine.dec_x();
assert_eq!(machine.registers.index_x, -1);
assert_eq!(machine.registers.status.contains(ps_carry), false);
assert_eq!(machine.registers.status.contains(ps_zero), false);
assert_eq!(machine.registers.status.contains(ps_negative), true);
assert_eq!(machine.registers.status.contains(ps_overflow), false);
}