diff options
| author | Martin Hořeňovský | 2020-04-21 19:27:12 +0200 |
|---|---|---|
| committer | Martin Hořeňovský | 2020-05-03 07:52:47 +0200 |
| commit | 5b8cccaf6a9f16267ac61449a65b2df77d82d886 (patch) | |
| tree | cced5d90376edda2b85fbb9119cb08ca725d82ca /tests/SelfTest/UsageTests/Compilation.tests.cpp | |
| parent | 4aefbbcd028a23ec4c111e990cbdb32a88e8bea5 (diff) | |
| download | catch3-5b8cccaf6a9f16267ac61449a65b2df77d82d886.tar.gz | |
Add support for bitwise xor to the decomposer
Diffstat (limited to 'tests/SelfTest/UsageTests/Compilation.tests.cpp')
| -rw-r--r-- | tests/SelfTest/UsageTests/Compilation.tests.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/SelfTest/UsageTests/Compilation.tests.cpp b/tests/SelfTest/UsageTests/Compilation.tests.cpp index 4fc63fa0..9e4211ff 100644 --- a/tests/SelfTest/UsageTests/Compilation.tests.cpp +++ b/tests/SelfTest/UsageTests/Compilation.tests.cpp @@ -247,6 +247,9 @@ namespace { friend HasBitOperators operator& (HasBitOperators lhs, HasBitOperators rhs) { return { lhs.value & rhs.value }; } + friend HasBitOperators operator^ (HasBitOperators lhs, HasBitOperators rhs) { + return { lhs.value ^ rhs.value }; + } explicit operator bool() const { return !!value; } @@ -263,5 +266,7 @@ TEST_CASE("Assertion macros support bit operators and bool conversions", "[compi REQUIRE(lhs | rhs); REQUIRE_FALSE(lhs & rhs); REQUIRE(HasBitOperators{ 1 } & HasBitOperators{ 1 }); + REQUIRE(lhs ^ rhs); + REQUIRE_FALSE(lhs ^ lhs); } |