Skip to content

Commit

Permalink
Fix source location test failure resulting from newer compiler (#1326)
Browse files Browse the repository at this point in the history
  • Loading branch information
dmachaj authored Jun 22, 2023
1 parent ec54c40 commit d3bb275
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions test/test_cpp20/custom_error.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,10 @@ TEST_CASE("custom_error_logger")
REQUIRE(fileNameSv.find("custom_error.cpp") != std::string::npos);
const auto functionNameSv = std::string_view(s_loggerArgs.functionName);
REQUIRE(!functionNameSv.empty());
#if defined(__GNUC__) && !defined(__clang__)
REQUIRE(functionNameSv == "void {anonymous}::FailOnLine15()");
#elif defined(__GNUC__) && defined(__clang__)
REQUIRE(functionNameSv == "void (anonymous namespace)::FailOnLine15()");
#else
REQUIRE(functionNameSv == "FailOnLine15");
#endif
// Every compiler has a slightly different naming approach for this function, and even the same
// compiler can change its mind over time. Instead of matching the entire function name just
// match against the part we care about.
REQUIRE((functionNameSv.find("FailOnLine15") != std::string_view::npos));

REQUIRE(s_loggerArgs.returnAddress);
REQUIRE(s_loggerArgs.result == static_cast<int32_t>(0x80000018)); // E_ILLEGAL_DELEGATE_ASSIGNMENT)
Expand Down

0 comments on commit d3bb275

Please sign in to comment.