Files
yaze/test/integration/dungeon_editor_v2_test.h
scawful 37e8e77376 feat: Introduce DungeonEditorV2 with component delegation for improved architecture
- Added DungeonEditorV2 to streamline dungeon editing by delegating tasks to specialized components.
- Implemented comprehensive integration tests to validate functionality and ensure proper ROM handling.
- Achieved 100% pass rate for all integration tests, enhancing reliability and performance of the editor.
- Updated test suite to include tests for the new editor, ensuring robust coverage and error handling.
2025-10-04 14:32:56 -04:00

53 lines
1.3 KiB
C++

#ifndef YAZE_TEST_INTEGRATION_DUNGEON_EDITOR_V2_TEST_H
#define YAZE_TEST_INTEGRATION_DUNGEON_EDITOR_V2_TEST_H
#include <memory>
#include <string>
#include "app/editor/dungeon/dungeon_editor_v2.h"
#include "app/rom.h"
#include "gtest/gtest.h"
namespace yaze {
namespace test {
/**
* @brief Integration test framework for DungeonEditorV2
*
* Tests the simplified component delegation architecture
*/
class DungeonEditorV2IntegrationTest : public ::testing::Test {
protected:
void SetUp() override {
// Use the real ROM (try multiple locations)
rom_ = std::make_unique<Rom>();
auto status = rom_->LoadFromFile("assets/zelda3.sfc");
if (!status.ok()) {
status = rom_->LoadFromFile("build/bin/zelda3.sfc");
}
if (!status.ok()) {
status = rom_->LoadFromFile("zelda3.sfc");
}
ASSERT_TRUE(status.ok()) << "Could not load zelda3.sfc from any location";
// Create V2 editor with ROM
dungeon_editor_v2_ = std::make_unique<editor::DungeonEditorV2>(rom_.get());
}
void TearDown() override {
dungeon_editor_v2_.reset();
rom_.reset();
}
std::unique_ptr<Rom> rom_;
std::unique_ptr<editor::DungeonEditorV2> dungeon_editor_v2_;
static constexpr int kTestRoomId = 0x01;
};
} // namespace test
} // namespace yaze
#endif // YAZE_TEST_INTEGRATION_DUNGEON_EDITOR_V2_TEST_H