Sha256: fc1b00d897ed4db57489b5b3612d2d45dda1cccd7fc7149ff65936d8ac3648b3

Contents?: true

Size: 1.57 KB

Versions: 36

Compression:

Stored size: 1.57 KB

Contents

#ifndef BOOST_CORE_LIGHTWEIGHT_TEST_TRAIT_HPP
#define BOOST_CORE_LIGHTWEIGHT_TEST_TRAIT_HPP

// MS compatible compilers support #pragma once

#if defined(_MSC_VER)
# pragma once
#endif

// boost/core/lightweight_test_trait.hpp
//
// BOOST_TEST_TRAIT_TRUE, BOOST_TEST_TRAIT_FALSE
//
// Copyright 2014 Peter Dimov
//
// 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

#include <boost/core/lightweight_test.hpp>
#include <boost/core/typeinfo.hpp>

namespace boost
{

namespace detail
{

template< class T > inline void test_trait_impl( char const * trait, void (*)( T ),
  bool expected, char const * file, int line, char const * function )
{
    if( T::value == expected )
    {
        report_errors_remind();
    }
    else
    {
        BOOST_LIGHTWEIGHT_TEST_OSTREAM
            << file << "(" << line << "): predicate '" << trait << "' ["
            << boost::core::demangled_name( BOOST_CORE_TYPEID(T) ) << "]"
            << " test failed in function '" << function
            << "' (should have been " << ( expected? "true": "false" ) << ")"
            << std::endl;

        ++test_errors();
    }
}

} // namespace detail

} // namespace boost

#define BOOST_TEST_TRAIT_TRUE(type) ( ::boost::detail::test_trait_impl(#type, (void(*)type)0, true, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION) )
#define BOOST_TEST_TRAIT_FALSE(type) ( ::boost::detail::test_trait_impl(#type, (void(*)type)0, false, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION) )

#endif // #ifndef BOOST_CORE_LIGHTWEIGHT_TEST_TRAIT_HPP

Version data entries

36 entries across 36 versions & 3 rubygems

Version Path
passenger-6.0.2 src/cxx_supportlib/vendor-modified/boost/core/lightweight_test_trait.hpp
passenger-6.0.1 src/cxx_supportlib/vendor-modified/boost/core/lightweight_test_trait.hpp
passenger-6.0.0 src/cxx_supportlib/vendor-modified/boost/core/lightweight_test_trait.hpp
passenger-5.3.7 src/cxx_supportlib/vendor-modified/boost/core/lightweight_test_trait.hpp
passenger-5.3.6 src/cxx_supportlib/vendor-modified/boost/core/lightweight_test_trait.hpp
passenger-5.3.5 src/cxx_supportlib/vendor-modified/boost/core/lightweight_test_trait.hpp
passenger-5.3.4 src/cxx_supportlib/vendor-modified/boost/core/lightweight_test_trait.hpp
passenger-5.3.3 src/cxx_supportlib/vendor-modified/boost/core/lightweight_test_trait.hpp
passenger-5.3.2 src/cxx_supportlib/vendor-modified/boost/core/lightweight_test_trait.hpp
passenger-5.3.1 src/cxx_supportlib/vendor-modified/boost/core/lightweight_test_trait.hpp
passenger-5.3.0 src/cxx_supportlib/vendor-modified/boost/core/lightweight_test_trait.hpp
passenger-5.2.3 src/cxx_supportlib/vendor-modified/boost/core/lightweight_test_trait.hpp
passenger-5.2.2 src/cxx_supportlib/vendor-modified/boost/core/lightweight_test_trait.hpp
passenger-5.2.1 src/cxx_supportlib/vendor-modified/boost/core/lightweight_test_trait.hpp
passenger-5.2.0 src/cxx_supportlib/vendor-modified/boost/core/lightweight_test_trait.hpp
passenger-5.1.12 src/cxx_supportlib/vendor-modified/boost/core/lightweight_test_trait.hpp
passenger-5.1.11 src/cxx_supportlib/vendor-modified/boost/core/lightweight_test_trait.hpp
passenger-5.1.10 src/cxx_supportlib/vendor-modified/boost/core/lightweight_test_trait.hpp
passenger-5.1.9 src/cxx_supportlib/vendor-modified/boost/core/lightweight_test_trait.hpp
passenger-5.1.8 src/cxx_supportlib/vendor-modified/boost/core/lightweight_test_trait.hpp