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

#include <tester.hpp>

Collaboration diagram for sysio::testing::fc_assert_exception_message_is:

Public Member Functions

 fc_assert_exception_message_is (const string &msg)
 
bool operator() (const fc::assert_exception &ex)
 

Public Attributes

string expected
 

Detailed Description

Utility predicate to check whether an fc::assert_exception message is equivalent to a given string

Definition at line 679 of file tester.hpp.

Constructor & Destructor Documentation

◆ fc_assert_exception_message_is()

sysio::testing::fc_assert_exception_message_is::fc_assert_exception_message_is ( const string & msg)
inline

Definition at line 680 of file tester.hpp.

Member Function Documentation

◆ operator()()

bool sysio::testing::fc_assert_exception_message_is::operator() ( const fc::assert_exception & ex)

Definition at line 1218 of file tester.cpp.

1218 {
1219 auto message = ex.get_log().at( 0 ).get_message();
1220 bool match = false;
1221 auto pos = message.find( ": " );
1222 if( pos != std::string::npos ) {
1223 message = message.substr( pos + 2 );
1224 match = (message == expected);
1225 }
1226 if( !match ) {
1227 BOOST_TEST_MESSAGE( "LOG: expected: " << expected << ", actual: " << message );
1228 }
1229 return match;
1230 }

Member Data Documentation

◆ expected

string sysio::testing::fc_assert_exception_message_is::expected

Definition at line 685 of file tester.hpp.


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