<feed xmlns='http://www.w3.org/2005/Atom'>
<title>catch3/tests/SelfTest, branch v3.10.0</title>
<subtitle>Progmasoft Catch3: an independently maintained C++17 test framework with a parallel runner, property checks, snapshots and structured results.</subtitle>
<link rel='alternate' type='text/html' href='https://git.progmasoft.com/catch3/'/>
<entry>
<title>Forbid deducing reference types for m_predicate in FilterGenerator (#3005)</title>
<updated>2025-08-23T19:55:38+00:00</updated>
<author>
<name>Szapi</name>
</author>
<published>2025-08-23T19:55:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.progmasoft.com/catch3/commit/?id=85c4bad86b0bd29b6d2f5aa270401c0a642d53b1'/>
<id>85c4bad86b0bd29b6d2f5aa270401c0a642d53b1</id>
<content type='text'>
Forbid deducing reference types for m_predicate in FilterGenerator to prevent dangling references.
This is needed for out-of-line predicates to work correctly instead of undefined behavior or crashes.

---------

Co-authored-by: Tek Mate &lt;mate.tek@evosoft.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Forbid deducing reference types for m_predicate in FilterGenerator to prevent dangling references.
This is needed for out-of-line predicates to work correctly instead of undefined behavior or crashes.

---------

Co-authored-by: Tek Mate &lt;mate.tek@evosoft.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>Improve performance of writing XML</title>
<updated>2025-08-22T15:03:35+00:00</updated>
<author>
<name>Martin Hořeňovský</name>
</author>
<published>2025-08-22T15:03:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.progmasoft.com/catch3/commit/?id=f4e05a67bb5a57ee6e051fc8c391b32cbf927f7d'/>
<id>f4e05a67bb5a57ee6e051fc8c391b32cbf927f7d</id>
<content type='text'>
As with the JSON writer, the old code was made to be simple and
for each char just decided whether it needs escaping, or should be
written as-is. The new code instead looks for characters that need
escaping and batches writes of characters that do not.

This provides 4-8x speedup (length dependent) for writing strings
that do not need escaping, and keeps roughly the same performance
for those that do need escaping.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
As with the JSON writer, the old code was made to be simple and
for each char just decided whether it needs escaping, or should be
written as-is. The new code instead looks for characters that need
escaping and batches writes of characters that do not.

This provides 4-8x speedup (length dependent) for writing strings
that do not need escaping, and keeps roughly the same performance
for those that do need escaping.
</pre>
</div>
</content>
</entry>
<entry>
<title>Improve performance of writing JSON values</title>
<updated>2025-08-22T15:00:40+00:00</updated>
<author>
<name>Martin Hořeňovský</name>
</author>
<published>2025-08-21T21:36:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.progmasoft.com/catch3/commit/?id=fb2e4fbe413824a5cad4101c0e94cb10b7828f0d'/>
<id>fb2e4fbe413824a5cad4101c0e94cb10b7828f0d</id>
<content type='text'>
The old code was exceedingly simple, as it went char-by-char and
decided whether to write it to the output stream as-is, or escaped.
This caused a _lot_ of stream writes of individual characters.

The new code instead looks for characters that need escaping, and
bulk-writes the non-escaped characters in between them. This leads
to about the same performance for strings that comprise of only
escaped characters, and 3-10x improvement for strings without any
escaping needed.

In practice, we should expect the former rather than the latter,
but this is still nice improvement.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The old code was exceedingly simple, as it went char-by-char and
decided whether to write it to the output stream as-is, or escaped.
This caused a _lot_ of stream writes of individual characters.

The new code instead looks for characters that need escaping, and
bulk-writes the non-escaped characters in between them. This leads
to about the same performance for strings that comprise of only
escaped characters, and 3-10x improvement for strings without any
escaping needed.

In practice, we should expect the former rather than the latter,
but this is still nice improvement.
</pre>
</div>
</content>
</entry>
<entry>
<title>Add tests for comparing &amp; stringifying volatile pointers</title>
<updated>2025-08-07T22:02:33+00:00</updated>
<author>
<name>Martin Hořeňovský</name>
</author>
<published>2025-08-07T22:02:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.progmasoft.com/catch3/commit/?id=03c62cdf2ede08ee759008637adf5d8e5581b77b'/>
<id>03c62cdf2ede08ee759008637adf5d8e5581b77b</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Cleanup WIP changes from last commit</title>
<updated>2025-08-02T08:21:41+00:00</updated>
<author>
<name>Martin Hořeňovský</name>
</author>
<published>2025-08-02T08:21:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.progmasoft.com/catch3/commit/?id=9b3f508a1b1579f5366cf83d19822cb395f23528'/>
<id>9b3f508a1b1579f5366cf83d19822cb395f23528</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Catch exceptions from StringMakers inside Detail::stringify</title>
<updated>2025-08-02T08:11:52+00:00</updated>
<author>
<name>Martin Hořeňovský</name>
</author>
<published>2025-08-01T21:23:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.progmasoft.com/catch3/commit/?id=c5e0ef4e67639e6001dc6f24b210ee9b1f0a7c1f'/>
<id>c5e0ef4e67639e6001dc6f24b210ee9b1f0a7c1f</id>
<content type='text'>
This stops tests failing falsely if the assertion passed, but the
stringification itself failed as the assertion was sent to the reporter.

I don't think that stringification should be fallible, but the
overhead in compilation ended up being small enough (&lt;0.5% on `SelfTest`)
that it might be worth implementing, in case there is more users
with weird `StringMaker`s than just MongoDB.

Closes #2980
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This stops tests failing falsely if the assertion passed, but the
stringification itself failed as the assertion was sent to the reporter.

I don't think that stringification should be fallible, but the
overhead in compilation ended up being small enough (&lt;0.5% on `SelfTest`)
that it might be worth implementing, in case there is more users
with weird `StringMaker`s than just MongoDB.

Closes #2980
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix StringMaker for time_point&lt;system_clock&gt; with non-default duration</title>
<updated>2025-08-02T06:31:34+00:00</updated>
<author>
<name>Martin Hořeňovský</name>
</author>
<published>2025-08-01T21:00:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.progmasoft.com/catch3/commit/?id=17fe5eaa5c0c28e7a6a197420f0f16b085a8fa9a'/>
<id>17fe5eaa5c0c28e7a6a197420f0f16b085a8fa9a</id>
<content type='text'>
Fixes #2685
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes #2685
</pre>
</div>
</content>
</entry>
<entry>
<title>Add enum types to what is captured by value by default</title>
<updated>2025-07-30T18:20:38+00:00</updated>
<author>
<name>Martin Hořeňovský</name>
</author>
<published>2025-07-29T21:51:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.progmasoft.com/catch3/commit/?id=ccabd4de891e749f472121497941bb9437b83c2e'/>
<id>ccabd4de891e749f472121497941bb9437b83c2e</id>
<content type='text'>
As it turns out, enums can be used to declare bitfields, and we
cannot form a reference to a bitfield in the cpature. Thus, we add
`std::is_enum` as a criteria to the default for `capture_by_value`,
so that enum-based bitfields are also captured by value and thus
decomposable.

Closes #3001
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
As it turns out, enums can be used to declare bitfields, and we
cannot form a reference to a bitfield in the cpature. Thus, we add
`std::is_enum` as a criteria to the default for `capture_by_value`,
so that enum-based bitfields are also captured by value and thus
decomposable.

Closes #3001
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix bad error reporting for nested exceptions in default configuration</title>
<updated>2025-07-27T19:41:02+00:00</updated>
<author>
<name>Martin Hořeňovský</name>
</author>
<published>2025-07-27T18:28:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.progmasoft.com/catch3/commit/?id=d547cae549f484dda3c6a2b3cc5f71b9db40e842'/>
<id>d547cae549f484dda3c6a2b3cc5f71b9db40e842</id>
<content type='text'>
Bad handling of `TestFailureException` when translating unexpected
exceptions inside assertion macros led to the unexpected exceptions
handling erroring out through throwing the same exception again.

This was then backstopped by the machinery for handling uncaught
exceptions from assertions, which is normally used by the
`CATCH_CONFIG_FAST_COMPILE` machinery, where we assume that it can
only be invoked because the assertion macros are not configured to
catch assertions.

Closes #1292
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Bad handling of `TestFailureException` when translating unexpected
exceptions inside assertion macros led to the unexpected exceptions
handling erroring out through throwing the same exception again.

This was then backstopped by the machinery for handling uncaught
exceptions from assertions, which is normally used by the
`CATCH_CONFIG_FAST_COMPILE` machinery, where we assume that it can
only be invoked because the assertion macros are not configured to
catch assertions.

Closes #1292
</pre>
</div>
</content>
</entry>
<entry>
<title>Regularize scoped message lifetime to only consider the object's scope</title>
<updated>2025-07-21T19:50:47+00:00</updated>
<author>
<name>Martin Hořeňovský</name>
</author>
<published>2025-07-21T15:47:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.progmasoft.com/catch3/commit/?id=10aef62f21e52e5cd73bf0dc6ac8be35fbc4a798'/>
<id>10aef62f21e52e5cd73bf0dc6ac8be35fbc4a798</id>
<content type='text'>
This means that:
1) Scoped messages are always removed at the end of their scope,
   even if the scope ended due to an exception.
2) Scoped messages outlive section end, if that section's scope is
   enclosed in their own.

Previously neither of these were true, which has led to a number
of surprising behaviour, where e.g. this:
```cpp
TEST_CASE() {
    try {
        INFO( "some info" );
        throw std::runtime_error( "ex" );
    } catch (std::exception const&amp;) {}

    REQUIRE( false );
}
```
would print "some info" as the message for the assertion, while this:
```cpp
TEST_CASE() {
    INFO("Hello");
    SECTION("dummy") {}
    REQUIRE(false);
}
```
would not print out "Hello" as the message for the assertion.

This had an underlying reason, in that it was trying to helpfully
keep the messages around in case of unexpected exceptions, so that
code like this:
```cpp
TEST_CASE() {
    auto [input, expected] = GENERATE(...);
    CAPTURE(input);
    auto result = transform(input); // throws
    REQUIRE(result == expected);
}
```
would report the value of `input` when `transform` throws. However,
it was surprising in practice and was causing various issues around
handling of messages in other cases.

Closes #1759
Closes #2019
Closes #2959
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This means that:
1) Scoped messages are always removed at the end of their scope,
   even if the scope ended due to an exception.
2) Scoped messages outlive section end, if that section's scope is
   enclosed in their own.

Previously neither of these were true, which has led to a number
of surprising behaviour, where e.g. this:
```cpp
TEST_CASE() {
    try {
        INFO( "some info" );
        throw std::runtime_error( "ex" );
    } catch (std::exception const&amp;) {}

    REQUIRE( false );
}
```
would print "some info" as the message for the assertion, while this:
```cpp
TEST_CASE() {
    INFO("Hello");
    SECTION("dummy") {}
    REQUIRE(false);
}
```
would not print out "Hello" as the message for the assertion.

This had an underlying reason, in that it was trying to helpfully
keep the messages around in case of unexpected exceptions, so that
code like this:
```cpp
TEST_CASE() {
    auto [input, expected] = GENERATE(...);
    CAPTURE(input);
    auto result = transform(input); // throws
    REQUIRE(result == expected);
}
```
would report the value of `input` when `transform` throws. However,
it was surprising in practice and was causing various issues around
handling of messages in other cases.

Closes #1759
Closes #2019
Closes #2959
</pre>
</div>
</content>
</entry>
</feed>
