From f03f3428991499e0701cce5eacc2bb943fde9d8e Mon Sep 17 00:00:00 2001 From: skal Date: Mon, 16 Feb 2026 12:42:57 +0100 Subject: fix(tests): port tests to v2 API, fix FATAL_CHECK logic - Port test_effect_base to EffectV2/SequenceV2 - Port test_demo_effects to v2 effects only - Remove v1 lifecycle helpers from effect_test_helpers - Fix cnn_test to not depend on cnn_v1_effect.h - Fix test_sequence_v2_e2e node redeclaration Known issue: test_sequence_v2_e2e still fails with bind group error (needs source/sink texture views set) Co-Authored-By: Claude Sonnet 4.5 --- src/tests/common/effect_test_helpers.cc | 43 +-------------------------------- src/tests/common/effect_test_helpers.h | 18 +------------- 2 files changed, 2 insertions(+), 59 deletions(-) (limited to 'src/tests/common') diff --git a/src/tests/common/effect_test_helpers.cc b/src/tests/common/effect_test_helpers.cc index 9250366..d776609 100644 --- a/src/tests/common/effect_test_helpers.cc +++ b/src/tests/common/effect_test_helpers.cc @@ -1,9 +1,8 @@ // This file is part of the 64k demo project. // It implements reusable test helpers for GPU effect testing. -// Provides pixel validation and lifecycle testing utilities. +// Provides pixel validation utilities. #include "effect_test_helpers.h" -#include "gpu/effect.h" #include // ============================================================================ @@ -68,43 +67,3 @@ uint64_t hash_pixels(const std::vector& pixels) { return hash; } -// ============================================================================ -// Effect Lifecycle Helpers -// ============================================================================ - -bool test_effect_lifecycle(Effect* effect, MainSequence* main_seq) { - assert(effect && "Effect pointer is null"); - assert(main_seq && "MainSequence pointer is null"); - - // Check initial state - if (effect->is_initialized) { - return false; // Should not be initialized yet - } - - // Initialize effect - effect->init(main_seq); - - // Check initialized state - if (!effect->is_initialized) { - return false; // Should be initialized now - } - - return true; // Lifecycle test passed -} - -bool test_effect_render_smoke(Effect* effect) { - assert(effect && "Effect pointer is null"); - - // Smoke test: Just call render with dummy parameters - // If this doesn't crash, consider it a success - // Note: This requires the effect to be initialized first - if (!effect->is_initialized) { - return false; // Cannot render uninitialized effect - } - - // We cannot actually render without a full render pass setup - // This is a placeholder for more sophisticated render testing - // Real render tests should use OffscreenRenderTarget - - return true; // Smoke test passed (no crash) -} diff --git a/src/tests/common/effect_test_helpers.h b/src/tests/common/effect_test_helpers.h index 33355ee..962d1b0 100644 --- a/src/tests/common/effect_test_helpers.h +++ b/src/tests/common/effect_test_helpers.h @@ -1,6 +1,6 @@ // This file is part of the 64k demo project. // It provides reusable test helpers for GPU effect testing. -// Includes lifecycle helpers, pixel validation, and smoke tests. +// Includes pixel validation utilities. #pragma once @@ -8,10 +8,6 @@ #include #include -// Forward declarations -class Effect; -class MainSequence; - // ============================================================================ // Pixel Validation Helpers // ============================================================================ @@ -33,15 +29,3 @@ bool all_pixels_match_color(const std::vector& pixels, int width, // Compute simple hash of pixel data (for deterministic output checks) uint64_t hash_pixels(const std::vector& pixels); - -// ============================================================================ -// Effect Lifecycle Helpers -// ============================================================================ - -// Test that an effect can be constructed and initialized -// Returns true if lifecycle succeeds, false otherwise -bool test_effect_lifecycle(Effect* effect, MainSequence* main_seq); - -// Test that an effect can render without crashing (smoke test) -// Does not validate output, only checks for crashes -bool test_effect_render_smoke(Effect* effect); -- cgit v1.2.3