mirror of
https://github.com/boostorg/smart_ptr.git
synced 2025-11-03 01:01:54 +01:00
Add sp_ostream_test, ip_ostream_test, lsp_ostream_test
This commit is contained in:
24
test/sp_ostream_test.cpp
Normal file
24
test/sp_ostream_test.cpp
Normal file
@@ -0,0 +1,24 @@
|
||||
// Copyright 2025 Peter Dimov
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// https://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <sstream>
|
||||
|
||||
template<class T> std::string to_string( T const& t )
|
||||
{
|
||||
std::ostringstream os;
|
||||
os << t;
|
||||
return os.str();
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
boost::shared_ptr<int> p1, p2( new int );
|
||||
|
||||
BOOST_TEST_EQ( to_string( p1 ), to_string( p1.get() ) );
|
||||
BOOST_TEST_EQ( to_string( p2 ), to_string( p2.get() ) );
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
Reference in New Issue
Block a user