mirror of
				https://github.com/catchorg/Catch2.git
				synced 2025-11-04 05:59:32 +01:00 
			
		
		
		
	enclosed more min/ max in parentheses to default MFC macros
This commit is contained in:
		@@ -13,7 +13,7 @@
 | 
				
			|||||||
namespace Catch {
 | 
					namespace Catch {
 | 
				
			||||||
namespace Detail {
 | 
					namespace Detail {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    double max(double lhs, double rhs) {
 | 
					    double dmax(double lhs, double rhs) {
 | 
				
			||||||
        if (lhs < rhs) {
 | 
					        if (lhs < rhs) {
 | 
				
			||||||
            return rhs;
 | 
					            return rhs;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -17,7 +17,7 @@
 | 
				
			|||||||
namespace Catch {
 | 
					namespace Catch {
 | 
				
			||||||
namespace Detail {
 | 
					namespace Detail {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    double max(double lhs, double rhs);
 | 
					    double dmax(double lhs, double rhs);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    class Approx {
 | 
					    class Approx {
 | 
				
			||||||
    public:
 | 
					    public:
 | 
				
			||||||
@@ -43,7 +43,8 @@ namespace Detail {
 | 
				
			|||||||
        friend bool operator == ( const T& lhs, Approx const& rhs ) {
 | 
					        friend bool operator == ( const T& lhs, Approx const& rhs ) {
 | 
				
			||||||
            // Thanks to Richard Harris for his help refining this formula
 | 
					            // Thanks to Richard Harris for his help refining this formula
 | 
				
			||||||
            auto lhs_v = static_cast<double>(lhs);
 | 
					            auto lhs_v = static_cast<double>(lhs);
 | 
				
			||||||
            bool relativeOK = std::fabs(lhs_v - rhs.m_value) < rhs.m_epsilon * (rhs.m_scale + (max)(std::fabs(lhs_v), std::fabs(rhs.m_value)));
 | 
					            bool relativeOK = std::fabs(lhs_v - rhs.m_value) < rhs.m_epsilon * (rhs.m_scale +
 | 
				
			||||||
 | 
					                    dmax(std::fabs(lhs_v), std::fabs(rhs.m_value)));
 | 
				
			||||||
            if (relativeOK) {
 | 
					            if (relativeOK) {
 | 
				
			||||||
                return true;
 | 
					                return true;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -25,7 +25,7 @@ namespace Catch {
 | 
				
			|||||||
        return std::rand() % n;
 | 
					        return std::rand() % n;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    RandomNumberGenerator::result_type RandomNumberGenerator::operator()() const {
 | 
					    RandomNumberGenerator::result_type RandomNumberGenerator::operator()() const {
 | 
				
			||||||
        return std::rand() % max();
 | 
					        return std::rand() % (max)();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -22,8 +22,8 @@ namespace Catch {
 | 
				
			|||||||
    struct RandomNumberGenerator {
 | 
					    struct RandomNumberGenerator {
 | 
				
			||||||
        using result_type = std::ptrdiff_t;
 | 
					        using result_type = std::ptrdiff_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        static constexpr result_type min() { return 0; }
 | 
					        static constexpr result_type (min)() { return 0; }
 | 
				
			||||||
        static constexpr result_type max() { return 1000000; }
 | 
					        static constexpr result_type (max)() { return 1000000; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        result_type operator()( result_type n ) const;
 | 
					        result_type operator()( result_type n ) const;
 | 
				
			||||||
        result_type operator()() const;
 | 
					        result_type operator()() const;
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user