Skip to content

Commit

Permalink
Fix failing test case
Browse files Browse the repository at this point in the history
  • Loading branch information
dmachaj committed Dec 16, 2023
1 parent fe7cd0a commit 7066b02
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/test_cpp20/custom_error.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,16 @@ TEST_CASE("custom_error_logger")
const auto fileNameSv = std::string_view(s_loggerArgs.fileName);
REQUIRE(!fileNameSv.empty());
REQUIRE(fileNameSv.find("custom_error.cpp") != std::string::npos);
#ifdef _DEBUG
const auto functionNameSv = std::string_view(s_loggerArgs.functionName);
REQUIRE(!functionNameSv.empty());
// 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));
#else
REQUIRE(s_loggerArgs.functionName == nullptr);
#endif // _DEBUG

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

0 comments on commit 7066b02

Please sign in to comment.