From df4a8eaa0cca3ae7e3d046c4837bc5084ade18df Mon Sep 17 00:00:00 2001 From: Willow Sparks Date: Wed, 28 Jan 2026 21:23:28 +0000 Subject: [PATCH] Clean up test warnings and fix test organization - Remove unused imports (Material, Vec4) from scene_manager tests - Fix unused variable warning for tesseract_resting in collision tests - Convert soft skip pattern in test_load_default_scene_file to proper #[ignore] attribute for clearer test organization Co-Authored-By: Claude Opus 4.5 --- crates/rust4d_core/src/scene_manager.rs | 4 ++-- .../rust4d_core/tests/physics_integration.rs | 19 ++++++------------- crates/rust4d_physics/src/collision.rs | 4 ++-- 3 files changed, 10 insertions(+), 17 deletions(-) diff --git a/crates/rust4d_core/src/scene_manager.rs b/crates/rust4d_core/src/scene_manager.rs index db3d711..65394ed 100644 --- a/crates/rust4d_core/src/scene_manager.rs +++ b/crates/rust4d_core/src/scene_manager.rs @@ -222,8 +222,8 @@ impl SceneManager { #[cfg(test)] mod tests { use super::*; - use crate::{Entity, Material, ShapeRef}; - use rust4d_math::{Tesseract4D, Vec4}; + use crate::{Entity, ShapeRef}; + use rust4d_math::Tesseract4D; fn make_test_entity() -> Entity { let tesseract = Tesseract4D::new(2.0); diff --git a/crates/rust4d_core/tests/physics_integration.rs b/crates/rust4d_core/tests/physics_integration.rs index 7d68df4..6c838d4 100644 --- a/crates/rust4d_core/tests/physics_integration.rs +++ b/crates/rust4d_core/tests/physics_integration.rs @@ -323,20 +323,15 @@ fn test_scene_dynamic_entity_falls_to_floor() { ); } -/// Test with actual scene file if it exists +/// Test with actual scene file (requires scenes/default.ron to exist) +/// +/// Run with: cargo test --test physics_integration test_load_default_scene_file -- --ignored #[test] +#[ignore = "Requires scenes/default.ron to exist"] fn test_load_default_scene_file() { // Try to load the actual default.ron scene - let scene_result = Scene::load("../../../scenes/default.ron"); - - // If the file doesn't exist, skip this test - let scene = match scene_result { - Ok(s) => s, - Err(_) => { - println!("Skipping test_load_default_scene_file: scenes/default.ron not found"); - return; - } - }; + let scene = Scene::load("../../../scenes/default.ron") + .expect("scenes/default.ron should exist for this test"); // Instantiate scene let mut active = ActiveScene::from_template(&scene, None, 0.5); @@ -361,8 +356,6 @@ fn test_load_default_scene_file() { let (_, entity) = active.world.get_by_name("tesseract").unwrap(); let final_y = entity.transform.position.y; - println!("Default scene test: initial_y={}, final_y={}", initial_y, final_y); - // Tesseract should have fallen assert!( final_y < initial_y, diff --git a/crates/rust4d_physics/src/collision.rs b/crates/rust4d_physics/src/collision.rs index 32dc233..fc28929 100644 --- a/crates/rust4d_physics/src/collision.rs +++ b/crates/rust4d_physics/src/collision.rs @@ -600,11 +600,11 @@ mod tests { assert!(contact.penetration > 0.0, "Should have positive penetration"); // Tesseract at rest position y=-1 (bottom at y=-2, exactly on floor) - let tesseract_resting = AABB4D::from_center_half_extents( + // At exact boundary - behavior is undefined (floating point edge case) + let _tesseract_resting = AABB4D::from_center_half_extents( Vec4::new(0.0, -1.0, 0.0, 0.0), Vec4::new(1.0, 1.0, 1.0, 1.0), ); - // At exact boundary - may or may not register as collision // Important: at y=-1.0001, should collide let tesseract_slightly_in = AABB4D::from_center_half_extents( Vec4::new(0.0, -1.001, 0.0, 0.0), -- knotmirror 0.0.1