File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed
Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -61,13 +61,10 @@ TEST_CASE("custom_error_logger")
6161 REQUIRE (fileNameSv.find (" custom_error.cpp" ) != std::string::npos);
6262 const auto functionNameSv = std::string_view (s_loggerArgs.functionName );
6363 REQUIRE (!functionNameSv.empty ());
64- #if defined(__GNUC__) && !defined(__clang__)
65- REQUIRE (functionNameSv == " void {anonymous}::FailOnLine15()" );
66- #elif defined(__GNUC__) && defined(__clang__)
67- REQUIRE (functionNameSv == " void (anonymous namespace)::FailOnLine15()" );
68- #else
69- REQUIRE (functionNameSv == " FailOnLine15" );
70- #endif
64+ // Every compiler has a slightly different naming approach for this function, and even the same
65+ // compiler can change its mind over time. Instead of matching the entire function name just
66+ // match against the part we care about.
67+ REQUIRE ((functionNameSv.find (" FailOnLine15" ) != std::string_view::npos));
7168
7269 REQUIRE (s_loggerArgs.returnAddress );
7370 REQUIRE (s_loggerArgs.result == static_cast <int32_t >(0x80000018 )); // E_ILLEGAL_DELEGATE_ASSIGNMENT)
You can’t perform that action at this time.
0 commit comments