From bf46e44e1cb6027a072819a2a3aa3be32651f6e1 Mon Sep 17 00:00:00 2001 From: skal Date: Tue, 3 Feb 2026 18:44:41 +0100 Subject: refactor: Task #20 - Platform & Code Hygiene - Consolidated all WebGPU shims and platform-specific logic into src/platform.h. - Refactored platform_init to return PlatformState by value and platform_poll to automatically refresh time and aspect_ratio. - Removed STL dependencies (std::map, std::vector, std::string) from AssetManager and Procedural subsystems. - Fixed Windows cross-compilation by adjusting include paths and linker flags in CMakeLists.txt and updating build_win.sh. - Removed redundant direct inclusions of GLFW/glfw3.h and WebGPU headers across the project. - Applied clang-format and updated documentation. handoff(Gemini): Completed Task #20 and 20.1. Platform abstraction is now unified, and core paths are STL-free. Windows build is stable. --- src/tests/test_tracker.cc | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'src/tests/test_tracker.cc') diff --git a/src/tests/test_tracker.cc b/src/tests/test_tracker.cc index ad84163..2a9239c 100644 --- a/src/tests/test_tracker.cc +++ b/src/tests/test_tracker.cc @@ -1,17 +1,16 @@ // This file is part of the 64k demo project. // It tests the core functionality of the audio tracker engine. -#include "audio/tracker.h" -#include "audio/synth.h" #include "audio/gen.h" +#include "audio/synth.h" +#include "audio/tracker.h" // #include "generated/music_data.h" // Will be generated by tracker_compiler #include #include -// Forward declaration for generated data to avoid compilation issues before generation -// extern const NoteParams g_tracker_samples[]; -// extern const uint32_t g_tracker_samples_count; -// extern const TrackerPattern g_tracker_patterns[]; +// Forward declaration for generated data to avoid compilation issues before +// generation extern const NoteParams g_tracker_samples[]; extern const uint32_t +// g_tracker_samples_count; extern const TrackerPattern g_tracker_patterns[]; // extern const uint32_t g_tracker_patterns_count; // extern const TrackerScore g_tracker_score; @@ -28,7 +27,8 @@ void test_tracker_pattern_triggering() { // Test 1: Trigger patterns at 0.0f tracker_update(0.0f); printf("Actual active voice count: %d\n", synth_get_active_voice_count()); - // Expect 3 voices (one for each pattern triggered at 0.0f: drum_loop, hihat_roll, em_melody) + // Expect 3 voices (one for each pattern triggered at 0.0f: drum_loop, + // hihat_roll, em_melody) assert(synth_get_active_voice_count() == 3); // Test 2: Advance time slightly @@ -39,9 +39,10 @@ void test_tracker_pattern_triggering() { tracker_update(3.0f); // Voices from 0.0f triggers might have ended, but new ones haven't started. // synth_get_active_voice_count might drop if previous voices ended. - // For this test, we assume voices triggered at 0.0f are still active for a short duration. - // A more robust test would check for specific spectrograms or mock synth. - // For now, we expect voices to still be somewhat active or new ones to be triggered if there's overlap + // For this test, we assume voices triggered at 0.0f are still active for a + // short duration. A more robust test would check for specific spectrograms or + // mock synth. For now, we expect voices to still be somewhat active or new + // ones to be triggered if there's overlap assert(synth_get_active_voice_count() > 0); printf("Tracker pattern triggering test PASSED\n"); -- cgit v1.2.3