From 945e6261ccd8e1b6e0def252bd92074ca5bac373 Mon Sep 17 00:00:00 2001 From: Tyler Chiriboga Date: Fri, 23 Oct 2026 14:30:38 +0000 Subject: [PATCH] 3D mouse test: clear the frame's texture changes, so it passes in debug builds (#4382) each_frame_hands_the_view_its_motion_through_the_drivers_mapping dropped the output of a frame it ran (`let _ = ctx.run_ui(...)`). epaint panics in debug builds when a TexturesDelta is dropped with deltas left ("Dropped TexturesDelta with 1 unapplied deltas"), so the test failed under a plain `cargo test` on every platform while the ci profile passed. It now clears them, as the other UI tests do since #60. Co-authored-by: Tyler Chiriboga <18270301+Tyler-Chiriboga@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 --- apps/solidcraft/src/space_mouse.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/solidcraft/src/space_mouse.rs b/apps/solidcraft/src/space_mouse.rs index c037f8f6c..1cf51a677 100644 --- a/apps/solidcraft/src/space_mouse.rs +++ b/apps/solidcraft/src/space_mouse.rs @@ -1051,7 +1051,8 @@ mod tests { }; // A window that has run a frame with focus, as the app's always has by now. let ctx = Context::default(); - let _ = ctx.run_ui(egui::RawInput::default(), |_| {}); + // Clear the frame's texture changes, or dropping them panics in debug builds (as in #60). + ctx.run_ui(egui::RawInput::default(), |_| {}).textures_delta.clear(); mouse.tick_at(&mut app, &ctx, now); let DeviceMotion { motion, seconds } = app.viewport.device_motion.expect("the frame hands the page its motion"); assert_eq!(motion, Motion { translation: [0.0; 3], rotation: [0.0, 0.0, -1.0] });