mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-22 13:26:10 +01:00
Remove some useless casts
This commit is contained in:
parent
c410e2596c
commit
332de39cd4
@ -58,7 +58,7 @@ namespace Catch {
|
|||||||
else if( tag == "!nonportable"_sr )
|
else if( tag == "!nonportable"_sr )
|
||||||
return TestCaseProperties::NonPortable;
|
return TestCaseProperties::NonPortable;
|
||||||
else if( tag == "!benchmark"_sr )
|
else if( tag == "!benchmark"_sr )
|
||||||
return static_cast<TestCaseProperties>(TestCaseProperties::Benchmark | TestCaseProperties::IsHidden );
|
return TestCaseProperties::Benchmark | TestCaseProperties::IsHidden;
|
||||||
else
|
else
|
||||||
return TestCaseProperties::None;
|
return TestCaseProperties::None;
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
namespace Catch {
|
namespace Catch {
|
||||||
StringRef::StringRef( char const* rawChars ) noexcept
|
StringRef::StringRef( char const* rawChars ) noexcept
|
||||||
: StringRef( rawChars, static_cast<StringRef::size_type>(std::strlen(rawChars) ) )
|
: StringRef( rawChars, std::strlen(rawChars) )
|
||||||
{}
|
{}
|
||||||
|
|
||||||
auto StringRef::operator == ( StringRef other ) const noexcept -> bool {
|
auto StringRef::operator == ( StringRef other ) const noexcept -> bool {
|
||||||
|
@ -150,14 +150,26 @@ namespace Detail {
|
|||||||
|
|
||||||
ret << " ([";
|
ret << " ([";
|
||||||
if (m_type == Detail::FloatingPointKind::Double) {
|
if (m_type == Detail::FloatingPointKind::Double) {
|
||||||
write(ret, step(m_target, static_cast<double>(-INFINITY), m_ulps));
|
write( ret,
|
||||||
|
step( m_target,
|
||||||
|
-std::numeric_limits<double>::infinity(),
|
||||||
|
m_ulps ) );
|
||||||
ret << ", ";
|
ret << ", ";
|
||||||
write(ret, step(m_target, static_cast<double>( INFINITY), m_ulps));
|
write( ret,
|
||||||
|
step( m_target,
|
||||||
|
std::numeric_limits<double>::infinity(),
|
||||||
|
m_ulps ) );
|
||||||
} else {
|
} else {
|
||||||
// We have to cast INFINITY to float because of MinGW, see #1782
|
// We have to cast INFINITY to float because of MinGW, see #1782
|
||||||
write(ret, step(static_cast<float>(m_target), static_cast<float>(-INFINITY), m_ulps));
|
write( ret,
|
||||||
|
step( static_cast<float>( m_target ),
|
||||||
|
-std::numeric_limits<float>::infinity(),
|
||||||
|
m_ulps ) );
|
||||||
ret << ", ";
|
ret << ", ";
|
||||||
write(ret, step(static_cast<float>(m_target), static_cast<float>( INFINITY), m_ulps));
|
write( ret,
|
||||||
|
step( static_cast<float>( m_target ),
|
||||||
|
std::numeric_limits<float>::infinity(),
|
||||||
|
m_ulps ) );
|
||||||
}
|
}
|
||||||
ret << "])";
|
ret << "])";
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user