Fixes overflow issue when listing tests.

This commit is contained in:
Fraser Hutchison 2013-10-24 02:53:13 +01:00
parent 93a945cee9
commit 6253386458

View File

@ -86,12 +86,13 @@ namespace Catch {
std::cout << nameCol;
}
if( i < tagsWrapper.size() && !tagsWrapper[i].empty() ) {
size_t padLen( maxNameLen > nameCol.size() ? maxNameLen - nameCol.size() : 0 );
if( i == 0 ) {
Colour colourGuard( Colour::SecondaryText );
std::cout << " " << std::string( maxNameLen - nameCol.size(), '.' ) << " ";
std::cout << " " << std::string( padLen, '.' ) << " ";
}
else {
std::cout << std::string( maxNameLen - nameCol.size(), ' ' ) << " ";
std::cout << std::string( padLen, ' ' ) << " ";
}
std::cout << tagsWrapper[i];
}