Skip to content

Commit cf500e4

Browse files
committed
Added SRE test
1 parent 915bea2 commit cf500e4

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

build/Testing/Temporary/LastTest.log

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
Start testing: Aug 03 21:56 CEST
1+
Start testing: Aug 04 10:35 CEST
22
----------------------------------------------------------
3-
End testing: Aug 03 21:56 CEST
3+
End testing: Aug 04 10:35 CEST

src/test/tests.cpp

+14-3
Original file line numberDiff line numberDiff line change
@@ -723,7 +723,7 @@ TEST(AF6502Tests, RRATest)
723723
TEST(AF6502Tests, SAXTest)
724724
{
725725
// Create CPU
726-
CPU cpu(4);
726+
CPU cpu(1);
727727

728728
// Set test values in accumulator and X
729729
cpu.A = 0xED;
@@ -739,7 +739,7 @@ TEST(AF6502Tests, SAXTest)
739739
TEST(AF6502Tests, SLOTest)
740740
{
741741
// Create CPU
742-
CPU cpu(4);
742+
CPU cpu(3);
743743

744744
// Set test values in memory and accumulator
745745
cpu.memory.WriteByte(0x6502, 0x54);
@@ -750,12 +750,23 @@ TEST(AF6502Tests, SLOTest)
750750
EXPECT_EQ(0xA8, cpu.memory.ReadByte(0x6502)); // Check result
751751
EXPECT_EQ(false, cpu.C); // Check carry
752752
EXPECT_EQ(0xDC, cpu.A); // Check accumulator
753+
EXPECT_EQ(0, cpu.cycles); // check cycles consumption
753754
}
754755

755756
// SRE test
756757
TEST(AF6502Tests, SRETest)
757758
{
758-
FAIL();
759+
// Create CPU
760+
CPU cpu(3);
761+
762+
// Set test value in memory
763+
cpu.memory.WriteByte(0x2505, 0x65);
764+
765+
cpu.SRE(0x2505);
766+
767+
EXPECT_EQ(0x32, cpu.memory.ReadByte(0x2505)); // Check result
768+
EXPECT_EQ(true, cpu.C); // Check carry
769+
EXPECT_EQ(0, cpu.cycles); // Check cycles consumption
759770
}
760771

761772
// Execute test

0 commit comments

Comments
 (0)