forked from boostorg/assert
Add source_location::to_string
This commit is contained in:
@@ -8,6 +8,11 @@
|
||||
|
||||
int main()
|
||||
{
|
||||
{
|
||||
boost::source_location loc;
|
||||
BOOST_TEST_EQ( loc.to_string(), std::string( "(unknown source location)" ) );
|
||||
}
|
||||
|
||||
{
|
||||
boost::source_location loc;
|
||||
|
||||
@@ -17,13 +22,18 @@ int main()
|
||||
BOOST_TEST_EQ( os.str(), std::string( "(unknown source location)" ) );
|
||||
}
|
||||
|
||||
{
|
||||
boost::source_location loc = BOOST_CURRENT_LOCATION;
|
||||
BOOST_TEST_EQ( loc.to_string(), std::string( __FILE__ ) + ":26 in function '" + BOOST_CURRENT_FUNCTION + "'" );
|
||||
}
|
||||
|
||||
{
|
||||
boost::source_location loc = BOOST_CURRENT_LOCATION;
|
||||
|
||||
std::ostringstream os;
|
||||
os << loc;
|
||||
|
||||
BOOST_TEST_EQ( os.str(), std::string( __FILE__ ) + ":21: in function '" + BOOST_CURRENT_FUNCTION + "'" );
|
||||
BOOST_TEST_EQ( os.str(), std::string( __FILE__ ) + ":31 in function '" + BOOST_CURRENT_FUNCTION + "'" );
|
||||
}
|
||||
|
||||
return boost::report_errors();
|
||||
|
||||
Reference in New Issue
Block a user