You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Test case description, which contains ": " (colon + space) somewhere at the end of the description, leads to segmentation fault, when the tests fail.
TEST_CASE("Measurements are scheduled for collecting and publishing. According to requirements: OP",
"[measurement_scheduler]")
Expected behavior
No segmentation fault shall occur when the tests fail.
Reproduction steps
Provide Catch2, using CMake integration guide; using FetchContent module.
Create such file:
#include <catch2/catch_test_macros.hpp>
TEST_CASE("Measurements are scheduled for collecting and publishing. According to requirements: OP",
"[measurement_scheduler]")
{
REQUIRE(false);
}
Compile, run and see output:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
aura_host_tests is a Catch v3.0.0-preview.3 host application.
Run with -? for options
Randomness seeded to: 523709168
-------------------------------------------------------------------------------
Measurements are scheduled for collecting and publishing. According to
requirements: OP
According to requirements: OP
publishing. According to requirements: OP
collecting and publishing. According to requirements: OP
scheduled for collecting and publishing. According to requirements: OP-------------------------------------------------------------------------------
Measurements are scheduled for collecting and publishing. According to
requirements: OP
According to requirements: OP
publishing. According to requirements: OP
collecting and publishing. According to requirements: OP
scheduled for collecting and publishing. According to requirements: OP-------------------------------------------------------------------------------
Measurements are scheduled for collecting and publishing. According to
requirements: OP
According to requirements: OP
publishing. According to requirements: OP
collecting and publishing. According to requirements: OP
scheduled for collecting and publishing. According to requirements: OPterminate called after throwing an instance of 'std::out_of_range'
what(): basic_string::append: __pos (which is 18446744073709551600) > this->size() (which is 87)
-------------------------------------------------------------------------------
Measurements are scheduled for collecting and publishing. According to
requirements: OP
According to requirements: OP
publishing. According to requirements: OP
collecting and publishing. According to requirements: OP
scheduled for collecting and publishing. According to requirements: OPterminate called recursively
Aborted (core dumped)
Catch version: v3.0.0-preview3 or efd8cc8777406457a34e15313076ac3a77d4e54b.
Additional context
What works without segmentation fault error (works as expected):
TEST_CASE("Measurements are scheduled for collecting and publishing. According to requirements [OP]", ...
TEST_CASE("Measurements are scheduled for collecting and publishing. According to requirements:OP", ...
TEST_CASE("Measurements are scheduled for collecting and publishing. According to requirements:OP", ...
TEST_CASE("Measurements are scheduled for collecting and publishing. According to requ: OP", ...
TEST_CASE(": ", ...
What doesn't work:
TEST_CASE("Measurements are scheduled for collecting and publishing. According to requi: OP", ...
The text was updated successfully, but these errors were encountered:
Okay, I see the problem. Console reporter is trying to be fancy and make it so that when there is ": " in the test name, then to change how the text is line broken like this:
Check this out:
fancy linebreaking!
instead of just this
Check this out:
fancy linebreaking?
However, the test name you have is long enough that it suddenly asks for line breaks to happen past the allowed line width and then all hell breaks loose. This can be fixed easily enough by clamping the computed indentation value, but that can still lead to some pathological behaviour, e.g. like this:
Check this out:
f
a
n
c
y
l
i
.
.
.
if the break falls just on the edge of the output width.
When the tests failed Catch2 had a segmentation fault. This was related
to the TEST_CASE description.
I have created an issue in Catch2, see:
catchorg/Catch2#2309
Describe the bug
Test case description, which contains ": " (colon + space) somewhere at the end of the description, leads to segmentation fault, when the tests fail.
Expected behavior
No segmentation fault shall occur when the tests fail.
Reproduction steps
FetchContent
module.I attach the
valgrind
dump as well: error.log.Platform information:
efd8cc8777406457a34e15313076ac3a77d4e54b
.Additional context
What works without segmentation fault error (works as expected):
What doesn't work:
The text was updated successfully, but these errors were encountered: