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

Fix for GitHub issue #56

TEST_CASE_METHOD's put the generated class into the anonymous namespace
Commit
d207cecade008b0a41da5d459ea8f38c8f75496a
Author
Phil Nash ·
Parents
f51d316dbacb

Files · Download .tar.gz

Changes

 include/internal/catch_test_registry.hpp | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/include/internal/catch_test_registry.hpp b/include/internal/catch_test_registry.hpp
index 7f090538..d2160dd1 100644
--- a/include/internal/catch_test_registry.hpp
+++ b/include/internal/catch_test_registry.hpp
@@ -139,11 +139,12 @@ private:
 
 ///////////////////////////////////////////////////////////////////////////////
 #define TEST_CASE_METHOD( ClassName, TestName, Desc )\
-    struct INTERNAL_CATCH_UNIQUE_NAME( Catch_FixtureWrapper ) : ClassName \
-    { \
-        void test(); \
-    }; \
-    namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar ) ( &INTERNAL_CATCH_UNIQUE_NAME( Catch_FixtureWrapper )::test, TestName, Desc, __FILE__, __LINE__ ); } \
+    namespace{ \
+        struct INTERNAL_CATCH_UNIQUE_NAME( Catch_FixtureWrapper ) : ClassName{ \
+            void test(); \
+        }; \
+        Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar ) ( &INTERNAL_CATCH_UNIQUE_NAME( Catch_FixtureWrapper )::test, TestName, Desc, __FILE__, __LINE__ ); \
+    } \
     void INTERNAL_CATCH_UNIQUE_NAME( Catch_FixtureWrapper )::test()
 
 #endif // TWOBLUECUBES_CATCH_REGISTRY_HPP_INCLUDED