Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/catch2/catch_timer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ namespace Catch {

namespace {
static auto getCurrentNanosecondsSinceEpoch() -> uint64_t {
return std::chrono::duration_cast<std::chrono::nanoseconds>(std::chrono::steady_clock::now().time_since_epoch()).count();
return static_cast<uint64_t>(
std::chrono::duration_cast<std::chrono::nanoseconds>(
std::chrono::steady_clock::now().time_since_epoch() )
.count() );
}
} // end unnamed namespace

Expand Down
2 changes: 1 addition & 1 deletion src/catch2/internal/catch_run_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ namespace Catch {
m_config(_config),
m_reporter(CATCH_MOVE(reporter)),
m_outputRedirect( makeOutputRedirect( m_reporter->getPreferences().shouldRedirectStdOut ) ),
m_abortAfterXFailedAssertions( m_config->abortAfter() ),
m_abortAfterXFailedAssertions( static_cast<size_t>(m_config->abortAfter()) ),
m_reportAssertionStarting( m_reporter->getPreferences().shouldReportAllAssertionStarts ),
m_includeSuccessfulResults( m_config->includeSuccessfulResults() || m_reporter->getPreferences().shouldReportAllAssertions ),
m_shouldDebugBreak( m_config->shouldDebugBreak() )
Expand Down
6 changes: 3 additions & 3 deletions src/catch2/internal/catch_test_case_info_hasher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@ namespace Catch {
const hash_t prime = 1099511628211u;
hash_t hash = 14695981039346656037u;
for ( const char c : t.name ) {
hash ^= c;
hash ^= static_cast<unsigned char>( c );
hash *= prime;
}
for ( const char c : t.className ) {
hash ^= c;
hash ^= static_cast<unsigned char>( c );
hash *= prime;
}
for ( const Tag& tag : t.tags ) {
for ( const char c : tag.original ) {
hash ^= c;
hash ^= static_cast<unsigned char>( c );
hash *= prime;
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/catch2/reporters/catch_reporter_console.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,8 @@ class TablePrinter {
}
tp.m_currentColumn++;

auto colInfo = tp.m_columnInfos[tp.m_currentColumn];
auto colInfo =
tp.m_columnInfos[static_cast<size_t>( tp.m_currentColumn )];
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tp.m_currentColumn should be changed to be unsigned instead. The only place where it uses the fact that it is signed is using -1 as guard value after reset.

auto padding = (strSize + 1 < colInfo.width)
? std::string(colInfo.width - (strSize + 1), ' ')
: std::string();
Expand Down
3 changes: 2 additions & 1 deletion src/catch2/reporters/catch_reporter_helpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,8 @@ namespace Catch {

for ( auto const& tagCount : tags ) {
ReusableStringStream rss;
rss << " " << std::setw( maxTagCountLen ) << tagCount.count << " ";
rss << " " << std::setw( static_cast<int>( maxTagCountLen ) )
<< tagCount.count << " ";
auto str = rss.str();
auto wrapper = TextFlow::Column( tagCount.all() )
.initialIndent( 0 )
Expand Down
4 changes: 3 additions & 1 deletion src/catch2/reporters/catch_reporter_multi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ namespace Catch {

void MultiReporter::addListener( IEventListenerPtr&& listener ) {
updatePreferences(*listener);
m_reporterLikes.insert(m_reporterLikes.begin() + m_insertedListeners, CATCH_MOVE(listener) );
m_reporterLikes.insert( m_reporterLikes.begin() +
static_cast<long>( m_insertedListeners ),
CATCH_MOVE( listener ) );
++m_insertedListeners;
}

Expand Down