From db7e0ba849371b6fac03aca45d06013985a86cc9 Mon Sep 17 00:00:00 2001 From: Stevan Freeborn Date: Sat, 18 Jul 2026 17:40:16 -0500 Subject: [PATCH] test: add group jump instruction test --- tests/test_chip8.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/test_chip8.c b/tests/test_chip8.c index 8ce57fb..3a95e55 100644 --- a/tests/test_chip8.c +++ b/tests/test_chip8.c @@ -61,6 +61,22 @@ static MunitResult test_ret(const MunitParameter params[], void* data) { return MUNIT_OK; } +static MunitResult test_group_jump(const MunitParameter params[], void* data) { + (void)params; + (void)data; + + chip_eight_t chip; + chip8_init(&chip); + + write_jump_instruction(&chip, 1); + + chip8_step(&chip); + + munit_assert_uint16(chip.pc, ==, 1); + + return MUNIT_OK; +} + static MunitResult test_add_carry(const MunitParameter params[], void* data) { (void)params; (void)data; @@ -84,6 +100,7 @@ static MunitTest tests[] = { { "/init", test_init, NULL, NULL, MUNIT_TEST_OPTION_NONE, NULL }, { "/cls", test_cls, NULL, NULL, MUNIT_TEST_OPTION_NONE, NULL }, { "/test_ret", test_ret, NULL, NULL, MUNIT_TEST_OPTION_NONE, NULL }, + { "/test_group_jump", test_group_jump, NULL, NULL, MUNIT_TEST_OPTION_NONE, NULL }, { "/test_add_carry", test_add_carry, NULL, NULL, MUNIT_TEST_OPTION_NONE, NULL }, { NULL, NULL, NULL, NULL, MUNIT_TEST_OPTION_NONE, NULL } };