Added workaround for when msvc defines small and near macros

git-svn-id: https://svn.code.sf.net/p/turtle/code/trunk@688 860be788-9bd5-4423-9f1e-828f051e677b
This commit is contained in:
mat007 2013-08-14 09:55:58 +00:00
parent 028a3c3650
commit df5bb8cf3c

View file

@ -30,8 +30,16 @@ namespace mock
MOCK_NARY_CONSTRAINT( less_equal, 1, ( expected ), actual <= expected ) MOCK_NARY_CONSTRAINT( less_equal, 1, ( expected ), actual <= expected )
MOCK_NARY_CONSTRAINT( greater_equal, 1, ( expected ), actual >= expected ) MOCK_NARY_CONSTRAINT( greater_equal, 1, ( expected ), actual >= expected )
#ifdef BOOST_MSVC
# pragma push_macro( "small" )
# undef small
#endif
MOCK_NARY_CONSTRAINT( small, 1, ( expected ), \ MOCK_NARY_CONSTRAINT( small, 1, ( expected ), \
( boost::test_tools::check_is_small( actual, expected ) ) ) ( boost::test_tools::check_is_small( actual, expected ) ) )
#ifdef BOOST_MSVC
# pragma pop_macro( "small" )
#endif
MOCK_NARY_CONSTRAINT( close, 2, ( expected, tolerance ), \ MOCK_NARY_CONSTRAINT( close, 2, ( expected, tolerance ), \
( boost::test_tools::check_is_close( \ ( boost::test_tools::check_is_close( \
actual, expected, \ actual, expected, \
@ -40,8 +48,16 @@ namespace mock
( boost::test_tools::check_is_close( \ ( boost::test_tools::check_is_close( \
actual, expected, \ actual, expected, \
boost::test_tools::fraction_tolerance( tolerance ) ) ) ) boost::test_tools::fraction_tolerance( tolerance ) ) ) )
#ifdef BOOST_MSVC
# pragma push_macro( "near" )
# undef near
#endif
MOCK_NARY_CONSTRAINT( near, 2, ( expected, tolerance ), \ MOCK_NARY_CONSTRAINT( near, 2, ( expected, tolerance ), \
std::abs( actual - expected ) < tolerance ) std::abs( actual - expected ) < tolerance )
#ifdef BOOST_MSVC
# pragma pop_macro( "near" )
#endif
namespace detail namespace detail
{ {