Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/projects
diff options
context:
space:
mode:
authorPhil Nash2012-07-20 18:43:48 +0100
committerPhil Nash2012-07-20 18:43:48 +0100
commit46bcd4b2b78b2e37c39998f574e815ac3fcbfa37 (patch)
tree11601ed0670f002f6b81f40f7ba974821d81c6b1 /projects
parent5d73c5a008cf5511dc7d39c4df80b946a6ed3879 (diff)
downloadcatch3-46bcd4b2b78b2e37c39998f574e815ac3fcbfa37.tar.gz
Added ability to specify if macros should be prefixed with CATCH_
Diffstat (limited to 'projects')
-rw-r--r--projects/SelfTest/GeneratorTests.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/projects/SelfTest/GeneratorTests.cpp b/projects/SelfTest/GeneratorTests.cpp
index 2f8fec84..fe843bd3 100644
--- a/projects/SelfTest/GeneratorTests.cpp
+++ b/projects/SelfTest/GeneratorTests.cpp
@@ -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 );
}