diff options
| author | Fraser Hutchison | 2013-10-24 02:53:13 +0100 |
|---|---|---|
| committer | Fraser Hutchison | 2013-10-24 02:53:13 +0100 |
| commit | 6253386458568cbe4d097ea59309a80ee2ffa815 (patch) | |
| tree | 57cde16f95fe9668472ab9c7883e34151139b71a /include | |
| parent | 93a945cee9d41236c91995f0bec563bcacbfc5c8 (diff) | |
| download | catch3-6253386458568cbe4d097ea59309a80ee2ffa815.tar.gz | |
Fixes overflow issue when listing tests.
Diffstat (limited to 'include')
| -rw-r--r-- | include/internal/catch_list.hpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/include/internal/catch_list.hpp b/include/internal/catch_list.hpp index 550107f8..45807edd 100644 --- a/include/internal/catch_list.hpp +++ b/include/internal/catch_list.hpp @@ -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]; } |