mirror of
https://github.com/mat007/turtle.git
synced 2026-06-22 12:13:43 +00:00
Added support for logging std::auto_ptr, boost::shared_ptr and boost::weak_ptr
git-svn-id: https://svn.code.sf.net/p/turtle/code/trunk@305 860be788-9bd5-4423-9f1e-828f051e677b
This commit is contained in:
parent
5ad7562d65
commit
d6850d9c20
3 changed files with 59 additions and 0 deletions
|
|
@ -9,6 +9,8 @@
|
|||
#define MOCK_USE_CONVERSIONS
|
||||
#include <turtle/log.hpp>
|
||||
#include <boost/assign.hpp>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <boost/weak_ptr.hpp>
|
||||
#include <boost/lexical_cast.hpp>
|
||||
#include <vector>
|
||||
#include <deque>
|
||||
|
|
@ -359,6 +361,24 @@ BOOST_AUTO_TEST_CASE( std_pairs_are_serialized_with_conversions )
|
|||
BOOST_CHECK_EQUAL( "(3,42)", to_string( std::make_pair( 3, 42.f ) ) );
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE( std_auto_ptr_are_serialized_with_conversions )
|
||||
{
|
||||
BOOST_CHECK_NE( "?", to_string( std::auto_ptr< int >() ) );
|
||||
BOOST_CHECK_NE( "?", to_string( std::auto_ptr< int >( new int( 42 ) ) ) );
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE( boost_shared_ptr_are_serialized_with_conversions )
|
||||
{
|
||||
BOOST_CHECK_NE( "?", to_string( boost::shared_ptr< int >() ) );
|
||||
BOOST_CHECK_NE( "?", to_string( boost::shared_ptr< int >( new int( 42 ) ) ) );
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE( boost_weak_ptr_are_serialized_with_conversions )
|
||||
{
|
||||
BOOST_CHECK_NE( "?", to_string( boost::weak_ptr< int >( boost::shared_ptr< int >() ) ) );
|
||||
BOOST_CHECK_NE( "?", to_string( boost::weak_ptr< int >( boost::shared_ptr< int >( new int( 42 ) ) ) ) );
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE( std_deques_are_serialized_with_conversions )
|
||||
{
|
||||
std::deque< int > d;
|
||||
|
|
|
|||
|
|
@ -8,6 +8,8 @@
|
|||
|
||||
#include <turtle/log.hpp>
|
||||
#include <boost/assign.hpp>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <boost/weak_ptr.hpp>
|
||||
#include <boost/lexical_cast.hpp>
|
||||
#include <vector>
|
||||
#include <deque>
|
||||
|
|
@ -355,6 +357,24 @@ BOOST_AUTO_TEST_CASE( std_pairs_are_serialized_without_conversions )
|
|||
BOOST_CHECK_EQUAL( "(3,42)", to_string( std::make_pair( 3, 42.f ) ) );
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE( std_auto_ptr_are_serialized_without_conversions )
|
||||
{
|
||||
BOOST_CHECK_NE( "?", to_string( std::auto_ptr< int >() ) );
|
||||
BOOST_CHECK_NE( "?", to_string( std::auto_ptr< int >( new int( 42 ) ) ) );
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE( boost_shared_ptr_are_serialized_without_conversions )
|
||||
{
|
||||
BOOST_CHECK_NE( "?", to_string( boost::shared_ptr< int >() ) );
|
||||
BOOST_CHECK_NE( "?", to_string( boost::shared_ptr< int >( new int( 42 ) ) ) );
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE( boost_weak_ptr_are_serialized_without_conversions )
|
||||
{
|
||||
BOOST_CHECK_NE( "?", to_string( boost::weak_ptr< int >( boost::shared_ptr< int >() ) ) );
|
||||
BOOST_CHECK_NE( "?", to_string( boost::weak_ptr< int >( boost::shared_ptr< int >( new int( 42 ) ) ) ) );
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE( std_deques_are_serialized_without_conversions )
|
||||
{
|
||||
std::deque< int > d;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue