mirror of
				https://github.com/catchorg/Catch2.git
				synced 2025-10-30 19:57:10 +01:00 
			
		
		
		
	some portability fixes (thanks to Sam Saariste)
This commit is contained in:
		| @@ -41,11 +41,3 @@ TEST_CASE( "succeeding/Tricky/complex lhs", "Where the LHS is not a simple value | ||||
|     // This only captures part of the expression, but issues a warning about the rest | ||||
|     EXPECT( a == 2 || b == 2 ); | ||||
| } | ||||
|  | ||||
| TEST_CASE( "succeeding/Tricky/complex lhs/2", "Where the LHS is not a simple value" ) | ||||
| { | ||||
|     int a = 1; | ||||
|      | ||||
|     // This only captures part of the expression, but issues a warning about the rest | ||||
| //    EXPECT( a + 1 == 2); | ||||
| } | ||||
| @@ -14,7 +14,7 @@ | ||||
|  | ||||
| #include "catch_resultinfo.hpp" | ||||
| #include <sstream> | ||||
| #include "math.h" | ||||
| #include <cmath> | ||||
|  | ||||
| namespace Catch | ||||
| { | ||||
| @@ -41,7 +41,7 @@ public: | ||||
|     MutableResultInfo() | ||||
|     {} | ||||
|      | ||||
|     MutableResultInfo( const std::string& expr, bool isNot, const std::string& filename, size_t line, const std::string& macroName ) | ||||
|     MutableResultInfo( const std::string& expr, bool isNot, const std::string& filename, std::size_t line, const std::string& macroName ) | ||||
|     : ResultInfo( ( isNot ? "!" : "" ) + expr, ResultWas::Unknown, isNot, filename, line, macroName ) | ||||
|     { | ||||
|     } | ||||
| @@ -84,7 +84,7 @@ private: | ||||
| class ResultBuilder | ||||
| { | ||||
| public: | ||||
|     ResultBuilder( const char* expr, bool isNot, const std::string& filename, size_t line, const std::string& macroName ) | ||||
|     ResultBuilder( const char* expr, bool isNot, const std::string& filename, std::size_t line, const std::string& macroName ) | ||||
|     : m_result( expr, isNot, filename, line, macroName ) | ||||
|     {} | ||||
|      | ||||
|   | ||||
| @@ -44,7 +44,7 @@ namespace Catch | ||||
|         :   m_mode( modeNone ), | ||||
|             m_config( config ) | ||||
|         { | ||||
|             for(size_t i=1; i < argc; ++i ) | ||||
|             for( int i=1; i < argc; ++i ) | ||||
|             { | ||||
|                 if( argv[i][0] == '-' ) | ||||
|                 { | ||||
|   | ||||
| @@ -15,6 +15,7 @@ | ||||
|  | ||||
| #include "catch_commandline.hpp" | ||||
| #include <limits> | ||||
|  | ||||
| namespace Catch | ||||
| { | ||||
|     inline int List( const RunnerConfig& config ) | ||||
|   | ||||
| @@ -44,7 +44,7 @@ namespace Catch | ||||
|             m_expressionIncomplete( false ) | ||||
|         {} | ||||
|          | ||||
|         ResultInfo( const std::string& expr, ResultWas::OfType result, bool isNot, const std::string& filename, size_t line, const std::string& macroName ) | ||||
|         ResultInfo( const std::string& expr, ResultWas::OfType result, bool isNot, const std::string& filename, std::size_t line, const std::string& macroName ) | ||||
|         :   m_expr( expr ), | ||||
|             m_result( result ), | ||||
|             m_isNot( isNot ), | ||||
| @@ -95,7 +95,7 @@ namespace Catch | ||||
|             return m_filename; | ||||
|         } | ||||
|          | ||||
|         size_t getLine() const | ||||
|         std::size_t getLine() const | ||||
|         { | ||||
|             return m_line; | ||||
|         } | ||||
| @@ -119,7 +119,7 @@ namespace Catch | ||||
|     protected: | ||||
|         std::string m_macroName; | ||||
|         std::string m_filename; | ||||
|         size_t m_line; | ||||
|         std::size_t m_line; | ||||
|         std::string m_expr, m_lhs, m_rhs, m_op; | ||||
|         std::string m_message; | ||||
|         ResultWas::OfType m_result; | ||||
|   | ||||
| @@ -63,19 +63,19 @@ namespace Catch | ||||
|         void runAll() | ||||
|         { | ||||
|             std::vector<TestCaseInfo> allTests = TestRegistry::instance().getAllTests(); | ||||
|             for( size_t i=0; i < allTests.size(); ++i ) | ||||
|             for( std::size_t i=0; i < allTests.size(); ++i ) | ||||
|             { | ||||
|                 runTest( allTests[i] ); | ||||
|             } | ||||
|         } | ||||
|          | ||||
|         size_t runMatching( const std::string& rawTestSpec ) | ||||
|         std::size_t runMatching( const std::string& rawTestSpec ) | ||||
|         { | ||||
|             TestSpec testSpec( rawTestSpec ); | ||||
|              | ||||
|             std::vector<TestCaseInfo> allTests = TestRegistry::instance().getAllTests(); | ||||
|             size_t testsRun = 0; | ||||
|             for( size_t i=0; i < allTests.size(); ++i ) | ||||
|             std::size_t testsRun = 0; | ||||
|             for( std::size_t i=0; i < allTests.size(); ++i ) | ||||
|             { | ||||
|                 if( testSpec.matches( allTests[i].getName() ) ) | ||||
|                 { | ||||
| @@ -114,11 +114,11 @@ namespace Catch | ||||
|             ResultsCapture::setListener( prevListener ); | ||||
|         } | ||||
|          | ||||
|         size_t getSuccessCount() const | ||||
|         std::size_t getSuccessCount() const | ||||
|         { | ||||
|             return m_successes; | ||||
|         } | ||||
|         size_t getFailures() const | ||||
|        std:: size_t getFailures() const | ||||
|         { | ||||
|             return m_failures; | ||||
|         } | ||||
| @@ -136,8 +136,8 @@ namespace Catch | ||||
|         } | ||||
|          | ||||
|     private: | ||||
|         size_t m_successes; | ||||
|         size_t m_failures; | ||||
|         std::size_t m_successes; | ||||
|         std::size_t m_failures; | ||||
|         ITestReporter* m_reporter; | ||||
|     }; | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user