Add wide stream tests. Refs #115.

This commit is contained in:
Peter Dimov
2025-01-13 16:12:31 +02:00
parent 576d31f206
commit 785a17aaaf
3 changed files with 30 additions and 0 deletions

View File

@@ -54,6 +54,13 @@ template<class T> std::string to_string( T const& t )
return os.str();
}
template<class T> std::wstring to_wstring( T const& t )
{
std::wostringstream os;
os << t;
return os.str();
}
int main()
{
boost::intrusive_ptr<X> p1, p2( new X );
@@ -61,5 +68,8 @@ int main()
BOOST_TEST_EQ( to_string( p1 ), to_string( p1.get() ) );
BOOST_TEST_EQ( to_string( p2 ), to_string( p2.get() ) );
BOOST_TEST( to_wstring( p1 ) == to_wstring( p1.get() ) );
BOOST_TEST( to_wstring( p2 ) == to_wstring( p2.get() ) );
return boost::report_errors();
}

View File

@@ -13,6 +13,13 @@ template<class T> std::string to_string( T const& t )
return os.str();
}
template<class T> std::wstring to_wstring( T const& t )
{
std::wostringstream os;
os << t;
return os.str();
}
int main()
{
boost::local_shared_ptr<int> p1, p2( new int );
@@ -20,5 +27,8 @@ int main()
BOOST_TEST_EQ( to_string( p1 ), to_string( p1.get() ) );
BOOST_TEST_EQ( to_string( p2 ), to_string( p2.get() ) );
BOOST_TEST( to_wstring( p1 ) == to_wstring( p1.get() ) );
BOOST_TEST( to_wstring( p2 ) == to_wstring( p2.get() ) );
return boost::report_errors();
}

View File

@@ -13,6 +13,13 @@ template<class T> std::string to_string( T const& t )
return os.str();
}
template<class T> std::wstring to_wstring( T const& t )
{
std::wostringstream os;
os << t;
return os.str();
}
int main()
{
boost::shared_ptr<int> p1, p2( new int );
@@ -20,5 +27,8 @@ int main()
BOOST_TEST_EQ( to_string( p1 ), to_string( p1.get() ) );
BOOST_TEST_EQ( to_string( p2 ), to_string( p2.get() ) );
BOOST_TEST( to_wstring( p1 ) == to_wstring( p1.get() ) );
BOOST_TEST( to_wstring( p2 ) == to_wstring( p2.get() ) );
return boost::report_errors();
}