mirror of
https://github.com/catchorg/Catch2.git
synced 2025-08-03 22:05:39 +02:00
Add enum types to what is captured by value by default
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
This commit is contained in:
@@ -772,6 +772,22 @@ Generators.tests.cpp:<line number>: FAILED:
|
||||
due to unexpected exception with message:
|
||||
failure to init
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
#3001: Enum-based bitfields can be captured
|
||||
-------------------------------------------------------------------------------
|
||||
Compilation.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
Compilation.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE( bf.e == 1 )
|
||||
with expansion:
|
||||
1 == 1
|
||||
|
||||
Compilation.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE( 1 == bf.e )
|
||||
with expansion:
|
||||
1 == 1
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
#748 - captures with unexpected exceptions
|
||||
outside assertions
|
||||
@@ -952,6 +968,6 @@ Condition.tests.cpp:<line number>: FAILED:
|
||||
CHECK( true != true )
|
||||
|
||||
===============================================================================
|
||||
test cases: 33 | 27 passed | 3 failed | 3 failed as expected
|
||||
assertions: 102 | 94 passed | 4 failed | 4 failed as expected
|
||||
test cases: 34 | 28 passed | 3 failed | 3 failed as expected
|
||||
assertions: 104 | 96 passed | 4 failed | 4 failed as expected
|
||||
|
||||
|
Reference in New Issue
Block a user