mirror of
				https://github.com/catchorg/Catch2.git
				synced 2025-10-31 20:27:11 +01:00 
			
		
		
		
	Added ability to specify if macros should be prefixed with CATCH_
This commit is contained in:
		| @@ -10,6 +10,9 @@ | ||||
|  * | ||||
|  */ | ||||
|  | ||||
| // This define means we have to prefix all the CATCH macros with CATCH_ | ||||
| // We're using it here to test it out | ||||
| #define CATCH_CONFIG_PREFIX_ALL | ||||
| #include "catch.hpp" | ||||
|  | ||||
| inline int multiply( int a, int b ) | ||||
| @@ -17,13 +20,13 @@ inline int multiply( int a, int b ) | ||||
|     return a*b; | ||||
| } | ||||
|  | ||||
| TEST_CASE( "./succeeding/generators/1", "Generators over two ranges" ) | ||||
| CATCH_TEST_CASE( "./succeeding/generators/1", "Generators over two ranges" ) | ||||
| { | ||||
|     using namespace Catch::Generators; | ||||
|      | ||||
|     int i = GENERATE( between( 1, 5 ).then( values( 15, 20, 21 ).then( 36 ) ) ); | ||||
|     int j = GENERATE( between( 100, 107 ) ); | ||||
|     int i = CATCH_GENERATE( between( 1, 5 ).then( values( 15, 20, 21 ).then( 36 ) ) ); | ||||
|     int j = CATCH_GENERATE( between( 100, 107 ) ); | ||||
|      | ||||
|     REQUIRE( multiply( i, 2 ) == i*2 ); | ||||
|     REQUIRE( multiply( j, 2 ) == j*2 ); | ||||
|     CATCH_REQUIRE( multiply( i, 2 ) == i*2 ); | ||||
|     CATCH_REQUIRE( multiply( j, 2 ) == j*2 ); | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Phil Nash
					Phil Nash