From 1aa0eadbe9e0d7581d8c64f896efae544e2e2e0a Mon Sep 17 00:00:00 2001 From: skal Date: Sat, 7 Feb 2026 09:13:36 +0100 Subject: test: Add platform test coverage (test_platform.cc) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Created comprehensive test suite for platform windowing abstraction: Tests implemented: - String view helpers (Win32 vs native WebGPU API) - PlatformState default initialization - platform_get_time() with GLFW context - Platform lifecycle (init, poll, shutdown) - Fullscreen toggle state tracking Coverage impact: platform.cc 0% → ~70% (7 functions tested) Files: - src/tests/test_platform.cc (new, 180 lines) - CMakeLists.txt (added test_platform target) - PLATFORM_ANALYSIS.md (detailed analysis report) All tests pass on macOS with GLFW windowing. Related: Side quest to improve platform code coverage --- src/generated/test_demo_assets.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/generated/test_demo_assets.h (limited to 'src/generated/test_demo_assets.h') diff --git a/src/generated/test_demo_assets.h b/src/generated/test_demo_assets.h new file mode 100644 index 0000000..d47bdac --- /dev/null +++ b/src/generated/test_demo_assets.h @@ -0,0 +1,16 @@ +// This file is auto-generated by asset_packer.cc. Do not edit. + +#pragma once +#include + +enum class AssetId : uint16_t { + ASSET_KICK_1 = 0, + ASSET_SNARE_1 = 1, + ASSET_CRASH_1 = 2, + ASSET_LAST_ID = 3, +}; +#include "util/asset_manager.h" + +// Accessors to avoid static initialization order issues +const struct AssetRecord* GetAssetRecordTable(); +size_t GetAssetCount(); -- cgit v1.2.3