Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
sysio::testing::sysio_assert_code_is Struct Reference

#include <tester.hpp>

Collaboration diagram for sysio::testing::sysio_assert_code_is:

Public Member Functions

 sysio_assert_code_is (uint64_t error_code)
 
bool operator() (const sysio_assert_code_exception &ex)
 

Public Attributes

string expected
 

Detailed Description

Utility predicate to check whether an sysio_assert_code error code is equivalent to a given number

Definition at line 731 of file tester.hpp.

Constructor & Destructor Documentation

◆ sysio_assert_code_is()

sysio::testing::sysio_assert_code_is::sysio_assert_code_is ( uint64_t error_code)
inline

Definition at line 732 of file tester.hpp.

733 : expected( "assertion failure with error code: " ) {
734 expected.append( std::to_string(error_code) );
735 }

Member Function Documentation

◆ operator()()

bool sysio::testing::sysio_assert_code_is::operator() ( const sysio_assert_code_exception & ex)

Definition at line 1264 of file tester.cpp.

1264 {
1265 auto message = ex.get_log().at( 0 ).get_message();
1266 bool match = (message == expected);
1267 if( !match ) {
1268 BOOST_TEST_MESSAGE( "LOG: expected: " << expected << ", actual: " << message );
1269 }
1270 return match;
1271 }

Member Data Documentation

◆ expected

string sysio::testing::sysio_assert_code_is::expected

Definition at line 739 of file tester.hpp.


The documentation for this struct was generated from the following files: