diff options
| author | Martin Hořeňovský | 2020-04-21 19:27:12 +0200 |
|---|---|---|
| committer | Martin Hořeňovský | 2020-04-21 19:27:12 +0200 |
| commit | 5c9f09e94a32ab47f16bf8353a708e226fccf645 (patch) | |
| tree | 60d07e07d0e2b0842275121fd7ac521b22830068 /projects/SelfTest/UsageTests/Compilation.tests.cpp | |
| parent | f4fc2dab2c5bb8cab11b0a0dde8a8421076c30f9 (diff) | |
| download | catch3-5c9f09e94a32ab47f16bf8353a708e226fccf645.tar.gz | |
Add support for bitwise xor to the decomposer
Diffstat (limited to 'projects/SelfTest/UsageTests/Compilation.tests.cpp')
| -rw-r--r-- | projects/SelfTest/UsageTests/Compilation.tests.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/projects/SelfTest/UsageTests/Compilation.tests.cpp b/projects/SelfTest/UsageTests/Compilation.tests.cpp index 7ec17448..850d5f9b 100644 --- a/projects/SelfTest/UsageTests/Compilation.tests.cpp +++ b/projects/SelfTest/UsageTests/Compilation.tests.cpp @@ -244,6 +244,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; } @@ -260,5 +263,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); } |