mirror of
https://github.com/mat007/turtle.git
synced 2026-06-22 12:13:43 +00:00
Removed duplicate test
git-svn-id: https://svn.code.sf.net/p/turtle/code/trunk@657 860be788-9bd5-4423-9f1e-828f051e677b
This commit is contained in:
parent
0592148204
commit
8919e56678
1 changed files with 0 additions and 45 deletions
|
|
@ -395,51 +395,6 @@ BOOST_AUTO_TEST_CASE( constraints_and_arguments_are_serialized_lazily )
|
||||||
BOOST_CHECK( ! serialized );
|
BOOST_CHECK( ! serialized );
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace
|
|
||||||
{
|
|
||||||
template< typename Expected >
|
|
||||||
struct near_constraint
|
|
||||||
{
|
|
||||||
near_constraint( Expected expected, Expected threshold )
|
|
||||||
: expected_( expected )
|
|
||||||
, threshold_( threshold )
|
|
||||||
{}
|
|
||||||
|
|
||||||
template< typename Actual >
|
|
||||||
bool operator()( Actual actual ) const
|
|
||||||
{
|
|
||||||
return std::abs( actual - boost::unwrap_ref( expected_ ) )
|
|
||||||
< boost::unwrap_ref( threshold_ );
|
|
||||||
}
|
|
||||||
|
|
||||||
friend std::ostream& operator<<( std::ostream& s, const near_constraint& c )
|
|
||||||
{
|
|
||||||
return s << "near( " << mock::format( c.expected_ )
|
|
||||||
<< ", " << mock::format( c.threshold_ ) << " )";
|
|
||||||
}
|
|
||||||
|
|
||||||
Expected expected_;
|
|
||||||
Expected threshold_;
|
|
||||||
};
|
|
||||||
template< typename Expected >
|
|
||||||
mock::constraint< near_constraint< Expected > > near( Expected expected, Expected threshold )
|
|
||||||
{
|
|
||||||
return near_constraint< Expected >( expected, threshold );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
BOOST_AUTO_TEST_CASE( using_custom_constraint )
|
|
||||||
{
|
|
||||||
MOCK_FUNCTOR( f, void( float ) );
|
|
||||||
MOCK_EXPECT( f ).with( near( 3.f, 0.01f ) );
|
|
||||||
f( 3.f );
|
|
||||||
const std::string expected = "f\n"
|
|
||||||
". unlimited().with( near( 3, 0.01 ) )";
|
|
||||||
std::stringstream s;
|
|
||||||
s << f;
|
|
||||||
BOOST_CHECK_EQUAL( expected, s.str() );
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
struct custom_constraint_with_non_const_operator
|
struct custom_constraint_with_non_const_operator
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue