Reverted previous commit

git-svn-id: https://svn.code.sf.net/p/turtle/code/trunk@440 860be788-9bd5-4423-9f1e-828f051e677b
This commit is contained in:
mat007 2012-04-12 16:21:02 +00:00
parent 7b0cde6b53
commit 0fa887deeb
2 changed files with 1 additions and 27 deletions

View file

@ -20,12 +20,6 @@
namespace mock namespace mock
{ {
template< typename Actual, typename Expected >
bool compare( const Actual& actual, const Expected& expected )
{
return actual == expected;
}
namespace detail namespace detail
{ {
template< typename Actual > template< typename Actual >
@ -55,7 +49,7 @@ namespace detail
private: private:
virtual bool operator()( Actual actual ) virtual bool operator()( Actual actual )
{ {
return mock::compare( actual, boost::unwrap_ref( expected_ ) ); return actual == boost::unwrap_ref( expected_ );
} }
virtual void serialize( std::ostream& s ) const virtual void serialize( std::ostream& s ) const
{ {

View file

@ -535,23 +535,3 @@ BOOST_AUTO_TEST_CASE( a_static_method_in_a_template_class_can_be_mocked )
BOOST_CHECK( MOCK_VERIFY( some_template_class< int >::some_static_method ) ); BOOST_CHECK( MOCK_VERIFY( some_template_class< int >::some_static_method ) );
MOCK_RESET( some_template_class< int >::some_static_method ); MOCK_RESET( some_template_class< int >::some_static_method );
} }
namespace
{
struct non_comparable_type
{};
}
namespace mock
{
bool compare( non_comparable_type, non_comparable_type )
{
return true;
}
}
BOOST_AUTO_TEST_CASE( compare_function_can_be_used_to_customize_validation )
{
MOCK_FUNCTOR( f, void( non_comparable_type ) );
MOCK_EXPECT( f ).with( non_comparable_type() );
}