catch3
Progmasoft Catch3: an independently maintained C++17 test framework with a parallel runner, property checks, snapshots and structured results.
Clonegit clone https://git.progmasoft.com/catch3
Refactor tests
- Commit
797c3e731883bfb80dff5e237f2559232314310c- Author
- Martin Hořeňovský ·
- Parents
6206db5a73e9
Changes
tests/SelfTest/Baselines/automake.sw.approved.txt | 6 +- .../Baselines/automake.sw.multi.approved.txt | 6 +- tests/SelfTest/Baselines/compact.sw.approved.txt | 33 +++-- .../Baselines/compact.sw.multi.approved.txt | 33 +++-- tests/SelfTest/Baselines/console.std.approved.txt | 4 +- tests/SelfTest/Baselines/console.sw.approved.txt | 155 ++++++++++---------- .../Baselines/console.sw.multi.approved.txt | 155 ++++++++++---------- tests/SelfTest/Baselines/junit.sw.approved.txt | 13 +- .../SelfTest/Baselines/junit.sw.multi.approved.txt | 13 +- tests/SelfTest/Baselines/sonarqube.sw.approved.txt | 11 +- .../Baselines/sonarqube.sw.multi.approved.txt | 11 +- tests/SelfTest/Baselines/tap.sw.approved.txt | 24 ++-- tests/SelfTest/Baselines/tap.sw.multi.approved.txt | 24 ++-- tests/SelfTest/Baselines/teamcity.sw.approved.txt | 12 +- .../Baselines/teamcity.sw.multi.approved.txt | 12 +- tests/SelfTest/Baselines/xml.sw.approved.txt | 156 +++++++++++---------- tests/SelfTest/Baselines/xml.sw.multi.approved.txt | 156 +++++++++++---------- .../TestCaseInfoHasher.tests.cpp | 77 +++++----- 18 files changed, 491 insertions(+), 410 deletions(-) diff --git a/tests/SelfTest/Baselines/automake.sw.approved.txt b/tests/SelfTest/Baselines/automake.sw.approved.txt index 9df8be0d..8da193da 100644 --- a/tests/SelfTest/Baselines/automake.sw.approved.txt +++ b/tests/SelfTest/Baselines/automake.sw.approved.txt @@ -155,6 +155,10 @@ Nor would this :test-result: PASS Generators -- simple :test-result: PASS Generators internals :test-result: PASS Greater-than inequalities with different epsilons +:test-result: PASS Hashers with different seed produce different hash with same test case +:test-result: PASS Hashers with same seed produce same hash +:test-result: PASS Hashing different test cases produces different result +:test-result: PASS Hashing test case produces same hash across multiple calls :test-result: FAIL INFO and WARN do not abort tests :test-result: FAIL INFO gets logged on failure :test-result: FAIL INFO gets logged on failure, even if captured before successful assertions @@ -255,8 +259,6 @@ Message from section two :test-result: PASS Test case with one argument :test-result: PASS Test enum bit values :test-result: PASS Test with special, characters "in name -:test-result: PASS TestCaseInfoHasher produces different hashes. -:test-result: PASS TestCaseInfoHasher produces equal hashes. :test-result: PASS Testing checked-if :test-result: XFAIL Testing checked-if 2 :test-result: XFAIL Testing checked-if 3 diff --git a/tests/SelfTest/Baselines/automake.sw.multi.approved.txt b/tests/SelfTest/Baselines/automake.sw.multi.approved.txt index 10db54cd..c95a970d 100644 --- a/tests/SelfTest/Baselines/automake.sw.multi.approved.txt +++ b/tests/SelfTest/Baselines/automake.sw.multi.approved.txt @@ -153,6 +153,10 @@ :test-result: PASS Generators -- simple :test-result: PASS Generators internals :test-result: PASS Greater-than inequalities with different epsilons +:test-result: PASS Hashers with different seed produce different hash with same test case +:test-result: PASS Hashers with same seed produce same hash +:test-result: PASS Hashing different test cases produces different result +:test-result: PASS Hashing test case produces same hash across multiple calls :test-result: FAIL INFO and WARN do not abort tests :test-result: FAIL INFO gets logged on failure :test-result: FAIL INFO gets logged on failure, even if captured before successful assertions @@ -248,8 +252,6 @@ :test-result: PASS Test case with one argument :test-result: PASS Test enum bit values :test-result: PASS Test with special, characters "in name -:test-result: PASS TestCaseInfoHasher produces different hashes. -:test-result: PASS TestCaseInfoHasher produces equal hashes. :test-result: PASS Testing checked-if :test-result: XFAIL Testing checked-if 2 :test-result: XFAIL Testing checked-if 3 diff --git a/tests/SelfTest/Baselines/compact.sw.approved.txt b/tests/SelfTest/Baselines/compact.sw.approved.txt index 8b404c58..f8c74732 100644 --- a/tests/SelfTest/Baselines/compact.sw.approved.txt +++ b/tests/SelfTest/Baselines/compact.sw.approved.txt @@ -916,6 +916,24 @@ Approx.tests.cpp:<line number>: passed: d >= Approx( 1.22 ) for: 1.23 >= Approx( Approx.tests.cpp:<line number>: passed: d >= Approx( 1.23 ) for: 1.23 >= Approx( 1.23 ) Approx.tests.cpp:<line number>: passed: !(d >= Approx( 1.24 )) for: !(1.23 >= Approx( 1.24 )) Approx.tests.cpp:<line number>: passed: d >= Approx( 1.24 ).epsilon(0.1) for: 1.23 >= Approx( 1.24 ) +TestCaseInfoHasher.tests.cpp:<line number>: passed: h1( dummy ) != h2( dummy ) for: 3422778688 (0x<hex digits>) +!= +130711275 (0x<hex digits>) +TestCaseInfoHasher.tests.cpp:<line number>: passed: h1( dummy ) == h2( dummy ) for: 3422778688 (0x<hex digits>) +== +3422778688 (0x<hex digits>) +TestCaseInfoHasher.tests.cpp:<line number>: passed: h( dummy1 ) != h( dummy2 ) for: 2903002874 (0x<hex digits>) +!= +2668622104 (0x<hex digits>) +TestCaseInfoHasher.tests.cpp:<line number>: passed: h( dummy1 ) != h( dummy2 ) for: 2673152918 (0x<hex digits>) +!= +3916075712 (0x<hex digits>) +TestCaseInfoHasher.tests.cpp:<line number>: passed: h( dummy1 ) != h( dummy2 ) for: 2074929312 (0x<hex digits>) +!= +3429949824 (0x<hex digits>) +TestCaseInfoHasher.tests.cpp:<line number>: passed: h( dummy ) == h( dummy ) for: 3422778688 (0x<hex digits>) +== +3422778688 (0x<hex digits>) Message.tests.cpp:<line number>: warning: 'this is a message' with 1 message: 'this is a warning' Message.tests.cpp:<line number>: failed: a == 1 for: 2 == 1 with 2 messages: 'this message should be logged' and 'so should this' Message.tests.cpp:<line number>: passed: a == 2 for: 2 == 2 with 1 message: 'this message may be logged later' @@ -1868,21 +1886,6 @@ Tag.tests.cpp:<line number>: passed: testCase.tags[0] == Tag( "tag1" ) for: {?} VariadicMacros.tests.cpp:<line number>: passed: with 1 message: 'no assertions' Tricky.tests.cpp:<line number>: passed: 0x<hex digits> == bit30and31 for: 3221225472 (0x<hex digits>) == 3221225472 CmdLine.tests.cpp:<line number>: passed: -TestCaseInfoHasher.tests.cpp:<line number>: passed: hasherWithCustomSeed(testCase1) != hasherWithCustomSeed(testCase2) for: 764519552 (0x<hex digits>) -!= -3472848544 (0x<hex digits>) -TestCaseInfoHasher.tests.cpp:<line number>: passed: hasherWithCustomSeed(testCase1) != hasherWithCustomSeed(testCase2) for: 869111496 (0x<hex digits>) -!= -2870097333 (0x<hex digits>) -TestCaseInfoHasher.tests.cpp:<line number>: passed: hasherWithCustomSeed(testCase1) != hasherWithCustomSeed(testCase2) for: 1172537240 (0x<hex digits>) -!= -1403724645 (0x<hex digits>) -TestCaseInfoHasher.tests.cpp:<line number>: passed: h1(testCase1) != h2(testCase2) for: 1836497244 (0x<hex digits>) -!= -430288597 (0x<hex digits>) -TestCaseInfoHasher.tests.cpp:<line number>: passed: hasherWithCustomSeed(testCase1) == hasherWithCustomSeed(testCase2) for: 764519552 (0x<hex digits>) -== -764519552 (0x<hex digits>) Misc.tests.cpp:<line number>: passed: true Misc.tests.cpp:<line number>: passed: Misc.tests.cpp:<line number>: failed - but was ok: false diff --git a/tests/SelfTest/Baselines/compact.sw.multi.approved.txt b/tests/SelfTest/Baselines/compact.sw.multi.approved.txt index 3b3e1eef..b9bfabd0 100644 --- a/tests/SelfTest/Baselines/compact.sw.multi.approved.txt +++ b/tests/SelfTest/Baselines/compact.sw.multi.approved.txt @@ -914,6 +914,24 @@ Approx.tests.cpp:<line number>: passed: d >= Approx( 1.22 ) for: 1.23 >= Approx( Approx.tests.cpp:<line number>: passed: d >= Approx( 1.23 ) for: 1.23 >= Approx( 1.23 ) Approx.tests.cpp:<line number>: passed: !(d >= Approx( 1.24 )) for: !(1.23 >= Approx( 1.24 )) Approx.tests.cpp:<line number>: passed: d >= Approx( 1.24 ).epsilon(0.1) for: 1.23 >= Approx( 1.24 ) +TestCaseInfoHasher.tests.cpp:<line number>: passed: h1( dummy ) != h2( dummy ) for: 3422778688 (0x<hex digits>) +!= +130711275 (0x<hex digits>) +TestCaseInfoHasher.tests.cpp:<line number>: passed: h1( dummy ) == h2( dummy ) for: 3422778688 (0x<hex digits>) +== +3422778688 (0x<hex digits>) +TestCaseInfoHasher.tests.cpp:<line number>: passed: h( dummy1 ) != h( dummy2 ) for: 2903002874 (0x<hex digits>) +!= +2668622104 (0x<hex digits>) +TestCaseInfoHasher.tests.cpp:<line number>: passed: h( dummy1 ) != h( dummy2 ) for: 2673152918 (0x<hex digits>) +!= +3916075712 (0x<hex digits>) +TestCaseInfoHasher.tests.cpp:<line number>: passed: h( dummy1 ) != h( dummy2 ) for: 2074929312 (0x<hex digits>) +!= +3429949824 (0x<hex digits>) +TestCaseInfoHasher.tests.cpp:<line number>: passed: h( dummy ) == h( dummy ) for: 3422778688 (0x<hex digits>) +== +3422778688 (0x<hex digits>) Message.tests.cpp:<line number>: warning: 'this is a message' with 1 message: 'this is a warning' Message.tests.cpp:<line number>: failed: a == 1 for: 2 == 1 with 2 messages: 'this message should be logged' and 'so should this' Message.tests.cpp:<line number>: passed: a == 2 for: 2 == 2 with 1 message: 'this message may be logged later' @@ -1861,21 +1879,6 @@ Tag.tests.cpp:<line number>: passed: testCase.tags[0] == Tag( "tag1" ) for: {?} VariadicMacros.tests.cpp:<line number>: passed: with 1 message: 'no assertions' Tricky.tests.cpp:<line number>: passed: 0x<hex digits> == bit30and31 for: 3221225472 (0x<hex digits>) == 3221225472 CmdLine.tests.cpp:<line number>: passed: -TestCaseInfoHasher.tests.cpp:<line number>: passed: hasherWithCustomSeed(testCase1) != hasherWithCustomSeed(testCase2) for: 764519552 (0x<hex digits>) -!= -3472848544 (0x<hex digits>) -TestCaseInfoHasher.tests.cpp:<line number>: passed: hasherWithCustomSeed(testCase1) != hasherWithCustomSeed(testCase2) for: 869111496 (0x<hex digits>) -!= -2870097333 (0x<hex digits>) -TestCaseInfoHasher.tests.cpp:<line number>: passed: hasherWithCustomSeed(testCase1) != hasherWithCustomSeed(testCase2) for: 1172537240 (0x<hex digits>) -!= -1403724645 (0x<hex digits>) -TestCaseInfoHasher.tests.cpp:<line number>: passed: h1(testCase1) != h2(testCase2) for: 1836497244 (0x<hex digits>) -!= -430288597 (0x<hex digits>) -TestCaseInfoHasher.tests.cpp:<line number>: passed: hasherWithCustomSeed(testCase1) == hasherWithCustomSeed(testCase2) for: 764519552 (0x<hex digits>) -== -764519552 (0x<hex digits>) Misc.tests.cpp:<line number>: passed: true Misc.tests.cpp:<line number>: passed: Misc.tests.cpp:<line number>: failed - but was ok: false diff --git a/tests/SelfTest/Baselines/console.std.approved.txt b/tests/SelfTest/Baselines/console.std.approved.txt index 61b1a112..a6847cdf 100644 --- a/tests/SelfTest/Baselines/console.std.approved.txt +++ b/tests/SelfTest/Baselines/console.std.approved.txt @@ -1395,6 +1395,6 @@ due to unexpected exception with message: Why would you throw a std::string? =============================================================================== -test cases: 388 | 312 passed | 69 failed | 7 failed as expected -assertions: 2224 | 2069 passed | 128 failed | 27 failed as expected +test cases: 390 | 314 passed | 69 failed | 7 failed as expected +assertions: 2225 | 2070 passed | 128 failed | 27 failed as expected diff --git a/tests/SelfTest/Baselines/console.sw.approved.txt b/tests/SelfTest/Baselines/console.sw.approved.txt index 148a3b53..d3476456 100644 --- a/tests/SelfTest/Baselines/console.sw.approved.txt +++ b/tests/SelfTest/Baselines/console.sw.approved.txt @@ -6832,6 +6832,87 @@ Approx.tests.cpp:<line number>: PASSED: with expansion: 1.23 >= Approx( 1.24 ) +------------------------------------------------------------------------------- +Hashers with different seed produce different hash with same test case +------------------------------------------------------------------------------- +TestCaseInfoHasher.tests.cpp:<line number> +............................................................................... + +TestCaseInfoHasher.tests.cpp:<line number>: PASSED: + REQUIRE( h1( dummy ) != h2( dummy ) ) +with expansion: + 3422778688 (0x<hex digits>) + != + 130711275 (0x<hex digits>) + +------------------------------------------------------------------------------- +Hashers with same seed produce same hash +------------------------------------------------------------------------------- +TestCaseInfoHasher.tests.cpp:<line number> +............................................................................... + +TestCaseInfoHasher.tests.cpp:<line number>: PASSED: + REQUIRE( h1( dummy ) == h2( dummy ) ) +with expansion: + 3422778688 (0x<hex digits>) + == + 3422778688 (0x<hex digits>) + +------------------------------------------------------------------------------- +Hashing different test cases produces different result + Different test name +------------------------------------------------------------------------------- +TestCaseInfoHasher.tests.cpp:<line number> +............................................................................... + +TestCaseInfoHasher.tests.cpp:<line number>: PASSED: + REQUIRE( h( dummy1 ) != h( dummy2 ) ) +with expansion: + 2903002874 (0x<hex digits>) + != + 2668622104 (0x<hex digits>) + +------------------------------------------------------------------------------- +Hashing different test cases produces different result + Different classname +------------------------------------------------------------------------------- +TestCaseInfoHasher.tests.cpp:<line number> +............................................................................... + +TestCaseInfoHasher.tests.cpp:<line number>: PASSED: + REQUIRE( h( dummy1 ) != h( dummy2 ) ) +with expansion: + 2673152918 (0x<hex digits>) + != + 3916075712 (0x<hex digits>) + +------------------------------------------------------------------------------- +Hashing different test cases produces different result + Different tags +------------------------------------------------------------------------------- +TestCaseInfoHasher.tests.cpp:<line number> +............................................................................... + +TestCaseInfoHasher.tests.cpp:<line number>: PASSED: + REQUIRE( h( dummy1 ) != h( dummy2 ) ) +with expansion: + 2074929312 (0x<hex digits>) + != + 3429949824 (0x<hex digits>) + +------------------------------------------------------------------------------- +Hashing test case produces same hash across multiple calls +------------------------------------------------------------------------------- +TestCaseInfoHasher.tests.cpp:<line number> +............................................................................... + +TestCaseInfoHasher.tests.cpp:<line number>: PASSED: + REQUIRE( h( dummy ) == h( dummy ) ) +with expansion: + 3422778688 (0x<hex digits>) + == + 3422778688 (0x<hex digits>) + ------------------------------------------------------------------------------- INFO and WARN do not abort tests ------------------------------------------------------------------------------- @@ -13286,76 +13367,6 @@ CmdLine.tests.cpp:<line number> CmdLine.tests.cpp:<line number>: PASSED: -------------------------------------------------------------------------------- -TestCaseInfoHasher produces different hashes. - class names are equal, names are equal but tags are different. -------------------------------------------------------------------------------- -TestCaseInfoHasher.tests.cpp:<line number> -............................................................................... - -TestCaseInfoHasher.tests.cpp:<line number>: PASSED: - CHECK( hasherWithCustomSeed(testCase1) != hasherWithCustomSeed(testCase2) ) -with expansion: - 764519552 (0x<hex digits>) - != - 3472848544 (0x<hex digits>) - -------------------------------------------------------------------------------- -TestCaseInfoHasher produces different hashes. - class names are equal, tags are equal but names are different -------------------------------------------------------------------------------- -TestCaseInfoHasher.tests.cpp:<line number> -............................................................................... - -TestCaseInfoHasher.tests.cpp:<line number>: PASSED: - CHECK( hasherWithCustomSeed(testCase1) != hasherWithCustomSeed(testCase2) ) -with expansion: - 869111496 (0x<hex digits>) - != - 2870097333 (0x<hex digits>) - -------------------------------------------------------------------------------- -TestCaseInfoHasher produces different hashes. - names are equal, tags are equal but class names are different -------------------------------------------------------------------------------- -TestCaseInfoHasher.tests.cpp:<line number> -............................................................................... - -TestCaseInfoHasher.tests.cpp:<line number>: PASSED: - CHECK( hasherWithCustomSeed(testCase1) != hasherWithCustomSeed(testCase2) ) -with expansion: - 1172537240 (0x<hex digits>) - != - 1403724645 (0x<hex digits>) - -------------------------------------------------------------------------------- -TestCaseInfoHasher produces different hashes. - class names and names and tags are equal but hashers are seeded differently. -------------------------------------------------------------------------------- -TestCaseInfoHasher.tests.cpp:<line number> -............................................................................... - -TestCaseInfoHasher.tests.cpp:<line number>: PASSED: - CHECK( h1(testCase1) != h2(testCase2) ) -with expansion: - 1836497244 (0x<hex digits>) - != - 430288597 (0x<hex digits>) - -------------------------------------------------------------------------------- -TestCaseInfoHasher produces equal hashes. - class names and names and tags are equal. -------------------------------------------------------------------------------- -TestCaseInfoHasher.tests.cpp:<line number> -............................................................................... - -TestCaseInfoHasher.tests.cpp:<line number>: PASSED: - CHECK( hasherWithCustomSeed(testCase1) == hasherWithCustomSeed(testCase2) ) -with expansion: - 764519552 (0x<hex digits>) - == - 764519552 (0x<hex digits>) - ------------------------------------------------------------------------------- Testing checked-if ------------------------------------------------------------------------------- @@ -17941,6 +17952,6 @@ Misc.tests.cpp:<line number> Misc.tests.cpp:<line number>: PASSED: =============================================================================== -test cases: 388 | 298 passed | 83 failed | 7 failed as expected -assertions: 2239 | 2069 passed | 143 failed | 27 failed as expected +test cases: 390 | 300 passed | 83 failed | 7 failed as expected +assertions: 2240 | 2070 passed | 143 failed | 27 failed as expected diff --git a/tests/SelfTest/Baselines/console.sw.multi.approved.txt b/tests/SelfTest/Baselines/console.sw.multi.approved.txt index 412303da..3cfef5e2 100644 --- a/tests/SelfTest/Baselines/console.sw.multi.approved.txt +++ b/tests/SelfTest/Baselines/console.sw.multi.approved.txt @@ -6830,6 +6830,87 @@ Approx.tests.cpp:<line number>: PASSED: with expansion: 1.23 >= Approx( 1.24 ) +------------------------------------------------------------------------------- +Hashers with different seed produce different hash with same test case +------------------------------------------------------------------------------- +TestCaseInfoHasher.tests.cpp:<line number> +............................................................................... + +TestCaseInfoHasher.tests.cpp:<line number>: PASSED: + REQUIRE( h1( dummy ) != h2( dummy ) ) +with expansion: + 3422778688 (0x<hex digits>) + != + 130711275 (0x<hex digits>) + +------------------------------------------------------------------------------- +Hashers with same seed produce same hash +------------------------------------------------------------------------------- +TestCaseInfoHasher.tests.cpp:<line number> +............................................................................... + +TestCaseInfoHasher.tests.cpp:<line number>: PASSED: + REQUIRE( h1( dummy ) == h2( dummy ) ) +with expansion: + 3422778688 (0x<hex digits>) + == + 3422778688 (0x<hex digits>) + +------------------------------------------------------------------------------- +Hashing different test cases produces different result + Different test name +------------------------------------------------------------------------------- +TestCaseInfoHasher.tests.cpp:<line number> +............................................................................... + +TestCaseInfoHasher.tests.cpp:<line number>: PASSED: + REQUIRE( h( dummy1 ) != h( dummy2 ) ) +with expansion: + 2903002874 (0x<hex digits>) + != + 2668622104 (0x<hex digits>) + +------------------------------------------------------------------------------- +Hashing different test cases produces different result + Different classname +------------------------------------------------------------------------------- +TestCaseInfoHasher.tests.cpp:<line number> +............................................................................... + +TestCaseInfoHasher.tests.cpp:<line number>: PASSED: + REQUIRE( h( dummy1 ) != h( dummy2 ) ) +with expansion: + 2673152918 (0x<hex digits>) + != + 3916075712 (0x<hex digits>) + +------------------------------------------------------------------------------- +Hashing different test cases produces different result + Different tags +------------------------------------------------------------------------------- +TestCaseInfoHasher.tests.cpp:<line number> +............................................................................... + +TestCaseInfoHasher.tests.cpp:<line number>: PASSED: + REQUIRE( h( dummy1 ) != h( dummy2 ) ) +with expansion: + 2074929312 (0x<hex digits>) + != + 3429949824 (0x<hex digits>) + +------------------------------------------------------------------------------- +Hashing test case produces same hash across multiple calls +------------------------------------------------------------------------------- +TestCaseInfoHasher.tests.cpp:<line number> +............................................................................... + +TestCaseInfoHasher.tests.cpp:<line number>: PASSED: + REQUIRE( h( dummy ) == h( dummy ) ) +with expansion: + 3422778688 (0x<hex digits>) + == + 3422778688 (0x<hex digits>) + ------------------------------------------------------------------------------- INFO and WARN do not abort tests ------------------------------------------------------------------------------- @@ -13279,76 +13360,6 @@ CmdLine.tests.cpp:<line number> CmdLine.tests.cpp:<line number>: PASSED: -------------------------------------------------------------------------------- -TestCaseInfoHasher produces different hashes. - class names are equal, names are equal but tags are different. -------------------------------------------------------------------------------- -TestCaseInfoHasher.tests.cpp:<line number> -............................................................................... - -TestCaseInfoHasher.tests.cpp:<line number>: PASSED: - CHECK( hasherWithCustomSeed(testCase1) != hasherWithCustomSeed(testCase2) ) -with expansion: - 764519552 (0x<hex digits>) - != - 3472848544 (0x<hex digits>) - -------------------------------------------------------------------------------- -TestCaseInfoHasher produces different hashes. - class names are equal, tags are equal but names are different -------------------------------------------------------------------------------- -TestCaseInfoHasher.tests.cpp:<line number> -............................................................................... - -TestCaseInfoHasher.tests.cpp:<line number>: PASSED: - CHECK( hasherWithCustomSeed(testCase1) != hasherWithCustomSeed(testCase2) ) -with expansion: - 869111496 (0x<hex digits>) - != - 2870097333 (0x<hex digits>) - -------------------------------------------------------------------------------- -TestCaseInfoHasher produces different hashes. - names are equal, tags are equal but class names are different -------------------------------------------------------------------------------- -TestCaseInfoHasher.tests.cpp:<line number> -............................................................................... - -TestCaseInfoHasher.tests.cpp:<line number>: PASSED: - CHECK( hasherWithCustomSeed(testCase1) != hasherWithCustomSeed(testCase2) ) -with expansion: - 1172537240 (0x<hex digits>) - != - 1403724645 (0x<hex digits>) - -------------------------------------------------------------------------------- -TestCaseInfoHasher produces different hashes. - class names and names and tags are equal but hashers are seeded differently. -------------------------------------------------------------------------------- -TestCaseInfoHasher.tests.cpp:<line number> -............................................................................... - -TestCaseInfoHasher.tests.cpp:<line number>: PASSED: - CHECK( h1(testCase1) != h2(testCase2) ) -with expansion: - 1836497244 (0x<hex digits>) - != - 430288597 (0x<hex digits>) - -------------------------------------------------------------------------------- -TestCaseInfoHasher produces equal hashes. - class names and names and tags are equal. -------------------------------------------------------------------------------- -TestCaseInfoHasher.tests.cpp:<line number> -............................................................................... - -TestCaseInfoHasher.tests.cpp:<line number>: PASSED: - CHECK( hasherWithCustomSeed(testCase1) == hasherWithCustomSeed(testCase2) ) -with expansion: - 764519552 (0x<hex digits>) - == - 764519552 (0x<hex digits>) - ------------------------------------------------------------------------------- Testing checked-if ------------------------------------------------------------------------------- @@ -17933,6 +17944,6 @@ Misc.tests.cpp:<line number> Misc.tests.cpp:<line number>: PASSED: =============================================================================== -test cases: 388 | 298 passed | 83 failed | 7 failed as expected -assertions: 2239 | 2069 passed | 143 failed | 27 failed as expected +test cases: 390 | 300 passed | 83 failed | 7 failed as expected +assertions: 2240 | 2070 passed | 143 failed | 27 failed as expected diff --git a/tests/SelfTest/Baselines/junit.sw.approved.txt b/tests/SelfTest/Baselines/junit.sw.approved.txt index 7c82e5b3..519fdfbc 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="126" tests="2239" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}"> + <testsuite name="<exe-name>" errors="17" failures="126" tests="2240" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}"> <properties> <property name="random-seed" value="1"/> <property name="filters" value="~[!nonportable]~[!benchmark]~[approvals] *"/> @@ -728,6 +728,12 @@ Message.tests.cpp:<line number> <testcase classname="<exe-name>.global" name="Generators internals/Range/Negative manual step/Integer/Slightly over end" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Generators internals/Range/Negative manual step/Integer/Slightly under end" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Greater-than inequalities with different epsilons" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Hashers with different seed produce different hash with same test case" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Hashers with same seed produce same hash" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Hashing different test cases produces different result/Different test name" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Hashing different test cases produces different result/Different classname" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Hashing different test cases produces different result/Different tags" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Hashing test case produces same hash across multiple calls" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="INFO and WARN do not abort tests" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="INFO gets logged on failure" time="{duration}" status="run"> <failure message="a == 1" type="REQUIRE"> @@ -1355,11 +1361,6 @@ Misc.tests.cpp:<line number> <testcase classname="<exe-name>.global" name="Test case with one argument" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Test enum bit values" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Test with special, characters "in name" time="{duration}" status="run"/> - <testcase classname="<exe-name>.global" name="TestCaseInfoHasher produces different hashes./class names are equal, names are equal but tags are different." time="{duration}" status="run"/> - <testcase classname="<exe-name>.global" name="TestCaseInfoHasher produces different hashes./class names are equal, tags are equal but names are different" time="{duration}" status="run"/> - <testcase classname="<exe-name>.global" name="TestCaseInfoHasher produces different hashes./names are equal, tags are equal but class names are different" time="{duration}" status="run"/> - <testcase classname="<exe-name>.global" name="TestCaseInfoHasher produces different hashes./class names and names and tags are equal but hashers are seeded differently." time="{duration}" status="run"/> - <testcase classname="<exe-name>.global" name="TestCaseInfoHasher produces equal hashes./class names and names and tags are equal." time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Testing checked-if" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Testing checked-if 2" time="{duration}" status="run"> <skipped message="TEST_CASE tagged with !mayfail"/> diff --git a/tests/SelfTest/Baselines/junit.sw.multi.approved.txt b/tests/SelfTest/Baselines/junit.sw.multi.approved.txt index d850f16a..567b7ab7 100644 --- a/tests/SelfTest/Baselines/junit.sw.multi.approved.txt +++ b/tests/SelfTest/Baselines/junit.sw.multi.approved.txt @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <testsuites> - <testsuite name="<exe-name>" errors="17" failures="126" tests="2239" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}"> + <testsuite name="<exe-name>" errors="17" failures="126" tests="2240" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}"> <properties> <property name="random-seed" value="1"/> <property name="filters" value="~[!nonportable]~[!benchmark]~[approvals] *"/> @@ -727,6 +727,12 @@ Message.tests.cpp:<line number> <testcase classname="<exe-name>.global" name="Generators internals/Range/Negative manual step/Integer/Slightly over end" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Generators internals/Range/Negative manual step/Integer/Slightly under end" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Greater-than inequalities with different epsilons" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Hashers with different seed produce different hash with same test case" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Hashers with same seed produce same hash" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Hashing different test cases produces different result/Different test name" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Hashing different test cases produces different result/Different classname" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Hashing different test cases produces different result/Different tags" time="{duration}" status="run"/> + <testcase classname="<exe-name>.global" name="Hashing test case produces same hash across multiple calls" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="INFO and WARN do not abort tests" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="INFO gets logged on failure" time="{duration}" status="run"> <failure message="a == 1" type="REQUIRE"> @@ -1354,11 +1360,6 @@ Misc.tests.cpp:<line number> <testcase classname="<exe-name>.global" name="Test case with one argument" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Test enum bit values" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Test with special, characters "in name" time="{duration}" status="run"/> - <testcase classname="<exe-name>.global" name="TestCaseInfoHasher produces different hashes./class names are equal, names are equal but tags are different." time="{duration}" status="run"/> - <testcase classname="<exe-name>.global" name="TestCaseInfoHasher produces different hashes./class names are equal, tags are equal but names are different" time="{duration}" status="run"/> - <testcase classname="<exe-name>.global" name="TestCaseInfoHasher produces different hashes./names are equal, tags are equal but class names are different" time="{duration}" status="run"/> - <testcase classname="<exe-name>.global" name="TestCaseInfoHasher produces different hashes./class names and names and tags are equal but hashers are seeded differently." time="{duration}" status="run"/> - <testcase classname="<exe-name>.global" name="TestCaseInfoHasher produces equal hashes./class names and names and tags are equal." time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Testing checked-if" time="{duration}" status="run"/> <testcase classname="<exe-name>.global" name="Testing checked-if 2" time="{duration}" status="run"> <skipped message="TEST_CASE tagged with !mayfail"/> diff --git a/tests/SelfTest/Baselines/sonarqube.sw.approved.txt b/tests/SelfTest/Baselines/sonarqube.sw.approved.txt index 1a9d215d..6d41d95b 100644 --- a/tests/SelfTest/Baselines/sonarqube.sw.approved.txt +++ b/tests/SelfTest/Baselines/sonarqube.sw.approved.txt @@ -274,11 +274,12 @@ <testCase name="tags with dots in later positions are not parsed as hidden" duration="{duration}"/> </file> <file path="tests/<exe-name>/IntrospectiveTests/TestCaseInfoHasher.tests.cpp"> - <testCase name="TestCaseInfoHasher produces different hashes./class names are equal, names are equal but tags are different." duration="{duration}"/> - <testCase name="TestCaseInfoHasher produces different hashes./class names are equal, tags are equal but names are different" duration="{duration}"/> - <testCase name="TestCaseInfoHasher produces different hashes./names are equal, tags are equal but class names are different" duration="{duration}"/> - <testCase name="TestCaseInfoHasher produces different hashes./class names and names and tags are equal but hashers are seeded differently." duration="{duration}"/> - <testCase name="TestCaseInfoHasher produces equal hashes./class names and names and tags are equal." duration="{duration}"/> + <testCase name="Hashers with different seed produce different hash with same test case" duration="{duration}"/> + <testCase name="Hashers with same seed produce same hash" duration="{duration}"/> + <testCase name="Hashing different test cases produces different result/Different test name" duration="{duration}"/> + <testCase name="Hashing different test cases produces different result/Different classname" duration="{duration}"/> + <testCase name="Hashing different test cases produces different result/Different tags" duration="{duration}"/> + <testCase name="Hashing test case produces same hash across multiple calls" duration="{duration}"/> </file> <file path="tests/<exe-name>/IntrospectiveTests/TestSpecParser.tests.cpp"> <testCase name="Parsed tags are matched case insensitive" duration="{duration}"/> diff --git a/tests/SelfTest/Baselines/sonarqube.sw.multi.approved.txt b/tests/SelfTest/Baselines/sonarqube.sw.multi.approved.txt index cbefb063..7f2f076b 100644 --- a/tests/SelfTest/Baselines/sonarqube.sw.multi.approved.txt +++ b/tests/SelfTest/Baselines/sonarqube.sw.multi.approved.txt @@ -273,11 +273,12 @@ <testCase name="tags with dots in later positions are not parsed as hidden" duration="{duration}"/> </file> <file path="tests/<exe-name>/IntrospectiveTests/TestCaseInfoHasher.tests.cpp"> - <testCase name="TestCaseInfoHasher produces different hashes./class names are equal, names are equal but tags are different." duration="{duration}"/> - <testCase name="TestCaseInfoHasher produces different hashes./class names are equal, tags are equal but names are different" duration="{duration}"/> - <testCase name="TestCaseInfoHasher produces different hashes./names are equal, tags are equal but class names are different" duration="{duration}"/> - <testCase name="TestCaseInfoHasher produces different hashes./class names and names and tags are equal but hashers are seeded differently." duration="{duration}"/> - <testCase name="TestCaseInfoHasher produces equal hashes./class names and names and tags are equal." duration="{duration}"/> + <testCase name="Hashers with different seed produce different hash with same test case" duration="{duration}"/> + <testCase name="Hashers with same seed produce same hash" duration="{duration}"/> + <testCase name="Hashing different test cases produces different result/Different test name" duration="{duration}"/> + <testCase name="Hashing different test cases produces different result/Different classname" duration="{duration}"/> + <testCase name="Hashing different test cases produces different result/Different tags" duration="{duration}"/> + <testCase name="Hashing test case produces same hash across multiple calls" duration="{duration}"/> </file> <file path="tests/<exe-name>/IntrospectiveTests/TestSpecParser.tests.cpp"> <testCase name="Parsed tags are matched case insensitive" duration="{duration}"/> diff --git a/tests/SelfTest/Baselines/tap.sw.approved.txt b/tests/SelfTest/Baselines/tap.sw.approved.txt index 67ceddfc..d7d9a9cf 100644 --- a/tests/SelfTest/Baselines/tap.sw.approved.txt +++ b/tests/SelfTest/Baselines/tap.sw.approved.txt @@ -1766,6 +1766,18 @@ ok {test-number} - d >= Approx( 1.23 ) for: 1.23 >= Approx( 1.23 ) ok {test-number} - !(d >= Approx( 1.24 )) for: !(1.23 >= Approx( 1.24 )) # Greater-than inequalities with different epsilons ok {test-number} - d >= Approx( 1.24 ).epsilon(0.1) for: 1.23 >= Approx( 1.24 ) +# Hashers with different seed produce different hash with same test case +ok {test-number} - h1( dummy ) != h2( dummy ) for: 3422778688 (0x<hex digits>) != 130711275 (0x<hex digits>) +# Hashers with same seed produce same hash +ok {test-number} - h1( dummy ) == h2( dummy ) for: 3422778688 (0x<hex digits>) == 3422778688 (0x<hex digits>) +# Hashing different test cases produces different result +ok {test-number} - h( dummy1 ) != h( dummy2 ) for: 2903002874 (0x<hex digits>) != 2668622104 (0x<hex digits>) +# Hashing different test cases produces different result +ok {test-number} - h( dummy1 ) != h( dummy2 ) for: 2673152918 (0x<hex digits>) != 3916075712 (0x<hex digits>) +# Hashing different test cases produces different result +ok {test-number} - h( dummy1 ) != h( dummy2 ) for: 2074929312 (0x<hex digits>) != 3429949824 (0x<hex digits>) +# Hashing test case produces same hash across multiple calls +ok {test-number} - h( dummy ) == h( dummy ) for: 3422778688 (0x<hex digits>) == 3422778688 (0x<hex digits>) # INFO and WARN do not abort tests warning {test-number} - 'this is a message' with 1 message: 'this is a warning' # INFO gets logged on failure @@ -3297,16 +3309,6 @@ ok {test-number} - with 1 message: 'no assertions' ok {test-number} - 0x<hex digits> == bit30and31 for: 3221225472 (0x<hex digits>) == 3221225472 # Test with special, characters "in name ok {test-number} - -# TestCaseInfoHasher produces different hashes. -ok {test-number} - hasherWithCustomSeed(testCase1) != hasherWithCustomSeed(testCase2) for: 764519552 (0x<hex digits>) != 3472848544 (0x<hex digits>) -# TestCaseInfoHasher produces different hashes. -ok {test-number} - hasherWithCustomSeed(testCase1) != hasherWithCustomSeed(testCase2) for: 869111496 (0x<hex digits>) != 2870097333 (0x<hex digits>) -# TestCaseInfoHasher produces different hashes. -ok {test-number} - hasherWithCustomSeed(testCase1) != hasherWithCustomSeed(testCase2) for: 1172537240 (0x<hex digits>) != 1403724645 (0x<hex digits>) -# TestCaseInfoHasher produces different hashes. -ok {test-number} - h1(testCase1) != h2(testCase2) for: 1836497244 (0x<hex digits>) != 430288597 (0x<hex digits>) -# TestCaseInfoHasher produces equal hashes. -ok {test-number} - hasherWithCustomSeed(testCase1) == hasherWithCustomSeed(testCase2) for: 764519552 (0x<hex digits>) == 764519552 (0x<hex digits>) # Testing checked-if ok {test-number} - true # Testing checked-if @@ -4480,5 +4482,5 @@ ok {test-number} - q3 == 23. for: 23.0 == 23.0 ok {test-number} - # xmlentitycheck ok {test-number} - -1..2239 +1..2240 diff --git a/tests/SelfTest/Baselines/tap.sw.multi.approved.txt b/tests/SelfTest/Baselines/tap.sw.multi.approved.txt index d369326e..cf36b3d9 100644 --- a/tests/SelfTest/Baselines/tap.sw.multi.approved.txt +++ b/tests/SelfTest/Baselines/tap.sw.multi.approved.txt @@ -1764,6 +1764,18 @@ ok {test-number} - d >= Approx( 1.23 ) for: 1.23 >= Approx( 1.23 ) ok {test-number} - !(d >= Approx( 1.24 )) for: !(1.23 >= Approx( 1.24 )) # Greater-than inequalities with different epsilons ok {test-number} - d >= Approx( 1.24 ).epsilon(0.1) for: 1.23 >= Approx( 1.24 ) +# Hashers with different seed produce different hash with same test case +ok {test-number} - h1( dummy ) != h2( dummy ) for: 3422778688 (0x<hex digits>) != 130711275 (0x<hex digits>) +# Hashers with same seed produce same hash +ok {test-number} - h1( dummy ) == h2( dummy ) for: 3422778688 (0x<hex digits>) == 3422778688 (0x<hex digits>) +# Hashing different test cases produces different result +ok {test-number} - h( dummy1 ) != h( dummy2 ) for: 2903002874 (0x<hex digits>) != 2668622104 (0x<hex digits>) +# Hashing different test cases produces different result +ok {test-number} - h( dummy1 ) != h( dummy2 ) for: 2673152918 (0x<hex digits>) != 3916075712 (0x<hex digits>) +# Hashing different test cases produces different result +ok {test-number} - h( dummy1 ) != h( dummy2 ) for: 2074929312 (0x<hex digits>) != 3429949824 (0x<hex digits>) +# Hashing test case produces same hash across multiple calls +ok {test-number} - h( dummy ) == h( dummy ) for: 3422778688 (0x<hex digits>) == 3422778688 (0x<hex digits>) # INFO and WARN do not abort tests warning {test-number} - 'this is a message' with 1 message: 'this is a warning' # INFO gets logged on failure @@ -3290,16 +3302,6 @@ ok {test-number} - with 1 message: 'no assertions' ok {test-number} - 0x<hex digits> == bit30and31 for: 3221225472 (0x<hex digits>) == 3221225472 # Test with special, characters "in name ok {test-number} - -# TestCaseInfoHasher produces different hashes. -ok {test-number} - hasherWithCustomSeed(testCase1) != hasherWithCustomSeed(testCase2) for: 764519552 (0x<hex digits>) != 3472848544 (0x<hex digits>) -# TestCaseInfoHasher produces different hashes. -ok {test-number} - hasherWithCustomSeed(testCase1) != hasherWithCustomSeed(testCase2) for: 869111496 (0x<hex digits>) != 2870097333 (0x<hex digits>) -# TestCaseInfoHasher produces different hashes. -ok {test-number} - hasherWithCustomSeed(testCase1) != hasherWithCustomSeed(testCase2) for: 1172537240 (0x<hex digits>) != 1403724645 (0x<hex digits>) -# TestCaseInfoHasher produces different hashes. -ok {test-number} - h1(testCase1) != h2(testCase2) for: 1836497244 (0x<hex digits>) != 430288597 (0x<hex digits>) -# TestCaseInfoHasher produces equal hashes. -ok {test-number} - hasherWithCustomSeed(testCase1) == hasherWithCustomSeed(testCase2) for: 764519552 (0x<hex digits>) == 764519552 (0x<hex digits>) # Testing checked-if ok {test-number} - true # Testing checked-if @@ -4472,5 +4474,5 @@ ok {test-number} - q3 == 23. for: 23.0 == 23.0 ok {test-number} - # xmlentitycheck ok {test-number} - -1..2239 +1..2240 diff --git a/tests/SelfTest/Baselines/teamcity.sw.approved.txt b/tests/SelfTest/Baselines/teamcity.sw.approved.txt index d9b98f70..2ef7d121 100644 --- a/tests/SelfTest/Baselines/teamcity.sw.approved.txt +++ b/tests/SelfTest/Baselines/teamcity.sw.approved.txt @@ -377,6 +377,14 @@ Message.tests.cpp:<line number>|nexplicit failure with message:|n "This is a fa ##teamcity[testFinished name='Generators internals' duration="{duration}"] ##teamcity[testStarted name='Greater-than inequalities with different epsilons'] ##teamcity[testFinished name='Greater-than inequalities with different epsilons' duration="{duration}"] +##teamcity[testStarted name='Hashers with different seed produce different hash with same test case'] +##teamcity[testFinished name='Hashers with different seed produce different hash with same test case' duration="{duration}"] +##teamcity[testStarted name='Hashers with same seed produce same hash'] +##teamcity[testFinished name='Hashers with same seed produce same hash' duration="{duration}"] +##teamcity[testStarted name='Hashing different test cases produces different result'] +##teamcity[testFinished name='Hashing different test cases produces different result' duration="{duration}"] +##teamcity[testStarted name='Hashing test case produces same hash across multiple calls'] +##teamcity[testFinished name='Hashing test case produces same hash across multiple calls' duration="{duration}"] ##teamcity[testStarted name='INFO and WARN do not abort tests'] ##teamcity[testFinished name='INFO and WARN do not abort tests' duration="{duration}"] ##teamcity[testStarted name='INFO gets logged on failure'] @@ -615,10 +623,6 @@ Misc.tests.cpp:<line number>|nexpression failed|n CHECK( s1 == s2 )|nwith expan ##teamcity[testFinished name='Test enum bit values' duration="{duration}"] ##teamcity[testStarted name='Test with special, characters "in name'] ##teamcity[testFinished name='Test with special, characters "in name' duration="{duration}"] -##teamcity[testStarted name='TestCaseInfoHasher produces different hashes.'] -##teamcity[testFinished name='TestCaseInfoHasher produces different hashes.' duration="{duration}"] -##teamcity[testStarted name='TestCaseInfoHasher produces equal hashes.'] -##teamcity[testFinished name='TestCaseInfoHasher produces equal hashes.' duration="{duration}"] ##teamcity[testStarted name='Testing checked-if'] ##teamcity[testFinished name='Testing checked-if' duration="{duration}"] ##teamcity[testStarted name='Testing checked-if 2'] diff --git a/tests/SelfTest/Baselines/teamcity.sw.multi.approved.txt b/tests/SelfTest/Baselines/teamcity.sw.multi.approved.txt index ffdae89c..4edcdab5 100644 --- a/tests/SelfTest/Baselines/teamcity.sw.multi.approved.txt +++ b/tests/SelfTest/Baselines/teamcity.sw.multi.approved.txt @@ -377,6 +377,14 @@ Message.tests.cpp:<line number>|nexplicit failure with message:|n "This is a fa ##teamcity[testFinished name='Generators internals' duration="{duration}"] ##teamcity[testStarted name='Greater-than inequalities with different epsilons'] ##teamcity[testFinished name='Greater-than inequalities with different epsilons' duration="{duration}"] +##teamcity[testStarted name='Hashers with different seed produce different hash with same test case'] +##teamcity[testFinished name='Hashers with different seed produce different hash with same test case' duration="{duration}"] +##teamcity[testStarted name='Hashers with same seed produce same hash'] +##teamcity[testFinished name='Hashers with same seed produce same hash' duration="{duration}"] +##teamcity[testStarted name='Hashing different test cases produces different result'] +##teamcity[testFinished name='Hashing different test cases produces different result' duration="{duration}"] +##teamcity[testStarted name='Hashing test case produces same hash across multiple calls'] +##teamcity[testFinished name='Hashing test case produces same hash across multiple calls' duration="{duration}"] ##teamcity[testStarted name='INFO and WARN do not abort tests'] ##teamcity[testFinished name='INFO and WARN do not abort tests' duration="{duration}"] ##teamcity[testStarted name='INFO gets logged on failure'] @@ -615,10 +623,6 @@ Misc.tests.cpp:<line number>|nexpression failed|n CHECK( s1 == s2 )|nwith expan ##teamcity[testFinished name='Test enum bit values' duration="{duration}"] ##teamcity[testStarted name='Test with special, characters "in name'] ##teamcity[testFinished name='Test with special, characters "in name' duration="{duration}"] -##teamcity[testStarted name='TestCaseInfoHasher produces different hashes.'] -##teamcity[testFinished name='TestCaseInfoHasher produces different hashes.' duration="{duration}"] -##teamcity[testStarted name='TestCaseInfoHasher produces equal hashes.'] -##teamcity[testFinished name='TestCaseInfoHasher produces equal hashes.' duration="{duration}"] ##teamcity[testStarted name='Testing checked-if'] ##teamcity[testFinished name='Testing checked-if' duration="{duration}"] ##teamcity[testStarted name='Testing checked-if 2'] diff --git a/tests/SelfTest/Baselines/xml.sw.approved.txt b/tests/SelfTest/Baselines/xml.sw.approved.txt index 4facaec2..79245e38 100644 --- a/tests/SelfTest/Baselines/xml.sw.approved.txt +++ b/tests/SelfTest/Baselines/xml.sw.approved.txt @@ -8221,6 +8221,87 @@ C </Expression> <OverallResult success="true"/> </TestCase> + <TestCase name="Hashers with different seed produce different hash with same test case" tags="[test-case-hash]" filename="tests/<exe-name>/IntrospectiveTests/TestCaseInfoHasher.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/TestCaseInfoHasher.tests.cpp" > + <Original> + h1( dummy ) != h2( dummy ) + </Original> + <Expanded> + 3422778688 (0x<hex digits>) +!= +130711275 (0x<hex digits>) + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Hashers with same seed produce same hash" tags="[test-case-hash]" filename="tests/<exe-name>/IntrospectiveTests/TestCaseInfoHasher.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/TestCaseInfoHasher.tests.cpp" > + <Original> + h1( dummy ) == h2( dummy ) + </Original> + <Expanded> + 3422778688 (0x<hex digits>) +== +3422778688 (0x<hex digits>) + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Hashing different test cases produces different result" tags="[test-case-hash]" filename="tests/<exe-name>/IntrospectiveTests/TestCaseInfoHasher.tests.cpp" > + <Section name="Different test name" filename="tests/<exe-name>/IntrospectiveTests/TestCaseInfoHasher.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/TestCaseInfoHasher.tests.cpp" > + <Original> + h( dummy1 ) != h( dummy2 ) + </Original> + <Expanded> + 2903002874 (0x<hex digits>) +!= +2668622104 (0x<hex digits>) + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Different classname" filename="tests/<exe-name>/IntrospectiveTests/TestCaseInfoHasher.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/TestCaseInfoHasher.tests.cpp" > + <Original> + h( dummy1 ) != h( dummy2 ) + </Original> + <Expanded> + 2673152918 (0x<hex digits>) +!= +3916075712 (0x<hex digits>) + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Different tags" filename="tests/<exe-name>/IntrospectiveTests/TestCaseInfoHasher.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/TestCaseInfoHasher.tests.cpp" > + <Original> + h( dummy1 ) != h( dummy2 ) + </Original> + <Expanded> + 2074929312 (0x<hex digits>) +!= +3429949824 (0x<hex digits>) + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Hashing test case produces same hash across multiple calls" tags="[test-case-hash]" filename="tests/<exe-name>/IntrospectiveTests/TestCaseInfoHasher.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/TestCaseInfoHasher.tests.cpp" > + <Original> + h( dummy ) == h( dummy ) + </Original> + <Expanded> + 3422778688 (0x<hex digits>) +== +3422778688 (0x<hex digits>) + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> <TestCase name="INFO and WARN do not abort tests" tags="[.][messages]" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > <Info> this is a message @@ -15579,77 +15660,6 @@ Message from section two <TestCase name="Test with special, characters "in name" tags="[cli][regression]" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <OverallResult success="true"/> </TestCase> - <TestCase name="TestCaseInfoHasher produces different hashes." filename="tests/<exe-name>/IntrospectiveTests/TestCaseInfoHasher.tests.cpp" > - <Section name="class names are equal, names are equal but tags are different." filename="tests/<exe-name>/IntrospectiveTests/TestCaseInfoHasher.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/TestCaseInfoHasher.tests.cpp" > - <Original> - hasherWithCustomSeed(testCase1) != hasherWithCustomSeed(testCase2) - </Original> - <Expanded> - 764519552 (0x<hex digits>) -!= -3472848544 (0x<hex digits>) - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="class names are equal, tags are equal but names are different" filename="tests/<exe-name>/IntrospectiveTests/TestCaseInfoHasher.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/TestCaseInfoHasher.tests.cpp" > - <Original> - hasherWithCustomSeed(testCase1) != hasherWithCustomSeed(testCase2) - </Original> - <Expanded> - 869111496 (0x<hex digits>) -!= -2870097333 (0x<hex digits>) - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="names are equal, tags are equal but class names are different" filename="tests/<exe-name>/IntrospectiveTests/TestCaseInfoHasher.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/TestCaseInfoHasher.tests.cpp" > - <Original> - hasherWithCustomSeed(testCase1) != hasherWithCustomSeed(testCase2) - </Original> - <Expanded> - 1172537240 (0x<hex digits>) -!= -1403724645 (0x<hex digits>) - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="class names and names and tags are equal but hashers are seeded differently." filename="tests/<exe-name>/IntrospectiveTests/TestCaseInfoHasher.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/TestCaseInfoHasher.tests.cpp" > - <Original> - h1(testCase1) != h2(testCase2) - </Original> - <Expanded> - 1836497244 (0x<hex digits>) -!= -430288597 (0x<hex digits>) - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <OverallResult success="true"/> - </TestCase> - <TestCase name="TestCaseInfoHasher produces equal hashes." filename="tests/<exe-name>/IntrospectiveTests/TestCaseInfoHasher.tests.cpp" > - <Section name="class names and names and tags are equal." filename="tests/<exe-name>/IntrospectiveTests/TestCaseInfoHasher.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/TestCaseInfoHasher.tests.cpp" > - <Original> - hasherWithCustomSeed(testCase1) == hasherWithCustomSeed(testCase2) - </Original> - <Expanded> - 764519552 (0x<hex digits>) -== -764519552 (0x<hex digits>) - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <OverallResult success="true"/> - </TestCase> <TestCase name="Testing checked-if" tags="[checked-if]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Expression success="true" type="CHECKED_IF" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> @@ -21062,6 +21072,6 @@ loose text artifact </Section> <OverallResult success="true"/> </TestCase> - <OverallResults successes="2069" failures="143" expectedFailures="27"/> - <OverallResultsCases successes="298" failures="83" expectedFailures="7"/> + <OverallResults successes="2070" failures="143" expectedFailures="27"/> + <OverallResultsCases successes="300" failures="83" expectedFailures="7"/> </Catch2TestRun> diff --git a/tests/SelfTest/Baselines/xml.sw.multi.approved.txt b/tests/SelfTest/Baselines/xml.sw.multi.approved.txt index f6b172f5..2daf4989 100644 --- a/tests/SelfTest/Baselines/xml.sw.multi.approved.txt +++ b/tests/SelfTest/Baselines/xml.sw.multi.approved.txt @@ -8221,6 +8221,87 @@ C </Expression> <OverallResult success="true"/> </TestCase> + <TestCase name="Hashers with different seed produce different hash with same test case" tags="[test-case-hash]" filename="tests/<exe-name>/IntrospectiveTests/TestCaseInfoHasher.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/TestCaseInfoHasher.tests.cpp" > + <Original> + h1( dummy ) != h2( dummy ) + </Original> + <Expanded> + 3422778688 (0x<hex digits>) +!= +130711275 (0x<hex digits>) + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Hashers with same seed produce same hash" tags="[test-case-hash]" filename="tests/<exe-name>/IntrospectiveTests/TestCaseInfoHasher.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/TestCaseInfoHasher.tests.cpp" > + <Original> + h1( dummy ) == h2( dummy ) + </Original> + <Expanded> + 3422778688 (0x<hex digits>) +== +3422778688 (0x<hex digits>) + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Hashing different test cases produces different result" tags="[test-case-hash]" filename="tests/<exe-name>/IntrospectiveTests/TestCaseInfoHasher.tests.cpp" > + <Section name="Different test name" filename="tests/<exe-name>/IntrospectiveTests/TestCaseInfoHasher.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/TestCaseInfoHasher.tests.cpp" > + <Original> + h( dummy1 ) != h( dummy2 ) + </Original> + <Expanded> + 2903002874 (0x<hex digits>) +!= +2668622104 (0x<hex digits>) + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Different classname" filename="tests/<exe-name>/IntrospectiveTests/TestCaseInfoHasher.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/TestCaseInfoHasher.tests.cpp" > + <Original> + h( dummy1 ) != h( dummy2 ) + </Original> + <Expanded> + 2673152918 (0x<hex digits>) +!= +3916075712 (0x<hex digits>) + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <Section name="Different tags" filename="tests/<exe-name>/IntrospectiveTests/TestCaseInfoHasher.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/TestCaseInfoHasher.tests.cpp" > + <Original> + h( dummy1 ) != h( dummy2 ) + </Original> + <Expanded> + 2074929312 (0x<hex digits>) +!= +3429949824 (0x<hex digits>) + </Expanded> + </Expression> + <OverallResults successes="1" failures="0" expectedFailures="0"/> + </Section> + <OverallResult success="true"/> + </TestCase> + <TestCase name="Hashing test case produces same hash across multiple calls" tags="[test-case-hash]" filename="tests/<exe-name>/IntrospectiveTests/TestCaseInfoHasher.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/TestCaseInfoHasher.tests.cpp" > + <Original> + h( dummy ) == h( dummy ) + </Original> + <Expanded> + 3422778688 (0x<hex digits>) +== +3422778688 (0x<hex digits>) + </Expanded> + </Expression> + <OverallResult success="true"/> + </TestCase> <TestCase name="INFO and WARN do not abort tests" tags="[.][messages]" filename="tests/<exe-name>/UsageTests/Message.tests.cpp" > <Info> this is a message @@ -15579,77 +15660,6 @@ Message from section two <TestCase name="Test with special, characters "in name" tags="[cli][regression]" filename="tests/<exe-name>/IntrospectiveTests/CmdLine.tests.cpp" > <OverallResult success="true"/> </TestCase> - <TestCase name="TestCaseInfoHasher produces different hashes." filename="tests/<exe-name>/IntrospectiveTests/TestCaseInfoHasher.tests.cpp" > - <Section name="class names are equal, names are equal but tags are different." filename="tests/<exe-name>/IntrospectiveTests/TestCaseInfoHasher.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/TestCaseInfoHasher.tests.cpp" > - <Original> - hasherWithCustomSeed(testCase1) != hasherWithCustomSeed(testCase2) - </Original> - <Expanded> - 764519552 (0x<hex digits>) -!= -3472848544 (0x<hex digits>) - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="class names are equal, tags are equal but names are different" filename="tests/<exe-name>/IntrospectiveTests/TestCaseInfoHasher.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/TestCaseInfoHasher.tests.cpp" > - <Original> - hasherWithCustomSeed(testCase1) != hasherWithCustomSeed(testCase2) - </Original> - <Expanded> - 869111496 (0x<hex digits>) -!= -2870097333 (0x<hex digits>) - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="names are equal, tags are equal but class names are different" filename="tests/<exe-name>/IntrospectiveTests/TestCaseInfoHasher.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/TestCaseInfoHasher.tests.cpp" > - <Original> - hasherWithCustomSeed(testCase1) != hasherWithCustomSeed(testCase2) - </Original> - <Expanded> - 1172537240 (0x<hex digits>) -!= -1403724645 (0x<hex digits>) - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <Section name="class names and names and tags are equal but hashers are seeded differently." filename="tests/<exe-name>/IntrospectiveTests/TestCaseInfoHasher.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/TestCaseInfoHasher.tests.cpp" > - <Original> - h1(testCase1) != h2(testCase2) - </Original> - <Expanded> - 1836497244 (0x<hex digits>) -!= -430288597 (0x<hex digits>) - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <OverallResult success="true"/> - </TestCase> - <TestCase name="TestCaseInfoHasher produces equal hashes." filename="tests/<exe-name>/IntrospectiveTests/TestCaseInfoHasher.tests.cpp" > - <Section name="class names and names and tags are equal." filename="tests/<exe-name>/IntrospectiveTests/TestCaseInfoHasher.tests.cpp" > - <Expression success="true" type="CHECK" filename="tests/<exe-name>/IntrospectiveTests/TestCaseInfoHasher.tests.cpp" > - <Original> - hasherWithCustomSeed(testCase1) == hasherWithCustomSeed(testCase2) - </Original> - <Expanded> - 764519552 (0x<hex digits>) -== -764519552 (0x<hex digits>) - </Expanded> - </Expression> - <OverallResults successes="1" failures="0" expectedFailures="0"/> - </Section> - <OverallResult success="true"/> - </TestCase> <TestCase name="Testing checked-if" tags="[checked-if]" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Expression success="true" type="CHECKED_IF" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> @@ -21061,6 +21071,6 @@ There is no extra whitespace here </Section> <OverallResult success="true"/> </TestCase> - <OverallResults successes="2069" failures="143" expectedFailures="27"/> - <OverallResultsCases successes="298" failures="83" expectedFailures="7"/> + <OverallResults successes="2070" failures="143" expectedFailures="27"/> + <OverallResultsCases successes="300" failures="83" expectedFailures="7"/> </Catch2TestRun> diff --git a/tests/SelfTest/IntrospectiveTests/TestCaseInfoHasher.tests.cpp b/tests/SelfTest/IntrospectiveTests/TestCaseInfoHasher.tests.cpp index a3c1d651..93cb70b1 100644 --- a/tests/SelfTest/IntrospectiveTests/TestCaseInfoHasher.tests.cpp +++ b/tests/SelfTest/IntrospectiveTests/TestCaseInfoHasher.tests.cpp @@ -12,48 +12,61 @@ static constexpr Catch::SourceLineInfo dummySourceLineInfo = CATCH_INTERNAL_LINEINFO; -TEST_CASE( "TestCaseInfoHasher produces equal hashes." ) { - SECTION( "class names and names and tags are equal." ) { - Catch::TestCaseInfo testCase1("", {"name", "[.magic-tag1]"}, dummySourceLineInfo); - Catch::TestCaseInfo testCase2("", {"name", "[.magic-tag1]"}, dummySourceLineInfo); +using Catch::TestCaseInfo; +using Catch::TestCaseInfoHasher; - Catch::TestCaseInfoHasher hasherWithCustomSeed(123456789u); - CHECK(hasherWithCustomSeed(testCase1) == hasherWithCustomSeed(testCase2)); - } +TEST_CASE("Hashers with same seed produce same hash", "[test-case-hash]") { + TestCaseInfo dummy( "", { "name", "[a-tag]" }, dummySourceLineInfo ); + + TestCaseInfoHasher h1( 0x12345678 ); + TestCaseInfoHasher h2( 0x12345678 ); + + REQUIRE( h1( dummy ) == h2( dummy ) ); } -TEST_CASE( "TestCaseInfoHasher produces different hashes." ) { - SECTION( "class names are equal, names are equal but tags are different." ) { - Catch::TestCaseInfo testCase1("", {"name", "[.magic-tag1]"}, dummySourceLineInfo); - Catch::TestCaseInfo testCase2("", {"name", "[.magic-tag2]"}, dummySourceLineInfo); +TEST_CASE( + "Hashers with different seed produce different hash with same test case", + "[test-case-hash]") { + TestCaseInfo dummy( "", { "name", "[a-tag]" }, dummySourceLineInfo ); - Catch::TestCaseInfoHasher hasherWithCustomSeed(123456789u); - CHECK(hasherWithCustomSeed(testCase1) != hasherWithCustomSeed(testCase2)); - } + TestCaseInfoHasher h1( 0x12345678 ); + TestCaseInfoHasher h2( 0x87654321 ); - SECTION( "class names are equal, tags are equal but names are different" ) { - Catch::TestCaseInfo testCase1("", {"name1", "[.magic-tag]"}, dummySourceLineInfo); - Catch::TestCaseInfo testCase2("", {"name2", "[.magic-tag]"}, dummySourceLineInfo); + REQUIRE( h1( dummy ) != h2( dummy ) ); +} - Catch::TestCaseInfoHasher hasherWithCustomSeed(123456789u); - CHECK(hasherWithCustomSeed(testCase1) != hasherWithCustomSeed(testCase2)); - } +TEST_CASE("Hashing test case produces same hash across multiple calls", + "[test-case-hash]") { + TestCaseInfo dummy( "", { "name", "[a-tag]" }, dummySourceLineInfo ); - SECTION( "names are equal, tags are equal but class names are different" ) { - Catch::TestCaseInfo testCase1("class1", {"name", "[.magic-tag]"}, dummySourceLineInfo); - Catch::TestCaseInfo testCase2("class2", {"name", "[.magic-tag]"}, dummySourceLineInfo); + TestCaseInfoHasher h( 0x12345678 ); - Catch::TestCaseInfoHasher hasherWithCustomSeed(123456789u); - CHECK(hasherWithCustomSeed(testCase1) != hasherWithCustomSeed(testCase2)); - } + REQUIRE( h( dummy ) == h( dummy ) ); +} - SECTION( "class names and names and tags are equal but hashers are seeded differently." ) { - Catch::TestCaseInfo testCase1("", {"name", "[.magic-tag1]"}, dummySourceLineInfo); - Catch::TestCaseInfo testCase2("", {"name", "[.magic-tag1]"}, dummySourceLineInfo); +TEST_CASE("Hashing different test cases produces different result", "[test-case-hash]") { + TestCaseInfoHasher h( 0x12345678 ); + SECTION("Different test name") { + TestCaseInfo dummy1( "class", { "name-1", "[a-tag]" }, dummySourceLineInfo ); + TestCaseInfo dummy2( + "class", { "name-2", "[a-tag]" }, dummySourceLineInfo ); - Catch::TestCaseInfoHasher h1(14695981039346656037u); - Catch::TestCaseInfoHasher h2(14695981039346656038u); + REQUIRE( h( dummy1 ) != h( dummy2 ) ); + } + SECTION("Different classname") { + TestCaseInfo dummy1( + "class-1", { "name", "[a-tag]" }, dummySourceLineInfo ); + TestCaseInfo dummy2( + "class-2", { "name", "[a-tag]" }, dummySourceLineInfo ); + + REQUIRE( h( dummy1 ) != h( dummy2 ) ); + } + SECTION("Different tags") { + TestCaseInfo dummy1( + "class", { "name", "[a-tag]" }, dummySourceLineInfo ); + TestCaseInfo dummy2( + "class", { "name", "[b-tag]" }, dummySourceLineInfo ); - CHECK(h1(testCase1) != h2(testCase2)); + REQUIRE( h( dummy1 ) != h( dummy2 ) ); } }