mirror of
https://github.com/catchorg/Catch2.git
synced 2025-08-03 22:05:39 +02:00
Support bitand and bitor in REQUIRE/CHECK
This means that bit-flag-like types with conversion to bool can be asserted on, like so `REQUIRE(var & Flags::AddNewline)`.
This commit is contained in:
@@ -1943,6 +1943,27 @@ Matchers.tests.cpp:<line number>: PASSED:
|
||||
with expansion:
|
||||
"This wouldn't pass" not matches undescribed predicate
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Assertion macros support bit operators and bool conversions
|
||||
-------------------------------------------------------------------------------
|
||||
Compilation.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
Compilation.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE( lhs | rhs )
|
||||
with expansion:
|
||||
Val: 1 | Val: 2
|
||||
|
||||
Compilation.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE_FALSE( lhs & rhs )
|
||||
with expansion:
|
||||
!(Val: 1 & Val: 2)
|
||||
|
||||
Compilation.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE( HasBitOperators{ 1 } & HasBitOperators{ 1 } )
|
||||
with expansion:
|
||||
Val: 1 & Val: 1
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Assertions then sections
|
||||
-------------------------------------------------------------------------------
|
||||
@@ -14773,6 +14794,6 @@ Misc.tests.cpp:<line number>
|
||||
Misc.tests.cpp:<line number>: PASSED:
|
||||
|
||||
===============================================================================
|
||||
test cases: 334 | 244 passed | 86 failed | 4 failed as expected
|
||||
assertions: 1909 | 1740 passed | 148 failed | 21 failed as expected
|
||||
test cases: 335 | 245 passed | 86 failed | 4 failed as expected
|
||||
assertions: 1912 | 1743 passed | 148 failed | 21 failed as expected
|
||||
|
||||
|
Reference in New Issue
Block a user