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 | |
| parent | 4aefbbcd028a23ec4c111e990cbdb32a88e8bea5 (diff) | |
| download | catch3-5b8cccaf6a9f16267ac61449a65b2df77d82d886.tar.gz | |
Add support for bitwise xor to the decomposer
Diffstat (limited to 'tests/SelfTest')
| -rw-r--r-- | tests/SelfTest/Baselines/compact.sw.approved.txt | 2 | ||||
| -rw-r--r-- | tests/SelfTest/Baselines/console.std.approved.txt | 2 | ||||
| -rw-r--r-- | tests/SelfTest/Baselines/console.sw.approved.txt | 12 | ||||
| -rw-r--r-- | tests/SelfTest/Baselines/junit.sw.approved.txt | 2 | ||||
| -rw-r--r-- | tests/SelfTest/Baselines/tap.sw.approved.txt | 6 | ||||
| -rw-r--r-- | tests/SelfTest/Baselines/xml.sw.approved.txt | 20 | ||||
| -rw-r--r-- | tests/SelfTest/UsageTests/Compilation.tests.cpp | 5 |
7 files changed, 43 insertions, 6 deletions
diff --git a/tests/SelfTest/Baselines/compact.sw.approved.txt b/tests/SelfTest/Baselines/compact.sw.approved.txt index c965699f..d505f9b6 100644 --- a/tests/SelfTest/Baselines/compact.sw.approved.txt +++ b/tests/SelfTest/Baselines/compact.sw.approved.txt @@ -248,6 +248,8 @@ Matchers.tests.cpp:<line number>: passed: "This wouldn't pass", !Predicate<std:: Compilation.tests.cpp:<line number>: passed: lhs | rhs for: Val: 1 | Val: 2 Compilation.tests.cpp:<line number>: passed: !(lhs & rhs) for: !(Val: 1 & Val: 2) Compilation.tests.cpp:<line number>: passed: HasBitOperators{ 1 } & HasBitOperators{ 1 } for: Val: 1 & Val: 1 +Compilation.tests.cpp:<line number>: passed: lhs ^ rhs for: Val: 1 ^ Val: 2 +Compilation.tests.cpp:<line number>: passed: !(lhs ^ lhs) for: !(Val: 1 ^ Val: 1) Tricky.tests.cpp:<line number>: passed: true Tricky.tests.cpp:<line number>: passed: true Tricky.tests.cpp:<line number>: passed: true diff --git a/tests/SelfTest/Baselines/console.std.approved.txt b/tests/SelfTest/Baselines/console.std.approved.txt index 9c523a54..0fb3f0b2 100644 --- a/tests/SelfTest/Baselines/console.std.approved.txt +++ b/tests/SelfTest/Baselines/console.std.approved.txt @@ -1381,5 +1381,5 @@ due to unexpected exception with message: =============================================================================== test cases: 335 | 261 passed | 70 failed | 4 failed as expected -assertions: 1895 | 1743 passed | 131 failed | 21 failed as expected +assertions: 1897 | 1745 passed | 131 failed | 21 failed as expected diff --git a/tests/SelfTest/Baselines/console.sw.approved.txt b/tests/SelfTest/Baselines/console.sw.approved.txt index 1feae362..6818786f 100644 --- a/tests/SelfTest/Baselines/console.sw.approved.txt +++ b/tests/SelfTest/Baselines/console.sw.approved.txt @@ -1964,6 +1964,16 @@ Compilation.tests.cpp:<line number>: PASSED: with expansion: Val: 1 & Val: 1 +Compilation.tests.cpp:<line number>: PASSED: + REQUIRE( lhs ^ rhs ) +with expansion: + Val: 1 ^ Val: 2 + +Compilation.tests.cpp:<line number>: PASSED: + REQUIRE_FALSE( lhs ^ lhs ) +with expansion: + !(Val: 1 ^ Val: 1) + ------------------------------------------------------------------------------- Assertions then sections ------------------------------------------------------------------------------- @@ -14795,5 +14805,5 @@ Misc.tests.cpp:<line number>: PASSED: =============================================================================== test cases: 335 | 245 passed | 86 failed | 4 failed as expected -assertions: 1912 | 1743 passed | 148 failed | 21 failed as expected +assertions: 1914 | 1745 passed | 148 failed | 21 failed as expected diff --git a/tests/SelfTest/Baselines/junit.sw.approved.txt b/tests/SelfTest/Baselines/junit.sw.approved.txt index b2d601e9..26044c54 100644 --- a/tests/SelfTest/Baselines/junit.sw.approved.txt +++ b/tests/SelfTest/Baselines/junit.sw.approved.txt @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <testsuitesloose text artifact > - <testsuite name="<exe-name>" errors="17" failures="132" tests="1913" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}"> + <testsuite name="<exe-name>" errors="17" failures="132" tests="1915" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}"> <properties> <property name="filters" value="~[!nonportable]~[!benchmark]~[approvals] *"/> <property name="random-seed" value="1"/> diff --git a/tests/SelfTest/Baselines/tap.sw.approved.txt b/tests/SelfTest/Baselines/tap.sw.approved.txt index 9d6eedb3..f7a5aeb7 100644 --- a/tests/SelfTest/Baselines/tap.sw.approved.txt +++ b/tests/SelfTest/Baselines/tap.sw.approved.txt @@ -494,6 +494,10 @@ ok {test-number} - lhs | rhs for: Val: 1 | Val: 2 ok {test-number} - !(lhs & rhs) for: !(Val: 1 & Val: 2) # Assertion macros support bit operators and bool conversions ok {test-number} - HasBitOperators{ 1 } & HasBitOperators{ 1 } for: Val: 1 & Val: 1 +# Assertion macros support bit operators and bool conversions +ok {test-number} - lhs ^ rhs for: Val: 1 ^ Val: 2 +# Assertion macros support bit operators and bool conversions +ok {test-number} - !(lhs ^ lhs) for: !(Val: 1 ^ Val: 1) # Assertions then sections ok {test-number} - true # Assertions then sections @@ -3816,5 +3820,5 @@ ok {test-number} - q3 == 23. for: 23.0 == 23.0 ok {test-number} - # xmlentitycheck ok {test-number} - -1..1904 +1..1906 diff --git a/tests/SelfTest/Baselines/xml.sw.approved.txt b/tests/SelfTest/Baselines/xml.sw.approved.txt index eb2b2593..70de0b73 100644 --- a/tests/SelfTest/Baselines/xml.sw.approved.txt +++ b/tests/SelfTest/Baselines/xml.sw.approved.txt @@ -2208,6 +2208,22 @@ Nor would this Val: 1 & Val: 1 </Expanded> </Expression> + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > + <Original> + lhs ^ rhs + </Original> + <Expanded> + Val: 1 ^ Val: 2 + </Expanded> + </Expression> + <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/Compilation.tests.cpp" > + <Original> + !(lhs ^ lhs) + </Original> + <Expanded> + !(Val: 1 ^ Val: 1) + </Expanded> + </Expression> <OverallResult success="true"/> </TestCase> <TestCase name="Assertions then sections" tags="[Tricky]" filename="tests/<exe-name>/UsageTests/Tricky.tests.cpp" > @@ -17759,7 +17775,7 @@ loose text artifact </Section> <OverallResult success="true"/> </TestCase> - <OverallResults successes="1743" failures="149" expectedFailures="21"/> + <OverallResults successes="1745" failures="149" expectedFailures="21"/> </Group> - <OverallResults successes="1743" failures="148" expectedFailures="21"/> + <OverallResults successes="1745" failures="148" expectedFailures="21"/> </Catch> 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); } |