Skip to content

Commit 96dce82

Browse files
authored
Skip name-based assertions for inlined functions in Release builds (#7727)
1 parent d4831b2 commit 96dce82

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/tasks/test/basic_tasks.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,9 @@ TEST_CASE("Exception handling" * doctest::test_suite("basic_tasks"))
392392
// Verify that stack traces contain demangled function names from the
393393
// known call chains. These functions have external linkage and are
394394
// exported to the dynamic symbol table via -rdynamic in Debug builds.
395+
// In Release builds, -rdynamic is not set and functions may be inlined,
396+
// so we skip name-based assertions there.
397+
#ifndef NDEBUG
395398
// Note: very small leaf functions (e.g. level_3_throws_int, which is
396399
// just `throw 42;`) may be inlined by the compiler, so we only assert
397400
// on the caller frames that reliably appear.
@@ -404,6 +407,7 @@ TEST_CASE("Exception handling" * doctest::test_suite("basic_tasks"))
404407
// ThrowsUnknown call chain
405408
REQUIRE(logger_ptr->contains("level_2_calls_level_3_int"));
406409
REQUIRE(logger_ptr->contains("level_1_calls_level_2_int"));
410+
#endif
407411

408412
// Clean up: remove the capturing logger
409413
auto& loggers = ccf::logger::config::loggers();

0 commit comments

Comments
 (0)