From 372045c38c38128c4ae4c43581b39f3a39053679 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gu=C3=B0ni=20M=C3=A1r=20Gilbert?= Date: Sat, 27 May 2023 20:09:54 +0000 Subject: [PATCH] Update cut filament unit test --- tests/unit/logic/cut_filament/test_cut_filament.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/unit/logic/cut_filament/test_cut_filament.cpp b/tests/unit/logic/cut_filament/test_cut_filament.cpp index 9687294..1555bac 100644 --- a/tests/unit/logic/cut_filament/test_cut_filament.cpp +++ b/tests/unit/logic/cut_filament/test_cut_filament.cpp @@ -76,13 +76,17 @@ void CutSlot(logic::CutFilament &cf, uint8_t startSlot, uint8_t cutSlot) { // cutting REQUIRE(WhileTopState(cf, ProgressCode::PerformingCut, selectorMoveMaxSteps)); - REQUIRE(VerifyState2(cf, mg::FilamentLoadState::AtPulley, mi::idler.IdleSlotIndex(), cutSlot, false, true, cutSlot, ml::blink0, ml::off, ErrorCode::RUNNING, ProgressCode::ReturningSelector)); + REQUIRE(VerifyState2(cf, mg::FilamentLoadState::AtPulley, mi::idler.IdleSlotIndex(), cutSlot, false, true, cutSlot, ml::blink0, ml::off, ErrorCode::RUNNING, ProgressCode::Homing)); // rehoming selector SimulateSelectorHoming(cf); + REQUIRE(WhileTopState(cf, ProgressCode::Homing, selectorMoveMaxSteps)); + + // Return selector to parked position + REQUIRE(VerifyState2(cf, mg::FilamentLoadState::AtPulley, mi::idler.IdleSlotIndex(), ms::Selector::IdleSlotIndex(), false, true, cutSlot, ml::blink0, ml::off, ErrorCode::RUNNING, ProgressCode::ReturningSelector)); REQUIRE(WhileTopState(cf, ProgressCode::ReturningSelector, selectorMoveMaxSteps)); - REQUIRE(VerifyState2(cf, mg::FilamentLoadState::AtPulley, mi::idler.IdleSlotIndex(), ms::Selector::IdleSlotIndex(), false, true, cutSlot, ml::on, ml::off, ErrorCode::OK, ProgressCode::OK)); + REQUIRE(VerifyState2(cf, mg::FilamentLoadState::AtPulley, mi::idler.IdleSlotIndex(), cutSlot, false, true, cutSlot, ml::on, ml::off, ErrorCode::OK, ProgressCode::OK)); } TEST_CASE("cut_filament::cut0", "[cut_filament]") {