Skip to content

Commit

Permalink
ADL begin/end tests
Browse files Browse the repository at this point in the history
  • Loading branch information
horenmar committed Jan 21, 2023
1 parent 8bdbcd4 commit ccb4f47
Show file tree
Hide file tree
Showing 14 changed files with 124 additions and 30 deletions.
8 changes: 5 additions & 3 deletions tests/SelfTest/Baselines/compact.sw.approved.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1859,8 +1859,8 @@ There is no extra whitespace here
StringManip.tests.cpp:<line number>: passed: trim(StringRef(whitespace_at_both_ends)) == StringRef(no_whitespace) for: There is no extra whitespace here
==
There is no extra whitespace here
MatchersRanges.tests.cpp:<line number>: passed: array_int_a, RangeEquals( vector_int_a ) for: { 1, 2, 3 } elements are { 1, 2, 3 }
MatchersRanges.tests.cpp:<line number>: passed: array_int_a, UnorderedRangeEquals( vector_int_a ) for: { 1, 2, 3 } unordered elements are { 1, 2, 3 }
MatchersRanges.tests.cpp:<line number>: passed: array_int_a, RangeEquals( c_array ) for: { 1, 2, 3 } elements are { 1, 2, 3 }
MatchersRanges.tests.cpp:<line number>: passed: array_int_a, UnorderedRangeEquals( c_array ) for: { 1, 2, 3 } unordered elements are { 1, 2, 3 }
MatchersRanges.tests.cpp:<line number>: passed: array_int_3, !RangeEquals( array_int_4 ) for: { 1, 2, 3 } not elements are { 1, 2, 3, 4 }
MatchersRanges.tests.cpp:<line number>: passed: array_int_3, !UnorderedRangeEquals( array_int_4 ) for: { 1, 2, 3 } not unordered elements are { 1, 2, 3, 4 }
MatchersRanges.tests.cpp:<line number>: passed: array_int_a, RangeEquals( vector_char_a ) for: { 1, 2, 3 } elements are { 1, 2, 3 }
Expand All @@ -1872,6 +1872,8 @@ MatchersRanges.tests.cpp:<line number>: passed: vector_int_a, RangeEquals( vecto
MatchersRanges.tests.cpp:<line number>: passed: vector_int_a, UnorderedRangeEquals( vector_char_a ) for: { 1, 2, 3 } unordered elements are { 1, 2, 3 }
MatchersRanges.tests.cpp:<line number>: passed: vector_int_a, !RangeEquals( vector_char_b ) for: { 1, 2, 3 } not elements are { 1, 2, 2 }
MatchersRanges.tests.cpp:<line number>: passed: vector_int_a, !UnorderedRangeEquals( vector_char_b ) for: { 1, 2, 3 } not unordered elements are { 1, 2, 2 }
MatchersRanges.tests.cpp:<line number>: passed: a, !RangeEquals( b ) for: { 1, 2, 3 } not elements are { 3, 2, 1 }
MatchersRanges.tests.cpp:<line number>: passed: a, UnorderedRangeEquals( b ) for: { 1, 2, 3 } unordered elements are { 3, 2, 1 }
MatchersRanges.tests.cpp:<line number>: passed: vector_a, RangeEquals( array_a_plus_1, close_enough ) for: { 1, 2, 3 } elements are { 2, 3, 4 }
MatchersRanges.tests.cpp:<line number>: passed: vector_a, UnorderedRangeEquals( array_a_plus_1, close_enough ) for: { 1, 2, 3 } unordered elements are { 2, 3, 4 }
Exception.tests.cpp:<line number>: failed: unexpected exception with message: '3.14'
Expand Down Expand Up @@ -2520,6 +2522,6 @@ InternalBenchmark.tests.cpp:<line number>: passed: q3 == 23. for: 23.0 == 23.0
Misc.tests.cpp:<line number>: passed:
Misc.tests.cpp:<line number>: passed:
test cases: 407 | 308 passed | 84 failed | 5 skipped | 10 failed as expected
assertions: 2207 | 2031 passed | 145 failed | 31 failed as expected
assertions: 2209 | 2033 passed | 145 failed | 31 failed as expected


8 changes: 5 additions & 3 deletions tests/SelfTest/Baselines/compact.sw.multi.approved.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1852,8 +1852,8 @@ There is no extra whitespace here
StringManip.tests.cpp:<line number>: passed: trim(StringRef(whitespace_at_both_ends)) == StringRef(no_whitespace) for: There is no extra whitespace here
==
There is no extra whitespace here
MatchersRanges.tests.cpp:<line number>: passed: array_int_a, RangeEquals( vector_int_a ) for: { 1, 2, 3 } elements are { 1, 2, 3 }
MatchersRanges.tests.cpp:<line number>: passed: array_int_a, UnorderedRangeEquals( vector_int_a ) for: { 1, 2, 3 } unordered elements are { 1, 2, 3 }
MatchersRanges.tests.cpp:<line number>: passed: array_int_a, RangeEquals( c_array ) for: { 1, 2, 3 } elements are { 1, 2, 3 }
MatchersRanges.tests.cpp:<line number>: passed: array_int_a, UnorderedRangeEquals( c_array ) for: { 1, 2, 3 } unordered elements are { 1, 2, 3 }
MatchersRanges.tests.cpp:<line number>: passed: array_int_3, !RangeEquals( array_int_4 ) for: { 1, 2, 3 } not elements are { 1, 2, 3, 4 }
MatchersRanges.tests.cpp:<line number>: passed: array_int_3, !UnorderedRangeEquals( array_int_4 ) for: { 1, 2, 3 } not unordered elements are { 1, 2, 3, 4 }
MatchersRanges.tests.cpp:<line number>: passed: array_int_a, RangeEquals( vector_char_a ) for: { 1, 2, 3 } elements are { 1, 2, 3 }
Expand All @@ -1865,6 +1865,8 @@ MatchersRanges.tests.cpp:<line number>: passed: vector_int_a, RangeEquals( vecto
MatchersRanges.tests.cpp:<line number>: passed: vector_int_a, UnorderedRangeEquals( vector_char_a ) for: { 1, 2, 3 } unordered elements are { 1, 2, 3 }
MatchersRanges.tests.cpp:<line number>: passed: vector_int_a, !RangeEquals( vector_char_b ) for: { 1, 2, 3 } not elements are { 1, 2, 2 }
MatchersRanges.tests.cpp:<line number>: passed: vector_int_a, !UnorderedRangeEquals( vector_char_b ) for: { 1, 2, 3 } not unordered elements are { 1, 2, 2 }
MatchersRanges.tests.cpp:<line number>: passed: a, !RangeEquals( b ) for: { 1, 2, 3 } not elements are { 3, 2, 1 }
MatchersRanges.tests.cpp:<line number>: passed: a, UnorderedRangeEquals( b ) for: { 1, 2, 3 } unordered elements are { 3, 2, 1 }
MatchersRanges.tests.cpp:<line number>: passed: vector_a, RangeEquals( array_a_plus_1, close_enough ) for: { 1, 2, 3 } elements are { 2, 3, 4 }
MatchersRanges.tests.cpp:<line number>: passed: vector_a, UnorderedRangeEquals( array_a_plus_1, close_enough ) for: { 1, 2, 3 } unordered elements are { 2, 3, 4 }
Exception.tests.cpp:<line number>: failed: unexpected exception with message: '3.14'
Expand Down Expand Up @@ -2509,6 +2511,6 @@ InternalBenchmark.tests.cpp:<line number>: passed: q3 == 23. for: 23.0 == 23.0
Misc.tests.cpp:<line number>: passed:
Misc.tests.cpp:<line number>: passed:
test cases: 407 | 308 passed | 84 failed | 5 skipped | 10 failed as expected
assertions: 2207 | 2031 passed | 145 failed | 31 failed as expected
assertions: 2209 | 2033 passed | 145 failed | 31 failed as expected


2 changes: 1 addition & 1 deletion tests/SelfTest/Baselines/console.std.approved.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1524,5 +1524,5 @@ due to unexpected exception with message:

===============================================================================
test cases: 407 | 322 passed | 69 failed | 6 skipped | 10 failed as expected
assertions: 2190 | 2031 passed | 128 failed | 31 failed as expected
assertions: 2192 | 2033 passed | 128 failed | 31 failed as expected

23 changes: 20 additions & 3 deletions tests/SelfTest/Baselines/console.sw.approved.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13107,12 +13107,12 @@ MatchersRanges.tests.cpp:<line number>
...............................................................................

MatchersRanges.tests.cpp:<line number>: PASSED:
CHECK_THAT( array_int_a, RangeEquals( vector_int_a ) )
CHECK_THAT( array_int_a, RangeEquals( c_array ) )
with expansion:
{ 1, 2, 3 } elements are { 1, 2, 3 }

MatchersRanges.tests.cpp:<line number>: PASSED:
CHECK_THAT( array_int_a, UnorderedRangeEquals( vector_int_a ) )
CHECK_THAT( array_int_a, UnorderedRangeEquals( c_array ) )
with expansion:
{ 1, 2, 3 } unordered elements are { 1, 2, 3 }

Expand Down Expand Up @@ -13211,6 +13211,23 @@ MatchersRanges.tests.cpp:<line number>: PASSED:
with expansion:
{ 1, 2, 3 } not unordered elements are { 1, 2, 2 }

-------------------------------------------------------------------------------
Type conversions of RangeEquals and similar
Ranges with begin that needs ADL
-------------------------------------------------------------------------------
MatchersRanges.tests.cpp:<line number>
...............................................................................

MatchersRanges.tests.cpp:<line number>: PASSED:
REQUIRE_THAT( a, !RangeEquals( b ) )
with expansion:
{ 1, 2, 3 } not elements are { 3, 2, 1 }

MatchersRanges.tests.cpp:<line number>: PASSED:
REQUIRE_THAT( a, UnorderedRangeEquals( b ) )
with expansion:
{ 1, 2, 3 } unordered elements are { 3, 2, 1 }

-------------------------------------------------------------------------------
Type conversions of RangeEquals and similar
Custom predicate
Expand Down Expand Up @@ -18077,5 +18094,5 @@ Misc.tests.cpp:<line number>: PASSED:

===============================================================================
test cases: 407 | 308 passed | 84 failed | 5 skipped | 10 failed as expected
assertions: 2207 | 2031 passed | 145 failed | 31 failed as expected
assertions: 2209 | 2033 passed | 145 failed | 31 failed as expected

23 changes: 20 additions & 3 deletions tests/SelfTest/Baselines/console.sw.multi.approved.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13100,12 +13100,12 @@ MatchersRanges.tests.cpp:<line number>
...............................................................................

MatchersRanges.tests.cpp:<line number>: PASSED:
CHECK_THAT( array_int_a, RangeEquals( vector_int_a ) )
CHECK_THAT( array_int_a, RangeEquals( c_array ) )
with expansion:
{ 1, 2, 3 } elements are { 1, 2, 3 }

MatchersRanges.tests.cpp:<line number>: PASSED:
CHECK_THAT( array_int_a, UnorderedRangeEquals( vector_int_a ) )
CHECK_THAT( array_int_a, UnorderedRangeEquals( c_array ) )
with expansion:
{ 1, 2, 3 } unordered elements are { 1, 2, 3 }

Expand Down Expand Up @@ -13204,6 +13204,23 @@ MatchersRanges.tests.cpp:<line number>: PASSED:
with expansion:
{ 1, 2, 3 } not unordered elements are { 1, 2, 2 }

-------------------------------------------------------------------------------
Type conversions of RangeEquals and similar
Ranges with begin that needs ADL
-------------------------------------------------------------------------------
MatchersRanges.tests.cpp:<line number>
...............................................................................

MatchersRanges.tests.cpp:<line number>: PASSED:
REQUIRE_THAT( a, !RangeEquals( b ) )
with expansion:
{ 1, 2, 3 } not elements are { 3, 2, 1 }

MatchersRanges.tests.cpp:<line number>: PASSED:
REQUIRE_THAT( a, UnorderedRangeEquals( b ) )
with expansion:
{ 1, 2, 3 } unordered elements are { 3, 2, 1 }

-------------------------------------------------------------------------------
Type conversions of RangeEquals and similar
Custom predicate
Expand Down Expand Up @@ -18066,5 +18083,5 @@ Misc.tests.cpp:<line number>: PASSED:

===============================================================================
test cases: 407 | 308 passed | 84 failed | 5 skipped | 10 failed as expected
assertions: 2207 | 2031 passed | 145 failed | 31 failed as expected
assertions: 2209 | 2033 passed | 145 failed | 31 failed as expected

3 changes: 2 additions & 1 deletion tests/SelfTest/Baselines/junit.sw.approved.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<testsuitesloose text artifact
>
<testsuite name="<exe-name>" errors="17" failures="128" skipped="11" tests="2218" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}">
<testsuite name="<exe-name>" errors="17" failures="128" skipped="11" tests="2220" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}">
<properties>
<property name="random-seed" value="1"/>
<property name="filters" value="&quot;*&quot; ~[!nonportable] ~[!benchmark] ~[approvals]"/>
Expand Down Expand Up @@ -1373,6 +1373,7 @@ at Exception.tests.cpp:<line number>
<testcase classname="<exe-name>.global" name="Type conversions of RangeEquals and similar/Container conversions/Two equal containers, one random access, one not" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Type conversions of RangeEquals and similar/Value type/Two equal containers of different value types" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Type conversions of RangeEquals and similar/Value type/Two non-equal containers of different value types" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Type conversions of RangeEquals and similar/Ranges with begin that needs ADL" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Type conversions of RangeEquals and similar/Custom predicate/Two equal non-empty containers (close enough)" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Unexpected exceptions can be translated" time="{duration}" status="run">
<error type="TEST_CASE">
Expand Down
3 changes: 2 additions & 1 deletion tests/SelfTest/Baselines/junit.sw.multi.approved.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<testsuites>
<testsuite name="<exe-name>" errors="17" failures="128" skipped="11" tests="2218" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}">
<testsuite name="<exe-name>" errors="17" failures="128" skipped="11" tests="2220" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}">
<properties>
<property name="random-seed" value="1"/>
<property name="filters" value="&quot;*&quot; ~[!nonportable] ~[!benchmark] ~[approvals]"/>
Expand Down Expand Up @@ -1372,6 +1372,7 @@ at Exception.tests.cpp:<line number>
<testcase classname="<exe-name>.global" name="Type conversions of RangeEquals and similar/Container conversions/Two equal containers, one random access, one not" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Type conversions of RangeEquals and similar/Value type/Two equal containers of different value types" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Type conversions of RangeEquals and similar/Value type/Two non-equal containers of different value types" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Type conversions of RangeEquals and similar/Ranges with begin that needs ADL" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Type conversions of RangeEquals and similar/Custom predicate/Two equal non-empty containers (close enough)" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Unexpected exceptions can be translated" time="{duration}" status="run">
<error type="TEST_CASE">
Expand Down
1 change: 1 addition & 0 deletions tests/SelfTest/Baselines/sonarqube.sw.approved.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1371,6 +1371,7 @@ at Matchers.tests.cpp:<line number>
<testCase name="Type conversions of RangeEquals and similar/Container conversions/Two equal containers, one random access, one not" duration="{duration}"/>
<testCase name="Type conversions of RangeEquals and similar/Value type/Two equal containers of different value types" duration="{duration}"/>
<testCase name="Type conversions of RangeEquals and similar/Value type/Two non-equal containers of different value types" duration="{duration}"/>
<testCase name="Type conversions of RangeEquals and similar/Ranges with begin that needs ADL" duration="{duration}"/>
<testCase name="Type conversions of RangeEquals and similar/Custom predicate/Two equal non-empty containers (close enough)" duration="{duration}"/>
<testCase name="Usage of AllMatch range matcher/Basic usage" duration="{duration}"/>
<testCase name="Usage of AllMatch range matcher/Type requires ADL found begin and end" duration="{duration}"/>
Expand Down
1 change: 1 addition & 0 deletions tests/SelfTest/Baselines/sonarqube.sw.multi.approved.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1370,6 +1370,7 @@ at Matchers.tests.cpp:<line number>
<testCase name="Type conversions of RangeEquals and similar/Container conversions/Two equal containers, one random access, one not" duration="{duration}"/>
<testCase name="Type conversions of RangeEquals and similar/Value type/Two equal containers of different value types" duration="{duration}"/>
<testCase name="Type conversions of RangeEquals and similar/Value type/Two non-equal containers of different value types" duration="{duration}"/>
<testCase name="Type conversions of RangeEquals and similar/Ranges with begin that needs ADL" duration="{duration}"/>
<testCase name="Type conversions of RangeEquals and similar/Custom predicate/Two equal non-empty containers (close enough)" duration="{duration}"/>
<testCase name="Usage of AllMatch range matcher/Basic usage" duration="{duration}"/>
<testCase name="Usage of AllMatch range matcher/Type requires ADL found begin and end" duration="{duration}"/>
Expand Down
10 changes: 7 additions & 3 deletions tests/SelfTest/Baselines/tap.sw.approved.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3224,9 +3224,9 @@ ok {test-number} - trim(StringRef(trailing_whitespace)) == StringRef(no_whitespa
# Trim strings
ok {test-number} - trim(StringRef(whitespace_at_both_ends)) == StringRef(no_whitespace) for: There is no extra whitespace here == There is no extra whitespace here
# Type conversions of RangeEquals and similar
ok {test-number} - array_int_a, RangeEquals( vector_int_a ) for: { 1, 2, 3 } elements are { 1, 2, 3 }
ok {test-number} - array_int_a, RangeEquals( c_array ) for: { 1, 2, 3 } elements are { 1, 2, 3 }
# Type conversions of RangeEquals and similar
ok {test-number} - array_int_a, UnorderedRangeEquals( vector_int_a ) for: { 1, 2, 3 } unordered elements are { 1, 2, 3 }
ok {test-number} - array_int_a, UnorderedRangeEquals( c_array ) for: { 1, 2, 3 } unordered elements are { 1, 2, 3 }
# Type conversions of RangeEquals and similar
ok {test-number} - array_int_3, !RangeEquals( array_int_4 ) for: { 1, 2, 3 } not elements are { 1, 2, 3, 4 }
# Type conversions of RangeEquals and similar
Expand All @@ -3250,6 +3250,10 @@ ok {test-number} - vector_int_a, !RangeEquals( vector_char_b ) for: { 1, 2, 3 }
# Type conversions of RangeEquals and similar
ok {test-number} - vector_int_a, !UnorderedRangeEquals( vector_char_b ) for: { 1, 2, 3 } not unordered elements are { 1, 2, 2 }
# Type conversions of RangeEquals and similar
ok {test-number} - a, !RangeEquals( b ) for: { 1, 2, 3 } not elements are { 3, 2, 1 }
# Type conversions of RangeEquals and similar
ok {test-number} - a, UnorderedRangeEquals( b ) for: { 1, 2, 3 } unordered elements are { 3, 2, 1 }
# Type conversions of RangeEquals and similar
ok {test-number} - vector_a, RangeEquals( array_a_plus_1, close_enough ) for: { 1, 2, 3 } elements are { 2, 3, 4 }
# Type conversions of RangeEquals and similar
ok {test-number} - vector_a, UnorderedRangeEquals( array_a_plus_1, close_enough ) for: { 1, 2, 3 } unordered elements are { 2, 3, 4 }
Expand Down Expand Up @@ -4439,5 +4443,5 @@ ok {test-number} - q3 == 23. for: 23.0 == 23.0
ok {test-number} -
# xmlentitycheck
ok {test-number} -
1..2218
1..2220

10 changes: 7 additions & 3 deletions tests/SelfTest/Baselines/tap.sw.multi.approved.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3217,9 +3217,9 @@ ok {test-number} - trim(StringRef(trailing_whitespace)) == StringRef(no_whitespa
# Trim strings
ok {test-number} - trim(StringRef(whitespace_at_both_ends)) == StringRef(no_whitespace) for: There is no extra whitespace here == There is no extra whitespace here
# Type conversions of RangeEquals and similar
ok {test-number} - array_int_a, RangeEquals( vector_int_a ) for: { 1, 2, 3 } elements are { 1, 2, 3 }
ok {test-number} - array_int_a, RangeEquals( c_array ) for: { 1, 2, 3 } elements are { 1, 2, 3 }
# Type conversions of RangeEquals and similar
ok {test-number} - array_int_a, UnorderedRangeEquals( vector_int_a ) for: { 1, 2, 3 } unordered elements are { 1, 2, 3 }
ok {test-number} - array_int_a, UnorderedRangeEquals( c_array ) for: { 1, 2, 3 } unordered elements are { 1, 2, 3 }
# Type conversions of RangeEquals and similar
ok {test-number} - array_int_3, !RangeEquals( array_int_4 ) for: { 1, 2, 3 } not elements are { 1, 2, 3, 4 }
# Type conversions of RangeEquals and similar
Expand All @@ -3243,6 +3243,10 @@ ok {test-number} - vector_int_a, !RangeEquals( vector_char_b ) for: { 1, 2, 3 }
# Type conversions of RangeEquals and similar
ok {test-number} - vector_int_a, !UnorderedRangeEquals( vector_char_b ) for: { 1, 2, 3 } not unordered elements are { 1, 2, 2 }
# Type conversions of RangeEquals and similar
ok {test-number} - a, !RangeEquals( b ) for: { 1, 2, 3 } not elements are { 3, 2, 1 }
# Type conversions of RangeEquals and similar
ok {test-number} - a, UnorderedRangeEquals( b ) for: { 1, 2, 3 } unordered elements are { 3, 2, 1 }
# Type conversions of RangeEquals and similar
ok {test-number} - vector_a, RangeEquals( array_a_plus_1, close_enough ) for: { 1, 2, 3 } elements are { 2, 3, 4 }
# Type conversions of RangeEquals and similar
ok {test-number} - vector_a, UnorderedRangeEquals( array_a_plus_1, close_enough ) for: { 1, 2, 3 } unordered elements are { 2, 3, 4 }
Expand Down Expand Up @@ -4428,5 +4432,5 @@ ok {test-number} - q3 == 23. for: 23.0 == 23.0
ok {test-number} -
# xmlentitycheck
ok {test-number} -
1..2218
1..2220

Loading

0 comments on commit ccb4f47

Please sign in to comment.