From b7211f43c2d806b69ee05a36fbdd8cec240645de Mon Sep 17 00:00:00 2001 From: Peter Evans Date: Fri, 29 Dec 2017 17:14:20 -0600 Subject: [PATCH] Testing relative label assignments --- tests/mos6502.dis.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/mos6502.dis.c b/tests/mos6502.dis.c index 740abf7..332d609 100644 --- a/tests/mos6502.dis.c +++ b/tests/mos6502.dis.c @@ -239,9 +239,18 @@ Test(mos6502_dis, jump_label) mos6502_dis_jump_label(123, 0, IND); cr_assert_eq(mos6502_dis_is_jump_label(123), true); - mos6502_dis_jump_unlabel(123); cr_assert_eq(mos6502_dis_is_jump_label(123), false); + + // Testing forward relative + mos6502_dis_jump_label(123, 10, REL); + cr_assert_eq(mos6502_dis_is_jump_label(123 + 10), true); + mos6502_dis_jump_unlabel(123 + 10); + + // Testing backward relative + mos6502_dis_jump_label(133, 1000, REL); + cr_assert_eq(mos6502_dis_is_jump_label(133 + 1000 - 256), true); + mos6502_dis_jump_unlabel(133 + 1000 - 256); } Test(mos6502_dis, label)