mirror of
https://github.com/boostorg/assert.git
synced 2025-08-01 21:34:29 +02:00
Update source_location_test3.cpp
This commit is contained in:
@@ -5,6 +5,21 @@
|
|||||||
#include <boost/assert/source_location.hpp>
|
#include <boost/assert/source_location.hpp>
|
||||||
#include <boost/core/lightweight_test.hpp>
|
#include <boost/core/lightweight_test.hpp>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
#include <cstring>
|
||||||
|
|
||||||
|
static char const* adjust_filename( char const* file )
|
||||||
|
{
|
||||||
|
#if defined(__INTEL_LLVM_COMPILER) && __INTEL_LLVM_COMPILER >= 20210300
|
||||||
|
|
||||||
|
char const* fn = std::strrchr( file, '/' );
|
||||||
|
return fn? fn + 1: file;
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
return file;
|
||||||
|
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
@@ -61,7 +76,7 @@ int main()
|
|||||||
{
|
{
|
||||||
boost::source_location loc = BOOST_CURRENT_LOCATION;
|
boost::source_location loc = BOOST_CURRENT_LOCATION;
|
||||||
|
|
||||||
std::string prefix = std::string( __FILE__ ) + ":62";
|
std::string prefix = std::string( adjust_filename(__FILE__) ) + ":77";
|
||||||
BOOST_TEST_EQ( loc.to_string().substr( 0, prefix.size() ), prefix );
|
BOOST_TEST_EQ( loc.to_string().substr( 0, prefix.size() ), prefix );
|
||||||
|
|
||||||
std::ostringstream os;
|
std::ostringstream os;
|
||||||
|
Reference in New Issue
Block a user