test: wrapping the error message checking in a macro

This commit is contained in:
Yoichi Hirai 2016-11-21 19:31:31 +01:00
parent ab3db782ae
commit cace51fc47
No known key found for this signature in database
GPG Key ID: E7B75D080FCF7992
2 changed files with 296 additions and 275 deletions

View File

@ -58,11 +58,10 @@ public:
Type type() const { return m_type; } Type type() const { return m_type; }
std::string const& typeName() const { return m_typeName; } std::string const& typeName() const { return m_typeName; }
template <typename T> bool regex_search(const std::string& _reg) const
bool regex_search(T&& _reg) const
{ {
if (std::string const* str = boost::get_error_info<errinfo_comment>(*this)) if (std::string const* str = boost::get_error_info<errinfo_comment>(*this))
return std::regex_search(*str, std::regex(std::forward<T>(_reg))); return std::regex_search(*str, std::regex(_reg));
else else
return false; return false;
} }

File diff suppressed because it is too large Load Diff