mirror of
				https://github.com/catchorg/Catch2.git
				synced 2025-10-31 20:27:11 +01:00 
			
		
		
		
	Fixes const int error seen on some compilers (see #136)
Added a new test to try to highlight issue.
This commit is contained in:
		| @@ -226,6 +226,20 @@ TEST_CASE(  "./succeeding/conditions//long_to_unsigned_x", | ||||
| 	REQUIRE( long_var == unsigned_long_var ); | ||||
| } | ||||
|  | ||||
| TEST_CASE(  "./succeeding/conditions/const ints to int literal", | ||||
|             "comparisons between const int variables" ) | ||||
| { | ||||
| 	const unsigned char     unsigned_char_var = 1; | ||||
| 	const unsigned short    unsigned_short_var = 1; | ||||
| 	const unsigned int      unsigned_int_var = 1; | ||||
| 	const unsigned long     unsigned_long_var = 1L; | ||||
|  | ||||
| 	REQUIRE( unsigned_char_var == 1 ); | ||||
| 	REQUIRE( unsigned_short_var == 1 ); | ||||
| 	REQUIRE( unsigned_int_var == 1 ); | ||||
| 	REQUIRE( unsigned_long_var == 1 ); | ||||
| } | ||||
|  | ||||
| TEST_CASE(  "./succeeding/conditions/negative ints", | ||||
|             "Comparisons between unsigned ints and negative signed ints match c++ standard behaviour" ) | ||||
| { | ||||
|   | ||||
| @@ -37,7 +37,7 @@ TEST_CASE( "selftest/main", "Runs all Catch self tests and checks their results" | ||||
|         SECTION(    "selftest/test counts/succeeding tests",  | ||||
|                     "Number of 'succeeding' tests is fixed" ) { | ||||
|             Totals totals = runner.runMatching( "./succeeding/*" ); | ||||
|             CHECK( totals.assertions.passed == 289 ); | ||||
|             CHECK( totals.assertions.passed == 293 ); | ||||
|             CHECK( totals.assertions.failed == 0 ); | ||||
|         } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Phil Nash
					Phil Nash