diff options
| author | Phil Nash | 2012-05-15 07:42:26 +0100 |
|---|---|---|
| committer | Phil Nash | 2012-05-15 07:42:26 +0100 |
| commit | 2efc1146bfd94780e319d6d9d90e966429d73bda (patch) | |
| tree | cd7e14fa8bb7757363470783499acf37dae4167f /include | |
| parent | 6acb36a996822a6d524c5f9f46eb118f18a969df (diff) | |
| download | catch3-2efc1146bfd94780e319d6d9d90e966429d73bda.tar.gz | |
Reformatting
Diffstat (limited to 'include')
| -rw-r--r-- | include/internal/catch_approx.hpp | 206 | ||||
| -rw-r--r-- | include/internal/catch_capture.hpp | 6 | ||||
| -rw-r--r-- | include/internal/catch_evaluate.hpp | 109 | ||||
| -rw-r--r-- | include/internal/catch_expression.hpp | 9 | ||||
| -rw-r--r-- | include/internal/catch_generators.hpp | 180 | ||||
| -rw-r--r-- | include/internal/catch_matchers.hpp | 22 | ||||
| -rw-r--r-- | include/internal/catch_result_type.h | 59 | ||||
| -rw-r--r-- | include/internal/catch_resultinfo.hpp | 120 | ||||
| -rw-r--r-- | include/internal/catch_resultinfo_builder.hpp | 3 | ||||
| -rw-r--r-- | include/internal/catch_section.hpp | 35 | ||||
| -rw-r--r-- | include/internal/catch_tostring.hpp | 7 |
11 files changed, 211 insertions, 545 deletions
diff --git a/include/internal/catch_approx.hpp b/include/internal/catch_approx.hpp index 04e63df9..86219dab 100644 --- a/include/internal/catch_approx.hpp +++ b/include/internal/catch_approx.hpp @@ -1,13 +1,9 @@ /* - * catch_approx.hpp - * Catch - * * Created by Phil on 28/04/2011. * Copyright 2010 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_APPROX_HPP_INCLUDED #define TWOBLUECUBES_CATCH_APPROX_HPP_INCLUDED @@ -17,140 +13,78 @@ #include <cmath> #include <limits> -namespace Catch -{ - namespace Detail - { - class Approx - { - public: - /////////////////////////////////////////////////////////////////////////// - explicit Approx - ( - double value - ) - : m_epsilon( std::numeric_limits<float>::epsilon()*100 ), - m_scale( 1.0 ), - m_value( value ) - { - } - - /////////////////////////////////////////////////////////////////////////// - Approx - ( - const Approx& other - ) - : m_epsilon( other.m_epsilon ), - m_scale( other.m_scale ), - m_value( other.m_value ) - { - } +namespace Catch { +namespace Detail { + + class Approx { + public: + explicit Approx ( double value ) + : m_epsilon( std::numeric_limits<float>::epsilon()*100 ), + m_scale( 1.0 ), + m_value( value ) + {} + + Approx( const Approx& other ) + : m_epsilon( other.m_epsilon ), + m_scale( other.m_scale ), + m_value( other.m_value ) + {} + + static Approx custom() { + return Approx( 0 ); + } + + Approx operator()( double value ) { + Approx approx( value ); + approx.epsilon( m_epsilon ); + approx.scale( m_scale ); + return approx; + } + + friend bool operator == ( double lhs, const Approx& rhs ) { + // Thanks to Richard Harris for his help refining this formula + return fabs( lhs - rhs.m_value ) < rhs.m_epsilon * (rhs.m_scale + (std::max)( fabs(lhs), fabs(rhs.m_value) ) ); + } + + friend bool operator == ( const Approx& lhs, double rhs ) { + return operator==( rhs, lhs ); + } + + friend bool operator != ( double lhs, const Approx& rhs ) { + return !operator==( lhs, rhs ); + } - /////////////////////////////////////////////////////////////////////////// - static Approx custom - () - { - return Approx( 0 ); - } - - /////////////////////////////////////////////////////////////////////////// - Approx operator() - ( - double value - ) - { - Approx approx( value ); - approx.epsilon( m_epsilon ); - approx.scale( m_scale ); - return approx; - } - - /////////////////////////////////////////////////////////////////////////// - friend bool operator == - ( - double lhs, - const Approx& rhs - ) - { - // Thanks to Richard Harris for his help refining this formula - return fabs( lhs - rhs.m_value ) < rhs.m_epsilon * (rhs.m_scale + (std::max)( fabs(lhs), fabs(rhs.m_value) ) ); - } - - /////////////////////////////////////////////////////////////////////////// - friend bool operator == - ( - const Approx& lhs, - double rhs - ) - { - return operator==( rhs, lhs ); - } - - /////////////////////////////////////////////////////////////////////////// - friend bool operator != - ( - double lhs, - const Approx& rhs - ) - { - return !operator==( lhs, rhs ); - } + friend bool operator != ( const Approx& lhs, double rhs ) { + return !operator==( rhs, lhs ); + } + + Approx& epsilon( double newEpsilon ) { + m_epsilon = newEpsilon; + return *this; + } + + Approx& scale( double newScale ) { + m_scale = newScale; + return *this; + } + + std::string toString() const { + std::ostringstream oss; + oss << "Approx( " << m_value << ")"; + return oss.str(); + } + + private: + double m_epsilon; + double m_scale; + double m_value; + }; +} - /////////////////////////////////////////////////////////////////////////// - friend bool operator != - ( - const Approx& lhs, - double rhs - ) - { - return !operator==( rhs, lhs ); - } - - - /////////////////////////////////////////////////////////////////////////// - Approx& epsilon - ( - double newEpsilon - ) - { - m_epsilon = newEpsilon; - return *this; - } - - /////////////////////////////////////////////////////////////////////////// - Approx& scale - ( - double newScale - ) - { - m_scale = newScale; - return *this; - } - - /////////////////////////////////////////////////////////////////////////// - std::string toString() const - { - std::ostringstream oss; - oss << "Approx( " << m_value << ")"; - return oss.str(); - } - - private: - double m_epsilon; - double m_scale; - double m_value; - }; - } - - /////////////////////////////////////////////////////////////////////////////// - template<> - inline std::string toString<Detail::Approx> - ( - const Detail::Approx& value - ) - { - return value.toString(); - } +template<> +inline std::string toString<Detail::Approx>( const Detail::Approx& value ) { + return value.toString(); +} } // end namespace Catch diff --git a/include/internal/catch_capture.hpp b/include/internal/catch_capture.hpp index 32b26e0f..688f8455 100644 --- a/include/internal/catch_capture.hpp +++ b/include/internal/catch_capture.hpp @@ -15,13 +15,11 @@ #include "catch_common.h" #include <ostream> -namespace Catch -{ +namespace Catch { struct TestFailureException{}; -class ScopedInfo -{ +class ScopedInfo { public: ScopedInfo() : m_oss() { Context::getResultCapture().pushScopedInfo( this ); diff --git a/include/internal/catch_evaluate.hpp b/include/internal/catch_evaluate.hpp index a17b3341..78472f6b 100644 --- a/include/internal/catch_evaluate.hpp +++ b/include/internal/catch_evaluate.hpp @@ -1,24 +1,17 @@ /* - * catch_evaluate.hpp - * Catch - * * 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) - * */ - #ifndef TWOBLUECUBES_CATCH_EVALUATE_HPP_INCLUDED #define TWOBLUECUBES_CATCH_EVALUATE_HPP_INCLUDED -namespace Catch -{ -namespace Internal -{ - enum Operator - { +namespace Catch { +namespace Internal { + + enum Operator { IsEqualTo, IsNotEqualTo, IsLessThan, @@ -54,146 +47,116 @@ namespace Internal class Evaluator{}; template<typename T1, typename T2> - struct Evaluator<T1, T2, IsEqualTo> - { - static bool evaluate( const T1& lhs, const T2& rhs) - { + struct Evaluator<T1, T2, IsEqualTo> { + static bool evaluate( const T1& lhs, const T2& rhs) { return const_cast<T1&>( lhs ) == const_cast<T2&>( rhs ); } }; template<typename T1, typename T2> - struct Evaluator<T1, T2, IsNotEqualTo> - { - static bool evaluate( const T1& lhs, const T2& rhs ) - { + struct Evaluator<T1, T2, IsNotEqualTo> { + static bool evaluate( const T1& lhs, const T2& rhs ) { return const_cast<T1&>( lhs ) != const_cast<T2&>( rhs ); } }; template<typename T1, typename T2> - struct Evaluator<T1, T2, IsLessThan> - { - static bool evaluate( const T1& lhs, const T2& rhs ) - { + struct Evaluator<T1, T2, IsLessThan> { + static bool evaluate( const T1& lhs, const T2& rhs ) { return const_cast<T1&>( lhs ) < const_cast<T2&>( rhs ); } }; template<typename T1, typename T2> - struct Evaluator<T1, T2, IsGreaterThan> - { - static bool evaluate( const T1& lhs, const T2& rhs ) - { + struct Evaluator<T1, T2, IsGreaterThan> { + static bool evaluate( const T1& lhs, const T2& rhs ) { return const_cast<T1&>( lhs ) > const_cast<T2&>( rhs ); } }; template<typename T1, typename T2> - struct Evaluator<T1, T2, IsGreaterThanOrEqualTo> - { - static bool evaluate( const T1& lhs, const T2& rhs ) - { + struct Evaluator<T1, T2, IsGreaterThanOrEqualTo> { + static bool evaluate( const T1& lhs, const T2& rhs ) { return const_cast<T1&>( lhs ) >= const_cast<T2&>( rhs ); } }; template<typename T1, typename T2> - struct Evaluator<T1, T2, IsLessThanOrEqualTo> - { - static bool evaluate( const T1& lhs, const T2& rhs ) - { + struct Evaluator<T1, T2, IsLessThanOrEqualTo> { + static bool evaluate( const T1& lhs, const T2& rhs ) { return const_cast<T1&>( lhs ) <= const_cast<T2&>( rhs ); } }; template<Operator Op, typename T1, typename T2> - bool applyEvaluator( const T1& lhs, const T2& rhs ) - { + bool applyEvaluator( const T1& lhs, const T2& rhs ) { return Evaluator<T1, T2, Op>::evaluate( lhs, rhs ); } // "base" overload template<Operator Op, typename T1, typename T2> - bool compare( const T1& lhs, const T2& rhs ) - { + bool compare( const T1& lhs, const T2& rhs ) { return Evaluator<T1, T2, Op>::evaluate( lhs, rhs ); } // unsigned X to int - template<Operator Op> bool compare( unsigned int lhs, int rhs ) - { + template<Operator Op> bool compare( unsigned int lhs, int rhs ) { return applyEvaluator<Op>( lhs, static_cast<unsigned int>( rhs ) ); } - template<Operator Op> bool compare( unsigned long lhs, int rhs ) - { + template<Operator Op> bool compare( unsigned long lhs, int rhs ) { return applyEvaluator<Op>( lhs, static_cast<unsigned int>( rhs ) ); } - template<Operator Op> bool compare( unsigned char lhs, int rhs ) - { + template<Operator Op> bool compare( unsigned char lhs, int rhs ) { return applyEvaluator<Op>( lhs, static_cast<unsigned int>( rhs ) ); } // unsigned X to long - template<Operator Op> bool compare( unsigned int lhs, long rhs ) - { + template<Operator Op> bool compare( unsigned int lhs, long rhs ) { return applyEvaluator<Op>( lhs, static_cast<unsigned long>( rhs ) ); } - template<Operator Op> bool compare( unsigned long lhs, long rhs ) - { + template<Operator Op> bool compare( unsigned long lhs, long rhs ) { return applyEvaluator<Op>( lhs, static_cast<unsigned long>( rhs ) ); } - template<Operator Op> bool compare( unsigned char lhs, long rhs ) - { + template<Operator Op> bool compare( unsigned char lhs, long rhs ) { return applyEvaluator<Op>( lhs, static_cast<unsigned long>( rhs ) ); } // int to unsigned X - template<Operator Op> bool compare( int lhs, unsigned int rhs ) - { + template<Operator Op> bool compare( int lhs, unsigned int rhs ) { return applyEvaluator<Op>( static_cast<unsigned int>( lhs ), rhs ); } - template<Operator Op> bool compare( int lhs, unsigned long rhs ) - { + template<Operator Op> bool compare( int lhs, unsigned long rhs ) { return applyEvaluator<Op>( static_cast<unsigned int>( lhs ), rhs ); } - template<Operator Op> bool compare( int lhs, unsigned char rhs ) - { + template<Operator Op> bool compare( int lhs, unsigned char rhs ) { return applyEvaluator<Op>( static_cast<unsigned int>( lhs ), rhs ); } // long to unsigned X - template<Operator Op> bool compare( long lhs, unsigned int rhs ) - { + template<Operator Op> bool compare( long lhs, unsigned int rhs ) { return applyEvaluator<Op>( static_cast<unsigned long>( lhs ), rhs ); } - template<Operator Op> bool compare( long lhs, unsigned long rhs ) - { + template<Operator Op> bool compare( long lhs, unsigned long rhs ) { return applyEvaluator<Op>( static_cast<unsigned long>( lhs ), rhs ); } - template<Operator Op> bool compare( long lhs, unsigned char rhs ) - { + template<Operator Op> bool compare( long lhs, unsigned char rhs ) { return applyEvaluator<Op>( static_cast<unsigned long>( lhs ), rhs ); } template<Operator Op, typename T> - bool compare( long lhs, const T* rhs ) - { + bool compare( long lhs, const T* rhs ) { return Evaluator<const T*, const T*, Op>::evaluate( reinterpret_cast<const T*>( lhs ), rhs ); } template<Operator Op, typename T> - bool compare( long lhs, T* rhs ) - { + bool compare( long lhs, T* rhs ) { return Evaluator<T*, T*, Op>::evaluate( reinterpret_cast<T*>( lhs ), rhs ); } template<Operator Op, typename T> - bool compare( const T* lhs, long rhs ) - { + bool compare( const T* lhs, long rhs ) { return Evaluator<const T*, const T*, Op>::evaluate( lhs, reinterpret_cast<const T*>( rhs ) ); - } + } template<Operator Op, typename T> - bool compare( T* lhs, long rhs ) - { + bool compare( T* lhs, long rhs ) { return Evaluator<T*, T*, Op>::evaluate( lhs, reinterpret_cast<T*>( rhs ) ); - } + } } // end of namespace Internal } // end of namespace Catch diff --git a/include/internal/catch_expression.hpp b/include/internal/catch_expression.hpp index 2a3dcf87..4fe147f6 100644 --- a/include/internal/catch_expression.hpp +++ b/include/internal/catch_expression.hpp @@ -11,12 +11,10 @@ #include "catch_resultinfo_builder.hpp" #include "catch_evaluate.hpp" -namespace Catch -{ +namespace Catch { template<typename T> -class Expression -{ +class Expression { void operator = ( const Expression& ); public: @@ -79,8 +77,7 @@ private: }; template<typename LhsT> -class PtrExpression -{ +class PtrExpression { public: PtrExpression ( ResultInfoBuilder& result, const LhsT* lhs ) diff --git a/include/internal/catch_generators.hpp b/include/internal/catch_generators.hpp index 08bfa4bb..6c72c397 100644 --- a/include/internal/catch_generators.hpp +++ b/include/internal/catch_generators.hpp @@ -1,15 +1,10 @@ /* - * catch_generators.hpp - * Catch - * * Created by Phil on 27/01/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) - * */ - #ifndef TWOBLUECUBES_CATCH_GENERATORS_HPP_INCLUDED #define TWOBLUECUBES_CATCH_GENERATORS_HPP_INCLUDED @@ -20,54 +15,25 @@ #include <string> #include <stdlib.h> -namespace Catch -{ +namespace Catch { template<typename T> -struct IGenerator -{ - virtual ~IGenerator - () - {} - - virtual T getValue - ( std::size_t index - ) const = 0; - - virtual std::size_t size - () const = 0; +struct IGenerator { + virtual ~IGenerator() {} + virtual T getValue( std::size_t index ) const = 0; + virtual std::size_t size () const = 0; }; template<typename T> -class BetweenGenerator : public IGenerator<T> -{ +class BetweenGenerator : public IGenerator<T> { public: - /////////////////////////////////////////////////////////////////////////// - BetweenGenerator - ( - T from, - T to - ) - : m_from( from ), - m_to( to ) - { - } + BetweenGenerator( T from, T to ) : m_from( from ), m_to( to ){} - /////////////////////////////////////////////////////////////////////////// - virtual T getValue - ( - std::size_t index - ) - const - { + virtual T getValue( std::size_t index ) const { return m_from+static_cast<T>( index ); } - /////////////////////////////////////////////////////////////////////////// - virtual std::size_t size - () - const - { + virtual std::size_t size() const { return static_cast<std::size_t>( 1+m_to-m_from ); } @@ -78,88 +44,49 @@ private: }; template<typename T> -class ValuesGenerator : public IGenerator<T> -{ +class ValuesGenerator : public IGenerator<T> { public: - /////////////////////////////////////////////////////////////////////////// - ValuesGenerator - () - { - } + ValuesGenerator(){} - /////////////////////////////////////////////////////////////////////////// - void add - ( - T value - ) - { + void add( T value ) { m_values.push_back( value ); } - /////////////////////////////////////////////////////////////////////////// - virtual T getValue - ( - std::size_t index - ) - const - { + virtual T getValue( std::size_t index ) const { return m_values[index]; } - /////////////////////////////////////////////////////////////////////////// - virtual std::size_t size - () - const - { + virtual std::size_t size() const { return m_values.size(); } private: - std::vector<T> m_values; }; template<typename T> -class CompositeGenerator -{ +class CompositeGenerator { public: - /////////////////////////////////////////////////////////////////////////// - CompositeGenerator() - : m_totalSize( 0 ) - { - } + CompositeGenerator() : m_totalSize( 0 ) {} - /////////////////////////////////////////////////////////////////////////// // *** Move semantics, similar to auto_ptr *** - CompositeGenerator( CompositeGenerator& other ) - : m_fileInfo( other.m_fileInfo ), - m_totalSize( 0 ) + CompositeGenerator( CompositeGenerator& other ) + : m_fileInfo( other.m_fileInfo ), + m_totalSize( 0 ) { move( other ); } - /////////////////////////////////////////////////////////////////////////// - CompositeGenerator& setFileInfo - ( - const char* fileInfo - ) - { + CompositeGenerator& setFileInfo( const char* fileInfo ) { m_fileInfo = fileInfo; return *this; } - /////////////////////////////////////////////////////////////////////////// - ~CompositeGenerator - () - { + ~CompositeGenerator() { deleteAll( m_composed ); } - /////////////////////////////////////////////////////////////////////////// - operator T - () - const - { + operator T () const { size_t overallIndex = Context::getGeneratorIndex( m_fileInfo, m_totalSize ); typename std::vector<const IGenerator<T>*>::const_iterator it = m_composed.begin(); @@ -177,32 +104,17 @@ public: return T(); // Suppress spurious "not all control paths return a value" warning in Visual Studio - if you know how to fix this please do so } - /////////////////////////////////////////////////////////////////////////// - void add - ( - const IGenerator<T>* generator - ) - { + void add( const IGenerator<T>* generator ) { m_totalSize += generator->size(); m_composed.push_back( generator ); } - /////////////////////////////////////////////////////////////////////////// - CompositeGenerator& then - ( - CompositeGenerator& other - ) - { + CompositeGenerator& then( CompositeGenerator& other ) { move( other ); return *this; } - /////////////////////////////////////////////////////////////////////////// - CompositeGenerator& then - ( - T value - ) - { + CompositeGenerator& then( T value ) { ValuesGenerator<T>* valuesGen = new ValuesGenerator<T>(); valuesGen->add( value ); add( valuesGen ); @@ -211,12 +123,7 @@ public: private: - /////////////////////////////////////////////////////////////////////////// - void move - ( - CompositeGenerator& other - ) - { + void move( CompositeGenerator& other ) { std::copy( other.m_composed.begin(), other.m_composed.end(), std::back_inserter( m_composed ) ); m_totalSize += other.m_totalSize; other.m_composed.clear(); @@ -229,27 +136,15 @@ private: namespace Generators { - /////////////////////////////////////////////////////////////////////////// template<typename T> - CompositeGenerator<T> between - ( - T from, - T to - ) - { + CompositeGenerator<T> between( T from, T to ) { CompositeGenerator<T> generators; generators.add( new BetweenGenerator<T>( from, to ) ); return generators; } - /////////////////////////////////////////////////////////////////////////// template<typename T> - CompositeGenerator<T> values - ( - T val1, - T val2 - ) - { + CompositeGenerator<T> values( T val1, T val2 ) { CompositeGenerator<T> generators; ValuesGenerator<T>* valuesGen = new ValuesGenerator<T>(); valuesGen->add( val1 ); @@ -258,15 +153,8 @@ namespace Generators return generators; } - /////////////////////////////////////////////////////////////////////////// template<typename T> - CompositeGenerator<T> values - ( - T val1, - T val2, - T val3 - ) - { + CompositeGenerator<T> values( T val1, T val2, T val3 ){ CompositeGenerator<T> generators; ValuesGenerator<T>* valuesGen = new ValuesGenerator<T>(); valuesGen->add( val1 ); @@ -276,16 +164,8 @@ namespace Generators return generators; } - /////////////////////////////////////////////////////////////////////////// template<typename T> - CompositeGenerator<T> values - ( - T val1, - T val2, - T val3, - T val4 - ) - { + CompositeGenerator<T> values( T val1, T val2, T val3, T val4 ) { CompositeGenerator<T> generators; ValuesGenerator<T>* valuesGen = new ValuesGenerator<T>(); valuesGen->add( val1 ); diff --git a/include/internal/catch_matchers.hpp b/include/internal/catch_matchers.hpp index a57bb56c..81085bbe 100644 --- a/include/internal/catch_matchers.hpp +++ b/include/internal/catch_matchers.hpp @@ -8,16 +8,12 @@ #ifndef TWOBLUECUBES_CATCH_MATCHERS_HPP_INCLUDED #define TWOBLUECUBES_CATCH_MATCHERS_HPP_INCLUDED -namespace Catch -{ -namespace Matchers -{ - namespace Impl - { - namespace StdString - { - struct Contains - { +namespace Catch { +namespace Matchers { + namespace Impl { + namespace StdString { + + struct Contains { Contains( const std::string& substr ) : m_substr( substr ){} bool operator()( const std::string& str ) const @@ -33,8 +29,7 @@ namespace Matchers std::string m_substr; }; - struct StartsWith - { + struct StartsWith { StartsWith( const std::string& substr ) : m_substr( substr ){} bool operator()( const std::string& str ) const @@ -50,8 +45,7 @@ namespace Matchers std::string m_substr; }; - struct EndsWith - { + struct EndsWith { EndsWith( const std::string& substr ) : m_substr( substr ){} bool operator()( const std::string& str ) const diff --git a/include/internal/catch_result_type.h b/include/internal/catch_result_type.h index e8f6f528..f7d14ed9 100644 --- a/include/internal/catch_result_type.h +++ b/include/internal/catch_result_type.h @@ -1,51 +1,40 @@ /* - * catch_result_type.h - * Catch - * * Created by Phil on 07/01/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) - * */ - #ifndef TWOBLUECUBES_CATCH_RESULT_TYPE_H_INCLUDED #define TWOBLUECUBES_CATCH_RESULT_TYPE_H_INCLUDED -namespace Catch -{ +namespace Catch { -struct ResultWas{ enum OfType - { - Unknown = -1, - Ok = 0, - Info = 1, - Warning = 2, - - FailureBit = 0x10, - - ExpressionFailed = FailureBit | 1, - ExplicitFailure = FailureBit | 2, - - Exception = 0x100 | FailureBit, - - ThrewException = Exception | 1, - DidntThrowException = Exception | 2 - - }; }; +struct ResultWas { enum OfType { + Unknown = -1, + Ok = 0, + Info = 1, + Warning = 2, + + FailureBit = 0x10, + + ExpressionFailed = FailureBit | 1, + ExplicitFailure = FailureBit | 2, + + Exception = 0x100 | FailureBit, + + ThrewException = Exception | 1, + DidntThrowException = Exception | 2 + +}; }; - struct ResultAction - { - enum Value - { - None, - Failed = 1, // Failure - but no debug break if Debug bit not set - DebugFailed = 3 // Indicates that the debugger should break, if possible - }; - }; +struct ResultAction { enum Value { + None, + Failed = 1, // Failure - but no debug break if Debug bit not set + DebugFailed = 3 // Indicates that the debugger should break, if possible + +}; }; } - #endif // TWOBLUECUBES_CATCH_RESULT_TYPE_H_INCLUDED diff --git a/include/internal/catch_resultinfo.hpp b/include/internal/catch_resultinfo.hpp index bc420bdf..da291414 100644 --- a/include/internal/catch_resultinfo.hpp +++ b/< |