Skip to content

Commit

Permalink
Update flag operations tests to verify cycle count
Browse files Browse the repository at this point in the history
  • Loading branch information
Shock9616 committed Nov 26, 2024
1 parent 1f59d27 commit 4189348
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/unit/execute_instruction_flagops_tests.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ void test_instr_clc_set() {
simulateMainloop(&memory, &processor);

CU_ASSERT_EQUAL(processor.P, 0x30);
CU_ASSERT_EQUAL(cycles, 2);
}

void test_instr_clc_clear() {
Expand All @@ -97,6 +98,7 @@ void test_instr_clc_clear() {
simulateMainloop(&memory, &processor);

CU_ASSERT_EQUAL(processor.P, 0x30);
CU_ASSERT_EQUAL(cycles, 2);
}

void test_instr_cld_set() {
Expand All @@ -106,6 +108,7 @@ void test_instr_cld_set() {
simulateMainloop(&memory, &processor);

CU_ASSERT_EQUAL(processor.P, 0x30);
CU_ASSERT_EQUAL(cycles, 2);
}

void test_instr_cld_clear() {
Expand All @@ -115,6 +118,7 @@ void test_instr_cld_clear() {
simulateMainloop(&memory, &processor);

CU_ASSERT_EQUAL(processor.P, 0x30);
CU_ASSERT_EQUAL(cycles, 2);
}

void test_instr_cli_set() {
Expand All @@ -124,6 +128,7 @@ void test_instr_cli_set() {
simulateMainloop(&memory, &processor);

CU_ASSERT_EQUAL(processor.P, 0x30);
CU_ASSERT_EQUAL(cycles, 2);
}

void test_instr_cli_clear() {
Expand All @@ -133,6 +138,7 @@ void test_instr_cli_clear() {
simulateMainloop(&memory, &processor);

CU_ASSERT_EQUAL(processor.P, 0x30);
CU_ASSERT_EQUAL(cycles, 2);
}

void test_instr_clv_set() {
Expand All @@ -142,6 +148,7 @@ void test_instr_clv_set() {
simulateMainloop(&memory, &processor);

CU_ASSERT_EQUAL(processor.P, 0x30);
CU_ASSERT_EQUAL(cycles, 2);
}

void test_instr_clv_clear() {
Expand All @@ -151,6 +158,7 @@ void test_instr_clv_clear() {
simulateMainloop(&memory, &processor);

CU_ASSERT_EQUAL(processor.P, 0x30);
CU_ASSERT_EQUAL(cycles, 2);
}

void test_instr_sec_set() {
Expand All @@ -160,6 +168,7 @@ void test_instr_sec_set() {
simulateMainloop(&memory, &processor);

CU_ASSERT_EQUAL(processor.P, 0x31);
CU_ASSERT_EQUAL(cycles, 2);
}

void test_instr_sec_clear() {
Expand All @@ -169,6 +178,7 @@ void test_instr_sec_clear() {
simulateMainloop(&memory, &processor);

CU_ASSERT_EQUAL(processor.P, 0x31);
CU_ASSERT_EQUAL(cycles, 2);
}

void test_instr_sed_set() {
Expand All @@ -178,6 +188,7 @@ void test_instr_sed_set() {
simulateMainloop(&memory, &processor);

CU_ASSERT_EQUAL(processor.P, 0x38);
CU_ASSERT_EQUAL(cycles, 2);
}

void test_instr_sed_clear() {
Expand All @@ -187,6 +198,7 @@ void test_instr_sed_clear() {
simulateMainloop(&memory, &processor);

CU_ASSERT_EQUAL(processor.P, 0x38);
CU_ASSERT_EQUAL(cycles, 2);
}

void test_instr_sei_set() {
Expand All @@ -196,6 +208,7 @@ void test_instr_sei_set() {
simulateMainloop(&memory, &processor);

CU_ASSERT_EQUAL(processor.P, 0x34);
CU_ASSERT_EQUAL(cycles, 2);
}

void test_instr_sei_clear() {
Expand All @@ -205,6 +218,7 @@ void test_instr_sei_clear() {
simulateMainloop(&memory, &processor);

CU_ASSERT_EQUAL(processor.P, 0x34);
CU_ASSERT_EQUAL(cycles, 2);
}

// ---------- Run Tests ----------
Expand Down

0 comments on commit 4189348

Please sign in to comment.