2 #include "../../../tests/catch2/catch.hpp"
4 #include <mx/sys/timeUtils.hpp>
6 #include "../stateCodes.hpp"
11 SCENARIO(
"Getting State Strings From Codes",
"[stateCodes]" )
13 GIVEN(
"a valid state code")
24 REQUIRE(str ==
"UNINITIALIZED");
67 SCENARIO(
"Getting State Codes From Strings",
"[stateCodes]" )
69 GIVEN(
"a string using stateCodeFast")
125 WHEN(
"strings too short")
153 GIVEN(
"a string using stateCode")
155 WHEN(
"valid strings")
209 WHEN(
"invalid strings")
@ OPERATING
The device is operating, other than homing.
@ POWEROFF
The device power is off.
@ NODEVICE
No device exists for the application to control.
@ SHUTDOWN
The application has shutdown, set just after calling appShutdown().
@ NOTHOMED
The device has not been homed.
@ HOMING
The device is homing.
@ FAILURE
The application has failed, should be used when m_shutdown is set for an error.
@ CONFIGURING
The application is configuring the device.
@ ERROR
The application has encountered an error, from which it is recovering (with or without intervention)
@ READY
The device is ready for operation, but is not operating.
@ LOGGEDIN
The application has logged into the device or service.
@ CONNECTED
The application has connected to the device or service.
@ UNINITIALIZED
The application is unitialized, the default.
@ INITIALIZED
The application has been initialized, set just before calling appStartup().
@ NOTCONNECTED
The application is not connected to the device or service.
@ POWERON
The device power is on.
SCENARIO("Getting State Strings From Codes", "[stateCodes]")
static stateCodeT str2CodeFast(const std::string &stateStr)
Get the stateCode corresponding to an ASCII string with minimal checks.
int16_t stateCodeT
The type of the state code.
static stateCodeT str2Code(const std::string &stateStr)
Get the stateCode corresponding to an ASCII string.
static std::string codeText(const stateCodeT &stateCode)
Get an ASCII string corresponding to an application stateCode.