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
This commit is contained in:
Daniel Feist
2022-03-31 16:46:41 +02:00
committed by GitHub
parent 1a8a793178
commit 78e33ce51f
24 changed files with 493 additions and 42 deletions

View File

@@ -15579,6 +15579,77 @@ Message from section two
<TestCase name="Test with special, characters &quot;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>
@@ -20991,6 +21062,6 @@ loose text artifact
</Section>
<OverallResult success="true"/>
</TestCase>
<OverallResults successes="2064" failures="143" expectedFailures="27"/>
<OverallResultsCases successes="296" failures="83" expectedFailures="7"/>
<OverallResults successes="2069" failures="143" expectedFailures="27"/>
<OverallResultsCases successes="298" failures="83" expectedFailures="7"/>
</Catch2TestRun>