Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/src/catch2/internal/catch_context.cpp
diff options
context:
space:
mode:
authorMartin Hořeňovský2025-07-19 00:18:45 +0200
committerMartin Hořeňovský2025-07-20 18:34:21 +0200
commit55b14e1b3482e1233f0fbf41dee8dceebee8db1e (patch)
tree049e971c06125f07b7babe837f792c98a0d58076 /src/catch2/internal/catch_context.cpp
parentce128f584c293b17362d838a8dc65bc81ffc8dff (diff)
downloadcatch3-55b14e1b3482e1233f0fbf41dee8dceebee8db1e.tar.gz
Update last seen line info in the assertionEnded fast path
This costs us about 1% perf in Debug build and 3% in Release build, but it is worth it for more precise information during unexpected exceptions or fatal errors. Given a simple test case like this ```cpp TEST_CASE("Hard fail") { REQUIRE( 1 == 1 ); REQUIRE( 2 == 2 ); throw 1; REQUIRE( 3 == 3 ); } ``` Catch2 before this change would report the line info from the `TEST_CASE` macro as the last seen expression before error. With this change, it will correctly report the line info from the `REQUIRE(2 == 2)` assertion as the last seen expression before error.
Diffstat (limited to 'src/catch2/internal/catch_context.cpp')
0 files changed, 0 insertions, 0 deletions