mirror of
https://github.com/catchorg/Catch2.git
synced 2025-06-03 10:27:57 +00:00
Added CATCH_ENFORCE (and updated CATCH_INTERNAL_ERROR to be stream based)
replaced all ad-hoc exceptions (where appropriate) with CATCH_ENFORCE or CATCH_INTERNAL_ERROR - no explicit ostringstreams.
This commit is contained in:
parent
687437fcd1
commit
4c5af2089a
13 changed files with 65 additions and 97 deletions
|
@ -49,16 +49,9 @@ namespace Catch
|
|||
return startsWith( adjustCase( str ), m_pattern );
|
||||
case WildcardAtBothEnds:
|
||||
return contains( adjustCase( str ), m_pattern );
|
||||
default:
|
||||
CATCH_INTERNAL_ERROR( "Unknown enum" );
|
||||
}
|
||||
|
||||
#ifdef __clang__
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wunreachable-code"
|
||||
#endif
|
||||
throw std::logic_error( "Unknown enum" );
|
||||
#ifdef __clang__
|
||||
#pragma clang diagnostic pop
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
std::string adjustCase( std::string const& str ) const {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue