Progmasoft Git

catch3

Progmasoft Catch3: an independently maintained C++17 test framework with a parallel runner, property checks, snapshots and structured results.

Clonegit clone https://git.progmasoft.com/catch3

Added tests for signed/ unsigned fix

Integrated test from @ jweyrich highlighting issue fixed by pull request #79
Commit
8fdf7f3a09743ba7001c88df544ae60364215cb4
Author
Phil Nash ·
Parents
5e82dcd62f78

Files · Download .tar.gz

Changes

 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<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
 #ifdef ALLOW_TESTS_THAT_WARN
 TEST_CASE(  "succeeding/conditions/negative ints",