mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-04 05:09:53 +01:00
Added tests for signed/ unsigned fix
Integrated test from @ jweyrich highlighting issue fixed by pull request #79
This commit is contained in:
parent
5e82dcd62f
commit
8fdf7f3a09
@ -189,6 +189,21 @@ TEST_CASE( "./succeeding/conditions/int literals",
|
|||||||
REQUIRE( (std::numeric_limits<unsigned long>::max)() > ul );
|
REQUIRE( (std::numeric_limits<unsigned long>::max)() > ul );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_CASE( "./succeeding/conditions//long_to_unsigned_x",
|
||||||
|
"comparisons between int variables" )
|
||||||
|
{
|
||||||
|
long long_var = 1L;
|
||||||
|
unsigned char unsigned_char_var = 1;
|
||||||
|
unsigned short unsigned_short_var = 1;
|
||||||
|
unsigned int unsigned_int_var = 1;
|
||||||
|
unsigned long unsigned_long_var = 1L;
|
||||||
|
|
||||||
|
REQUIRE( long_var == unsigned_char_var );
|
||||||
|
REQUIRE( long_var == unsigned_short_var );
|
||||||
|
REQUIRE( long_var == unsigned_int_var );
|
||||||
|
REQUIRE( long_var == unsigned_long_var );
|
||||||
|
}
|
||||||
|
|
||||||
// These are not built normally to avoid warnings about signed/ unsigned
|
// These are not built normally to avoid warnings about signed/ unsigned
|
||||||
#ifdef ALLOW_TESTS_THAT_WARN
|
#ifdef ALLOW_TESTS_THAT_WARN
|
||||||
TEST_CASE( "succeeding/conditions/negative ints",
|
TEST_CASE( "succeeding/conditions/negative ints",
|
||||||
|
Loading…
Reference in New Issue
Block a user