Test: a failed calibration now leaves the machine in Error, not Inactive

JFJochStateMachine_CalibrationFailure was written in rc.164 against the
behaviour of the time. rc.165 moved every calibration FAILURE path -
CalibrateDetector's catch, TakeDarkMaskInternal's mask-size check and the
three ImportPedestal checks - from Inactive to Error, so that /wait_till_done
and /wait_until_running answer with the reason instead of the bodiless 502
that a deliberate Deactivate() also leaves; only a CANCELLED calibration still
ends in Inactive. The test kept asserting the old state and started failing.

Assert Error. The rest of the case is unaffected: the message and severity are
what the new SetState writes, and Start() still throws from Error because it
requires Idle, so "a data collection is refused on it" keeps its meaning.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FBumeJVx4oeXxiBRpkrE5H
This commit is contained in:
2026-08-28 10:01:49 +02:00
co-authored by Claude Opus 5
parent 511be0c366
commit 8999287ba4
+4 -3
View File
@@ -336,10 +336,11 @@ TEST_CASE("JFJochStateMachine_CalibrationFailure") {
REQUIRE_NOTHROW(state_machine.Initialize());
REQUIRE_NOTHROW(state_machine.WaitTillMeasurementDone());
// Inactive, not Idle and not Error: the calibration is undefined, so the detector has to be
// initialized again rather than looking ready to measure.
// Error, not Idle: the calibration is undefined, so the detector has to be initialized again
// rather than looking ready to measure. Error and not Inactive, so that the wait calls report
// the reason instead of the bodiless answer a deliberate power-off leaves behind.
auto status = state_machine.GetStatus();
REQUIRE(status.state == JFJochState::Inactive);
REQUIRE(status.state == JFJochState::Error);
REQUIRE(status.message_severity == BrokerStatus::MessageSeverity::Error);
REQUIRE(status.message == "Pedestal not collected properly");