Skip to content

Commit

Permalink
fixup the tests for the new behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanthecoder committed Oct 23, 2024
1 parent df4f082 commit 7f8c99d
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions motor-control/tests/test_motor_stall_handling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -308,11 +308,17 @@ SCENARIO("motor handler stall detection") {
REQUIRE(!test_objs.hw.position_flags.check_flag(
Flags::stepper_position_ok));
THEN("move completed and no error was raised") {
REQUIRE(test_objs.reporter.messages.size() == 1);
Ack ack_msg =
std::get<Ack>(test_objs.reporter.messages.front());
REQUIRE(ack_msg.ack_id ==
AckMessageId::complete_without_condition);
REQUIRE(test_objs.reporter.messages.size() == 6);
for (auto& element : test_objs.reporter.messages) {
printf("%ld\n", element.index());
}
can::messages::ErrorMessage err =
std::get<can::messages::ErrorMessage>(
test_objs.reporter.messages.front());
REQUIRE(err.error_code ==
can::ids::ErrorCode::collision_detected);
REQUIRE(err.severity ==
can::ids::ErrorSeverity::unrecoverable);
}
}
}
Expand Down Expand Up @@ -349,4 +355,4 @@ SCENARIO("motor handler stall detection") {
}
}
}
}
}

0 comments on commit 7f8c99d

Please sign in to comment.