Support custom allocators in vector Matchers (#1909)

This commit is contained in:
schallerr
2020-04-16 15:36:54 +02:00
committed by GitHub
parent fa4a93e051
commit 38f897c887
7 changed files with 222 additions and 48 deletions

View File

@@ -1531,18 +1531,26 @@ Matchers.tests.cpp:<line number>: failed: empty, Approx(t1) for: { } is approx:
Matchers.tests.cpp:<line number>: failed: v1, Approx(v2) for: { 2.0, 4.0, 6.0 } is approx: { 1.0, 3.0, 5.0 }
Matchers.tests.cpp:<line number>: passed: v, VectorContains(1) for: { 1, 2, 3 } Contains: 1
Matchers.tests.cpp:<line number>: passed: v, VectorContains(2) for: { 1, 2, 3 } Contains: 2
Matchers.tests.cpp:<line number>: passed: v5, (VectorContains<int, CustomAllocator<int>>(2)) for: { 1, 2, 3 } Contains: 2
Matchers.tests.cpp:<line number>: passed: v, Contains(v2) for: { 1, 2, 3 } Contains: { 1, 2 }
Matchers.tests.cpp:<line number>: passed: v5, (Contains<int, std::allocator<int>, CustomAllocator<int>>(v2)) for: { 1, 2, 3 } Contains: { 1, 2 }
Matchers.tests.cpp:<line number>: passed: v, Contains(v2) for: { 1, 2, 3 } Contains: { 1, 2, 3 }
Matchers.tests.cpp:<line number>: passed: v, Contains(empty) for: { 1, 2, 3 } Contains: { }
Matchers.tests.cpp:<line number>: passed: empty, Contains(empty) for: { } Contains: { }
Matchers.tests.cpp:<line number>: passed: v5, (Contains<int, std::allocator<int>, CustomAllocator<int>>(v2)) for: { 1, 2, 3 } Contains: { 1, 2, 3 }
Matchers.tests.cpp:<line number>: passed: v5, Contains(v6) for: { 1, 2, 3 } Contains: { 1, 2 }
Matchers.tests.cpp:<line number>: passed: v, VectorContains(1) && VectorContains(2) for: { 1, 2, 3 } ( Contains: 1 and Contains: 2 )
Matchers.tests.cpp:<line number>: passed: v, Equals(v) for: { 1, 2, 3 } Equals: { 1, 2, 3 }
Matchers.tests.cpp:<line number>: passed: empty, Equals(empty) for: { } Equals: { }
Matchers.tests.cpp:<line number>: passed: v, Equals(v2) for: { 1, 2, 3 } Equals: { 1, 2, 3 }
Matchers.tests.cpp:<line number>: passed: v5, (Equals<int, std::allocator<int>, CustomAllocator<int>>(v2)) for: { 1, 2, 3 } Equals: { 1, 2, 3 }
Matchers.tests.cpp:<line number>: passed: v5, Equals(v6) for: { 1, 2, 3 } Equals: { 1, 2, 3 }
Matchers.tests.cpp:<line number>: passed: v, UnorderedEquals(v) for: { 1, 2, 3 } UnorderedEquals: { 1, 2, 3 }
Matchers.tests.cpp:<line number>: passed: empty, UnorderedEquals(empty) for: { } UnorderedEquals: { }
Matchers.tests.cpp:<line number>: passed: permuted, UnorderedEquals(v) for: { 1, 3, 2 } UnorderedEquals: { 1, 2, 3 }
Matchers.tests.cpp:<line number>: passed: permuted, UnorderedEquals(v) for: { 2, 3, 1 } UnorderedEquals: { 1, 2, 3 }
Matchers.tests.cpp:<line number>: passed: v5, (UnorderedEquals<int, std::allocator<int>, CustomAllocator<int>>(permuted)) for: { 1, 2, 3 } UnorderedEquals: { 2, 3, 1 }
Matchers.tests.cpp:<line number>: passed: v5_permuted, UnorderedEquals(v5) for: { 1, 3, 2 } UnorderedEquals: { 1, 2, 3 }
Matchers.tests.cpp:<line number>: failed: v, VectorContains(-1) for: { 1, 2, 3 } Contains: -1
Matchers.tests.cpp:<line number>: failed: empty, VectorContains(1) for: { } Contains: 1
Matchers.tests.cpp:<line number>: failed: empty, Contains(v) for: { } Contains: { 1, 2, 3 }

View File

@@ -1381,5 +1381,5 @@ due to unexpected exception with message:
===============================================================================
test cases: 308 | 234 passed | 70 failed | 4 failed as expected
assertions: 1680 | 1528 passed | 131 failed | 21 failed as expected
assertions: 1688 | 1536 passed | 131 failed | 21 failed as expected

View File

@@ -11204,6 +11204,11 @@ Matchers.tests.cpp:<line number>: PASSED:
with expansion:
{ 1, 2, 3 } Contains: 2
Matchers.tests.cpp:<line number>: PASSED:
CHECK_THAT( v5, (VectorContains<int, CustomAllocator<int>>(2)) )
with expansion:
{ 1, 2, 3 } Contains: 2
-------------------------------------------------------------------------------
Vector matchers
Contains (vector)
@@ -11216,6 +11221,11 @@ Matchers.tests.cpp:<line number>: PASSED:
with expansion:
{ 1, 2, 3 } Contains: { 1, 2 }
Matchers.tests.cpp:<line number>: PASSED:
CHECK_THAT( v5, (Contains<int, std::allocator<int>, CustomAllocator<int>>(v2)) )
with expansion:
{ 1, 2, 3 } Contains: { 1, 2 }
Matchers.tests.cpp:<line number>: PASSED:
CHECK_THAT( v, Contains(v2) )
with expansion:
@@ -11231,6 +11241,16 @@ Matchers.tests.cpp:<line number>: PASSED:
with expansion:
{ } Contains: { }
Matchers.tests.cpp:<line number>: PASSED:
CHECK_THAT( v5, (Contains<int, std::allocator<int>, CustomAllocator<int>>(v2)) )
with expansion:
{ 1, 2, 3 } Contains: { 1, 2, 3 }
Matchers.tests.cpp:<line number>: PASSED:
CHECK_THAT( v5, Contains(v6) )
with expansion:
{ 1, 2, 3 } Contains: { 1, 2 }
-------------------------------------------------------------------------------
Vector matchers
Contains (element), composed
@@ -11265,6 +11285,16 @@ Matchers.tests.cpp:<line number>: PASSED:
with expansion:
{ 1, 2, 3 } Equals: { 1, 2, 3 }
Matchers.tests.cpp:<line number>: PASSED:
CHECK_THAT( v5, (Equals<int, std::allocator<int>, CustomAllocator<int>>(v2)) )
with expansion:
{ 1, 2, 3 } Equals: { 1, 2, 3 }
Matchers.tests.cpp:<line number>: PASSED:
CHECK_THAT( v5, Equals(v6) )
with expansion:
{ 1, 2, 3 } Equals: { 1, 2, 3 }
-------------------------------------------------------------------------------
Vector matchers
UnorderedEquals
@@ -11292,6 +11322,16 @@ Matchers.tests.cpp:<line number>: PASSED:
with expansion:
{ 2, 3, 1 } UnorderedEquals: { 1, 2, 3 }
Matchers.tests.cpp:<line number>: PASSED:
CHECK_THAT( v5, (UnorderedEquals<int, std::allocator<int>, CustomAllocator<int>>(permuted)) )
with expansion:
{ 1, 2, 3 } UnorderedEquals: { 2, 3, 1 }
Matchers.tests.cpp:<line number>: PASSED:
CHECK_THAT( v5_permuted, UnorderedEquals(v5) )
with expansion:
{ 1, 3, 2 } UnorderedEquals: { 1, 2, 3 }
-------------------------------------------------------------------------------
Vector matchers that fail
Contains (element)
@@ -13449,5 +13489,5 @@ Misc.tests.cpp:<line number>: PASSED:
===============================================================================
test cases: 308 | 218 passed | 86 failed | 4 failed as expected
assertions: 1697 | 1528 passed | 148 failed | 21 failed as expected
assertions: 1705 | 1536 passed | 148 failed | 21 failed as expected

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<testsuitesloose text artifact
>
<testsuite name="<exe-name>" errors="17" failures="132" tests="1698" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}">
<testsuite name="<exe-name>" errors="17" failures="132" tests="1706" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}">
<properties>
<property name="filters" value="~[!nonportable]~[!benchmark]~[approvals]"/>
<property name="random-seed" value="1"/>

View File

@@ -13657,7 +13657,15 @@ There is no extra whitespace here
{ 1, 2, 3 } Contains: 2
</Expanded>
</Expression>
<OverallResults successes="2" failures="0" expectedFailures="0"/>
<Expression success="true" type="CHECK_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
<Original>
v5, (VectorContains&lt;int, CustomAllocator&lt;int>>(2))
</Original>
<Expanded>
{ 1, 2, 3 } Contains: 2
</Expanded>
</Expression>
<OverallResults successes="3" failures="0" expectedFailures="0"/>
</Section>
<Section name="Contains (vector)" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
<Expression success="true" type="CHECK_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
@@ -13668,6 +13676,14 @@ There is no extra whitespace here
{ 1, 2, 3 } Contains: { 1, 2 }
</Expanded>
</Expression>
<Expression success="true" type="CHECK_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
<Original>
v5, (Contains&lt;int, std::allocator&lt;int>, CustomAllocator&lt;int>>(v2))
</Original>
<Expanded>
{ 1, 2, 3 } Contains: { 1, 2 }
</Expanded>
</Expression>
<Expression success="true" type="CHECK_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
<Original>
v, Contains(v2)
@@ -13692,7 +13708,23 @@ There is no extra whitespace here
{ } Contains: { }
</Expanded>
</Expression>
<OverallResults successes="4" failures="0" expectedFailures="0"/>
<Expression success="true" type="CHECK_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
<Original>
v5, (Contains&lt;int, std::allocator&lt;int>, CustomAllocator&lt;int>>(v2))
</Original>
<Expanded>
{ 1, 2, 3 } Contains: { 1, 2, 3 }
</Expanded>
</Expression>
<Expression success="true" type="CHECK_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
<Original>
v5, Contains(v6)
</Original>
<Expanded>
{ 1, 2, 3 } Contains: { 1, 2 }
</Expanded>
</Expression>
<OverallResults successes="7" failures="0" expectedFailures="0"/>
</Section>
<Section name="Contains (element), composed" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
<Expression success="true" type="CHECK_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
@@ -13730,7 +13762,23 @@ There is no extra whitespace here
{ 1, 2, 3 } Equals: { 1, 2, 3 }
</Expanded>
</Expression>
<OverallResults successes="3" failures="0" expectedFailures="0"/>
<Expression success="true" type="CHECK_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
<Original>
v5, (Equals&lt;int, std::allocator&lt;int>, CustomAllocator&lt;int>>(v2))
</Original>
<Expanded>
{ 1, 2, 3 } Equals: { 1, 2, 3 }
</Expanded>
</Expression>
<Expression success="true" type="CHECK_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
<Original>
v5, Equals(v6)
</Original>
<Expanded>
{ 1, 2, 3 } Equals: { 1, 2, 3 }
</Expanded>
</Expression>
<OverallResults successes="5" failures="0" expectedFailures="0"/>
</Section>
<Section name="UnorderedEquals" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
<Expression success="true" type="CHECK_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
@@ -13765,7 +13813,23 @@ There is no extra whitespace here
{ 2, 3, 1 } UnorderedEquals: { 1, 2, 3 }
</Expanded>
</Expression>
<OverallResults successes="4" failures="0" expectedFailures="0"/>
<Expression success="true" type="CHECK_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
<Original>
v5, (UnorderedEquals&lt;int, std::allocator&lt;int>, CustomAllocator&lt;int>>(permuted))
</Original>
<Expanded>
{ 1, 2, 3 } UnorderedEquals: { 2, 3, 1 }
</Expanded>
</Expression>
<Expression success="true" type="CHECK_THAT" filename="projects/<exe-name>/UsageTests/Matchers.tests.cpp" >
<Original>
v5_permuted, UnorderedEquals(v5)
</Original>
<Expanded>
{ 1, 3, 2 } UnorderedEquals: { 1, 2, 3 }
</Expanded>
</Expression>
<OverallResults successes="6" failures="0" expectedFailures="0"/>
</Section>
<OverallResult success="true"/>
</TestCase>
@@ -16075,7 +16139,7 @@ loose text artifact
</Section>
<OverallResult success="true"/>
</TestCase>
<OverallResults successes="1528" failures="149" expectedFailures="21"/>
<OverallResults successes="1536" failures="149" expectedFailures="21"/>
</Group>
<OverallResults successes="1528" failures="148" expectedFailures="21"/>
<OverallResults successes="1536" failures="148" expectedFailures="21"/>
</Catch>