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,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);