catch_result_type.cpp
1 2 // Copyright Catch2 Authors 3 // Distributed under the Boost Software License, Version 1.0. 4 // (See accompanying file LICENSE.txt or copy at 5 // https://www.boost.org/LICENSE_1_0.txt) 6 7 // SPDX-License-Identifier: BSL-1.0 8 #include <catch2/internal/catch_result_type.hpp> 9 10 namespace Catch { 11 12 bool isOk( ResultWas::OfType resultType ) { 13 return ( resultType & ResultWas::FailureBit ) == 0; 14 } 15 bool isJustInfo( int flags ) { 16 return flags == ResultWas::Info; 17 } 18 19 ResultDisposition::Flags operator | ( ResultDisposition::Flags lhs, ResultDisposition::Flags rhs ) { 20 return static_cast<ResultDisposition::Flags>( static_cast<int>( lhs ) | static_cast<int>( rhs ) ); 21 } 22 23 bool shouldContinueOnFailure( int flags ) { return ( flags & ResultDisposition::ContinueOnFailure ) != 0; } 24 bool shouldSuppressFailure( int flags ) { return ( flags & ResultDisposition::SuppressFail ) != 0; } 25 26 } // end namespace Catch