test: add group jump instruction test
This commit is contained in:
@@ -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 }
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user