yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
dungeon_editor_test.h
Go to the documentation of this file.
1#ifndef YAZE_TEST_INTEGRATION_DUNGEON_EDITOR_TEST_H
2#define YAZE_TEST_INTEGRATION_DUNGEON_EDITOR_TEST_H
3
4#include <memory>
5#include <string>
6
8#include "app/rom.h"
10#include "gtest/gtest.h"
11
12namespace yaze {
13namespace test {
14
20class DungeonEditorIntegrationTest : public ::testing::Test {
21 protected:
22 void SetUp() override {
23 // Use the real ROM (try multiple locations)
24 rom_ = std::make_unique<Rom>();
25 auto status = rom_->LoadFromFile("assets/zelda3.sfc");
26 if (!status.ok()) {
27 status = rom_->LoadFromFile("build/bin/zelda3.sfc");
28 }
29 if (!status.ok()) {
30 status = rom_->LoadFromFile("zelda3.sfc");
31 }
32 ASSERT_TRUE(status.ok()) << "Could not load zelda3.sfc from any location";
33 ASSERT_TRUE(rom_->InitializeForTesting().ok());
34
35 // Initialize DungeonEditorV2 with ROM
36 dungeon_editor_ = std::make_unique<editor::DungeonEditorV2>();
37 dungeon_editor_->set_rom(rom_.get());
38
39 // Load editor data
40 auto load_status = dungeon_editor_->Load();
41 ASSERT_TRUE(load_status.ok()) << "Failed to load dungeon editor: "
42 << load_status.message();
43 }
44
45 void TearDown() override {
46 dungeon_editor_.reset();
47 rom_.reset();
48 }
49
50 std::unique_ptr<Rom> rom_;
51 std::unique_ptr<editor::DungeonEditorV2> dungeon_editor_;
52
53 static constexpr int kTestRoomId = 0x01;
54};
55
56} // namespace test
57} // namespace yaze
58
59#endif // YAZE_TEST_INTEGRATION_DUNGEON_EDITOR_TEST_H
Integration test framework using real ROM data.
std::unique_ptr< editor::DungeonEditorV2 > dungeon_editor_
Main namespace for the application.