mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-16 18:52:25 +01:00
Add -Wdouble-promotion to common warnings
This has not huge benefits in Catch2 codebase, but it is still easy to take in use and it will benefit those which build catch2 with project default compiler options. Signed-off-by: Kari Argillander <kari.argillander@gmail.com>
This commit is contained in:
parent
e4b16053a6
commit
e5632e5e94
@ -53,6 +53,7 @@ function(add_warnings_to_targets targets)
|
||||
"-Wdangling"
|
||||
"-Wdeprecated"
|
||||
"-Wdeprecated-register"
|
||||
"-Wdouble-promotion"
|
||||
"-Wexceptions"
|
||||
"-Wexit-time-destructors"
|
||||
"-Wextra"
|
||||
|
@ -25,7 +25,7 @@ bool marginComparison(double lhs, double rhs, double margin) {
|
||||
namespace Catch {
|
||||
|
||||
Approx::Approx ( double value )
|
||||
: m_epsilon( std::numeric_limits<float>::epsilon()*100. ),
|
||||
: m_epsilon( std::numeric_limits<float>::epsilon()*100.f ),
|
||||
m_margin( 0.0 ),
|
||||
m_scale( 0.0 ),
|
||||
m_value( value )
|
||||
|
@ -136,7 +136,7 @@ TEST_CASE( "Ordering comparison checks that should succeed" )
|
||||
|
||||
REQUIRE( data.float_nine_point_one > 9 );
|
||||
REQUIRE( data.float_nine_point_one < 10 );
|
||||
REQUIRE( data.float_nine_point_one < 9.2 );
|
||||
REQUIRE( data.float_nine_point_one < 9.2f );
|
||||
|
||||
REQUIRE( data.str_hello <= "hello" );
|
||||
REQUIRE( data.str_hello >= "hello" );
|
||||
@ -163,7 +163,7 @@ TEST_CASE( "Ordering comparison checks that should fail", "[.][failing]" )
|
||||
|
||||
CHECK( data.float_nine_point_one < 9 );
|
||||
CHECK( data.float_nine_point_one > 10 );
|
||||
CHECK( data.float_nine_point_one > 9.2 );
|
||||
CHECK( data.float_nine_point_one > 9.2f );
|
||||
|
||||
CHECK( data.str_hello > "hello" );
|
||||
CHECK( data.str_hello < "hello" );
|
||||
|
Loading…
Reference in New Issue
Block a user