From 2519948f03a8fc467614bdfbdf5bd3e065dbcb5e Mon Sep 17 00:00:00 2001 From: skal Date: Mon, 2 Feb 2026 23:26:16 +0100 Subject: feat: Complete audio tracker system integration and tests --- src/tests/test_shader_composer.cc | 50 +++++++++++++++++++-------------------- 1 file changed, 25 insertions(+), 25 deletions(-) (limited to 'src/tests/test_shader_composer.cc') diff --git a/src/tests/test_shader_composer.cc b/src/tests/test_shader_composer.cc index 4a5cb8b..cdb5c88 100644 --- a/src/tests/test_shader_composer.cc +++ b/src/tests/test_shader_composer.cc @@ -7,32 +7,32 @@ #include void test_composition() { - std::cout << "Testing Shader Composition..." << std::endl; - auto& sc = ShaderComposer::Get(); - - sc.RegisterSnippet("math", "fn add(a: f32, b: f32) -> f32 { return a + b; }"); - sc.RegisterSnippet("util", "fn square(a: f32) -> f32 { return a * a; }"); - - std::string main_code = "fn main() { let x = add(1.0, square(2.0)); }"; - std::string result = sc.Compose({"math", "util"}, main_code); - - // Verify order and presence - assert(result.find("Snippet: math") != std::string::npos); - assert(result.find("Snippet: util") != std::string::npos); - assert(result.find("Main Code") != std::string::npos); - - size_t pos_math = result.find("Snippet: math"); - size_t pos_util = result.find("Snippet: util"); - size_t pos_main = result.find("Main Code"); - - assert(pos_math < pos_util); - assert(pos_util < pos_main); - - std::cout << "Composition logic verified." << std::endl; + std::cout << "Testing Shader Composition..." << std::endl; + auto& sc = ShaderComposer::Get(); + + sc.RegisterSnippet("math", "fn add(a: f32, b: f32) -> f32 { return a + b; }"); + sc.RegisterSnippet("util", "fn square(a: f32) -> f32 { return a * a; }"); + + std::string main_code = "fn main() { let x = add(1.0, square(2.0)); }"; + std::string result = sc.Compose({"math", "util"}, main_code); + + // Verify order and presence + assert(result.find("Snippet: math") != std::string::npos); + assert(result.find("Snippet: util") != std::string::npos); + assert(result.find("Main Code") != std::string::npos); + + size_t pos_math = result.find("Snippet: math"); + size_t pos_util = result.find("Snippet: util"); + size_t pos_main = result.find("Main Code"); + + assert(pos_math < pos_util); + assert(pos_util < pos_main); + + std::cout << "Composition logic verified." << std::endl; } int main() { - test_composition(); - std::cout << "--- ALL SHADER COMPOSER TESTS PASSED ---" << std::endl; - return 0; + test_composition(); + std::cout << "--- ALL SHADER COMPOSER TESTS PASSED ---" << std::endl; + return 0; } -- cgit v1.2.3