diff options
| author | Daniel Feist | 2022-03-31 16:46:41 +0200 |
|---|---|---|
| committer | GitHub | 2022-03-31 16:46:41 +0200 |
| commit | 78e33ce51f78f0837b36a0e8b6b92c4b2a860178 (patch) | |
| tree | 35f4c8fc248ae1e99e411a1c58ca080c3495dcb5 /tests | |
| parent | 1a8a793178d50b74b0f9a0adb3eec937b61039a9 (diff) | |
| download | catch3-78e33ce51f78f0837b36a0e8b6b92c4b2a860178.tar.gz | |
Added TestCaseInfoHasher and tests. (#2394)
Test case hashing includes tags and class name
As the hasher involves more code now, it was split out into its own file
and it got its own set of tests.
Closes #2304
Diffstat (limited to 'tests')
19 files changed, 434 insertions, 14 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index ef1b13ea..1c520120 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -88,6 +88,7 @@ set(TEST_SOURCES ${SELF_TEST_DIR}/IntrospectiveTests/RandomNumberGeneration.tests.cpp ${SELF_TEST_DIR}/IntrospectiveTests/Reporters.tests.cpp ${SELF_TEST_DIR}/IntrospectiveTests/Tag.tests.cpp + ${SELF_TEST_DIR}/IntrospectiveTests/TestCaseInfoHasher.tests.cpp ${SELF_TEST_DIR}/IntrospectiveTests/TestSpecParser.tests.cpp ${SELF_TEST_DIR}/IntrospectiveTests/TextFlow.tests.cpp ${SELF_TEST_DIR}/IntrospectiveTests/Sharding.tests.cpp diff --git a/tests/SelfTest/Baselines/automake.sw.approved.txt b/tests/SelfTest/Baselines/automake.sw.approved.txt index fadb2747..9df8be0d 100644 --- a/tests/SelfTest/Baselines/automake.sw.approved.txt +++ b/tests/SelfTest/Baselines/automake.sw.approved.txt @@ -255,6 +255,8 @@ 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 f05de0ab..10db54cd 100644 --- a/tests/SelfTest/Baselines/automake.sw.multi.approved.txt +++ b/tests/SelfTest/Baselines/automake.sw.multi.approved.txt @@ -248,6 +248,8 @@ :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 4688a228..8b404c58 100644 --- a/tests/SelfTest/Baselines/compact.sw.approved.txt +++ b/tests/SelfTest/Baselines/compact.sw.approved.txt @@ -1868,6 +1868,21 @@ 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 c571b0c9..3b3e1eef 100644 --- a/tests/SelfTest/Baselines/compact.sw.multi.approved.txt +++ b/tests/SelfTest/Baselines/compact.sw.multi.approved.txt @@ -1861,6 +1861,21 @@ 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 ca0a77e5..61b1a112 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: 386 | 310 passed | 69 failed | 7 failed as expected -assertions: 2219 | 2064 passed | 128 failed | 27 failed as expected +test cases: 388 | 312 passed | 69 failed | 7 failed as expected +assertions: 2224 | 2069 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 5655f50a..148a3b53 100644 --- a/tests/SelfTest/Baselines/console.sw.approved.txt +++ b/tests/SelfTest/Baselines/console.sw.approved.txt @@ -13287,6 +13287,76 @@ 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 ------------------------------------------------------------------------------- Misc.tests.cpp:<line number> @@ -17871,6 +17941,6 @@ Misc.tests.cpp:<line number> Misc.tests.cpp:<line number>: PASSED: =============================================================================== -test cases: 386 | 296 passed | 83 failed | 7 failed as expected -assertions: 2234 | 2064 passed | 143 failed | 27 failed as expected +test cases: 388 | 298 passed | 83 failed | 7 failed as expected +assertions: 2239 | 2069 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 32fa0689..412303da 100644 --- a/tests/SelfTest/Baselines/console.sw.multi.approved.txt +++ b/tests/SelfTest/Baselines/console.sw.multi.approved.txt @@ -13280,6 +13280,76 @@ 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 ------------------------------------------------------------------------------- Misc.tests.cpp:<line number> @@ -17863,6 +17933,6 @@ Misc.tests.cpp:<line number> Misc.tests.cpp:<line number>: PASSED: =============================================================================== -test cases: 386 | 296 passed | 83 failed | 7 failed as expected -assertions: 2234 | 2064 passed | 143 failed | 27 failed as expected +test cases: 388 | 298 passed | 83 failed | 7 failed as expected +assertions: 2239 | 2069 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 3a099b4f..7c82e5b3 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="2234" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}"> + <testsuite name="<exe-name>" errors="17" failures="126" tests="2239" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}"> <properties> <property name="random-seed" value="1"/> <property name="filters" value="~[!nonportable]~[!benchmark]~[approvals] *"/> @@ -1355,6 +1355,11 @@ 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 527f7ba0..d850f16a 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="2234" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}"> + <testsuite name="<exe-name>" errors="17" failures="126" tests="2239" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}"> <properties> <property name="random-seed" value="1"/> <property name="filters" value="~[!nonportable]~[!benchmark]~[approvals] *"/> @@ -1354,6 +1354,11 @@ 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 92db65df..1a9d215d 100644 --- a/tests/SelfTest/Baselines/sonarqube.sw.approved.txt +++ b/tests/SelfTest/Baselines/sonarqube.sw.approved.txt @@ -273,6 +273,13 @@ <testCase name="shortened hide tags are split apart" duration="{duration}"/> <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}"/> + </file> <file path="tests/<exe-name>/IntrospectiveTests/TestSpecParser.tests.cpp"> <testCase name="Parsed tags are matched case insensitive" duration="{duration}"/> <testCase name="Parsing tags with non-alphabetical characters is pass-through" duration="{duration}"/> diff --git a/tests/SelfTest/Baselines/sonarqube.sw.multi.approved.txt b/tests/SelfTest/Baselines/sonarqube.sw.multi.approved.txt index c9074bf0..cbefb063 100644 --- a/tests/SelfTest/Baselines/sonarqube.sw.multi.approved.txt +++ b/tests/SelfTest/Baselines/sonarqube.sw.multi.approved.txt @@ -272,6 +272,13 @@ <testCase name="shortened hide tags are split apart" duration="{duration}"/> <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}"/> + </file> <file path="tests/<exe-name>/IntrospectiveTests/TestSpecParser.tests.cpp"> <testCase name="Parsed tags are matched case insensitive" duration="{duration}"/> <testCase name="Parsing tags with non-alphabetical characters is pass-through" duration="{duration}"/> diff --git a/tests/SelfTest/Baselines/tap.sw.approved.txt b/tests/SelfTest/Baselines/tap.sw.approved.txt index 456e80ee..67ceddfc 100644 --- a/tests/SelfTest/Baselines/tap.sw.approved.txt +++ b/tests/SelfTest/Baselines/tap.sw.approved.txt @@ -3297,6 +3297,16 @@ 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 @@ -4470,5 +4480,5 @@ ok {test-number} - q3 == 23. for: 23.0 == 23.0 ok {test-number} - # xmlentitycheck ok {test-number} - -1..2234 +1..2239 diff --git a/tests/SelfTest/Baselines/tap.sw.multi.approved.txt b/tests/SelfTest/Baselines/tap.sw.multi.approved.txt index 534005df..d369326e 100644 --- a/tests/SelfTest/Baselines/tap.sw.multi.approved.txt +++ b/tests/SelfTest/Baselines/tap.sw.multi.approved.txt @@ -3290,6 +3290,16 @@ 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 @@ -4462,5 +4472,5 @@ ok {test-number} - q3 == 23. for: 23.0 == 23.0 ok {test-number} - # xmlentitycheck ok {test-number} - -1..2234 +1..2239 diff --git a/tests/SelfTest/Baselines/teamcity.sw.approved.txt b/tests/SelfTest/Baselines/teamcity.sw.approved.txt index 43324e06..d9b98f70 100644 --- a/tests/SelfTest/Baselines/teamcity.sw.approved.txt +++ b/tests/SelfTest/Baselines/teamcity.sw.approved.txt @@ -615,6 +615,10 @@ 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 3bc028a4..ffdae89c 100644 --- a/tests/SelfTest/Baselines/teamcity.sw.multi.approved.txt +++ b/tests/SelfTest/Baselines/teamcity.sw.multi.approved.txt @@ -615,6 +615,10 @@ 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 f9518c3d..4facaec2 100644 --- a/tests/SelfTest/Baselines/xml.sw.approved.txt +++ b/tests/SelfTest/Baselines/xml.sw.approved.txt @@ -15579,6 +15579,77 @@ 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& |