Merge pull request #25 from mat007/use-identity-type

Use identity type
This commit is contained in:
Mathieu Champlon 2016-07-18 08:36:50 +02:00 committed by GitHub
commit 34661258b7
5 changed files with 9 additions and 8 deletions

View file

@ -121,6 +121,6 @@
</tar>
</target>
<target name="boost" depends="boost.convert,boost.build,boost.package" description="convert to boost with documentation and tests"/>
<target name="boost" depends="boost.convert,boost.build,boost.package" description="convert and package to boost with documentation and tests"/>
</project>

View file

@ -7,8 +7,8 @@
[section Changelog]
[section unreleased]
Not yet released
[section 1.3.0]
Released 17 July 2016
* Fixed MOCK_FUNCTOR compilation with VS2015
* Removed round parenthesis in signature support for compilers without variadic macros

View file

@ -234,7 +234,7 @@ namespace member_function_example_8
//[ member_function_example_8
MOCK_CLASS( mock_class )
{
MOCK_METHOD( method, 0, (std::map< int, int >()) ) // the signature must be surrounded with round parenthesis if the return type contains a comma
MOCK_METHOD( method, 0, BOOST_IDENTITY_TYPE((std::map< int, int >())) ) // the signature must be wrapped in [@http://www.boost.org/libs/utility/identity_type/doc/html/index.html BOOST_IDENTITY_TYPE] if the return type contains a comma
};
//]
}

View file

@ -390,9 +390,9 @@ Constraints :
[[mock::less_equal( ['expected] )] [['actual] <= ['expected]] [compares ['actual] to ['expected] using operator <=]]
[[mock::greater_equal( ['expected] )] [['actual] >= ['expected]] [compares ['actual] to ['expected] using operator >=]]
[[mock::near( ['expected], ['tolerance] )] [std::abs( ['actual] - ['expected] ) < ['tolerance]] [checks whether ['actual] is near ['expected] within ['tolerance]]]
[[mock::close( ['expected], ['tolerance] )] [boost::test_tools::check_is_close( ['actual], ['expected], boost::test_tools::percent_tolerance( ['arg] ) )] [checks whether ['actual] is close to ['expected], see [@http://www.boost.org/libs/test/doc/html/utf/testing-tools/floating_point_comparison.html Floating-point comparison algorithms] ]]
[[mock::close_fraction( ['expected], ['tolerance] )] [boost::test_tools::check_is_close( ['actual], ['expected], boost::test_tools::fraction_tolerance( ['arg] ) )] [checks whether ['actual] is close to ['expected], see [@http://www.boost.org/libs/test/doc/html/utf/testing-tools/floating_point_comparison.html Floating-point comparison algorithms] ]]
[[mock::small( ['tolerance] )] [boost::test_tools::check_is_small( ['actual], ['expected] ) )] [checks whether ['actual] is small within ['tolerance], see [@http://www.boost.org/libs/test/doc/html/utf/testing-tools/floating_point_comparison.html Floating-point comparison algorithms] ]]
[[mock::close( ['expected], ['tolerance] )] [boost::test_tools::check_is_close( ['actual], ['expected], boost::test_tools::percent_tolerance( ['arg] ) )] [checks whether ['actual] is close to ['expected], see [@http://www.boost.org/libs/test/doc/html/boost_test/testing_tools/extended_comparison/floating_point.html Floating-point comparison algorithms] ]]
[[mock::close_fraction( ['expected], ['tolerance] )] [boost::test_tools::check_is_close( ['actual], ['expected], boost::test_tools::fraction_tolerance( ['arg] ) )] [checks whether ['actual] is close to ['expected], see [@http://www.boost.org/libs/test/doc/html/boost_test/testing_tools/extended_comparison/floating_point.html Floating-point comparison algorithms] ]]
[[mock::small( ['tolerance] )] [boost::test_tools::check_is_small( ['actual], ['expected] ) )] [checks whether ['actual] is small within ['tolerance], see [@http://www.boost.org/libs/test/doc/html/boost_test/testing_tools/extended_comparison/floating_point.html Floating-point comparison algorithms] ]]
[[mock::call( ['expected] )] [['expected]( ['actual] )] [calls ['expected] as a functor returning a ['bool] and accepting ['actual] as parameter]]
[[mock::same( ['expected] )] [&['actual] == &['expected]] [compares ['actual] to ['expected] by comparing their pointers]]
[[mock::assign( ['expected] )] [['actual] = ['expected], true

View file

@ -69,7 +69,8 @@ namespace detail
# define MOCK_SMALL() \
detail::is_small( actual, tolerance )
# define MOCK_PERCENT_TOLERANCE() \
detail::is_close( actual, expected, boost::math::fpc::percent_tolerance( tolerance ) )
detail::is_close( actual, expected, \
boost::math::fpc::percent_tolerance( tolerance ) )
# define MOCK_FRACTION_TOLERANCE() \
detail::is_close( actual, expected, tolerance )