-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathboost_predicate_wrapper.cpp
More file actions
39 lines (28 loc) · 1.06 KB
/
boost_predicate_wrapper.cpp
File metadata and controls
39 lines (28 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include "test_tools/boost_predicate_wrapper.hpp"
//------------------------------------------------------------------------------
namespace tools
{
//------------------------------------------------------------------------------
BoostPredicateWrapper::BoostPredicateWrapper( bool _result )
: m_message{ _result ? "" : "error" }
{
}
//------------------------------------------------------------------------------
BoostPredicateWrapper::BoostPredicateWrapper( std::string_view _message )
: m_message{ _message }
{
}
//------------------------------------------------------------------------------
BoostPredicateWrapper::BoostPredicateWrapper( std::string _message )
: m_message{ std::move( _message ) }
{
}
//------------------------------------------------------------------------------
BoostPredicateWrapper::operator ::boost::test_tools::assertion_result() const
{
boost::test_tools::predicate_result result{ m_message.empty() };
result.message() << m_message;
return result;
}
//------------------------------------------------------------------------------
}