Rearrange test namespaces

This commit is contained in:
scawful
2024-04-14 09:30:21 -05:00
parent ed7b1aa3df
commit ce2cae2242
7 changed files with 39 additions and 33 deletions

View File

@@ -16,9 +16,9 @@ add_executable(
emu/cpu_test.cc emu/cpu_test.cc
emu/spc700_test.cc emu/spc700_test.cc
emu/ppu_test.cc emu/ppu_test.cc
compression_test.cc gfx/compression_test.cc
snes_palette_test.cc gfx/snes_palette_test.cc
room_object_test.cc zelda3/room_object_test.cc
../src/cli/patch.cc ../src/cli/patch.cc
../src/cli/command_handler.cc ../src/cli/command_handler.cc
../src/app/rom.cc ../src/app/rom.cc

View File

@@ -9,9 +9,13 @@
#include "app/emu/memory/memory.h" #include "app/emu/memory/memory.h"
#include "app/emu/memory/mock_memory.h" #include "app/emu/memory/mock_memory.h"
namespace yaze { namespace yaze_test {
namespace app { namespace emu_test {
namespace emu {
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 * \test Test fixture for CPU unit tests
@@ -26,8 +30,8 @@ class CpuTest : public ::testing::Test {
} }
AsmParser asm_parser; AsmParser asm_parser;
memory::MockMemory mock_memory; MockMemory mock_memory;
memory::MockClock mock_clock; MockClock mock_clock;
Cpu cpu{mock_memory, mock_clock}; Cpu cpu{mock_memory, mock_clock};
}; };
@@ -39,7 +43,7 @@ using ::testing::Return;
// ============================================================================ // ============================================================================
TEST_F(CpuTest, CheckMemoryContents) { TEST_F(CpuTest, CheckMemoryContents) {
memory::MockMemory memory; MockMemory memory;
std::vector<uint8_t> data = {0x00, 0x01, 0x02, 0x03, 0x04}; std::vector<uint8_t> data = {0x00, 0x01, 0x02, 0x03, 0x04};
memory.SetMemoryContents(data); memory.SetMemoryContents(data);
@@ -4167,6 +4171,5 @@ TEST_F(CpuTest, XCESwitchBackAndForth) {
EXPECT_FALSE(cpu.E); // Emulation mode flag should be cleared EXPECT_FALSE(cpu.E); // Emulation mode flag should be cleared
} }
} // namespace emu } // namespace emu_test
} // namespace app } // namespace yaze_test
} // namespace yaze

View File

@@ -6,10 +6,17 @@
#include "app/emu/memory/memory.h" #include "app/emu/memory/memory.h"
#include "app/emu/memory/mock_memory.h" #include "app/emu/memory/mock_memory.h"
namespace yaze { namespace yaze_test {
namespace app { namespace emu_test {
namespace emu {
namespace video { 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 * @brief Mock Ppu class for testing
@@ -32,7 +39,7 @@ class MockPpu : public PpuInterface {
MOCK_METHOD(const std::vector<uint8_t>&, GetFrameBuffer, (), MOCK_METHOD(const std::vector<uint8_t>&, GetFrameBuffer, (),
(const, override)); (const, override));
MOCK_METHOD(std::shared_ptr<gfx::Bitmap>, GetScreen, (), (const, override)); MOCK_METHOD(std::shared_ptr<Bitmap>, GetScreen, (), (const, override));
MOCK_METHOD(void, UpdateModeSettings, (), (override)); MOCK_METHOD(void, UpdateModeSettings, (), (override));
MOCK_METHOD(void, UpdateTileData, (), (override)); MOCK_METHOD(void, UpdateTileData, (), (override));
@@ -148,7 +155,5 @@ TEST_F(PpuTest, FrameComposition) {
// buffer // buffer
} }
} // namespace video } // namespace emu_test
} // namespace emu } // namespace yaze_test
} // namespace app
} // namespace yaze

View File

@@ -4,13 +4,13 @@
#include <gmock/gmock.h> #include <gmock/gmock.h>
#include <gtest/gtest.h> #include <gtest/gtest.h>
namespace yaze { namespace yaze_test {
namespace app { namespace emu_test {
namespace emu {
namespace audio {
using testing::_; using testing::_;
using testing::Return; 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. * @brief MockAudioRam is a mock class for the AudioRam class.
@@ -468,7 +468,5 @@ TEST_F(Spc700Test, BootIplRomOk) {
// EXPECT_EQ(spc700.PC, 0xFFC1 + 0x3F); // EXPECT_EQ(spc700.PC, 0xFFC1 + 0x3F);
} }
} // namespace audio } // namespace emu_test
} // namespace emu } // namespace yaze_test
} // namespace app
} // namespace yaze

View File

@@ -10,8 +10,8 @@
#include "app/gfx/bitmap.h" #include "app/gfx/bitmap.h"
#include "app/rom.h" #include "app/rom.h"
namespace yaze { namespace yaze_test {
namespace test { namespace zelda3_test {
TEST(DungeonObjectTest, RenderObjectsAsBitmaps) { TEST(DungeonObjectTest, RenderObjectsAsBitmaps) {
app::ROM rom; app::ROM rom;
@@ -21,5 +21,5 @@ TEST(DungeonObjectTest, RenderObjectsAsBitmaps) {
app::zelda3::dungeon::DungeonObjectRenderer renderer; app::zelda3::dungeon::DungeonObjectRenderer renderer;
} }
} // namespace test } // namespace zelda3_test
} // namespace yaze } // namespace yaze_test