5 #ifndef NDS_PROXY_STATUS_CODES_HH_HH
6 #define NDS_PROXY_STATUS_CODES_HH_HH
14 typedef std::array< char, 4 > status_code;
16 const auto STATUS_DAQD_OK = status_code{
'0',
'0',
'0',
'0' };
17 const auto STATUS_DAQD_ERROR = status_code{
'0',
'0',
'0',
'1' };
18 const auto STATUS_DAQD_VERSION_MISMATCH =
19 status_code{
'0',
'0',
'0',
'b' };
20 const auto STATUS_DAQD_NOT_FOUND = status_code{
'0',
'0',
'0',
'd' };
21 const auto STATUS_DAQD_SYNTAX = status_code{
'0',
'0',
'1',
'9' };
22 const auto STATUS_DAQD_ON_TAPE = status_code{
'0',
'0',
'1',
'a' };
30 #ifdef _NDS_IMPL_ENABLE_CATCH_TESTS_
35 TEST_CASE(
"Verify status codes exist",
"[status_codes]" )
38 [](
const nds_impl::common::status_code& code ) -> std::string {
39 return std::string( code.data( ), code.size( ) );
41 using namespace nds_impl::common;
42 REQUIRE( status_to_str( STATUS_DAQD_OK ) ==
"0000" );
43 REQUIRE( status_to_str( STATUS_DAQD_ERROR ) ==
"0001" );
44 REQUIRE( status_to_str( STATUS_DAQD_VERSION_MISMATCH ) ==
"000b" );
45 REQUIRE( status_to_str( STATUS_DAQD_SYNTAX ) ==
"0019" );
46 REQUIRE( status_to_str( STATUS_DAQD_ON_TAPE ) ==
"001a" );
47 REQUIRE( status_to_str( STATUS_DAQD_NOT_FOUND ) ==
"000d" );
50 #endif // _NDS_IMPL_ENABLE_CATCH_TESTS_
52 #endif // NDS_PROXY_STATUS_CODES_HH_HH