backend-infra-engineer: Pre-0.2.2 2024 Q2 snapshot
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -6,10 +6,21 @@
|
||||
#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::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
|
||||
*/
|
||||
class MockPpu : public PpuInterface {
|
||||
public:
|
||||
MOCK_METHOD(void, Write, (uint16_t address, uint8_t data), (override));
|
||||
@@ -28,7 +39,7 @@ class MockPpu : public PpuInterface {
|
||||
|
||||
MOCK_METHOD(const std::vector<uint8_t>&, GetFrameBuffer, (),
|
||||
(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, UpdateTileData, (), (override));
|
||||
@@ -48,6 +59,9 @@ class MockPpu : public PpuInterface {
|
||||
BackgroundMode bgMode;
|
||||
};
|
||||
|
||||
/**
|
||||
* \test Test fixture for PPU unit tests
|
||||
*/
|
||||
class PpuTest : public ::testing::Test {
|
||||
protected:
|
||||
MockMemory mock_memory;
|
||||
@@ -141,6 +155,5 @@ TEST_F(PpuTest, FrameComposition) {
|
||||
// buffer
|
||||
}
|
||||
|
||||
} // namespace emu
|
||||
} // namespace app
|
||||
} // namespace yaze
|
||||
} // namespace emu_test
|
||||
} // namespace yaze_test
|
||||
@@ -4,13 +4,17 @@
|
||||
#include <gmock/gmock.h>
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
namespace yaze {
|
||||
namespace app {
|
||||
namespace emu {
|
||||
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.
|
||||
*/
|
||||
class MockAudioRam : public AudioRam {
|
||||
public:
|
||||
MOCK_METHOD(void, reset, (), (override));
|
||||
@@ -51,6 +55,9 @@ class MockAudioRam : public AudioRam {
|
||||
std::vector<uint8_t> internal_audio_ram_ = std::vector<uint8_t>(0x10000, 0);
|
||||
};
|
||||
|
||||
/**
|
||||
* \test Spc700Test is a test fixture for the Spc700 class.
|
||||
*/
|
||||
class Spc700Test : public ::testing::Test {
|
||||
public:
|
||||
Spc700Test() = default;
|
||||
@@ -461,6 +468,5 @@ TEST_F(Spc700Test, BootIplRomOk) {
|
||||
// EXPECT_EQ(spc700.PC, 0xFFC1 + 0x3F);
|
||||
}
|
||||
|
||||
} // namespace emu
|
||||
} // namespace app
|
||||
} // namespace yaze
|
||||
} // namespace emu_test
|
||||
} // namespace yaze_test
|
||||
|
||||
Reference in New Issue
Block a user