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

#include <tester.hpp>

Collaboration diagram for sysio::testing::fc_assert_exception_message_starts_with:

Public Member Functions

 fc_assert_exception_message_starts_with (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 starts with a given string

Definition at line 691 of file tester.hpp.

Constructor & Destructor Documentation

◆ fc_assert_exception_message_starts_with()

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

Definition at line 692 of file tester.hpp.

Member Function Documentation

◆ operator()()

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

Definition at line 1232 of file tester.cpp.

1232 {
1233 auto message = ex.get_log().at( 0 ).get_message();
1234 bool match = false;
1235 auto pos = message.find( ": " );
1236 if( pos != std::string::npos ) {
1237 message = message.substr( pos + 2 );
1238 match = boost::algorithm::starts_with( message, expected );
1239 }
1240 if( !match ) {
1241 BOOST_TEST_MESSAGE( "LOG: expected: " << expected << ", actual: " << message );
1242 }
1243 return match;
1244 }

Member Data Documentation

◆ expected

string sysio::testing::fc_assert_exception_message_starts_with::expected

Definition at line 697 of file tester.hpp.


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