Skip to content

Commit 7066b02

Browse files
committed
Fix failing test case
1 parent fe7cd0a commit 7066b02

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

test/test_cpp20/custom_error.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,16 @@ TEST_CASE("custom_error_logger")
5454
const auto fileNameSv = std::string_view(s_loggerArgs.fileName);
5555
REQUIRE(!fileNameSv.empty());
5656
REQUIRE(fileNameSv.find("custom_error.cpp") != std::string::npos);
57+
#ifdef _DEBUG
5758
const auto functionNameSv = std::string_view(s_loggerArgs.functionName);
5859
REQUIRE(!functionNameSv.empty());
5960
// Every compiler has a slightly different naming approach for this function, and even the same
6061
// compiler can change its mind over time. Instead of matching the entire function name just
6162
// match against the part we care about.
6263
REQUIRE((functionNameSv.find("FailOnLine15") != std::string_view::npos));
64+
#else
65+
REQUIRE(s_loggerArgs.functionName == nullptr);
66+
#endif // _DEBUG
6367

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

0 commit comments

Comments
 (0)