TestStateEnum.cpp
Go to the documentation of this file.
1 
7 #include <gtest/gtest.h>
8 
10 
11 namespace rokubimini
12 {
13 namespace fsm
14 {
15 TEST(StateEnumTest, StateEnumToIdWorksCorrectly)
16 {
24 }
25 
26 TEST(StateEnumTest, StateIdToEnumWorksCorrectly)
27 {
34  EXPECT_EQ(StateEnum::NA, stateIdToEnum(15));
35 }
36 
37 TEST(StateEnumTest, StateEnumToNameWorksCorrectly)
38 {
46 }
47 TEST(StateEnumTest, StateNameToEnumWorksCorrectly)
48 {
55  EXPECT_EQ(StateEnum::NA, stateNameToEnum("ABBAB"));
56 }
57 
58 } // namespace fsm
59 } // namespace rokubimini
TEST(StateEnumTest, StateEnumToIdWorksCorrectly)
#define ROKUBIMINI_STATE_ID_FATAL
Definition: StateEnum.hpp:18
#define ROKUBIMINI_STATE_ID_OPERATIONAL
Definition: StateEnum.hpp:19
StateEnum stateNameToEnum(const std::string &string)
Gets a state enumeration matching the state name.
Definition: StateEnum.cpp:103
#define ROKUBIMINI_STATE_NAME_FATAL
Definition: StateEnum.hpp:27
#define ROKUBIMINI_STATE_NAME_DEVICE_MISSING
Definition: StateEnum.hpp:25
#define ROKUBIMINI_STATE_NAME_NA
Definition: StateEnum.hpp:29
#define ROKUBIMINI_STATE_NAME_STANDBY
Definition: StateEnum.hpp:30
#define ROKUBIMINI_STATE_NAME_CALIBRATE
Definition: StateEnum.hpp:24
#define ROKUBIMINI_STATE_NAME_OPERATIONAL
Definition: StateEnum.hpp:28
#define ROKUBIMINI_STATE_NAME_ERROR
Definition: StateEnum.hpp:26
#define ROKUBIMINI_STATE_ID_DEVICE_MISSING
Definition: StateEnum.hpp:16
#define ROKUBIMINI_STATE_ID_CALIBRATE
Definition: StateEnum.hpp:15
uint16_t stateEnumToId(const StateEnum stateEnum)
Gets an ID matching the state enumeration.
Definition: StateEnum.cpp:16
StateEnum stateIdToEnum(uint16_t stateId)
Gets a state enumeration matching the state ID.
Definition: StateEnum.cpp:45
#define ROKUBIMINI_STATE_ID_STANDBY
Definition: StateEnum.hpp:21
#define ROKUBIMINI_STATE_ID_ERROR
Definition: StateEnum.hpp:17
#define ROKUBIMINI_STATE_ID_NA
Definition: StateEnum.hpp:20
std::string stateEnumToName(const StateEnum stateEnum)
Gets a name matching the state enumeration.
Definition: StateEnum.cpp:74
Tests Configuration.


rokubimini
Author(s):
autogenerated on Wed Mar 3 2021 03:09:12