forked from boostorg/assert
Add source_location::to_string
This commit is contained in:
1 parent
6aabfebae6
commit
b7a43990e6
2 files changed
+54
-23
No files matched your search
@@ -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