From 8fdf7f3a09743ba7001c88df544ae60364215cb4 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Sat, 28 Apr 2012 12:20:29 +0100 Subject: [PATCH] Added tests for signed/ unsigned fix Integrated test from @ jweyrich highlighting issue fixed by pull request #79 --- projects/SelfTest/ConditionTests.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/projects/SelfTest/ConditionTests.cpp b/projects/SelfTest/ConditionTests.cpp index e03b8d05..f14da68d 100644 --- a/projects/SelfTest/ConditionTests.cpp +++ b/projects/SelfTest/ConditionTests.cpp @@ -189,6 +189,21 @@ TEST_CASE( "./succeeding/conditions/int literals", REQUIRE( (std::numeric_limits::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 #ifdef ALLOW_TESTS_THAT_WARN TEST_CASE( "succeeding/conditions/negative ints",