Truncate excessively long messages rather than asserting
This commit is contained in:
parent
aafed303bb
commit
39ef46a02e
1 changed files with 4 additions and 1 deletions
|
@ -23,7 +23,10 @@ namespace Catch {
|
|||
std::string remainder = _str;
|
||||
|
||||
while( !remainder.empty() ) {
|
||||
assert( lines.size() < 1000 );
|
||||
if( lines.size() >= 1000 ) {
|
||||
lines.push_back( "... message truncated due to excessive size" );
|
||||
return;
|
||||
}
|
||||
std::size_t tabPos = std::string::npos;
|
||||
std::size_t width = (std::min)( remainder.size(), _attr.width - indent );
|
||||
std::size_t pos = remainder.find_first_of( '\n' );
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue