From 3567a3dcd5770ea50d05cda64559415c7cabb694 Mon Sep 17 00:00:00 2001 From: Yuri D'Elia Date: Sat, 22 Oct 2022 17:39:09 +0200 Subject: [PATCH] motion: Also test for the simplest case of a single+unplanned move --- tests/unit/modules/motion/test_motion.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/unit/modules/motion/test_motion.cpp b/tests/unit/modules/motion/test_motion.cpp index 25d1005..ee0e99b 100644 --- a/tests/unit/modules/motion/test_motion.cpp +++ b/tests/unit/modules/motion/test_motion.cpp @@ -302,6 +302,19 @@ TEST_CASE("motion::queue_abort_3", "[motion]") { REQUIRE(motion.QueueEmpty(Pulley)); } +TEST_CASE("motion::queue_abort_4", "[motion]") { + // queue should start empty + ResetMotionSim(); + + // enqueue a move on a single axis + motion.PlanMoveTo(Pulley, 10, 1); + REQUIRE(!motion.QueueEmpty(Pulley)); + + // abort the single unscheduled move + motion.AbortPlannedMoves(Pulley); + REQUIRE(motion.QueueEmpty(Pulley)); +} + TEST_CASE("motion::long_pulley_move", "[motion]") { ResetMotionSim(); constexpr auto mm400 = 400._mm;