mirror of
https://github.com/mat007/turtle.git
synced 2026-06-22 12:13:43 +00:00
Added floating point comparison constraints
git-svn-id: https://svn.code.sf.net/p/turtle/code/trunk@659 860be788-9bd5-4423-9f1e-828f051e677b
This commit is contained in:
parent
c8072405c8
commit
8a6edd531e
4 changed files with 56 additions and 11 deletions
|
|
@ -8,6 +8,7 @@ Not yet released
|
|||
* Officially documented MOCK_UNARY_CONSTRAINT and MOCK_BINARY_CONSTRAINT
|
||||
* Added support for several sequences in 'in'
|
||||
* Added support for nullptr as constraint
|
||||
* Added mock::close, mock::close_fraction, mock::small and mock::near constraints
|
||||
|
||||
[endsect]
|
||||
|
||||
|
|
|
|||
|
|
@ -323,6 +323,10 @@ Constraints :
|
|||
[[mock::greater( ['expected] )] [['actual] > ['expected]] [compares ['actual] to ['expected] using operator >]]
|
||||
[[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] [std::abs( ['actual] - ['expected] ) < ['arg]] [checks whether ['actual] is near ['expected]]]
|
||||
[[mock::close] [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] [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] [boost::test_tools::check_is_small( ['actual], ['expected] ) )] [checks whether ['actual] is small with a tolerance of ['expected], see [@http://www.boost.org/libs/test/doc/html/utf/testing-tools/floating_point_comparison.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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue