2011-03-09 09:32:03 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								/*
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								 *  Created by Phil on 04/03/2011.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								 *  Copyright 2011 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)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								 */
							 | 
						
					
						
							
								
									
										
										
										
											2011-03-09 09:38:33 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								#ifndef TWOBLUECUBES_CATCH_EVALUATE_HPP_INCLUDED
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								#define TWOBLUECUBES_CATCH_EVALUATE_HPP_INCLUDED
							 | 
						
					
						
							
								
									
										
										
										
											2011-03-09 09:32:03 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2013-03-25 08:46:48 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								#ifdef _MSC_VER
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								#pragma warning(push)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								#pragma warning(disable:4389) // '==' : signed/unsigned mismatch
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								#endif
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2014-04-23 18:19:19 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								#include <cstddef>
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2012-05-15 07:42:26 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								namespace Catch {
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								namespace Internal {
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    enum Operator {
							 | 
						
					
						
							
								
									
										
										
										
											2011-03-09 09:33:33 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        IsEqualTo,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        IsNotEqualTo,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        IsLessThan,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        IsGreaterThan,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        IsLessThanOrEqualTo,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        IsGreaterThanOrEqualTo
							 | 
						
					
						
							
								
									
										
										
										
											2011-03-09 09:32:03 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    };
							 | 
						
					
						
							
								
									
										
										
										
											2013-07-03 19:14:59 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2012-05-21 18:52:09 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    template<Operator Op> struct OperatorTraits             { static const char* getName(){ return "*error*"; } };
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    template<> struct OperatorTraits<IsEqualTo>             { static const char* getName(){ return "=="; } };
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    template<> struct OperatorTraits<IsNotEqualTo>          { static const char* getName(){ return "!="; } };
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    template<> struct OperatorTraits<IsLessThan>            { static const char* getName(){ return "<"; } };
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    template<> struct OperatorTraits<IsGreaterThan>         { static const char* getName(){ return ">"; } };
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    template<> struct OperatorTraits<IsLessThanOrEqualTo>   { static const char* getName(){ return "<="; } };
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    template<> struct OperatorTraits<IsGreaterThanOrEqualTo>{ static const char* getName(){ return ">="; } };
							 | 
						
					
						
							
								
									
										
										
										
											2013-07-03 19:14:59 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2013-04-22 18:55:12 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    template<typename T>
							 | 
						
					
						
							
								
									
										
										
										
											2013-04-23 18:58:56 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    inline T& opCast(T const& t) { return const_cast<T&>(t); }
							 | 
						
					
						
							
								
									
										
										
										
											2013-04-22 18:55:12 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								// nullptr_t support based on pull request #154 from Konstantin Baumann
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								#ifdef CATCH_CONFIG_CPP11_NULLPTR
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    inline std::nullptr_t opCast(std::nullptr_t) { return nullptr; }
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								#endif // CATCH_CONFIG_CPP11_NULLPTR
							 | 
						
					
						
							
								
									
										
										
										
											2013-07-03 19:14:59 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2013-03-25 08:46:48 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2011-03-15 22:22:19 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    // So the compare overloads can be operator agnostic we convey the operator as a template
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    // enum, which is used to specialise an Evaluator for doing the comparison.
							 | 
						
					
						
							
								
									
										
										
										
											2011-03-09 09:33:33 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    template<typename T1, typename T2, Operator Op>
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    class Evaluator{};
							 | 
						
					
						
							
								
									
										
										
										
											2013-07-03 19:14:59 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2011-03-09 09:33:33 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    template<typename T1, typename T2>
							 | 
						
					
						
							
								
									
										
										
										
											2012-05-15 07:42:26 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    struct Evaluator<T1, T2, IsEqualTo> {
							 | 
						
					
						
							
								
									
										
										
										
											2013-04-23 18:58:56 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        static bool evaluate( T1 const& lhs, T2 const& rhs) {
							 | 
						
					
						
							
								
									
										
										
										
											2013-04-22 18:55:12 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								            return opCast( lhs ) ==  opCast( rhs );
							 | 
						
					
						
							
								
									
										
										
										
											2011-03-09 09:33:33 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        }
							 | 
						
					
						
							
								
									
										
										
										
											2011-03-09 09:32:03 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    };
							 | 
						
					
						
							
								
									
										
										
										
											2011-03-09 09:33:33 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    template<typename T1, typename T2>
							 | 
						
					
						
							
								
									
										
										
										
											2012-05-15 07:42:26 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    struct Evaluator<T1, T2, IsNotEqualTo> {
							 | 
						
					
						
							
								
									
										
										
										
											2013-04-23 18:58:56 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        static bool evaluate( T1 const& lhs, T2 const& rhs ) {
							 | 
						
					
						
							
								
									
										
										
										
											2013-04-22 18:55:12 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								            return opCast( lhs ) != opCast( rhs );
							 | 
						
					
						
							
								
									
										
										
										
											2011-03-09 09:33:33 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        }
							 | 
						
					
						
							
								
									
										
										
										
											2011-03-09 09:32:03 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    };
							 | 
						
					
						
							
								
									
										
										
										
											2011-03-09 09:33:33 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    template<typename T1, typename T2>
							 | 
						
					
						
							
								
									
										
										
										
											2012-05-15 07:42:26 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    struct Evaluator<T1, T2, IsLessThan> {
							 | 
						
					
						
							
								
									
										
										
										
											2013-04-23 18:58:56 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        static bool evaluate( T1 const& lhs, T2 const& rhs ) {
							 | 
						
					
						
							
								
									
										
										
										
											2013-04-22 18:55:12 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								            return opCast( lhs ) < opCast( rhs );
							 | 
						
					
						
							
								
									
										
										
										
											2011-03-09 09:32:03 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        }
							 | 
						
					
						
							
								
									
										
										
										
											2011-03-09 09:33:33 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    };
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    template<typename T1, typename T2>
							 | 
						
					
						
							
								
									
										
										
										
											2012-05-15 07:42:26 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    struct Evaluator<T1, T2, IsGreaterThan> {
							 | 
						
					
						
							
								
									
										
										
										
											2013-04-23 18:58:56 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        static bool evaluate( T1 const& lhs, T2 const& rhs ) {
							 | 
						
					
						
							
								
									
										
										
										
											2013-04-22 18:55:12 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								            return opCast( lhs ) > opCast( rhs );
							 | 
						
					
						
							
								
									
										
										
										
											2011-03-09 09:32:03 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        }
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    };
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    template<typename T1, typename T2>
							 | 
						
					
						
							
								
									
										
										
										
											2012-05-15 07:42:26 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    struct Evaluator<T1, T2, IsGreaterThanOrEqualTo> {
							 | 
						
					
						
							
								
									
										
										
										
											2013-04-23 18:58:56 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        static bool evaluate( T1 const& lhs, T2 const& rhs ) {
							 | 
						
					
						
							
								
									
										
										
										
											2013-04-22 18:55:12 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								            return opCast( lhs ) >= opCast( rhs );
							 | 
						
					
						
							
								
									
										
										
										
											2011-03-09 09:32:03 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        }
							 | 
						
					
						
							
								
									
										
										
										
											2011-03-09 09:33:33 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    };
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    template<typename T1, typename T2>
							 | 
						
					
						
							
								
									
										
										
										
											2012-05-15 07:42:26 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    struct Evaluator<T1, T2, IsLessThanOrEqualTo> {
							 | 
						
					
						
							
								
									
										
										
										
											2013-04-23 18:58:56 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        static bool evaluate( T1 const& lhs, T2 const& rhs ) {
							 | 
						
					
						
							
								
									
										
										
										
											2013-04-22 18:55:12 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								            return opCast( lhs ) <= opCast( rhs );
							 | 
						
					
						
							
								
									
										
										
										
											2011-03-09 09:32:03 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        }
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    };
							 | 
						
					
						
							
								
									
										
										
										
											2012-11-06 19:13:25 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2011-03-15 22:22:19 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    template<Operator Op, typename T1, typename T2>
							 | 
						
					
						
							
								
									
										
										
										
											2013-04-23 18:58:56 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    bool applyEvaluator( T1 const& lhs, T2 const& rhs ) {
							 | 
						
					
						
							
								
									
										
										
										
											2011-04-01 08:15:08 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        return Evaluator<T1, T2, Op>::evaluate( lhs, rhs );
							 | 
						
					
						
							
								
									
										
										
										
											2011-03-15 22:22:19 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    }
							 | 
						
					
						
							
								
									
										
										
										
											2012-11-06 19:13:25 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    // This level of indirection allows us to specialise for integer types
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    // to avoid signed/ unsigned warnings
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2011-03-15 22:22:19 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    // "base" overload
							 | 
						
					
						
							
								
									
										
										
										
											2011-03-09 09:33:33 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    template<Operator Op, typename T1, typename T2>
							 | 
						
					
						
							
								
									
										
										
										
											2013-04-23 18:58:56 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    bool compare( T1 const& lhs, T2 const& rhs ) {
							 | 
						
					
						
							
								
									
										
										
										
											2011-03-09 09:33:33 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        return Evaluator<T1, T2, Op>::evaluate( lhs, rhs );
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    }
							 | 
						
					
						
							
								
									
										
										
										
											2012-11-06 19:13:25 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2011-03-09 09:33:33 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    // unsigned X to int
							 | 
						
					
						
							
								
									
										
										
										
											2012-05-15 07:42:26 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    template<Operator Op> bool compare( unsigned int lhs, int rhs ) {
							 | 
						
					
						
							
								
									
										
										
										
											2011-04-01 08:15:08 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        return applyEvaluator<Op>( lhs, static_cast<unsigned int>( rhs ) );
							 | 
						
					
						
							
								
									
										
										
										
											2011-03-09 09:33:33 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    }
							 | 
						
					
						
							
								
									
										
										
										
											2012-05-15 07:42:26 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    template<Operator Op> bool compare( unsigned long lhs, int rhs ) {
							 | 
						
					
						
							
								
									
										
										
										
											2011-04-01 08:15:08 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        return applyEvaluator<Op>( lhs, static_cast<unsigned int>( rhs ) );
							 | 
						
					
						
							
								
									
										
										
										
											2011-03-09 09:33:33 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    }
							 | 
						
					
						
							
								
									
										
										
										
											2012-05-15 07:42:26 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    template<Operator Op> bool compare( unsigned char lhs, int rhs ) {
							 | 
						
					
						
							
								
									
										
										
										
											2011-04-01 08:15:08 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        return applyEvaluator<Op>( lhs, static_cast<unsigned int>( rhs ) );
							 | 
						
					
						
							
								
									
										
										
										
											2011-03-09 09:33:33 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    }
							 | 
						
					
						
							
								
									
										
										
										
											2013-07-03 19:14:59 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2011-03-09 09:33:33 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    // unsigned X to long
							 | 
						
					
						
							
								
									
										
										
										
											2012-05-15 07:42:26 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    template<Operator Op> bool compare( unsigned int lhs, long rhs ) {
							 | 
						
					
						
							
								
									
										
										
										
											2011-04-01 08:15:08 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        return applyEvaluator<Op>( lhs, static_cast<unsigned long>( rhs ) );
							 | 
						
					
						
							
								
									
										
										
										
											2011-03-09 09:33:33 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    }
							 | 
						
					
						
							
								
									
										
										
										
											2012-05-15 07:42:26 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    template<Operator Op> bool compare( unsigned long lhs, long rhs ) {
							 | 
						
					
						
							
								
									
										
										
										
											2011-04-01 08:15:08 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        return applyEvaluator<Op>( lhs, static_cast<unsigned long>( rhs ) );
							 | 
						
					
						
							
								
									
										
										
										
											2011-03-09 09:33:33 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    }
							 | 
						
					
						
							
								
									
										
										
										
											2012-05-15 07:42:26 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    template<Operator Op> bool compare( unsigned char lhs, long rhs ) {
							 | 
						
					
						
							
								
									
										
										
										
											2011-04-01 08:15:08 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        return applyEvaluator<Op>( lhs, static_cast<unsigned long>( rhs ) );
							 | 
						
					
						
							
								
									
										
										
										
											2011-03-09 09:33:33 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    }
							 | 
						
					
						
							
								
									
										
										
										
											2013-07-03 19:14:59 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2011-03-09 09:33:33 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    // int to unsigned X
							 | 
						
					
						
							
								
									
										
										
										
											2012-05-15 07:42:26 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    template<Operator Op> bool compare( int lhs, unsigned int rhs ) {
							 | 
						
					
						
							
								
									
										
										
										
											2011-04-01 08:15:08 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        return applyEvaluator<Op>( static_cast<unsigned int>( lhs ), rhs );
							 | 
						
					
						
							
								
									
										
										
										
											2011-03-09 09:33:33 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    }
							 | 
						
					
						
							
								
									
										
										
										
											2012-05-15 07:42:26 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    template<Operator Op> bool compare( int lhs, unsigned long rhs ) {
							 | 
						
					
						
							
								
									
										
										
										
											2011-04-01 08:15:08 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        return applyEvaluator<Op>( static_cast<unsigned int>( lhs ), rhs );
							 | 
						
					
						
							
								
									
										
										
										
											2011-03-09 09:33:33 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    }
							 | 
						
					
						
							
								
									
										
										
										
											2012-05-15 07:42:26 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    template<Operator Op> bool compare( int lhs, unsigned char rhs ) {
							 | 
						
					
						
							
								
									
										
										
										
											2011-04-01 08:15:08 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        return applyEvaluator<Op>( static_cast<unsigned int>( lhs ), rhs );
							 | 
						
					
						
							
								
									
										
										
										
											2011-03-09 09:33:33 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    }
							 | 
						
					
						
							
								
									
										
										
										
											2013-07-03 19:14:59 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2011-03-09 09:33:33 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    // long to unsigned X
							 | 
						
					
						
							
								
									
										
										
										
											2012-05-15 07:42:26 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    template<Operator Op> bool compare( long lhs, unsigned int rhs ) {
							 | 
						
					
						
							
								
									
										
										
										
											2012-04-27 14:42:40 -03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        return applyEvaluator<Op>( static_cast<unsigned long>( lhs ), rhs );
							 | 
						
					
						
							
								
									
										
										
										
											2011-03-09 09:33:33 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    }
							 | 
						
					
						
							
								
									
										
										
										
											2012-05-15 07:42:26 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    template<Operator Op> bool compare( long lhs, unsigned long rhs ) {
							 | 
						
					
						
							
								
									
										
										
										
											2012-04-27 14:42:40 -03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        return applyEvaluator<Op>( static_cast<unsigned long>( lhs ), rhs );
							 | 
						
					
						
							
								
									
										
										
										
											2011-03-09 09:33:33 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    }
							 | 
						
					
						
							
								
									
										
										
										
											2012-05-15 07:42:26 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    template<Operator Op> bool compare( long lhs, unsigned char rhs ) {
							 | 
						
					
						
							
								
									
										
										
										
											2012-04-27 14:42:40 -03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        return applyEvaluator<Op>( static_cast<unsigned long>( lhs ), rhs );
							 | 
						
					
						
							
								
									
										
										
										
											2011-03-09 09:33:33 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    }
							 | 
						
					
						
							
								
									
										
										
										
											2011-03-18 19:08:33 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2012-05-24 18:41:14 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    // pointer to long (when comparing against NULL)
							 | 
						
					
						
							
								
									
										
										
										
											2012-11-06 19:13:25 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    template<Operator Op, typename T> bool compare( long lhs, T* rhs ) {
							 | 
						
					
						
							
								
									
										
										
										
											2011-03-18 19:08:33 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        return Evaluator<T*, T*, Op>::evaluate( reinterpret_cast<T*>( lhs ), rhs );
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    }
							 | 
						
					
						
							
								
									
										
										
										
											2012-11-06 19:13:25 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    template<Operator Op, typename T> bool compare( T* lhs, long rhs ) {
							 | 
						
					
						
							
								
									
										
										
										
											2012-05-07 19:45:55 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        return Evaluator<T*, T*, Op>::evaluate( lhs, reinterpret_cast<T*>( rhs ) );
							 | 
						
					
						
							
								
									
										
										
										
											2012-05-15 07:42:26 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    }
							 | 
						
					
						
							
								
									
										
										
										
											2013-07-03 19:14:59 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2012-05-24 18:41:14 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    // pointer to int (when comparing against NULL)
							 | 
						
					
						
							
								
									
										
										
										
											2012-11-06 19:13:25 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    template<Operator Op, typename T> bool compare( int lhs, T* rhs ) {
							 | 
						
					
						
							
								
									
										
										
										
											2012-05-24 18:41:14 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        return Evaluator<T*, T*, Op>::evaluate( reinterpret_cast<T*>( lhs ), rhs );
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    }
							 | 
						
					
						
							
								
									
										
										
										
											2012-11-06 19:13:25 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    template<Operator Op, typename T> bool compare( T* lhs, int rhs ) {
							 | 
						
					
						
							
								
									
										
										
										
											2012-05-24 18:41:14 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        return Evaluator<T*, T*, Op>::evaluate( lhs, reinterpret_cast<T*>( rhs ) );
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    }
							 | 
						
					
						
							
								
									
										
										
										
											2013-04-22 18:55:12 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								#ifdef CATCH_CONFIG_CPP11_NULLPTR
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    // pointer to nullptr_t (when comparing against nullptr)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    template<Operator Op, typename T> bool compare( std::nullptr_t, T* rhs ) {
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        return Evaluator<T*, T*, Op>::evaluate( NULL, rhs );
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    }
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    template<Operator Op, typename T> bool compare( T* lhs, std::nullptr_t ) {
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								        return Evaluator<T*, T*, Op>::evaluate( lhs, NULL );
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    }
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								#endif // CATCH_CONFIG_CPP11_NULLPTR
							 | 
						
					
						
							
								
									
										
										
										
											2013-07-03 19:14:59 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2011-03-15 22:22:19 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								} // end of namespace Internal
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								} // end of namespace Catch
							 | 
						
					
						
							
								
									
										
										
										
											2011-03-09 09:32:03 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2013-03-25 08:46:48 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								#ifdef _MSC_VER
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								#pragma warning(pop)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								#endif
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2011-03-09 09:38:33 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								#endif // TWOBLUECUBES_CATCH_EVALUATE_HPP_INCLUDED
							 |