From 263b2b24fb03ba10f8469953694dabf9051dacfd Mon Sep 17 00:00:00 2001 From: vangel76 Date: Wed, 25 Nov 2026 10:37:22 +0100 Subject: [PATCH] Derive the expected work threads in the settings test from the core count --- crates/ui-egui/tests/it/settings_window.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/tests/it/settings_window.rs b/crates/ui-egui/tests/it/settings_window.rs index c89a8347..4cbde681 100644 --- a/crates/ui-egui/tests/it/settings_window.rs +++ b/crates/ui-egui/tests/it/settings_window.rs @@ -281,7 +281,11 @@ fn cancel_drops_the_changes_and_ok_applies_and_keeps_them() { let prefs = h.state().ui.prefs.clone(); assert!(!h.state().ui.windows.settings, "OK closes the window"); - assert_eq!((prefs.autosave_minutes, prefs.work_threads, prefs.project_open_limit_gib), (25, 1, 12)); + + // The slider's end stores 0, which is the only step on a one-core machine + let (cores, _) = texturecraft_engine::formats::available_save_resources(); + let expected_work_threads = if cores <= 1 { 0 } else { 1 }; + assert_eq!((prefs.autosave_minutes, prefs.work_threads, prefs.project_open_limit_gib), (25, expected_work_threads, 12)); assert!(prefs.zoom_inverse && !prefs.wheel_inverse && !prefs.show_world_axes); assert!(prefs.drag_zoom_scale() < 0.0, "inverted zoom runs the other way");