diff --git a/test/throw_exception_test4.cpp b/test/throw_exception_test4.cpp index 5f88d96..69be7d2 100644 --- a/test/throw_exception_test4.cpp +++ b/test/throw_exception_test4.cpp @@ -28,6 +28,20 @@ char const* translate_function( char const * fn, char const * cfn ) return fn[0] == 0 || std::strcmp( fn, "main" ) == 0? cfn: fn; } +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() { try @@ -40,14 +54,14 @@ int main() char const * const * file = boost::get_error_info( x ); BOOST_TEST( file != 0 ); - BOOST_TEST_CSTR_EQ( *file, __FILE__ ); + BOOST_TEST_CSTR_EQ( *file, adjust_filename(__FILE__) ); } { int const * line = boost::get_error_info( x ); BOOST_TEST( line != 0 ); - BOOST_TEST_EQ( *line, 35 ); + BOOST_TEST_EQ( *line, 49 ); } { @@ -68,14 +82,14 @@ int main() char const * const * file = boost::get_error_info( x ); BOOST_TEST( file != 0 ); - BOOST_TEST_CSTR_EQ( *file, __FILE__ ); + BOOST_TEST_CSTR_EQ( *file, adjust_filename(__FILE__) ); } { int const * line = boost::get_error_info( x ); BOOST_TEST( line != 0 ); - BOOST_TEST_EQ( *line, 63 ); + BOOST_TEST_EQ( *line, 77 ); } { @@ -96,14 +110,14 @@ int main() char const * const * file = boost::get_error_info( x ); BOOST_TEST( file != 0 ); - BOOST_TEST_CSTR_EQ( *file, __FILE__ ); + BOOST_TEST_CSTR_EQ( *file, adjust_filename(__FILE__) ); } { int const * line = boost::get_error_info( x ); BOOST_TEST( line != 0 ); - BOOST_TEST_EQ( *line, 91 ); + BOOST_TEST_EQ( *line, 105 ); } {