fix: apply clang-format and exclude third-party libraries from formatting checks

- Applied clang-format to fix formatting violations in TUI and other source files
- Updated CMakeLists.txt to exclude src/lib/* from format targets to prevent third-party library violations
- Fixes clang-format violations in chat_tui.cc, tui.cc, and unified_layout.cc
- All source files now pass format-check target

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
scawful
2025-11-20 03:30:56 -05:00
parent 43a0e5e314
commit bb5e2002c2
433 changed files with 3092 additions and 4123 deletions

View File

@@ -1,9 +1,8 @@
#include "gtest/gtest.h"
#include "absl/strings/str_format.h"
#include "cli/service/ai/ai_action_parser.h"
#include "cli/service/ai/ai_gui_controller.h"
#include "cli/service/ai/vision_action_refiner.h"
#include "gtest/gtest.h"
#ifdef YAZE_WITH_GRPC
#include "cli/service/ai/gemini_ai_service.h"
@@ -15,7 +14,7 @@ namespace test {
/**
* @brief Integration tests for AI-controlled tile placement
*
*
* These tests verify the complete pipeline:
* 1. Parse natural language commands
* 2. Execute actions via gRPC

View File

@@ -1,4 +1,6 @@
#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include <filesystem>
#include <fstream>
@@ -7,9 +9,6 @@
#include "core/asar_wrapper.h"
#include "testing.h"
#include <gmock/gmock.h>
#include <gtest/gtest.h>
namespace yaze {
namespace test {
namespace integration {

View File

@@ -4,6 +4,7 @@
#endif
#include <gtest/gtest.h>
#include <filesystem>
#include <fstream>
@@ -330,7 +331,8 @@ TEST_F(AsarRomIntegrationTest, GameplayModificationPatch) {
// Check health modification at 0x7EF36C -> ROM offset would need calculation
// For a proper test, we'd need to convert SNES addresses to ROM offsets
// Check if custom routine was inserted at 0xC000 -> ROM offset 0x18000 (in LoROM)
// Check if custom routine was inserted at 0xC000 -> ROM offset 0x18000 (in
// LoROM)
const uint32_t rom_offset = 0x18000; // Bank $00:C000 in LoROM
if (rom_offset < rom_copy.size()) {
// Check for SEP #$20 instruction (0xE2 0x20)

View File

@@ -14,7 +14,7 @@ namespace test {
/**
* @brief Integration test framework using real ROM data
*
*
* Updated for DungeonEditorV2 with card-based architecture
*/
class DungeonEditorIntegrationTest : public ::testing::Test {

View File

@@ -13,7 +13,7 @@ namespace test {
/**
* @brief Integration test framework for DungeonEditorV2
*
*
* Tests the simplified component delegation architecture
*/
class DungeonEditorV2IntegrationTest : public ::testing::Test {

View File

@@ -21,12 +21,14 @@ namespace test {
/**
* @class EditorIntegrationTest
* @brief Base class for editor integration tests
*
* This class provides common functionality for testing editors in the application.
* It sets up the test environment and provides helper methods for ROM operations.
*
* For UI interaction testing, use the ImGui test engine API directly within your test functions:
*
*
* This class provides common functionality for testing editors in the
* application. It sets up the test environment and provides helper methods for
* ROM operations.
*
* For UI interaction testing, use the ImGui test engine API directly within
* your test functions:
*
* ImGuiTest* test = IM_REGISTER_TEST(engine, "test_suite", "test_name");
* test->TestFunc = [](ImGuiTestContext* ctx) {
* ctx->SetRef("Window Name");

View File

@@ -1,10 +1,11 @@
#include "app/editor/overworld/tile16_editor.h"
#include <gtest/gtest.h>
#include <iostream>
#include <memory>
#include <vector>
#include <gtest/gtest.h>
#include "app/gfx/backend/sdl2_renderer.h"
#include "app/gfx/core/bitmap.h"
#include "app/gfx/render/tilemap.h"

View File

@@ -1,4 +1,5 @@
#include <gtest/gtest.h>
#include <chrono>
#include <map>
#include <memory>

View File

@@ -1,16 +1,13 @@
// Integration tests for dungeon object rendering using ObjectDrawer
// Updated for DungeonEditorV2 architecture - uses ObjectDrawer (production system)
// instead of the obsolete ObjectRenderer
// Updated for DungeonEditorV2 architecture - uses ObjectDrawer (production
// system) instead of the obsolete ObjectRenderer
#ifndef IMGUI_DEFINE_MATH_OPERATORS
#define IMGUI_DEFINE_MATH_OPERATORS
#endif
#include "zelda3/dungeon/object_drawer.h"
#include "zelda3/dungeon/room.h"
#include "zelda3/dungeon/room_object.h"
#include <gtest/gtest.h>
#include <chrono>
#include <memory>
#include <vector>
@@ -20,13 +17,16 @@
#include "app/rom.h"
#include "test_utils.h"
#include "testing.h"
#include "zelda3/dungeon/object_drawer.h"
#include "zelda3/dungeon/room.h"
#include "zelda3/dungeon/room_object.h"
namespace yaze {
namespace test {
/**
* @brief Tests for ObjectDrawer with realistic dungeon scenarios
*
*
* These tests validate that ObjectDrawer correctly renders dungeon objects
* to BackgroundBuffers using pattern-based drawing routines.
*/

View File

@@ -1,12 +1,9 @@
// Integration tests for dungeon object rendering using ObjectDrawer
// Updated for DungeonEditorV2 architecture - uses ObjectDrawer (production system)
// instead of the obsolete ObjectRenderer
#include "zelda3/dungeon/object_drawer.h"
#include "zelda3/dungeon/room.h"
#include "zelda3/dungeon/room_object.h"
// Updated for DungeonEditorV2 architecture - uses ObjectDrawer (production
// system) instead of the obsolete ObjectRenderer
#include <gtest/gtest.h>
#include <chrono>
#include <memory>
#include <vector>
@@ -16,13 +13,16 @@
#include "app/rom.h"
#include "test_utils.h"
#include "testing.h"
#include "zelda3/dungeon/object_drawer.h"
#include "zelda3/dungeon/room.h"
#include "zelda3/dungeon/room_object.h"
namespace yaze {
namespace test {
/**
* @brief Tests for ObjectDrawer with realistic dungeon scenarios
*
*
* These tests validate that ObjectDrawer correctly renders dungeon objects
* to BackgroundBuffers using pattern-based drawing routines.
*/

View File

@@ -1,9 +1,8 @@
#include "gtest/gtest.h"
#include "absl/status/status.h"
#include "app/gfx/background_buffer.h"
#include "app/gfx/snes_palette.h"
#include "app/rom.h"
#include "gtest/gtest.h"
#include "zelda3/dungeon/object_drawer.h"
#include "zelda3/dungeon/object_parser.h"
#include "zelda3/dungeon/room.h"

View File

@@ -1,4 +1,5 @@
#include <gtest/gtest.h>
#include <filesystem>
#include "app/editor/message/message_data.h"
@@ -211,7 +212,8 @@ TEST_F(MessageRomTest, BuildDictionaryEntries_CorrectSize) {
TEST_F(MessageRomTest, ParseMessageData_CommandWithArgument_NoExtraCharacters) {
// This test specifically checks for the bug where command arguments
// were being incorrectly parsed as characters (e.g., capital 'A' after [W])
// The bug was caused by using a range-based for loop while also tracking position
// The bug was caused by using a range-based for loop while also tracking
// position
// Message: [W:01]ABC
// Bytes: 0x6B (W command), 0x01 (argument), 0x00 (A), 0x01 (B), 0x02 (C)

View File

@@ -1,4 +1,5 @@
#include <gtest/gtest.h>
#include <filesystem>
#include <memory>
#include <string>
@@ -13,9 +14,10 @@ namespace yaze {
namespace zelda3 {
/**
* @brief Comprehensive overworld integration test that validates YAZE C++
* implementation against ZScream C# logic and existing test infrastructure
*
* @brief Comprehensive overworld integration test that validates YAZE C++
* implementation against ZScream C# logic and existing test
* infrastructure
*
* This test suite:
* 1. Validates overworld loading logic matches ZScream behavior
* 2. Tests integration with ZSCustomOverworld versions (vanilla, v2, v3)
@@ -78,7 +80,8 @@ class OverworldIntegrationTest : public ::testing::Test {
mock_rom_data_[0x012844 + i] = 0x00; // Small areas
}
// Setup entrance data (matches ZScream Constants.OWEntranceMap/Pos/EntranceId)
// Setup entrance data (matches ZScream
// Constants.OWEntranceMap/Pos/EntranceId)
for (int i = 0; i < 129; i++) {
mock_rom_data_[0x0DB96F + (i * 2)] = i & 0xFF; // Map ID
mock_rom_data_[0x0DB96F + (i * 2) + 1] = (i >> 8) & 0xFF;
@@ -267,7 +270,8 @@ TEST_F(OverworldIntegrationTest, RomDependentTestSuiteCompatibility) {
<< "Real ROM required for RomDependentTestSuite compatibility testing";
}
// Test that our overworld loading works with the same patterns as RomDependentTestSuite
// Test that our overworld loading works with the same patterns as
// RomDependentTestSuite
auto status = overworld_->Load(rom_.get());
ASSERT_TRUE(status.ok());
@@ -288,7 +292,8 @@ TEST_F(OverworldIntegrationTest, RomDependentTestSuiteCompatibility) {
EXPECT_LE(map.area_size(), AreaSizeEnum::TallArea);
}
// Test that sprite data is accessible (matches RomDependentTestSuite expectations)
// Test that sprite data is accessible (matches RomDependentTestSuite
// expectations)
const auto& sprites = overworld_->sprites(0);
EXPECT_EQ(sprites.size(), 3); // Three game states
@@ -359,8 +364,8 @@ TEST_F(OverworldIntegrationTest, ZScreamCoordinateCompatibility) {
// int p = mapPos >> 1;
// int x = p % 64;
// int y = p >> 6;
// int real_x = (x * 16) + (((mapId % 64) - (((mapId % 64) / 8) * 8)) * 512);
// int real_y = (y * 16) + (((mapId % 64) / 8) * 512);
// int real_x = (x * 16) + (((mapId % 64) - (((mapId % 64) / 8) * 8)) *
// 512); int real_y = (y * 16) + (((mapId % 64) / 8) * 512);
uint16_t map_pos = entrance.map_pos_;
uint16_t map_id = entrance.map_id_;
@@ -387,8 +392,8 @@ TEST_F(OverworldIntegrationTest, ZScreamCoordinateCompatibility) {
// int p = (mapPos + 0x400) >> 1;
// int x = p % 64;
// int y = p >> 6;
// int real_x = (x * 16) + (((mapId % 64) - (((mapId % 64) / 8) * 8)) * 512);
// int real_y = (y * 16) + (((mapId % 64) / 8) * 512);
// int real_x = (x * 16) + (((mapId % 64) - (((mapId % 64) / 8) * 8)) *
// 512); int real_y = (y * 16) + (((mapId % 64) / 8) * 512);
uint16_t map_pos = hole.map_pos_;
uint16_t map_id = hole.map_id_;

View File

@@ -277,8 +277,7 @@ TEST_F(RoomIntegrationTest, BinaryDataExactMatch) {
break;
}
}
if (might_be_final)
break;
if (might_be_final) break;
}
}
@@ -319,12 +318,9 @@ TEST_F(RoomIntegrationTest, KnownRoomData) {
bool found_layer1 = false;
for (const auto& obj : objects) {
if (obj.id_ < 0x100)
found_type1 = true;
if (obj.GetLayerValue() == 0)
found_layer0 = true;
if (obj.GetLayerValue() == 1)
found_layer1 = true;
if (obj.id_ < 0x100) found_type1 = true;
if (obj.GetLayerValue() == 0) found_layer0 = true;
if (obj.GetLayerValue() == 1) found_layer1 = true;
}
EXPECT_TRUE(found_type1) << "Should have Type 1 objects";

View File

@@ -1,4 +1,5 @@
#include <gtest/gtest.h>
#include <fstream>
#include <iomanip>
#include <iostream>
@@ -125,7 +126,6 @@ TEST_F(SpritePositionTest, MapCoordinateCalculations) {
if (!sprite.deleted() &&
sprite.map_id() < 0x40 + (current_world * 0x40) &&
sprite.map_id() >= (current_world * 0x40)) {
// Calculate map position
int sprite_map_id = sprite.map_id();
int local_map_index = sprite_map_id - (current_world * 0x40);