From 9bf0fc2a8e076ee7fc345e048c780785a1e185fb Mon Sep 17 00:00:00 2001 From: Ian Chua Date: Tue, 6 Oct 2026 20:53:46 +0800 Subject: [PATCH] test: reset virtual trays in the generic AMS tray index map case --- tests/slic3rutils/test_dev_mapping.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/slic3rutils/test_dev_mapping.cpp b/tests/slic3rutils/test_dev_mapping.cpp index 19e6d7ddc1..7d43016513 100644 --- a/tests/slic3rutils/test_dev_mapping.cpp +++ b/tests/slic3rutils/test_dev_mapping.cpp @@ -144,7 +144,10 @@ TEST_CASE("Generic AMS tray index map uses cumulative lane counts", "[DevMapping { MachineObject obj(nullptr, nullptr, "test", "test_dev", "127.0.0.1"); - json filament = { {"units", json::array()} }; + // A well-formed generic payload pairs "units" with "external". An empty external array resets + // vt_slot, clearing the default virtual tray (255) MachineObject's constructor seeds; otherwise + // that phantom external tray lands in GetTrayIndexMap and inflates the map size. + json filament = { {"units", json::array()}, {"external", json::array()} }; for (int ams_id = 0; ams_id < 2; ++ams_id) { json unit = { {"id", std::to_string(ams_id)},