|
STAR
Cal STAR — firmware, DAQ server, and engine design
|
#include <unity.h>#include <cstring>#include <set>#include <vector>#include "DiabloEnums.h"#include "DiabloPacketUtils.cpp"#include "DiabloPacketUtils.h"#include "DiabloPackets.h"Go to the source code of this file.
|
strong |
Actuator state machine unit tests.
Tests the actuator applyPacketTransition() and getBoardStateForHeartbeat() functions. Because these are static in Actuator_Hotfire/main.cpp with tightly coupled globals, we extract the pure logic here for testing.
Definition at line 25 of file test_actuator_state_machine.cpp.
|
strong |
Definition at line 36 of file test_actuator_state_machine.cpp.
|
static |
Definition at line 74 of file test_actuator_state_machine.cpp.
References Abort, AbortDone, AbortFinished, Active, ClearAbort, Config, ConnectionLossDetected, is_abort_controller, NoConnAbort, NoConnAbortFollower, ServerHeartbeat, state, and WaitingForServer.
Referenced by test_actuator_abort_finished_clear_goes_active(), test_actuator_active_abort_done_goes_abort_finished(), test_actuator_active_abort_done_stays_active(), test_actuator_active_abort_goes_abort_finished(), test_actuator_active_abort_stays_active(), test_actuator_active_noconn_abort_goes_follower(), test_actuator_active_noconn_abort_stays_active(), test_actuator_connloss_heartbeat_goes_active(), test_actuator_noconn_abort_state_clear_doesnt_transition(), test_actuator_none_kind_stays(), test_actuator_pt_abort_clear_doesnt_transition(), test_actuator_waiting_config_goes_active(), and test_actuator_waiting_heartbeat_stays().
|
static |
Definition at line 48 of file test_actuator_state_machine.cpp.
References daq::ABORT_FINISHED, AbortFinished, daq::ACTIVE, Active, daq::CONNECTION_LOSS_DETECTED, ConnectionLossDetected, daq::NO_CONN_ABORT_FOLLOWER, daq::NO_CONNECTION_ABORT, daq::NO_PT_ABORT, NoConnAbortFollower, NoConnectionAbort, NoPTAbort, daq::PT_ABORT, PTAbort, daq::SETUP, state, and WaitingForServer.
| int main | ( | int | argc, |
| char ** | argv ) |
Definition at line 293 of file test_actuator_state_machine.cpp.
References test_actuator_abort_finished_clear_goes_active(), test_actuator_active_abort_done_goes_abort_finished(), test_actuator_active_abort_done_stays_active(), test_actuator_active_abort_goes_abort_finished(), test_actuator_active_abort_stays_active(), test_actuator_active_noconn_abort_goes_follower(), test_actuator_active_noconn_abort_stays_active(), test_actuator_connloss_heartbeat_goes_active(), test_actuator_heartbeat_board_id_preserved(), test_actuator_heartbeat_state_mapping_table(), test_actuator_noconn_abort_state_clear_doesnt_transition(), test_actuator_none_kind_stays(), test_actuator_pt_abort_clear_doesnt_transition(), test_actuator_waiting_config_goes_active(), and test_actuator_waiting_heartbeat_stays().
| void setUp | ( | void | ) |
Definition at line 288 of file test_actuator_state_machine.cpp.
| void tearDown | ( | void | ) |
Definition at line 290 of file test_actuator_state_machine.cpp.
| void test_actuator_abort_finished_clear_goes_active | ( | ) |
Definition at line 140 of file test_actuator_state_machine.cpp.
References AbortFinished, Active, applyPacketTransition(), ClearAbort, and result.
Referenced by main().
| void test_actuator_active_abort_done_goes_abort_finished | ( | ) |
Definition at line 168 of file test_actuator_state_machine.cpp.
References AbortDone, AbortFinished, Active, applyPacketTransition(), and result.
Referenced by main().
| void test_actuator_active_abort_done_stays_active | ( | ) |
Definition at line 161 of file test_actuator_state_machine.cpp.
References AbortDone, Active, applyPacketTransition(), and result.
Referenced by main().
| void test_actuator_active_abort_goes_abort_finished | ( | ) |
Definition at line 154 of file test_actuator_state_machine.cpp.
References Abort, AbortFinished, Active, applyPacketTransition(), and result.
Referenced by main().
| void test_actuator_active_abort_stays_active | ( | ) |
Definition at line 147 of file test_actuator_state_machine.cpp.
References Abort, Active, applyPacketTransition(), and result.
Referenced by main().
| void test_actuator_active_noconn_abort_goes_follower | ( | ) |
Definition at line 183 of file test_actuator_state_machine.cpp.
References Active, applyPacketTransition(), NoConnAbort, NoConnAbortFollower, and result.
Referenced by main().
| void test_actuator_active_noconn_abort_stays_active | ( | ) |
Definition at line 175 of file test_actuator_state_machine.cpp.
References Active, applyPacketTransition(), NoConnAbort, and result.
Referenced by main().
| void test_actuator_connloss_heartbeat_goes_active | ( | ) |
Definition at line 133 of file test_actuator_state_machine.cpp.
References Active, applyPacketTransition(), ConnectionLossDetected, result, and ServerHeartbeat.
Referenced by main().
| void test_actuator_heartbeat_board_id_preserved | ( | ) |
Definition at line 265 of file test_actuator_state_machine.cpp.
References daq::create_board_heartbeat_packet(), daq::FIRING, getBoardStateForHeartbeat(), daq::parse_board_heartbeat_packet(), daq::PT_ABORT, and PTAbort.
Referenced by main().
| void test_actuator_heartbeat_state_mapping_table | ( | ) |
Definition at line 219 of file test_actuator_state_machine.cpp.
References daq::ABORT_FINISHED, AbortFinished, daq::ACTIVE, Active, daq::CONNECTION_LOSS_DETECTED, ConnectionLossDetected, daq::create_board_heartbeat_packet(), getBoardStateForHeartbeat(), daq::NO_CONN_ABORT_FOLLOWER, daq::NO_CONNECTION_ABORT, daq::NO_PT_ABORT, NoConnAbortFollower, NoConnectionAbort, NoPTAbort, daq::parse_board_heartbeat_packet(), daq::PT_ABORT, PTAbort, daq::SAFE, daq::SETUP, state, and WaitingForServer.
Referenced by main().
| void test_actuator_noconn_abort_state_clear_doesnt_transition | ( | ) |
Definition at line 193 of file test_actuator_state_machine.cpp.
References applyPacketTransition(), ClearAbort, NoConnectionAbort, and result.
Referenced by main().
| void test_actuator_none_kind_stays | ( | ) |
Definition at line 209 of file test_actuator_state_machine.cpp.
References Active, applyPacketTransition(), None, and result.
Referenced by main().
| void test_actuator_pt_abort_clear_doesnt_transition | ( | ) |
Definition at line 202 of file test_actuator_state_machine.cpp.
References applyPacketTransition(), ClearAbort, PTAbort, and result.
Referenced by main().
| void test_actuator_waiting_config_goes_active | ( | ) |
Definition at line 118 of file test_actuator_state_machine.cpp.
References Active, applyPacketTransition(), Config, result, and WaitingForServer.
Referenced by main().
| void test_actuator_waiting_heartbeat_stays | ( | ) |
Definition at line 125 of file test_actuator_state_machine.cpp.
References applyPacketTransition(), result, ServerHeartbeat, and WaitingForServer.
Referenced by main().