|
STAR
Cal STAR — firmware, DAQ server, and engine design
|
#include <unity.h>#include <cstring>#include <vector>#include "DiabloEnums.h"#include "DiabloPacketUtils.cpp"#include "DiabloPacketUtils.h"#include "DiabloPackets.h"Go to the source code of this file.
Classes | |
| struct | SensorSM::StoredConfig |
Namespaces | |
| namespace | SensorSM |
| Sensor state machine unit tests. | |
Enumerations | |
| enum class | SensorSM::State : uint8_t { SensorSM::WaitingForServer = 1 , SensorSM::Active = 2 , SensorSM::StandaloneAbort = 9 , SensorSM::SelfTest = 10 } |
| enum class | SensorSM::IncomingPacketKind { SensorSM::None , SensorSM::ServerHeartbeat , SensorSM::SensorConfig , SensorSM::NoConnAbort , SensorSM::ClearAbort } |
| int main | ( | int | argc, |
| char ** | argv ) |
Definition at line 351 of file test_sensor_state_machine.cpp.
References test_sensor_clear_abort_in_active_stays(), test_sensor_clear_abort_returns_to_active(), test_sensor_config_transitions_to_active(), test_sensor_config_transitions_to_selftest(), test_sensor_heartbeat_state_mapping_table(), test_sensor_heartbeat_stays_waiting(), test_sensor_initial_state(), test_sensor_noconn_abort_with_necessary(), test_sensor_noconn_abort_without_necessary(), test_sensor_none_packet_doesnt_transition(), test_sensor_process_clear_abort_packet(), test_sensor_process_sensor_config_packet(), test_sensor_process_sensor_config_with_abort(), test_sensor_process_server_heartbeat_packet(), and test_sensor_process_too_short_returns_none().
| void setUp | ( | void | ) |
Definition at line 346 of file test_sensor_state_machine.cpp.
| void tearDown | ( | void | ) |
Definition at line 348 of file test_sensor_state_machine.cpp.
| void test_sensor_clear_abort_in_active_stays | ( | ) |
Definition at line 203 of file test_sensor_state_machine.cpp.
References SensorSM::Active, SensorSM::applyPacketTransition(), and SensorSM::ClearAbort.
Referenced by main().
| void test_sensor_clear_abort_returns_to_active | ( | ) |
Definition at line 196 of file test_sensor_state_machine.cpp.
References SensorSM::Active, SensorSM::applyPacketTransition(), SensorSM::ClearAbort, and SensorSM::StandaloneAbort.
Referenced by main().
| void test_sensor_config_transitions_to_active | ( | ) |
Definition at line 161 of file test_sensor_state_machine.cpp.
References SensorSM::Active, SensorSM::applyPacketTransition(), SensorSM::SensorConfig, and SensorSM::WaitingForServer.
Referenced by main().
| void test_sensor_config_transitions_to_selftest | ( | ) |
Definition at line 168 of file test_sensor_state_machine.cpp.
References SensorSM::applyPacketTransition(), SensorSM::SelfTest, SensorSM::SensorConfig, and SensorSM::WaitingForServer.
Referenced by main().
| void test_sensor_heartbeat_state_mapping_table | ( | ) |
Definition at line 303 of file test_sensor_state_machine.cpp.
References daq::ACTIVE, SensorSM::Active, daq::create_board_heartbeat_packet(), SensorSM::getBoardStateForHeartbeat(), daq::parse_board_heartbeat_packet(), daq::SAFE, daq::SELF_TEST, SensorSM::SelfTest, daq::SETUP, daq::STANDALONE_ABORT, SensorSM::StandaloneAbort, state, and SensorSM::WaitingForServer.
Referenced by main().
| void test_sensor_heartbeat_stays_waiting | ( | ) |
Definition at line 175 of file test_sensor_state_machine.cpp.
References SensorSM::applyPacketTransition(), SensorSM::ServerHeartbeat, and SensorSM::WaitingForServer.
Referenced by main().
| void test_sensor_initial_state | ( | ) |
Definition at line 156 of file test_sensor_state_machine.cpp.
References SensorSM::WaitingForServer.
Referenced by main().
| void test_sensor_noconn_abort_with_necessary | ( | ) |
Definition at line 182 of file test_sensor_state_machine.cpp.
References SensorSM::Active, SensorSM::applyPacketTransition(), SensorSM::NoConnAbort, and SensorSM::StandaloneAbort.
Referenced by main().
| void test_sensor_noconn_abort_without_necessary | ( | ) |
Definition at line 189 of file test_sensor_state_machine.cpp.
References SensorSM::Active, SensorSM::applyPacketTransition(), and SensorSM::NoConnAbort.
Referenced by main().
| void test_sensor_none_packet_doesnt_transition | ( | ) |
Definition at line 210 of file test_sensor_state_machine.cpp.
References SensorSM::Active, SensorSM::applyPacketTransition(), and SensorSM::None.
Referenced by main().
| void test_sensor_process_clear_abort_packet | ( | ) |
Definition at line 279 of file test_sensor_state_machine.cpp.
References daq::CLEAR_ABORT, SensorSM::ClearAbort, and SensorSM::processIncomingPacket().
Referenced by main().
| void test_sensor_process_sensor_config_packet | ( | ) |
Definition at line 240 of file test_sensor_state_machine.cpp.
References daq::create_sensor_config_packet(), SensorSM::processIncomingPacket(), and SensorSM::SensorConfig.
Referenced by main().
| void test_sensor_process_sensor_config_with_abort | ( | ) |
Definition at line 259 of file test_sensor_state_machine.cpp.
References daq::create_sensor_config_packet(), SensorSM::processIncomingPacket(), and SensorSM::SensorConfig.
Referenced by main().
| void test_sensor_process_server_heartbeat_packet | ( | ) |
Definition at line 221 of file test_sensor_state_machine.cpp.
References SensorSM::processIncomingPacket(), daq::SAFE, daq::SERVER_HEARTBEAT, and SensorSM::ServerHeartbeat.
Referenced by main().
| void test_sensor_process_too_short_returns_none | ( | ) |
Definition at line 292 of file test_sensor_state_machine.cpp.
References SensorSM::None, and SensorSM::processIncomingPacket().
Referenced by main().