diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 53de6e0c..4c9e2914 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -16,9 +16,9 @@ add_executable( emu/cpu_test.cc emu/spc700_test.cc emu/ppu_test.cc - compression_test.cc - snes_palette_test.cc - room_object_test.cc + gfx/compression_test.cc + gfx/snes_palette_test.cc + zelda3/room_object_test.cc ../src/cli/patch.cc ../src/cli/command_handler.cc ../src/app/rom.cc diff --git a/test/emu/cpu_test.cc b/test/emu/cpu_test.cc index d7c49759..7c294a43 100644 --- a/test/emu/cpu_test.cc +++ b/test/emu/cpu_test.cc @@ -9,9 +9,13 @@ #include "app/emu/memory/memory.h" #include "app/emu/memory/mock_memory.h" -namespace yaze { -namespace app { -namespace emu { +namespace yaze_test { +namespace emu_test { + +using yaze::app::emu::AsmParser; +using yaze::app::emu::Cpu; +using yaze::app::emu::memory::MockClock; +using yaze::app::emu::memory::MockMemory; /** * \test Test fixture for CPU unit tests @@ -26,8 +30,8 @@ class CpuTest : public ::testing::Test { } AsmParser asm_parser; - memory::MockMemory mock_memory; - memory::MockClock mock_clock; + MockMemory mock_memory; + MockClock mock_clock; Cpu cpu{mock_memory, mock_clock}; }; @@ -39,7 +43,7 @@ using ::testing::Return; // ============================================================================ TEST_F(CpuTest, CheckMemoryContents) { - memory::MockMemory memory; + MockMemory memory; std::vector data = {0x00, 0x01, 0x02, 0x03, 0x04}; memory.SetMemoryContents(data); @@ -4167,6 +4171,5 @@ TEST_F(CpuTest, XCESwitchBackAndForth) { EXPECT_FALSE(cpu.E); // Emulation mode flag should be cleared } -} // namespace emu -} // namespace app -} // namespace yaze +} // namespace emu_test +} // namespace yaze_test diff --git a/test/emu/ppu_test.cc b/test/emu/ppu_test.cc index fb5e05a3..8e0a671f 100644 --- a/test/emu/ppu_test.cc +++ b/test/emu/ppu_test.cc @@ -6,10 +6,17 @@ #include "app/emu/memory/memory.h" #include "app/emu/memory/mock_memory.h" -namespace yaze { -namespace app { -namespace emu { -namespace video { +namespace yaze_test { +namespace emu_test { + +using yaze::app::emu::Clock; +using yaze::app::emu::memory::MockClock; +using yaze::app::emu::memory::MockMemory; +using yaze::app::emu::video::BackgroundMode; +using yaze::app::emu::video::PpuInterface; +using yaze::app::emu::video::SpriteAttributes; +using yaze::app::emu::video::Tilemap; +using yaze::app::gfx::Bitmap; /** * @brief Mock Ppu class for testing @@ -32,7 +39,7 @@ class MockPpu : public PpuInterface { MOCK_METHOD(const std::vector&, GetFrameBuffer, (), (const, override)); - MOCK_METHOD(std::shared_ptr, GetScreen, (), (const, override)); + MOCK_METHOD(std::shared_ptr, GetScreen, (), (const, override)); MOCK_METHOD(void, UpdateModeSettings, (), (override)); MOCK_METHOD(void, UpdateTileData, (), (override)); @@ -148,7 +155,5 @@ TEST_F(PpuTest, FrameComposition) { // buffer } -} // namespace video -} // namespace emu -} // namespace app -} // namespace yaze \ No newline at end of file +} // namespace emu_test +} // namespace yaze_test \ No newline at end of file diff --git a/test/emu/spc700_test.cc b/test/emu/spc700_test.cc index 8c9248a3..03175d1b 100644 --- a/test/emu/spc700_test.cc +++ b/test/emu/spc700_test.cc @@ -4,13 +4,13 @@ #include #include -namespace yaze { -namespace app { -namespace emu { -namespace audio { +namespace yaze_test { +namespace emu_test { using testing::_; using testing::Return; +using yaze::app::emu::audio::AudioRam; +using yaze::app::emu::audio::Spc700; /** * @brief MockAudioRam is a mock class for the AudioRam class. @@ -468,7 +468,5 @@ TEST_F(Spc700Test, BootIplRomOk) { // EXPECT_EQ(spc700.PC, 0xFFC1 + 0x3F); } -} // namespace audio -} // namespace emu -} // namespace app -} // namespace yaze +} // namespace emu_test +} // namespace yaze_test diff --git a/test/compression_test.cc b/test/gfx/compression_test.cc similarity index 100% rename from test/compression_test.cc rename to test/gfx/compression_test.cc diff --git a/test/snes_palette_test.cc b/test/gfx/snes_palette_test.cc similarity index 100% rename from test/snes_palette_test.cc rename to test/gfx/snes_palette_test.cc diff --git a/test/room_object_test.cc b/test/zelda3/room_object_test.cc similarity index 84% rename from test/room_object_test.cc rename to test/zelda3/room_object_test.cc index dfd5a58c..8a283106 100644 --- a/test/room_object_test.cc +++ b/test/zelda3/room_object_test.cc @@ -10,8 +10,8 @@ #include "app/gfx/bitmap.h" #include "app/rom.h" -namespace yaze { -namespace test { +namespace yaze_test { +namespace zelda3_test { TEST(DungeonObjectTest, RenderObjectsAsBitmaps) { app::ROM rom; @@ -21,5 +21,5 @@ TEST(DungeonObjectTest, RenderObjectsAsBitmaps) { app::zelda3::dungeon::DungeonObjectRenderer renderer; } -} // namespace test -} // namespace yaze \ No newline at end of file +} // namespace zelda3_test +} // namespace yaze_test \ No newline at end of file