Added support for Boost.Phoenix

git-svn-id: https://svn.code.sf.net/p/turtle/code/trunk@113 860be788-9bd5-4423-9f1e-828f051e677b
This commit is contained in:
mat007 2010-02-04 07:40:26 +00:00
parent 05654f9f5f
commit 0bcfffcc03
7 changed files with 55 additions and 71 deletions

View file

@ -13,6 +13,7 @@
# pragma warning( push, 0 )
#endif
#include <boost/lambda/lambda.hpp>
#include <boost/spirit/home/phoenix.hpp>
#ifdef _MSC_VER
# pragma warning( pop )
#endif
@ -23,7 +24,7 @@
namespace
{
BOOST_STATIC_ASSERT( sizeof( mock::detail::true_type ) != sizeof( mock::detail::false_type ) );
BOOST_STATIC_ASSERT( sizeof( mock::detail::yes_type ) != sizeof( mock::detail::no_type ) );
template< typename T >
void check( T )
@ -88,6 +89,11 @@ BOOST_AUTO_TEST_CASE( boost_lambda_is_functor )
check( boost::lambda::_1 < 42 );
}
BOOST_AUTO_TEST_CASE( boost_phoenix_is_functor )
{
check( boost::phoenix::arg_names::arg1 < 42 );
}
BOOST_AUTO_TEST_CASE( boost_function_is_functor )
{
check( boost::function< void() >() );

View file

@ -221,11 +221,11 @@ BOOST_AUTO_TEST_CASE( mocking_a_destructor )
BOOST_MPL_ASSERT(( boost::is_same< float, mock::detail::arg< void( float ), 1, 1 >::type > ));
BOOST_MPL_ASSERT(( boost::is_same< float, mock::detail::arg< void( float, int ), 1, 2 >::type > ));
BOOST_MPL_ASSERT(( boost::is_same< int, mock::detail::arg< void( float, int ), 2, 2 >::type > ));
BOOST_MPL_ASSERT(( boost::is_same< mock::detail::no_type, mock::detail::arg< void( float ), 1, 2 >::type > ));
BOOST_MPL_ASSERT(( boost::is_same< mock::detail::no_type, mock::detail::arg< void( float ), 2, 2 >::type > ));
BOOST_MPL_ASSERT(( boost::is_same< mock::detail::no_type, mock::detail::arg< void( float, int ), 1, 1 >::type > ));
BOOST_MPL_ASSERT(( boost::is_same< mock::detail::no_type, mock::detail::arg< void( float, int ), 1, 3 >::type > ));
BOOST_MPL_ASSERT(( boost::is_same< mock::detail::no_type, mock::detail::arg< void( float, int ), 2, 3 >::type > ));
BOOST_MPL_ASSERT(( boost::is_same< mock::detail::invalid_type, mock::detail::arg< void( float ), 1, 2 >::type > ));
BOOST_MPL_ASSERT(( boost::is_same< mock::detail::invalid_type, mock::detail::arg< void( float ), 2, 2 >::type > ));
BOOST_MPL_ASSERT(( boost::is_same< mock::detail::invalid_type, mock::detail::arg< void( float, int ), 1, 1 >::type > ));
BOOST_MPL_ASSERT(( boost::is_same< mock::detail::invalid_type, mock::detail::arg< void( float, int ), 1, 3 >::type > ));
BOOST_MPL_ASSERT(( boost::is_same< mock::detail::invalid_type, mock::detail::arg< void( float, int ), 2, 3 >::type > ));
BOOST_AUTO_TEST_CASE( call_selects_proper_form )
{