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

ExpressionBuilder ->ExpressionDecomposer

Expression -> ExpressionLhs
Commit
8cca2f13699aa6aa5cd4a60e293f49a1bae54629
Author
Phil Nash ·
Parents
e04e74f896c7

Files · Download .tar.gz

Changes

 include/internal/catch_capture.hpp                 |  4 +--
 include/internal/catch_expression_builder.hpp      | 31 ----------------------
 include/internal/catch_expression_decomposer.hpp   | 31 ++++++++++++++++++++++
 ...tch_expression.hpp => catch_expression_lhs.hpp} |  6 ++---
 .../CatchSelfTest.xcodeproj/project.pbxproj        |  8 +++---
 5 files changed, 40 insertions(+), 40 deletions(-)

diff --git a/include/internal/catch_capture.hpp b/include/internal/catch_capture.hpp
index a1726f39..73ecc425 100644
--- a/include/internal/catch_capture.hpp
+++ b/include/internal/catch_capture.hpp
@@ -8,7 +8,7 @@
 #ifndef TWOBLUECUBES_CATCH_CAPTURE_HPP_INCLUDED
 #define TWOBLUECUBES_CATCH_CAPTURE_HPP_INCLUDED
 
-#include "catch_expression_builder.hpp"
+#include "catch_expression_decomposer.hpp"
 #include "catch_assertionresult_builder.h"
 #include "catch_interfaces_capture.h"
 #include "catch_debugger.hpp"
@@ -97,7 +97,7 @@ inline bool isTrue( bool value ){ return value; }
 #define INTERNAL_CATCH_TEST( expr, shouldNegate, stopOnFailure, macroName ) \
     do { try { \
         INTERNAL_CATCH_ACCEPT_INFO( #expr, macroName, shouldNegate ); \
-        INTERNAL_CATCH_ACCEPT_EXPR( ( Catch::ExpressionBuilder()->*expr ).negate( shouldNegate ), stopOnFailure, expr ); \
+        INTERNAL_CATCH_ACCEPT_EXPR( ( Catch::ExpressionDecomposer()->*expr ).negate( shouldNegate ), stopOnFailure, expr ); \
     } catch( Catch::TestFailureException& ) { \
         throw; \
     } catch( ... ) { \
diff --git a/include/internal/catch_expression_builder.hpp b/include/internal/catch_expression_builder.hpp
deleted file mode 100644
index a3282b95..00000000
--- a/include/internal/catch_expression_builder.hpp
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- *  Created by Phil on 11/5/2012.
- *  Copyright 2012 Two Blue Cubes Ltd. All rights reserved.
- *
- *  Distributed under the Boost Software License, Version 1.0. (See accompanying
- *  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_CATCH_EXPRESSION_BUILDER_HPP_INCLUDED
-#define TWOBLUECUBES_CATCH_EXPRESSION_BUILDER_HPP_INCLUDED
-
-#include "catch_expression.hpp"
-#include "catch_assertionresult_builder.h"
-
-namespace Catch {
-    
-class ExpressionBuilder {
-public:
-
-    template<typename T>
-    Expression<const T&> operator->* ( const T & operand ) {
-        return Expression<const T&>( operand );
-    }
-
-    Expression<bool> operator->* ( bool value ) {
-        return Expression<bool>( value );
-    }
-};
-
-} // end namespace Catch
-
-#endif // TWOBLUECUBES_CATCH_EXPRESSION_BUILDER_HPP_INCLUDED
diff --git a/include/internal/catch_expression_decomposer.hpp b/include/internal/catch_expression_decomposer.hpp
new file mode 100644
index 00000000..9dbd9833
--- /dev/null
+++ b/include/internal/catch_expression_decomposer.hpp
@@ -0,0 +1,31 @@
+/*
+ *  Created by Phil on 11/5/2012.
+ *  Copyright 2012 Two Blue Cubes Ltd. All rights reserved.
+ *
+ *  Distributed under the Boost Software License, Version 1.0. (See accompanying
+ *  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ */
+#ifndef TWOBLUECUBES_CATCH_EXPRESSION_DECOMPOSER_HPP_INCLUDED
+#define TWOBLUECUBES_CATCH_EXPRESSION_DECOMPOSER_HPP_INCLUDED
+
+#include "catch_expression_lhs.hpp"
+#include "catch_assertionresult_builder.h"
+
+namespace Catch {
+    
+class ExpressionDecomposer {
+public:
+
+    template<typename T>
+    ExpressionLhs<const T&> operator->* ( const T & operand ) {
+        return ExpressionLhs<const T&>( operand );
+    }
+
+    ExpressionLhs<bool> operator->* ( bool value ) {
+        return ExpressionLhs<bool>( value );
+    }
+};
+
+} // end namespace Catch
+
+#endif // TWOBLUECUBES_CATCH_EXPRESSION_DECOMPOSER_HPP_INCLUDED
diff --git a/include/internal/catch_expression.hpp b/include/internal/catch_expression_lhs.hpp
similarity index 96%
rename from include/internal/catch_expression.hpp
rename to include/internal/catch_expression_lhs.hpp
index 38b32d90..7d2cc733 100644
--- a/include/internal/catch_expression.hpp
+++ b/include/internal/catch_expression_lhs.hpp
@@ -19,11 +19,11 @@ namespace Catch {
         result.setResultType( value );
     }
 template<typename T>
-class Expression {
-	void operator = ( const Expression& );
+class ExpressionLhs {
+	void operator = ( const ExpressionLhs& );
 
 public:
-    Expression( T lhs ) : m_lhs( lhs ) {
+    ExpressionLhs( T lhs ) : m_lhs( lhs ) {
         setResultIfBoolean( m_result.setLhs( Catch::toString( lhs ) ), lhs );
     }
 
diff --git a/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj b/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj
index bf490fdf..68507bd1 100644
--- a/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj
+++ b/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj
@@ -134,8 +134,8 @@
 		4AB77CB71553B72B00857BF0 /* catch_section_info.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = catch_section_info.hpp; sourceTree = "<group>"; };
 		4AB77CB81553BB3800857BF0 /* catch_running_test.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = catch_running_test.hpp; sourceTree = "<group>"; };
 		4ABEA80415C90D2B009F0424 /* catch_objc_arc.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = catch_objc_arc.hpp; sourceTree = "<group>"; };
-		4AC91CCE155CF02800DC5117 /* catch_expression.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; lineEnding = 0; path = catch_expression.hpp; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };
-		4AC91CD0155D8DA600DC5117 /* catch_expression_builder.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; lineEnding = 0; path = catch_expression_builder.hpp; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };
+		4AC91CCE155CF02800DC5117 /* catch_expression_lhs.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; lineEnding = 0; path = catch_expression_lhs.hpp; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };
+		4AC91CD0155D8DA600DC5117 /* catch_expression_decomposer.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; lineEnding = 0; path = catch_expression_decomposer.hpp; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };
 		4AE1840A14EE4F230066340D /* catch_self_test.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = catch_self_test.cpp; path = ../../../SelfTest/catch_self_test.cpp; sourceTree = "<group>"; };
 		4AEE031F16142F910071E950 /* catch_common.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = catch_common.cpp; path = ../../../SelfTest/SurrogateCpps/catch_common.cpp; sourceTree = "<group>"; };
 		4AEE032216142FC70071E950 /* catch_debugger.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = catch_debugger.cpp; path = ../../../SelfTest/SurrogateCpps/catch_debugger.cpp; sourceTree = "<group>"; };
@@ -295,8 +295,8 @@
 				4A9D84B11558FC0400FBB209 /* catch_tostring.hpp */,
 				4A6D0C46149B3E3D00DB3EAA /* catch_approx.hpp */,
 				4A6D0C47149B3E3D00DB3EAA /* catch_capture.hpp */,
-				4AC91CCE155CF02800DC5117 /* catch_expression.hpp */,
-				4AC91CD0155D8DA600DC5117 /* catch_expression_builder.hpp */,
+				4AC91CCE155CF02800DC5117 /* catch_expression_lhs.hpp */,
+				4AC91CD0155D8DA600DC5117 /* catch_expression_decomposer.hpp */,
 				4A4B0F9A15CEF84800AE2392 /* catch_notimplemented_exception.h */,
 			);
 			name = Assertions;