- Upgraded CMake minimum version requirement to 3.16 and updated project version to 0.3.0. - Introduced new CMake presets for build configurations, including default, debug, and release options. - Added CI/CD workflows for continuous integration and release management, enhancing automated testing and deployment processes. - Integrated Asar assembler support with new wrapper classes and CLI commands for patching ROMs. - Implemented comprehensive tests for Asar integration, ensuring robust functionality and error handling. - Enhanced packaging configuration for cross-platform support, including Windows, macOS, and Linux. - Updated documentation and added test assets for improved clarity and usability.
55 lines
1.2 KiB
C++
55 lines
1.2 KiB
C++
#include "app/emu/video/ppu.h"
|
|
|
|
#include <gmock/gmock.h>
|
|
|
|
#include "mocks/mock_memory.h"
|
|
|
|
namespace yaze {
|
|
namespace test {
|
|
|
|
using yaze::emu::MockMemory;
|
|
using yaze::emu::BackgroundMode;
|
|
using yaze::emu::PpuInterface;
|
|
using yaze::emu::SpriteAttributes;
|
|
using yaze::emu::Tilemap;
|
|
|
|
/**
|
|
* @brief Mock Ppu class for testing
|
|
*/
|
|
class MockPpu : public PpuInterface {
|
|
public:
|
|
MOCK_METHOD(void, Write, (uint16_t address, uint8_t data), (override));
|
|
MOCK_METHOD(uint8_t, Read, (uint16_t address), (const, override));
|
|
|
|
std::vector<uint8_t> internalFrameBuffer;
|
|
std::vector<uint8_t> vram;
|
|
std::vector<SpriteAttributes> sprites;
|
|
std::vector<Tilemap> tilemaps;
|
|
BackgroundMode bgMode;
|
|
};
|
|
|
|
/**
|
|
* \test Test fixture for PPU unit tests
|
|
*/
|
|
class PpuTest : public ::testing::Test {
|
|
protected:
|
|
MockMemory mock_memory;
|
|
MockPpu mock_ppu;
|
|
|
|
PpuTest() {}
|
|
|
|
void SetUp() override {
|
|
ON_CALL(mock_ppu, Write(::testing::_, ::testing::_))
|
|
.WillByDefault([this](uint16_t address, uint8_t data) {
|
|
mock_ppu.vram[address] = data;
|
|
});
|
|
|
|
ON_CALL(mock_ppu, Read(::testing::_))
|
|
.WillByDefault(
|
|
[this](uint16_t address) { return mock_ppu.vram[address]; });
|
|
}
|
|
};
|
|
|
|
} // namespace test
|
|
} // namespace yaze
|