mirror of
https://github.com/mat007/turtle.git
synced 2026-06-22 12:13:43 +00:00
Clean-up
git-svn-id: https://svn.code.sf.net/p/turtle/code/trunk@126 860be788-9bd5-4423-9f1e-828f051e677b
This commit is contained in:
parent
05f40c40d5
commit
7325a49c0a
2 changed files with 14 additions and 10 deletions
|
|
@ -58,7 +58,7 @@ namespace detail
|
|||
template< typename Y >
|
||||
bool operator()( const Y& y ) const
|
||||
{
|
||||
return y == t_;
|
||||
return y == t_;
|
||||
}
|
||||
private:
|
||||
T t_;
|
||||
|
|
@ -74,7 +74,7 @@ namespace detail
|
|||
template< typename Y >
|
||||
bool operator()( const Y& y ) const
|
||||
{
|
||||
return &y == t_.get_pointer();
|
||||
return &y == t_.get_pointer();
|
||||
}
|
||||
private:
|
||||
boost::reference_wrapper< T > t_;
|
||||
|
|
|
|||
|
|
@ -22,12 +22,6 @@
|
|||
namespace
|
||||
{
|
||||
struct non_serializable_type {};
|
||||
|
||||
struct serializable_type {};
|
||||
std::ostream& operator<<( std::ostream& s, const serializable_type& )
|
||||
{
|
||||
return s << "serializable_type";
|
||||
}
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE( type_not_serializable_in_standard_stream_yields_an_interrogation_mark_when_serialized )
|
||||
|
|
@ -40,6 +34,16 @@ BOOST_AUTO_TEST_CASE( base_type_serializable_in_standard_stream_yields_its_value
|
|||
BOOST_CHECK_EQUAL( "42", mock::format( 42 ) );
|
||||
}
|
||||
|
||||
namespace
|
||||
{
|
||||
struct serializable_type {};
|
||||
|
||||
std::ostream& operator<<( std::ostream& s, const serializable_type& )
|
||||
{
|
||||
return s << "serializable_type";
|
||||
}
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE( custom_type_serializable_in_standard_stream_yields_its_value_when_serialized )
|
||||
{
|
||||
BOOST_CHECK_EQUAL( "serializable_type", mock::format( serializable_type() ) );
|
||||
|
|
@ -49,13 +53,13 @@ namespace
|
|||
{
|
||||
struct convertible_to_int
|
||||
{
|
||||
operator int() const { return 0; }
|
||||
operator int() const { return 12; }
|
||||
};
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE( custom_type_convertible_to_base_type_yields_its_value_when_serialized )
|
||||
{
|
||||
BOOST_CHECK_EQUAL( "0", mock::format( convertible_to_int() ) );
|
||||
BOOST_CHECK_EQUAL( "12", mock::format( convertible_to_int() ) );
|
||||
}
|
||||
|
||||
namespace
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue