Refactor MatchersRanges test utils (#2386)

- do not hardcode content of containers
- prefix members with m_
- add const and non-const iterators to `with_mocked_iterator_access`
- remove `m_touched` as it wasn't filled properly and isn't used anyway
This commit is contained in:
schallerr 2022-03-09 23:13:37 +01:00 committed by GitHub
parent 913f79a661
commit 81f612c96c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 358 additions and 338 deletions

View File

@ -1967,47 +1967,47 @@ MatchersRanges.tests.cpp:<line number>: passed: data, AllMatch(SizeIs(5)) for: {
MatchersRanges.tests.cpp:<line number>: passed: data, !AllMatch(Contains(0) && Contains(1)) for: { { 0, 1, 2, 3, 5 }, { 4, -3, -2, 5, 0 }, { 0, 0, 0, 5, 0 }, { 0, -5, 0, 5, 0 }, { 1, 0, 0, -1, 5 } } not all match ( contains element 0 and contains element 1 ) MatchersRanges.tests.cpp:<line number>: passed: data, !AllMatch(Contains(0) && Contains(1)) for: { { 0, 1, 2, 3, 5 }, { 4, -3, -2, 5, 0 }, { 0, 0, 0, 5, 0 }, { 0, -5, 0, 5, 0 }, { 1, 0, 0, -1, 5 } } not all match ( contains element 0 and contains element 1 )
MatchersRanges.tests.cpp:<line number>: passed: needs_adl, AllMatch( Predicate<int>( []( int elem ) { return elem < 6; } ) ) for: { 1, 2, 3, 4, 5 } all match matches undescribed predicate MatchersRanges.tests.cpp:<line number>: passed: needs_adl, AllMatch( Predicate<int>( []( int elem ) { return elem < 6; } ) ) for: { 1, 2, 3, 4, 5 } all match matches undescribed predicate
MatchersRanges.tests.cpp:<line number>: passed: mocked, allMatch for: { 1, 2, 3, 4, 5 } all match matches undescribed predicate MatchersRanges.tests.cpp:<line number>: passed: mocked, allMatch for: { 1, 2, 3, 4, 5 } all match matches undescribed predicate
MatchersRanges.tests.cpp:<line number>: passed: mocked.derefed[0] for: true MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[0] for: true
MatchersRanges.tests.cpp:<line number>: passed: mocked.derefed[1] for: true MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[1] for: true
MatchersRanges.tests.cpp:<line number>: passed: mocked.derefed[2] for: true MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[2] for: true
MatchersRanges.tests.cpp:<line number>: passed: mocked.derefed[3] for: true MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[3] for: true
MatchersRanges.tests.cpp:<line number>: passed: mocked.derefed[4] for: true MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[4] for: true
MatchersRanges.tests.cpp:<line number>: passed: mocked, !allMatch for: { 1, 2, 3, 4, 5 } not all match matches undescribed predicate MatchersRanges.tests.cpp:<line number>: passed: mocked, !allMatch for: { 1, 2, 3, 4, 5 } not all match matches undescribed predicate
MatchersRanges.tests.cpp:<line number>: passed: mocked.derefed[0] for: true MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[0] for: true
MatchersRanges.tests.cpp:<line number>: passed: mocked.derefed[1] for: true MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[1] for: true
MatchersRanges.tests.cpp:<line number>: passed: mocked.derefed[2] for: true MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[2] for: true
MatchersRanges.tests.cpp:<line number>: passed: !(mocked.derefed[3]) for: !false MatchersRanges.tests.cpp:<line number>: passed: !(mocked.m_derefed[3]) for: !false
MatchersRanges.tests.cpp:<line number>: passed: !(mocked.derefed[4]) for: !false MatchersRanges.tests.cpp:<line number>: passed: !(mocked.m_derefed[4]) for: !false
MatchersRanges.tests.cpp:<line number>: passed: data, AnyMatch(SizeIs(5)) for: { { 0, 1, 2, 3, 5 }, { 4, -3, -2, 5, 0 }, { 0, 0, 0, 5, 0 }, { 0, -5, 0, 5, 0 }, { 1, 0, 0, -1, 5 } } any match has size == 5 MatchersRanges.tests.cpp:<line number>: passed: data, AnyMatch(SizeIs(5)) for: { { 0, 1, 2, 3, 5 }, { 4, -3, -2, 5, 0 }, { 0, 0, 0, 5, 0 }, { 0, -5, 0, 5, 0 }, { 1, 0, 0, -1, 5 } } any match has size == 5
MatchersRanges.tests.cpp:<line number>: passed: data, !AnyMatch(Contains(0) && Contains(10)) for: { { 0, 1, 2, 3, 5 }, { 4, -3, -2, 5, 0 }, { 0, 0, 0, 5, 0 }, { 0, -5, 0, 5, 0 }, { 1, 0, 0, -1, 5 } } not any match ( contains element 0 and contains element 10 ) MatchersRanges.tests.cpp:<line number>: passed: data, !AnyMatch(Contains(0) && Contains(10)) for: { { 0, 1, 2, 3, 5 }, { 4, -3, -2, 5, 0 }, { 0, 0, 0, 5, 0 }, { 0, -5, 0, 5, 0 }, { 1, 0, 0, -1, 5 } } not any match ( contains element 0 and contains element 10 )
MatchersRanges.tests.cpp:<line number>: passed: needs_adl, AnyMatch( Predicate<int>( []( int elem ) { return elem < 3; } ) ) for: { 1, 2, 3, 4, 5 } any match matches undescribed predicate MatchersRanges.tests.cpp:<line number>: passed: needs_adl, AnyMatch( Predicate<int>( []( int elem ) { return elem < 3; } ) ) for: { 1, 2, 3, 4, 5 } any match matches undescribed predicate
MatchersRanges.tests.cpp:<line number>: passed: mocked, !anyMatch for: { 1, 2, 3, 4, 5 } not any match matches undescribed predicate MatchersRanges.tests.cpp:<line number>: passed: mocked, !anyMatch for: { 1, 2, 3, 4, 5 } not any match matches undescribed predicate
MatchersRanges.tests.cpp:<line number>: passed: mocked.derefed[0] for: true MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[0] for: true
MatchersRanges.tests.cpp:<line number>: passed: mocked.derefed[1] for: true MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[1] for: true
MatchersRanges.tests.cpp:<line number>: passed: mocked.derefed[2] for: true MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[2] for: true
MatchersRanges.tests.cpp:<line number>: passed: mocked.derefed[3] for: true MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[3] for: true
MatchersRanges.tests.cpp:<line number>: passed: mocked.derefed[4] for: true MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[4] for: true
MatchersRanges.tests.cpp:<line number>: passed: mocked, anyMatch for: { 1, 2, 3, 4, 5 } any match matches undescribed predicate MatchersRanges.tests.cpp:<line number>: passed: mocked, anyMatch for: { 1, 2, 3, 4, 5 } any match matches undescribed predicate
MatchersRanges.tests.cpp:<line number>: passed: mocked.derefed[0] for: true MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[0] for: true
MatchersRanges.tests.cpp:<line number>: passed: !(mocked.derefed[1]) for: !false MatchersRanges.tests.cpp:<line number>: passed: !(mocked.m_derefed[1]) for: !false
MatchersRanges.tests.cpp:<line number>: passed: !(mocked.derefed[2]) for: !false MatchersRanges.tests.cpp:<line number>: passed: !(mocked.m_derefed[2]) for: !false
MatchersRanges.tests.cpp:<line number>: passed: !(mocked.derefed[3]) for: !false MatchersRanges.tests.cpp:<line number>: passed: !(mocked.m_derefed[3]) for: !false
MatchersRanges.tests.cpp:<line number>: passed: !(mocked.derefed[4]) for: !false MatchersRanges.tests.cpp:<line number>: passed: !(mocked.m_derefed[4]) for: !false
MatchersRanges.tests.cpp:<line number>: passed: data, NoneMatch(SizeIs(6)) for: { { 0, 1, 2, 3, 5 }, { 4, -3, -2, 5, 0 }, { 0, 0, 0, 5, 0 }, { 0, -5, 0, 5, 0 }, { 1, 0, 0, -1, 5 } } none match has size == 6 MatchersRanges.tests.cpp:<line number>: passed: data, NoneMatch(SizeIs(6)) for: { { 0, 1, 2, 3, 5 }, { 4, -3, -2, 5, 0 }, { 0, 0, 0, 5, 0 }, { 0, -5, 0, 5, 0 }, { 1, 0, 0, -1, 5 } } none match has size == 6
MatchersRanges.tests.cpp:<line number>: passed: data, !NoneMatch(Contains(0) && Contains(1)) for: { { 0, 1, 2, 3, 5 }, { 4, -3, -2, 5, 0 }, { 0, 0, 0, 5, 0 }, { 0, -5, 0, 5, 0 }, { 1, 0, 0, -1, 5 } } not none match ( contains element 0 and contains element 1 ) MatchersRanges.tests.cpp:<line number>: passed: data, !NoneMatch(Contains(0) && Contains(1)) for: { { 0, 1, 2, 3, 5 }, { 4, -3, -2, 5, 0 }, { 0, 0, 0, 5, 0 }, { 0, -5, 0, 5, 0 }, { 1, 0, 0, -1, 5 } } not none match ( contains element 0 and contains element 1 )
MatchersRanges.tests.cpp:<line number>: passed: needs_adl, NoneMatch( Predicate<int>( []( int elem ) { return elem > 6; } ) ) for: { 1, 2, 3, 4, 5 } none match matches undescribed predicate MatchersRanges.tests.cpp:<line number>: passed: needs_adl, NoneMatch( Predicate<int>( []( int elem ) { return elem > 6; } ) ) for: { 1, 2, 3, 4, 5 } none match matches undescribed predicate
MatchersRanges.tests.cpp:<line number>: passed: mocked, noneMatch for: { 1, 2, 3, 4, 5 } none match matches undescribed predicate MatchersRanges.tests.cpp:<line number>: passed: mocked, noneMatch for: { 1, 2, 3, 4, 5 } none match matches undescribed predicate
MatchersRanges.tests.cpp:<line number>: passed: mocked.derefed[0] for: true MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[0] for: true
MatchersRanges.tests.cpp:<line number>: passed: mocked.derefed[1] for: true MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[1] for: true
MatchersRanges.tests.cpp:<line number>: passed: mocked.derefed[2] for: true MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[2] for: true
MatchersRanges.tests.cpp:<line number>: passed: mocked.derefed[3] for: true MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[3] for: true
MatchersRanges.tests.cpp:<line number>: passed: mocked.derefed[4] for: true MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[4] for: true
MatchersRanges.tests.cpp:<line number>: passed: mocked, !noneMatch for: { 1, 2, 3, 4, 5 } not none match matches undescribed predicate MatchersRanges.tests.cpp:<line number>: passed: mocked, !noneMatch for: { 1, 2, 3, 4, 5 } not none match matches undescribed predicate
MatchersRanges.tests.cpp:<line number>: passed: mocked.derefed[0] for: true MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[0] for: true
MatchersRanges.tests.cpp:<line number>: passed: !(mocked.derefed[1]) for: !false MatchersRanges.tests.cpp:<line number>: passed: !(mocked.m_derefed[1]) for: !false
MatchersRanges.tests.cpp:<line number>: passed: !(mocked.derefed[2]) for: !false MatchersRanges.tests.cpp:<line number>: passed: !(mocked.m_derefed[2]) for: !false
MatchersRanges.tests.cpp:<line number>: passed: !(mocked.derefed[3]) for: !false MatchersRanges.tests.cpp:<line number>: passed: !(mocked.m_derefed[3]) for: !false
MatchersRanges.tests.cpp:<line number>: passed: !(mocked.derefed[4]) for: !false MatchersRanges.tests.cpp:<line number>: passed: !(mocked.m_derefed[4]) for: !false
MatchersRanges.tests.cpp:<line number>: passed: empty_vec, SizeIs(0) for: { } has size == 0 MatchersRanges.tests.cpp:<line number>: passed: empty_vec, SizeIs(0) for: { } has size == 0
MatchersRanges.tests.cpp:<line number>: passed: empty_vec, !SizeIs(2) for: { } not has size == 2 MatchersRanges.tests.cpp:<line number>: passed: empty_vec, !SizeIs(2) for: { } not has size == 2
MatchersRanges.tests.cpp:<line number>: passed: empty_vec, SizeIs(Lt(2)) for: { } size matches is less than 2 MatchersRanges.tests.cpp:<line number>: passed: empty_vec, SizeIs(Lt(2)) for: { } size matches is less than 2

View File

@ -1960,47 +1960,47 @@ MatchersRanges.tests.cpp:<line number>: passed: data, AllMatch(SizeIs(5)) for: {
MatchersRanges.tests.cpp:<line number>: passed: data, !AllMatch(Contains(0) && Contains(1)) for: { { 0, 1, 2, 3, 5 }, { 4, -3, -2, 5, 0 }, { 0, 0, 0, 5, 0 }, { 0, -5, 0, 5, 0 }, { 1, 0, 0, -1, 5 } } not all match ( contains element 0 and contains element 1 ) MatchersRanges.tests.cpp:<line number>: passed: data, !AllMatch(Contains(0) && Contains(1)) for: { { 0, 1, 2, 3, 5 }, { 4, -3, -2, 5, 0 }, { 0, 0, 0, 5, 0 }, { 0, -5, 0, 5, 0 }, { 1, 0, 0, -1, 5 } } not all match ( contains element 0 and contains element 1 )
MatchersRanges.tests.cpp:<line number>: passed: needs_adl, AllMatch( Predicate<int>( []( int elem ) { return elem < 6; } ) ) for: { 1, 2, 3, 4, 5 } all match matches undescribed predicate MatchersRanges.tests.cpp:<line number>: passed: needs_adl, AllMatch( Predicate<int>( []( int elem ) { return elem < 6; } ) ) for: { 1, 2, 3, 4, 5 } all match matches undescribed predicate
MatchersRanges.tests.cpp:<line number>: passed: mocked, allMatch for: { 1, 2, 3, 4, 5 } all match matches undescribed predicate MatchersRanges.tests.cpp:<line number>: passed: mocked, allMatch for: { 1, 2, 3, 4, 5 } all match matches undescribed predicate
MatchersRanges.tests.cpp:<line number>: passed: mocked.derefed[0] for: true MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[0] for: true
MatchersRanges.tests.cpp:<line number>: passed: mocked.derefed[1] for: true MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[1] for: true
MatchersRanges.tests.cpp:<line number>: passed: mocked.derefed[2] for: true MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[2] for: true
MatchersRanges.tests.cpp:<line number>: passed: mocked.derefed[3] for: true MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[3] for: true
MatchersRanges.tests.cpp:<line number>: passed: mocked.derefed[4] for: true MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[4] for: true
MatchersRanges.tests.cpp:<line number>: passed: mocked, !allMatch for: { 1, 2, 3, 4, 5 } not all match matches undescribed predicate MatchersRanges.tests.cpp:<line number>: passed: mocked, !allMatch for: { 1, 2, 3, 4, 5 } not all match matches undescribed predicate
MatchersRanges.tests.cpp:<line number>: passed: mocked.derefed[0] for: true MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[0] for: true
MatchersRanges.tests.cpp:<line number>: passed: mocked.derefed[1] for: true MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[1] for: true
MatchersRanges.tests.cpp:<line number>: passed: mocked.derefed[2] for: true MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[2] for: true
MatchersRanges.tests.cpp:<line number>: passed: !(mocked.derefed[3]) for: !false MatchersRanges.tests.cpp:<line number>: passed: !(mocked.m_derefed[3]) for: !false
MatchersRanges.tests.cpp:<line number>: passed: !(mocked.derefed[4]) for: !false MatchersRanges.tests.cpp:<line number>: passed: !(mocked.m_derefed[4]) for: !false
MatchersRanges.tests.cpp:<line number>: passed: data, AnyMatch(SizeIs(5)) for: { { 0, 1, 2, 3, 5 }, { 4, -3, -2, 5, 0 }, { 0, 0, 0, 5, 0 }, { 0, -5, 0, 5, 0 }, { 1, 0, 0, -1, 5 } } any match has size == 5 MatchersRanges.tests.cpp:<line number>: passed: data, AnyMatch(SizeIs(5)) for: { { 0, 1, 2, 3, 5 }, { 4, -3, -2, 5, 0 }, { 0, 0, 0, 5, 0 }, { 0, -5, 0, 5, 0 }, { 1, 0, 0, -1, 5 } } any match has size == 5
MatchersRanges.tests.cpp:<line number>: passed: data, !AnyMatch(Contains(0) && Contains(10)) for: { { 0, 1, 2, 3, 5 }, { 4, -3, -2, 5, 0 }, { 0, 0, 0, 5, 0 }, { 0, -5, 0, 5, 0 }, { 1, 0, 0, -1, 5 } } not any match ( contains element 0 and contains element 10 ) MatchersRanges.tests.cpp:<line number>: passed: data, !AnyMatch(Contains(0) && Contains(10)) for: { { 0, 1, 2, 3, 5 }, { 4, -3, -2, 5, 0 }, { 0, 0, 0, 5, 0 }, { 0, -5, 0, 5, 0 }, { 1, 0, 0, -1, 5 } } not any match ( contains element 0 and contains element 10 )
MatchersRanges.tests.cpp:<line number>: passed: needs_adl, AnyMatch( Predicate<int>( []( int elem ) { return elem < 3; } ) ) for: { 1, 2, 3, 4, 5 } any match matches undescribed predicate MatchersRanges.tests.cpp:<line number>: passed: needs_adl, AnyMatch( Predicate<int>( []( int elem ) { return elem < 3; } ) ) for: { 1, 2, 3, 4, 5 } any match matches undescribed predicate
MatchersRanges.tests.cpp:<line number>: passed: mocked, !anyMatch for: { 1, 2, 3, 4, 5 } not any match matches undescribed predicate MatchersRanges.tests.cpp:<line number>: passed: mocked, !anyMatch for: { 1, 2, 3, 4, 5 } not any match matches undescribed predicate
MatchersRanges.tests.cpp:<line number>: passed: mocked.derefed[0] for: true MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[0] for: true
MatchersRanges.tests.cpp:<line number>: passed: mocked.derefed[1] for: true MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[1] for: true
MatchersRanges.tests.cpp:<line number>: passed: mocked.derefed[2] for: true MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[2] for: true
MatchersRanges.tests.cpp:<line number>: passed: mocked.derefed[3] for: true MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[3] for: true
MatchersRanges.tests.cpp:<line number>: passed: mocked.derefed[4] for: true MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[4] for: true
MatchersRanges.tests.cpp:<line number>: passed: mocked, anyMatch for: { 1, 2, 3, 4, 5 } any match matches undescribed predicate MatchersRanges.tests.cpp:<line number>: passed: mocked, anyMatch for: { 1, 2, 3, 4, 5 } any match matches undescribed predicate
MatchersRanges.tests.cpp:<line number>: passed: mocked.derefed[0] for: true MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[0] for: true
MatchersRanges.tests.cpp:<line number>: passed: !(mocked.derefed[1]) for: !false MatchersRanges.tests.cpp:<line number>: passed: !(mocked.m_derefed[1]) for: !false
MatchersRanges.tests.cpp:<line number>: passed: !(mocked.derefed[2]) for: !false MatchersRanges.tests.cpp:<line number>: passed: !(mocked.m_derefed[2]) for: !false
MatchersRanges.tests.cpp:<line number>: passed: !(mocked.derefed[3]) for: !false MatchersRanges.tests.cpp:<line number>: passed: !(mocked.m_derefed[3]) for: !false
MatchersRanges.tests.cpp:<line number>: passed: !(mocked.derefed[4]) for: !false MatchersRanges.tests.cpp:<line number>: passed: !(mocked.m_derefed[4]) for: !false
MatchersRanges.tests.cpp:<line number>: passed: data, NoneMatch(SizeIs(6)) for: { { 0, 1, 2, 3, 5 }, { 4, -3, -2, 5, 0 }, { 0, 0, 0, 5, 0 }, { 0, -5, 0, 5, 0 }, { 1, 0, 0, -1, 5 } } none match has size == 6 MatchersRanges.tests.cpp:<line number>: passed: data, NoneMatch(SizeIs(6)) for: { { 0, 1, 2, 3, 5 }, { 4, -3, -2, 5, 0 }, { 0, 0, 0, 5, 0 }, { 0, -5, 0, 5, 0 }, { 1, 0, 0, -1, 5 } } none match has size == 6
MatchersRanges.tests.cpp:<line number>: passed: data, !NoneMatch(Contains(0) && Contains(1)) for: { { 0, 1, 2, 3, 5 }, { 4, -3, -2, 5, 0 }, { 0, 0, 0, 5, 0 }, { 0, -5, 0, 5, 0 }, { 1, 0, 0, -1, 5 } } not none match ( contains element 0 and contains element 1 ) MatchersRanges.tests.cpp:<line number>: passed: data, !NoneMatch(Contains(0) && Contains(1)) for: { { 0, 1, 2, 3, 5 }, { 4, -3, -2, 5, 0 }, { 0, 0, 0, 5, 0 }, { 0, -5, 0, 5, 0 }, { 1, 0, 0, -1, 5 } } not none match ( contains element 0 and contains element 1 )
MatchersRanges.tests.cpp:<line number>: passed: needs_adl, NoneMatch( Predicate<int>( []( int elem ) { return elem > 6; } ) ) for: { 1, 2, 3, 4, 5 } none match matches undescribed predicate MatchersRanges.tests.cpp:<line number>: passed: needs_adl, NoneMatch( Predicate<int>( []( int elem ) { return elem > 6; } ) ) for: { 1, 2, 3, 4, 5 } none match matches undescribed predicate
MatchersRanges.tests.cpp:<line number>: passed: mocked, noneMatch for: { 1, 2, 3, 4, 5 } none match matches undescribed predicate MatchersRanges.tests.cpp:<line number>: passed: mocked, noneMatch for: { 1, 2, 3, 4, 5 } none match matches undescribed predicate
MatchersRanges.tests.cpp:<line number>: passed: mocked.derefed[0] for: true MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[0] for: true
MatchersRanges.tests.cpp:<line number>: passed: mocked.derefed[1] for: true MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[1] for: true
MatchersRanges.tests.cpp:<line number>: passed: mocked.derefed[2] for: true MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[2] for: true
MatchersRanges.tests.cpp:<line number>: passed: mocked.derefed[3] for: true MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[3] for: true
MatchersRanges.tests.cpp:<line number>: passed: mocked.derefed[4] for: true MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[4] for: true
MatchersRanges.tests.cpp:<line number>: passed: mocked, !noneMatch for: { 1, 2, 3, 4, 5 } not none match matches undescribed predicate MatchersRanges.tests.cpp:<line number>: passed: mocked, !noneMatch for: { 1, 2, 3, 4, 5 } not none match matches undescribed predicate
MatchersRanges.tests.cpp:<line number>: passed: mocked.derefed[0] for: true MatchersRanges.tests.cpp:<line number>: passed: mocked.m_derefed[0] for: true
MatchersRanges.tests.cpp:<line number>: passed: !(mocked.derefed[1]) for: !false MatchersRanges.tests.cpp:<line number>: passed: !(mocked.m_derefed[1]) for: !false
MatchersRanges.tests.cpp:<line number>: passed: !(mocked.derefed[2]) for: !false MatchersRanges.tests.cpp:<line number>: passed: !(mocked.m_derefed[2]) for: !false
MatchersRanges.tests.cpp:<line number>: passed: !(mocked.derefed[3]) for: !false MatchersRanges.tests.cpp:<line number>: passed: !(mocked.m_derefed[3]) for: !false
MatchersRanges.tests.cpp:<line number>: passed: !(mocked.derefed[4]) for: !false MatchersRanges.tests.cpp:<line number>: passed: !(mocked.m_derefed[4]) for: !false
MatchersRanges.tests.cpp:<line number>: passed: empty_vec, SizeIs(0) for: { } has size == 0 MatchersRanges.tests.cpp:<line number>: passed: empty_vec, SizeIs(0) for: { } has size == 0
MatchersRanges.tests.cpp:<line number>: passed: empty_vec, !SizeIs(2) for: { } not has size == 2 MatchersRanges.tests.cpp:<line number>: passed: empty_vec, !SizeIs(2) for: { } not has size == 2
MatchersRanges.tests.cpp:<line number>: passed: empty_vec, SizeIs(Lt(2)) for: { } size matches is less than 2 MatchersRanges.tests.cpp:<line number>: passed: empty_vec, SizeIs(Lt(2)) for: { } size matches is less than 2

View File

@ -13955,27 +13955,27 @@ with expansion:
{ 1, 2, 3, 4, 5 } all match matches undescribed predicate { 1, 2, 3, 4, 5 } all match matches undescribed predicate
MatchersRanges.tests.cpp:<line number>: PASSED: MatchersRanges.tests.cpp:<line number>: PASSED:
REQUIRE( mocked.derefed[0] ) REQUIRE( mocked.m_derefed[0] )
with expansion: with expansion:
true true
MatchersRanges.tests.cpp:<line number>: PASSED: MatchersRanges.tests.cpp:<line number>: PASSED:
REQUIRE( mocked.derefed[1] ) REQUIRE( mocked.m_derefed[1] )
with expansion: with expansion:
true true
MatchersRanges.tests.cpp:<line number>: PASSED: MatchersRanges.tests.cpp:<line number>: PASSED:
REQUIRE( mocked.derefed[2] ) REQUIRE( mocked.m_derefed[2] )
with expansion: with expansion:
true true
MatchersRanges.tests.cpp:<line number>: PASSED: MatchersRanges.tests.cpp:<line number>: PASSED:
REQUIRE( mocked.derefed[3] ) REQUIRE( mocked.m_derefed[3] )
with expansion: with expansion:
true true
MatchersRanges.tests.cpp:<line number>: PASSED: MatchersRanges.tests.cpp:<line number>: PASSED:
REQUIRE( mocked.derefed[4] ) REQUIRE( mocked.m_derefed[4] )
with expansion: with expansion:
true true
@ -13993,27 +13993,27 @@ with expansion:
{ 1, 2, 3, 4, 5 } not all match matches undescribed predicate { 1, 2, 3, 4, 5 } not all match matches undescribed predicate
MatchersRanges.tests.cpp:<line number>: PASSED: MatchersRanges.tests.cpp:<line number>: PASSED:
REQUIRE( mocked.derefed[0] ) REQUIRE( mocked.m_derefed[0] )
with expansion: with expansion:
true true
MatchersRanges.tests.cpp:<line number>: PASSED: MatchersRanges.tests.cpp:<line number>: PASSED:
REQUIRE( mocked.derefed[1] ) REQUIRE( mocked.m_derefed[1] )
with expansion: with expansion:
true true
MatchersRanges.tests.cpp:<line number>: PASSED: MatchersRanges.tests.cpp:<line number>: PASSED:
REQUIRE( mocked.derefed[2] ) REQUIRE( mocked.m_derefed[2] )
with expansion: with expansion:
true true
MatchersRanges.tests.cpp:<line number>: PASSED: MatchersRanges.tests.cpp:<line number>: PASSED:
REQUIRE_FALSE( mocked.derefed[3] ) REQUIRE_FALSE( mocked.m_derefed[3] )
with expansion: with expansion:
!false !false
MatchersRanges.tests.cpp:<line number>: PASSED: MatchersRanges.tests.cpp:<line number>: PASSED:
REQUIRE_FALSE( mocked.derefed[4] ) REQUIRE_FALSE( mocked.m_derefed[4] )
with expansion: with expansion:
!false !false
@ -14063,27 +14063,27 @@ with expansion:
{ 1, 2, 3, 4, 5 } not any match matches undescribed predicate { 1, 2, 3, 4, 5 } not any match matches undescribed predicate
MatchersRanges.tests.cpp:<line number>: PASSED: MatchersRanges.tests.cpp:<line number>: PASSED:
REQUIRE( mocked.derefed[0] ) REQUIRE( mocked.m_derefed[0] )
with expansion: with expansion:
true true
MatchersRanges.tests.cpp:<line number>: PASSED: MatchersRanges.tests.cpp:<line number>: PASSED:
REQUIRE( mocked.derefed[1] ) REQUIRE( mocked.m_derefed[1] )
with expansion: with expansion:
true true
MatchersRanges.tests.cpp:<line number>: PASSED: MatchersRanges.tests.cpp:<line number>: PASSED:
REQUIRE( mocked.derefed[2] ) REQUIRE( mocked.m_derefed[2] )
with expansion: with expansion:
true true
MatchersRanges.tests.cpp:<line number>: PASSED: MatchersRanges.tests.cpp:<line number>: PASSED:
REQUIRE( mocked.derefed[3] ) REQUIRE( mocked.m_derefed[3] )
with expansion: with expansion:
true true
MatchersRanges.tests.cpp:<line number>: PASSED: MatchersRanges.tests.cpp:<line number>: PASSED:
REQUIRE( mocked.derefed[4] ) REQUIRE( mocked.m_derefed[4] )
with expansion: with expansion:
true true
@ -14101,27 +14101,27 @@ with expansion:
{ 1, 2, 3, 4, 5 } any match matches undescribed predicate { 1, 2, 3, 4, 5 } any match matches undescribed predicate
MatchersRanges.tests.cpp:<line number>: PASSED: MatchersRanges.tests.cpp:<line number>: PASSED:
REQUIRE( mocked.derefed[0] ) REQUIRE( mocked.m_derefed[0] )
with expansion: with expansion:
true true
MatchersRanges.tests.cpp:<line number>: PASSED: MatchersRanges.tests.cpp:<line number>: PASSED:
REQUIRE_FALSE( mocked.derefed[1] ) REQUIRE_FALSE( mocked.m_derefed[1] )
with expansion: with expansion:
!false !false
MatchersRanges.tests.cpp:<line number>: PASSED: MatchersRanges.tests.cpp:<line number>: PASSED:
REQUIRE_FALSE( mocked.derefed[2] ) REQUIRE_FALSE( mocked.m_derefed[2] )
with expansion: with expansion:
!false !false
MatchersRanges.tests.cpp:<line number>: PASSED: MatchersRanges.tests.cpp:<line number>: PASSED:
REQUIRE_FALSE( mocked.derefed[3] ) REQUIRE_FALSE( mocked.m_derefed[3] )
with expansion: with expansion:
!false !false
MatchersRanges.tests.cpp:<line number>: PASSED: MatchersRanges.tests.cpp:<line number>: PASSED:
REQUIRE_FALSE( mocked.derefed[4] ) REQUIRE_FALSE( mocked.m_derefed[4] )
with expansion: with expansion:
!false !false
@ -14171,27 +14171,27 @@ with expansion:
{ 1, 2, 3, 4, 5 } none match matches undescribed predicate { 1, 2, 3, 4, 5 } none match matches undescribed predicate
MatchersRanges.tests.cpp:<line number>: PASSED: MatchersRanges.tests.cpp:<line number>: PASSED:
REQUIRE( mocked.derefed[0] ) REQUIRE( mocked.m_derefed[0] )
with expansion: with expansion:
true true
MatchersRanges.tests.cpp:<line number>: PASSED: MatchersRanges.tests.cpp:<line number>: PASSED:
REQUIRE( mocked.derefed[1] ) REQUIRE( mocked.m_derefed[1] )
with expansion: with expansion:
true true
MatchersRanges.tests.cpp:<line number>: PASSED: MatchersRanges.tests.cpp:<line number>: PASSED:
REQUIRE( mocked.derefed[2] ) REQUIRE( mocked.m_derefed[2] )
with expansion: with expansion:
true true
MatchersRanges.tests.cpp:<line number>: PASSED: MatchersRanges.tests.cpp:<line number>: PASSED:
REQUIRE( mocked.derefed[3] ) REQUIRE( mocked.m_derefed[3] )
with expansion: with expansion:
true true
MatchersRanges.tests.cpp:<line number>: PASSED: MatchersRanges.tests.cpp:<line number>: PASSED:
REQUIRE( mocked.derefed[4] ) REQUIRE( mocked.m_derefed[4] )
with expansion: with expansion:
true true
@ -14209,27 +14209,27 @@ with expansion:
{ 1, 2, 3, 4, 5 } not none match matches undescribed predicate { 1, 2, 3, 4, 5 } not none match matches undescribed predicate
MatchersRanges.tests.cpp:<line number>: PASSED: MatchersRanges.tests.cpp:<line number>: PASSED:
REQUIRE( mocked.derefed[0] ) REQUIRE( mocked.m_derefed[0] )
with expansion: with expansion:
true true
MatchersRanges.tests.cpp:<line number>: PASSED: MatchersRanges.tests.cpp:<line number>: PASSED:
REQUIRE_FALSE( mocked.derefed[1] ) REQUIRE_FALSE( mocked.m_derefed[1] )
with expansion: with expansion:
!false !false
MatchersRanges.tests.cpp:<line number>: PASSED: MatchersRanges.tests.cpp:<line number>: PASSED:
REQUIRE_FALSE( mocked.derefed[2] ) REQUIRE_FALSE( mocked.m_derefed[2] )
with expansion: with expansion:
!false !false
MatchersRanges.tests.cpp:<line number>: PASSED: MatchersRanges.tests.cpp:<line number>: PASSED:
REQUIRE_FALSE( mocked.derefed[3] ) REQUIRE_FALSE( mocked.m_derefed[3] )
with expansion: with expansion:
!false !false
MatchersRanges.tests.cpp:<line number>: PASSED: MatchersRanges.tests.cpp:<line number>: PASSED:
REQUIRE_FALSE( mocked.derefed[4] ) REQUIRE_FALSE( mocked.m_derefed[4] )
with expansion: with expansion:
!false !false

View File

@ -13948,27 +13948,27 @@ with expansion:
{ 1, 2, 3, 4, 5 } all match matches undescribed predicate { 1, 2, 3, 4, 5 } all match matches undescribed predicate
MatchersRanges.tests.cpp:<line number>: PASSED: MatchersRanges.tests.cpp:<line number>: PASSED:
REQUIRE( mocked.derefed[0] ) REQUIRE( mocked.m_derefed[0] )
with expansion: with expansion:
true true
MatchersRanges.tests.cpp:<line number>: PASSED: MatchersRanges.tests.cpp:<line number>: PASSED:
REQUIRE( mocked.derefed[1] ) REQUIRE( mocked.m_derefed[1] )
with expansion: with expansion:
true true
MatchersRanges.tests.cpp:<line number>: PASSED: MatchersRanges.tests.cpp:<line number>: PASSED:
REQUIRE( mocked.derefed[2] ) REQUIRE( mocked.m_derefed[2] )
with expansion: with expansion:
true true
MatchersRanges.tests.cpp:<line number>: PASSED: MatchersRanges.tests.cpp:<line number>: PASSED:
REQUIRE( mocked.derefed[3] ) REQUIRE( mocked.m_derefed[3] )
with expansion: with expansion:
true true
MatchersRanges.tests.cpp:<line number>: PASSED: MatchersRanges.tests.cpp:<line number>: PASSED:
REQUIRE( mocked.derefed[4] ) REQUIRE( mocked.m_derefed[4] )
with expansion: with expansion:
true true
@ -13986,27 +13986,27 @@ with expansion:
{ 1, 2, 3, 4, 5 } not all match matches undescribed predicate { 1, 2, 3, 4, 5 } not all match matches undescribed predicate
MatchersRanges.tests.cpp:<line number>: PASSED: MatchersRanges.tests.cpp:<line number>: PASSED:
REQUIRE( mocked.derefed[0] ) REQUIRE( mocked.m_derefed[0] )
with expansion: with expansion:
true true
MatchersRanges.tests.cpp:<line number>: PASSED: MatchersRanges.tests.cpp:<line number>: PASSED:
REQUIRE( mocked.derefed[1] ) REQUIRE( mocked.m_derefed[1] )
with expansion: with expansion:
true true
MatchersRanges.tests.cpp:<line number>: PASSED: MatchersRanges.tests.cpp:<line number>: PASSED:
REQUIRE( mocked.derefed[2] ) REQUIRE( mocked.m_derefed[2] )
with expansion: with expansion:
true true
MatchersRanges.tests.cpp:<line number>: PASSED: MatchersRanges.tests.cpp:<line number>: PASSED:
REQUIRE_FALSE( mocked.derefed[3] ) REQUIRE_FALSE( mocked.m_derefed[3] )
with expansion: with expansion:
!false !false
MatchersRanges.tests.cpp:<line number>: PASSED: MatchersRanges.tests.cpp:<line number>: PASSED:
REQUIRE_FALSE( mocked.derefed[4] ) REQUIRE_FALSE( mocked.m_derefed[4] )
with expansion: with expansion:
!false !false
@ -14056,27 +14056,27 @@ with expansion:
{ 1, 2, 3, 4, 5 } not any match matches undescribed predicate { 1, 2, 3, 4, 5 } not any match matches undescribed predicate
MatchersRanges.tests.cpp:<line number>: PASSED: MatchersRanges.tests.cpp:<line number>: PASSED:
REQUIRE( mocked.derefed[0] ) REQUIRE( mocked.m_derefed[0] )
with expansion: with expansion:
true true
MatchersRanges.tests.cpp:<line number>: PASSED: MatchersRanges.tests.cpp:<line number>: PASSED:
REQUIRE( mocked.derefed[1] ) REQUIRE( mocked.m_derefed[1] )
with expansion: with expansion:
true true
MatchersRanges.tests.cpp:<line number>: PASSED: MatchersRanges.tests.cpp:<line number>: PASSED:
REQUIRE( mocked.derefed[2] ) REQUIRE( mocked.m_derefed[2] )
with expansion: with expansion:
true true
MatchersRanges.tests.cpp:<line number>: PASSED: MatchersRanges.tests.cpp:<line number>: PASSED:
REQUIRE( mocked.derefed[3] ) REQUIRE( mocked.m_derefed[3] )
with expansion: with expansion:
true true
MatchersRanges.tests.cpp:<line number>: PASSED: MatchersRanges.tests.cpp:<line number>: PASSED:
REQUIRE( mocked.derefed[4] ) REQUIRE( mocked.m_derefed[4] )
with expansion: with expansion:
true true
@ -14094,27 +14094,27 @@ with expansion:
{ 1, 2, 3, 4, 5 } any match matches undescribed predicate { 1, 2, 3, 4, 5 } any match matches undescribed predicate
MatchersRanges.tests.cpp:<line number>: PASSED: MatchersRanges.tests.cpp:<line number>: PASSED:
REQUIRE( mocked.derefed[0] ) REQUIRE( mocked.m_derefed[0] )
with expansion: with expansion:
true true
MatchersRanges.tests.cpp:<line number>: PASSED: MatchersRanges.tests.cpp:<line number>: PASSED:
REQUIRE_FALSE( mocked.derefed[1] ) REQUIRE_FALSE( mocked.m_derefed[1] )
with expansion: with expansion:
!false !false
MatchersRanges.tests.cpp:<line number>: PASSED: MatchersRanges.tests.cpp:<line number>: PASSED:
REQUIRE_FALSE( mocked.derefed[2] ) REQUIRE_FALSE( mocked.m_derefed[2] )
with expansion: with expansion:
!false !false
MatchersRanges.tests.cpp:<line number>: PASSED: MatchersRanges.tests.cpp:<line number>: PASSED:
REQUIRE_FALSE( mocked.derefed[3] ) REQUIRE_FALSE( mocked.m_derefed[3] )
with expansion: with expansion:
!false !false
MatchersRanges.tests.cpp:<line number>: PASSED: MatchersRanges.tests.cpp:<line number>: PASSED:
REQUIRE_FALSE( mocked.derefed[4] ) REQUIRE_FALSE( mocked.m_derefed[4] )
with expansion: with expansion:
!false !false
@ -14164,27 +14164,27 @@ with expansion:
{ 1, 2, 3, 4, 5 } none match matches undescribed predicate { 1, 2, 3, 4, 5 } none match matches undescribed predicate
MatchersRanges.tests.cpp:<line number>: PASSED: MatchersRanges.tests.cpp:<line number>: PASSED:
REQUIRE( mocked.derefed[0] ) REQUIRE( mocked.m_derefed[0] )
with expansion: with expansion:
true true
MatchersRanges.tests.cpp:<line number>: PASSED: MatchersRanges.tests.cpp:<line number>: PASSED:
REQUIRE( mocked.derefed[1] ) REQUIRE( mocked.m_derefed[1] )
with expansion: with expansion:
true true
MatchersRanges.tests.cpp:<line number>: PASSED: MatchersRanges.tests.cpp:<line number>: PASSED:
REQUIRE( mocked.derefed[2] ) REQUIRE( mocked.m_derefed[2] )
with expansion: with expansion:
true true
MatchersRanges.tests.cpp:<line number>: PASSED: MatchersRanges.tests.cpp:<line number>: PASSED:
REQUIRE( mocked.derefed[3] ) REQUIRE( mocked.m_derefed[3] )
with expansion: with expansion:
true true
MatchersRanges.tests.cpp:<line number>: PASSED: MatchersRanges.tests.cpp:<line number>: PASSED:
REQUIRE( mocked.derefed[4] ) REQUIRE( mocked.m_derefed[4] )
with expansion: with expansion:
true true
@ -14202,27 +14202,27 @@ with expansion:
{ 1, 2, 3, 4, 5 } not none match matches undescribed predicate { 1, 2, 3, 4, 5 } not none match matches undescribed predicate
MatchersRanges.tests.cpp:<line number>: PASSED: MatchersRanges.tests.cpp:<line number>: PASSED:
REQUIRE( mocked.derefed[0] ) REQUIRE( mocked.m_derefed[0] )
with expansion: with expansion:
true true
MatchersRanges.tests.cpp:<line number>: PASSED: MatchersRanges.tests.cpp:<line number>: PASSED:
REQUIRE_FALSE( mocked.derefed[1] ) REQUIRE_FALSE( mocked.m_derefed[1] )
with expansion: with expansion:
!false !false
MatchersRanges.tests.cpp:<line number>: PASSED: MatchersRanges.tests.cpp:<line number>: PASSED:
REQUIRE_FALSE( mocked.derefed[2] ) REQUIRE_FALSE( mocked.m_derefed[2] )
with expansion: with expansion:
!false !false
MatchersRanges.tests.cpp:<line number>: PASSED: MatchersRanges.tests.cpp:<line number>: PASSED:
REQUIRE_FALSE( mocked.derefed[3] ) REQUIRE_FALSE( mocked.m_derefed[3] )
with expansion: with expansion:
!false !false
MatchersRanges.tests.cpp:<line number>: PASSED: MatchersRanges.tests.cpp:<line number>: PASSED:
REQUIRE_FALSE( mocked.derefed[4] ) REQUIRE_FALSE( mocked.m_derefed[4] )
with expansion: with expansion:
!false !false

View File

@ -3488,27 +3488,27 @@ ok {test-number} - needs_adl, AllMatch( Predicate<int>( []( int elem ) { return
# Usage of AllMatch range matcher # Usage of AllMatch range matcher
ok {test-number} - mocked, allMatch for: { 1, 2, 3, 4, 5 } all match matches undescribed predicate ok {test-number} - mocked, allMatch for: { 1, 2, 3, 4, 5 } all match matches undescribed predicate
# Usage of AllMatch range matcher # Usage of AllMatch range matcher
ok {test-number} - mocked.derefed[0] for: true ok {test-number} - mocked.m_derefed[0] for: true
# Usage of AllMatch range matcher # Usage of AllMatch range matcher
ok {test-number} - mocked.derefed[1] for: true ok {test-number} - mocked.m_derefed[1] for: true
# Usage of AllMatch range matcher # Usage of AllMatch range matcher
ok {test-number} - mocked.derefed[2] for: true ok {test-number} - mocked.m_derefed[2] for: true
# Usage of AllMatch range matcher # Usage of AllMatch range matcher
ok {test-number} - mocked.derefed[3] for: true ok {test-number} - mocked.m_derefed[3] for: true
# Usage of AllMatch range matcher # Usage of AllMatch range matcher
ok {test-number} - mocked.derefed[4] for: true ok {test-number} - mocked.m_derefed[4] for: true
# Usage of AllMatch range matcher # Usage of AllMatch range matcher
ok {test-number} - mocked, !allMatch for: { 1, 2, 3, 4, 5 } not all match matches undescribed predicate ok {test-number} - mocked, !allMatch for: { 1, 2, 3, 4, 5 } not all match matches undescribed predicate
# Usage of AllMatch range matcher # Usage of AllMatch range matcher
ok {test-number} - mocked.derefed[0] for: true ok {test-number} - mocked.m_derefed[0] for: true
# Usage of AllMatch range matcher # Usage of AllMatch range matcher
ok {test-number} - mocked.derefed[1] for: true ok {test-number} - mocked.m_derefed[1] for: true
# Usage of AllMatch range matcher # Usage of AllMatch range matcher
ok {test-number} - mocked.derefed[2] for: true ok {test-number} - mocked.m_derefed[2] for: true
# Usage of AllMatch range matcher # Usage of AllMatch range matcher
ok {test-number} - !(mocked.derefed[3]) for: !false ok {test-number} - !(mocked.m_derefed[3]) for: !false
# Usage of AllMatch range matcher # Usage of AllMatch range matcher
ok {test-number} - !(mocked.derefed[4]) for: !false ok {test-number} - !(mocked.m_derefed[4]) for: !false
# Usage of AnyMatch range matcher # Usage of AnyMatch range matcher
ok {test-number} - data, AnyMatch(SizeIs(5)) for: { { 0, 1, 2, 3, 5 }, { 4, -3, -2, 5, 0 }, { 0, 0, 0, 5, 0 }, { 0, -5, 0, 5, 0 }, { 1, 0, 0, -1, 5 } } any match has size == 5 ok {test-number} - data, AnyMatch(SizeIs(5)) for: { { 0, 1, 2, 3, 5 }, { 4, -3, -2, 5, 0 }, { 0, 0, 0, 5, 0 }, { 0, -5, 0, 5, 0 }, { 1, 0, 0, -1, 5 } } any match has size == 5
# Usage of AnyMatch range matcher # Usage of AnyMatch range matcher
@ -3518,27 +3518,27 @@ ok {test-number} - needs_adl, AnyMatch( Predicate<int>( []( int elem ) { return
# Usage of AnyMatch range matcher # Usage of AnyMatch range matcher
ok {test-number} - mocked, !anyMatch for: { 1, 2, 3, 4, 5 } not any match matches undescribed predicate ok {test-number} - mocked, !anyMatch for: { 1, 2, 3, 4, 5 } not any match matches undescribed predicate
# Usage of AnyMatch range matcher # Usage of AnyMatch range matcher
ok {test-number} - mocked.derefed[0] for: true ok {test-number} - mocked.m_derefed[0] for: true
# Usage of AnyMatch range matcher # Usage of AnyMatch range matcher
ok {test-number} - mocked.derefed[1] for: true ok {test-number} - mocked.m_derefed[1] for: true
# Usage of AnyMatch range matcher # Usage of AnyMatch range matcher
ok {test-number} - mocked.derefed[2] for: true ok {test-number} - mocked.m_derefed[2] for: true
# Usage of AnyMatch range matcher # Usage of AnyMatch range matcher
ok {test-number} - mocked.derefed[3] for: true ok {test-number} - mocked.m_derefed[3] for: true
# Usage of AnyMatch range matcher # Usage of AnyMatch range matcher
ok {test-number} - mocked.derefed[4] for: true ok {test-number} - mocked.m_derefed[4] for: true
# Usage of AnyMatch range matcher # Usage of AnyMatch range matcher
ok {test-number} - mocked, anyMatch for: { 1, 2, 3, 4, 5 } any match matches undescribed predicate ok {test-number} - mocked, anyMatch for: { 1, 2, 3, 4, 5 } any match matches undescribed predicate
# Usage of AnyMatch range matcher # Usage of AnyMatch range matcher
ok {test-number} - mocked.derefed[0] for: true ok {test-number} - mocked.m_derefed[0] for: true
# Usage of AnyMatch range matcher # Usage of AnyMatch range matcher
ok {test-number} - !(mocked.derefed[1]) for: !false ok {test-number} - !(mocked.m_derefed[1]) for: !false
# Usage of AnyMatch range matcher # Usage of AnyMatch range matcher
ok {test-number} - !(mocked.derefed[2]) for: !false ok {test-number} - !(mocked.m_derefed[2]) for: !false
# Usage of AnyMatch range matcher # Usage of AnyMatch range matcher
ok {test-number} - !(mocked.derefed[3]) for: !false ok {test-number} - !(mocked.m_derefed[3]) for: !false
# Usage of AnyMatch range matcher # Usage of AnyMatch range matcher
ok {test-number} - !(mocked.derefed[4]) for: !false ok {test-number} - !(mocked.m_derefed[4]) for: !false
# Usage of NoneMatch range matcher # Usage of NoneMatch range matcher
ok {test-number} - data, NoneMatch(SizeIs(6)) for: { { 0, 1, 2, 3, 5 }, { 4, -3, -2, 5, 0 }, { 0, 0, 0, 5, 0 }, { 0, -5, 0, 5, 0 }, { 1, 0, 0, -1, 5 } } none match has size == 6 ok {test-number} - data, NoneMatch(SizeIs(6)) for: { { 0, 1, 2, 3, 5 }, { 4, -3, -2, 5, 0 }, { 0, 0, 0, 5, 0 }, { 0, -5, 0, 5, 0 }, { 1, 0, 0, -1, 5 } } none match has size == 6
# Usage of NoneMatch range matcher # Usage of NoneMatch range matcher
@ -3548,27 +3548,27 @@ ok {test-number} - needs_adl, NoneMatch( Predicate<int>( []( int elem ) { return
# Usage of NoneMatch range matcher # Usage of NoneMatch range matcher
ok {test-number} - mocked, noneMatch for: { 1, 2, 3, 4, 5 } none match matches undescribed predicate ok {test-number} - mocked, noneMatch for: { 1, 2, 3, 4, 5 } none match matches undescribed predicate
# Usage of NoneMatch range matcher # Usage of NoneMatch range matcher
ok {test-number} - mocked.derefed[0] for: true ok {test-number} - mocked.m_derefed[0] for: true
# Usage of NoneMatch range matcher # Usage of NoneMatch range matcher
ok {test-number} - mocked.derefed[1] for: true ok {test-number} - mocked.m_derefed[1] for: true
# Usage of NoneMatch range matcher # Usage of NoneMatch range matcher
ok {test-number} - mocked.derefed[2] for: true ok {test-number} - mocked.m_derefed[2] for: true
# Usage of NoneMatch range matcher # Usage of NoneMatch range matcher
ok {test-number} - mocked.derefed[3] for: true ok {test-number} - mocked.m_derefed[3] for: true
# Usage of NoneMatch range matcher # Usage of NoneMatch range matcher
ok {test-number} - mocked.derefed[4] for: true ok {test-number} - mocked.m_derefed[4] for: true
# Usage of NoneMatch range matcher # Usage of NoneMatch range matcher
ok {test-number} - mocked, !noneMatch for: { 1, 2, 3, 4, 5 } not none match matches undescribed predicate ok {test-number} - mocked, !noneMatch for: { 1, 2, 3, 4, 5 } not none match matches undescribed predicate
# Usage of NoneMatch range matcher # Usage of NoneMatch range matcher
ok {test-number} - mocked.derefed[0] for: true ok {test-number} - mocked.m_derefed[0] for: true
# Usage of NoneMatch range matcher # Usage of NoneMatch range matcher
ok {test-number} - !(mocked.derefed[1]) for: !false ok {test-number} - !(mocked.m_derefed[1]) for: !false
# Usage of NoneMatch range matcher # Usage of NoneMatch range matcher
ok {test-number} - !(mocked.derefed[2]) for: !false ok {test-number} - !(mocked.m_derefed[2]) for: !false
# Usage of NoneMatch range matcher # Usage of NoneMatch range matcher
ok {test-number} - !(mocked.derefed[3]) for: !false ok {test-number} - !(mocked.m_derefed[3]) for: !false
# Usage of NoneMatch range matcher # Usage of NoneMatch range matcher
ok {test-number} - !(mocked.derefed[4]) for: !false ok {test-number} - !(mocked.m_derefed[4]) for: !false
# Usage of the SizeIs range matcher # Usage of the SizeIs range matcher
ok {test-number} - empty_vec, SizeIs(0) for: { } has size == 0 ok {test-number} - empty_vec, SizeIs(0) for: { } has size == 0
# Usage of the SizeIs range matcher # Usage of the SizeIs range matcher

View File

@ -3481,27 +3481,27 @@ ok {test-number} - needs_adl, AllMatch( Predicate<int>( []( int elem ) { return
# Usage of AllMatch range matcher # Usage of AllMatch range matcher
ok {test-number} - mocked, allMatch for: { 1, 2, 3, 4, 5 } all match matches undescribed predicate ok {test-number} - mocked, allMatch for: { 1, 2, 3, 4, 5 } all match matches undescribed predicate
# Usage of AllMatch range matcher # Usage of AllMatch range matcher
ok {test-number} - mocked.derefed[0] for: true ok {test-number} - mocked.m_derefed[0] for: true
# Usage of AllMatch range matcher # Usage of AllMatch range matcher
ok {test-number} - mocked.derefed[1] for: true ok {test-number} - mocked.m_derefed[1] for: true
# Usage of AllMatch range matcher # Usage of AllMatch range matcher
ok {test-number} - mocked.derefed[2] for: true ok {test-number} - mocked.m_derefed[2] for: true
# Usage of AllMatch range matcher # Usage of AllMatch range matcher
ok {test-number} - mocked.derefed[3] for: true ok {test-number} - mocked.m_derefed[3] for: true
# Usage of AllMatch range matcher # Usage of AllMatch range matcher
ok {test-number} - mocked.derefed[4] for: true ok {test-number} - mocked.m_derefed[4] for: true
# Usage of AllMatch range matcher # Usage of AllMatch range matcher
ok {test-number} - mocked, !allMatch for: { 1, 2, 3, 4, 5 } not all match matches undescribed predicate ok {test-number} - mocked, !allMatch for: { 1, 2, 3, 4, 5 } not all match matches undescribed predicate
# Usage of AllMatch range matcher # Usage of AllMatch range matcher
ok {test-number} - mocked.derefed[0] for: true ok {test-number} - mocked.m_derefed[0] for: true
# Usage of AllMatch range matcher # Usage of AllMatch range matcher
ok {test-number} - mocked.derefed[1] for: true ok {test-number} - mocked.m_derefed[1] for: true
# Usage of AllMatch range matcher # Usage of AllMatch range matcher
ok {test-number} - mocked.derefed[2] for: true ok {test-number} - mocked.m_derefed[2] for: true
# Usage of AllMatch range matcher # Usage of AllMatch range matcher
ok {test-number} - !(mocked.derefed[3]) for: !false ok {test-number} - !(mocked.m_derefed[3]) for: !false
# Usage of AllMatch range matcher # Usage of AllMatch range matcher
ok {test-number} - !(mocked.derefed[4]) for: !false ok {test-number} - !(mocked.m_derefed[4]) for: !false
# Usage of AnyMatch range matcher # Usage of AnyMatch range matcher
ok {test-number} - data, AnyMatch(SizeIs(5)) for: { { 0, 1, 2, 3, 5 }, { 4, -3, -2, 5, 0 }, { 0, 0, 0, 5, 0 }, { 0, -5, 0, 5, 0 }, { 1, 0, 0, -1, 5 } } any match has size == 5 ok {test-number} - data, AnyMatch(SizeIs(5)) for: { { 0, 1, 2, 3, 5 }, { 4, -3, -2, 5, 0 }, { 0, 0, 0, 5, 0 }, { 0, -5, 0, 5, 0 }, { 1, 0, 0, -1, 5 } } any match has size == 5
# Usage of AnyMatch range matcher # Usage of AnyMatch range matcher
@ -3511,27 +3511,27 @@ ok {test-number} - needs_adl, AnyMatch( Predicate<int>( []( int elem ) { return
# Usage of AnyMatch range matcher # Usage of AnyMatch range matcher
ok {test-number} - mocked, !anyMatch for: { 1, 2, 3, 4, 5 } not any match matches undescribed predicate ok {test-number} - mocked, !anyMatch for: { 1, 2, 3, 4, 5 } not any match matches undescribed predicate
# Usage of AnyMatch range matcher # Usage of AnyMatch range matcher
ok {test-number} - mocked.derefed[0] for: true ok {test-number} - mocked.m_derefed[0] for: true
# Usage of AnyMatch range matcher # Usage of AnyMatch range matcher
ok {test-number} - mocked.derefed[1] for: true ok {test-number} - mocked.m_derefed[1] for: true
# Usage of AnyMatch range matcher # Usage of AnyMatch range matcher
ok {test-number} - mocked.derefed[2] for: true ok {test-number} - mocked.m_derefed[2] for: true
# Usage of AnyMatch range matcher # Usage of AnyMatch range matcher
ok {test-number} - mocked.derefed[3] for: true ok {test-number} - mocked.m_derefed[3] for: true
# Usage of AnyMatch range matcher # Usage of AnyMatch range matcher
ok {test-number} - mocked.derefed[4] for: true ok {test-number} - mocked.m_derefed[4] for: true
# Usage of AnyMatch range matcher # Usage of AnyMatch range matcher
ok {test-number} - mocked, anyMatch for: { 1, 2, 3, 4, 5 } any match matches undescribed predicate ok {test-number} - mocked, anyMatch for: { 1, 2, 3, 4, 5 } any match matches undescribed predicate
# Usage of AnyMatch range matcher # Usage of AnyMatch range matcher
ok {test-number} - mocked.derefed[0] for: true ok {test-number} - mocked.m_derefed[0] for: true
# Usage of AnyMatch range matcher # Usage of AnyMatch range matcher
ok {test-number} - !(mocked.derefed[1]) for: !false ok {test-number} - !(mocked.m_derefed[1]) for: !false
# Usage of AnyMatch range matcher # Usage of AnyMatch range matcher
ok {test-number} - !(mocked.derefed[2]) for: !false ok {test-number} - !(mocked.m_derefed[2]) for: !false
# Usage of AnyMatch range matcher # Usage of AnyMatch range matcher
ok {test-number} - !(mocked.derefed[3]) for: !false ok {test-number} - !(mocked.m_derefed[3]) for: !false
# Usage of AnyMatch range matcher # Usage of AnyMatch range matcher
ok {test-number} - !(mocked.derefed[4]) for: !false ok {test-number} - !(mocked.m_derefed[4]) for: !false
# Usage of NoneMatch range matcher # Usage of NoneMatch range matcher
ok {test-number} - data, NoneMatch(SizeIs(6)) for: { { 0, 1, 2, 3, 5 }, { 4, -3, -2, 5, 0 }, { 0, 0, 0, 5, 0 }, { 0, -5, 0, 5, 0 }, { 1, 0, 0, -1, 5 } } none match has size == 6 ok {test-number} - data, NoneMatch(SizeIs(6)) for: { { 0, 1, 2, 3, 5 }, { 4, -3, -2, 5, 0 }, { 0, 0, 0, 5, 0 }, { 0, -5, 0, 5, 0 }, { 1, 0, 0, -1, 5 } } none match has size == 6
# Usage of NoneMatch range matcher # Usage of NoneMatch range matcher
@ -3541,27 +3541,27 @@ ok {test-number} - needs_adl, NoneMatch( Predicate<int>( []( int elem ) { return
# Usage of NoneMatch range matcher # Usage of NoneMatch range matcher
ok {test-number} - mocked, noneMatch for: { 1, 2, 3, 4, 5 } none match matches undescribed predicate ok {test-number} - mocked, noneMatch for: { 1, 2, 3, 4, 5 } none match matches undescribed predicate
# Usage of NoneMatch range matcher # Usage of NoneMatch range matcher
ok {test-number} - mocked.derefed[0] for: true ok {test-number} - mocked.m_derefed[0] for: true
# Usage of NoneMatch range matcher # Usage of NoneMatch range matcher
ok {test-number} - mocked.derefed[1] for: true ok {test-number} - mocked.m_derefed[1] for: true
# Usage of NoneMatch range matcher # Usage of NoneMatch range matcher
ok {test-number} - mocked.derefed[2] for: true ok {test-number} - mocked.m_derefed[2] for: true
# Usage of NoneMatch range matcher # Usage of NoneMatch range matcher
ok {test-number} - mocked.derefed[3] for: true ok {test-number} - mocked.m_derefed[3] for: true
# Usage of NoneMatch range matcher # Usage of NoneMatch range matcher
ok {test-number} - mocked.derefed[4] for: true ok {test-number} - mocked.m_derefed[4] for: true
# Usage of NoneMatch range matcher # Usage of NoneMatch range matcher
ok {test-number} - mocked, !noneMatch for: { 1, 2, 3, 4, 5 } not none match matches undescribed predicate ok {test-number} - mocked, !noneMatch for: { 1, 2, 3, 4, 5 } not none match matches undescribed predicate
# Usage of NoneMatch range matcher # Usage of NoneMatch range matcher
ok {test-number} - mocked.derefed[0] for: true ok {test-number} - mocked.m_derefed[0] for: true
# Usage of NoneMatch range matcher # Usage of NoneMatch range matcher
ok {test-number} - !(mocked.derefed[1]) for: !false ok {test-number} - !(mocked.m_derefed[1]) for: !false
# Usage of NoneMatch range matcher # Usage of NoneMatch range matcher
ok {test-number} - !(mocked.derefed[2]) for: !false ok {test-number} - !(mocked.m_derefed[2]) for: !false
# Usage of NoneMatch range matcher # Usage of NoneMatch range matcher
ok {test-number} - !(mocked.derefed[3]) for: !false ok {test-number} - !(mocked.m_derefed[3]) for: !false
# Usage of NoneMatch range matcher # Usage of NoneMatch range matcher
ok {test-number} - !(mocked.derefed[4]) for: !false ok {test-number} - !(mocked.m_derefed[4]) for: !false
# Usage of the SizeIs range matcher # Usage of the SizeIs range matcher
ok {test-number} - empty_vec, SizeIs(0) for: { } has size == 0 ok {test-number} - empty_vec, SizeIs(0) for: { } has size == 0
# Usage of the SizeIs range matcher # Usage of the SizeIs range matcher

View File

@ -16378,7 +16378,7 @@ There is no extra whitespace here
</Expression> </Expression>
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" >
<Original> <Original>
mocked.derefed[0] mocked.m_derefed[0]
</Original> </Original>
<Expanded> <Expanded>
true true
@ -16386,7 +16386,7 @@ There is no extra whitespace here
</Expression> </Expression>
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" >
<Original> <Original>
mocked.derefed[1] mocked.m_derefed[1]
</Original> </Original>
<Expanded> <Expanded>
true true
@ -16394,7 +16394,7 @@ There is no extra whitespace here
</Expression> </Expression>
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" >
<Original> <Original>
mocked.derefed[2] mocked.m_derefed[2]
</Original> </Original>
<Expanded> <Expanded>
true true
@ -16402,7 +16402,7 @@ There is no extra whitespace here
</Expression> </Expression>
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" >
<Original> <Original>
mocked.derefed[3] mocked.m_derefed[3]
</Original> </Original>
<Expanded> <Expanded>
true true
@ -16410,7 +16410,7 @@ There is no extra whitespace here
</Expression> </Expression>
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" >
<Original> <Original>
mocked.derefed[4] mocked.m_derefed[4]
</Original> </Original>
<Expanded> <Expanded>
true true
@ -16432,7 +16432,7 @@ There is no extra whitespace here
</Expression> </Expression>
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" >
<Original> <Original>
mocked.derefed[0] mocked.m_derefed[0]
</Original> </Original>
<Expanded> <Expanded>
true true
@ -16440,7 +16440,7 @@ There is no extra whitespace here
</Expression> </Expression>
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" >
<Original> <Original>
mocked.derefed[1] mocked.m_derefed[1]
</Original> </Original>
<Expanded> <Expanded>
true true
@ -16448,7 +16448,7 @@ There is no extra whitespace here
</Expression> </Expression>
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" >
<Original> <Original>
mocked.derefed[2] mocked.m_derefed[2]
</Original> </Original>
<Expanded> <Expanded>
true true
@ -16456,7 +16456,7 @@ There is no extra whitespace here
</Expression> </Expression>
<Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" >
<Original> <Original>
!(mocked.derefed[3]) !(mocked.m_derefed[3])
</Original> </Original>
<Expanded> <Expanded>
!false !false
@ -16464,7 +16464,7 @@ There is no extra whitespace here
</Expression> </Expression>
<Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" >
<Original> <Original>
!(mocked.derefed[4]) !(mocked.m_derefed[4])
</Original> </Original>
<Expanded> <Expanded>
!false !false
@ -16519,7 +16519,7 @@ There is no extra whitespace here
</Expression> </Expression>
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" >
<Original> <Original>
mocked.derefed[0] mocked.m_derefed[0]
</Original> </Original>
<Expanded> <Expanded>
true true
@ -16527,7 +16527,7 @@ There is no extra whitespace here
</Expression> </Expression>
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" >
<Original> <Original>
mocked.derefed[1] mocked.m_derefed[1]
</Original> </Original>
<Expanded> <Expanded>
true true
@ -16535,7 +16535,7 @@ There is no extra whitespace here
</Expression> </Expression>
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" >
<Original> <Original>
mocked.derefed[2] mocked.m_derefed[2]
</Original> </Original>
<Expanded> <Expanded>
true true
@ -16543,7 +16543,7 @@ There is no extra whitespace here
</Expression> </Expression>
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" >
<Original> <Original>
mocked.derefed[3] mocked.m_derefed[3]
</Original> </Original>
<Expanded> <Expanded>
true true
@ -16551,7 +16551,7 @@ There is no extra whitespace here
</Expression> </Expression>
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" >
<Original> <Original>
mocked.derefed[4] mocked.m_derefed[4]
</Original> </Original>
<Expanded> <Expanded>
true true
@ -16573,7 +16573,7 @@ There is no extra whitespace here
</Expression> </Expression>
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" >
<Original> <Original>
mocked.derefed[0] mocked.m_derefed[0]
</Original> </Original>
<Expanded> <Expanded>
true true
@ -16581,7 +16581,7 @@ There is no extra whitespace here
</Expression> </Expression>
<Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" >
<Original> <Original>
!(mocked.derefed[1]) !(mocked.m_derefed[1])
</Original> </Original>
<Expanded> <Expanded>
!false !false
@ -16589,7 +16589,7 @@ There is no extra whitespace here
</Expression> </Expression>
<Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" >
<Original> <Original>
!(mocked.derefed[2]) !(mocked.m_derefed[2])
</Original> </Original>
<Expanded> <Expanded>
!false !false
@ -16597,7 +16597,7 @@ There is no extra whitespace here
</Expression> </Expression>
<Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" >
<Original> <Original>
!(mocked.derefed[3]) !(mocked.m_derefed[3])
</Original> </Original>
<Expanded> <Expanded>
!false !false
@ -16605,7 +16605,7 @@ There is no extra whitespace here
</Expression> </Expression>
<Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" >
<Original> <Original>
!(mocked.derefed[4]) !(mocked.m_derefed[4])
</Original> </Original>
<Expanded> <Expanded>
!false !false
@ -16660,7 +16660,7 @@ There is no extra whitespace here
</Expression> </Expression>
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" >
<Original> <Original>
mocked.derefed[0] mocked.m_derefed[0]
</Original> </Original>
<Expanded> <Expanded>
true true
@ -16668,7 +16668,7 @@ There is no extra whitespace here
</Expression> </Expression>
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" >
<Original> <Original>
mocked.derefed[1] mocked.m_derefed[1]
</Original> </Original>
<Expanded> <Expanded>
true true
@ -16676,7 +16676,7 @@ There is no extra whitespace here
</Expression> </Expression>
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" >
<Original> <Original>
mocked.derefed[2] mocked.m_derefed[2]
</Original> </Original>
<Expanded> <Expanded>
true true
@ -16684,7 +16684,7 @@ There is no extra whitespace here
</Expression> </Expression>
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" >
<Original> <Original>
mocked.derefed[3] mocked.m_derefed[3]
</Original> </Original>
<Expanded> <Expanded>
true true
@ -16692,7 +16692,7 @@ There is no extra whitespace here
</Expression> </Expression>
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" >
<Original> <Original>
mocked.derefed[4] mocked.m_derefed[4]
</Original> </Original>
<Expanded> <Expanded>
true true
@ -16714,7 +16714,7 @@ There is no extra whitespace here
</Expression> </Expression>
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" >
<Original> <Original>
mocked.derefed[0] mocked.m_derefed[0]
</Original> </Original>
<Expanded> <Expanded>
true true
@ -16722,7 +16722,7 @@ There is no extra whitespace here
</Expression> </Expression>
<Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" >
<Original> <Original>
!(mocked.derefed[1]) !(mocked.m_derefed[1])
</Original> </Original>
<Expanded> <Expanded>
!false !false
@ -16730,7 +16730,7 @@ There is no extra whitespace here
</Expression> </Expression>
<Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" >
<Original> <Original>
!(mocked.derefed[2]) !(mocked.m_derefed[2])
</Original> </Original>
<Expanded> <Expanded>
!false !false
@ -16738,7 +16738,7 @@ There is no extra whitespace here
</Expression> </Expression>
<Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" >
<Original> <Original>
!(mocked.derefed[3]) !(mocked.m_derefed[3])
</Original> </Original>
<Expanded> <Expanded>
!false !false
@ -16746,7 +16746,7 @@ There is no extra whitespace here
</Expression> </Expression>
<Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" >
<Original> <Original>
!(mocked.derefed[4]) !(mocked.m_derefed[4])
</Original> </Original>
<Expanded> <Expanded>
!false !false

View File

@ -16378,7 +16378,7 @@ There is no extra whitespace here
</Expression> </Expression>
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" >
<Original> <Original>
mocked.derefed[0] mocked.m_derefed[0]
</Original> </Original>
<Expanded> <Expanded>
true true
@ -16386,7 +16386,7 @@ There is no extra whitespace here
</Expression> </Expression>
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" >
<Original> <Original>
mocked.derefed[1] mocked.m_derefed[1]
</Original> </Original>
<Expanded> <Expanded>
true true
@ -16394,7 +16394,7 @@ There is no extra whitespace here
</Expression> </Expression>
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" >
<Original> <Original>
mocked.derefed[2] mocked.m_derefed[2]
</Original> </Original>
<Expanded> <Expanded>
true true
@ -16402,7 +16402,7 @@ There is no extra whitespace here
</Expression> </Expression>
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" >
<Original> <Original>
mocked.derefed[3] mocked.m_derefed[3]
</Original> </Original>
<Expanded> <Expanded>
true true
@ -16410,7 +16410,7 @@ There is no extra whitespace here
</Expression> </Expression>
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" >
<Original> <Original>
mocked.derefed[4] mocked.m_derefed[4]
</Original> </Original>
<Expanded> <Expanded>
true true
@ -16432,7 +16432,7 @@ There is no extra whitespace here
</Expression> </Expression>
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" >
<Original> <Original>
mocked.derefed[0] mocked.m_derefed[0]
</Original> </Original>
<Expanded> <Expanded>
true true
@ -16440,7 +16440,7 @@ There is no extra whitespace here
</Expression> </Expression>
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" >
<Original> <Original>
mocked.derefed[1] mocked.m_derefed[1]
</Original> </Original>
<Expanded> <Expanded>
true true
@ -16448,7 +16448,7 @@ There is no extra whitespace here
</Expression> </Expression>
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" >
<Original> <Original>
mocked.derefed[2] mocked.m_derefed[2]
</Original> </Original>
<Expanded> <Expanded>
true true
@ -16456,7 +16456,7 @@ There is no extra whitespace here
</Expression> </Expression>
<Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" >
<Original> <Original>
!(mocked.derefed[3]) !(mocked.m_derefed[3])
</Original> </Original>
<Expanded> <Expanded>
!false !false
@ -16464,7 +16464,7 @@ There is no extra whitespace here
</Expression> </Expression>
<Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" >
<Original> <Original>
!(mocked.derefed[4]) !(mocked.m_derefed[4])
</Original> </Original>
<Expanded> <Expanded>
!false !false
@ -16519,7 +16519,7 @@ There is no extra whitespace here
</Expression> </Expression>
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" >
<Original> <Original>
mocked.derefed[0] mocked.m_derefed[0]
</Original> </Original>
<Expanded> <Expanded>
true true
@ -16527,7 +16527,7 @@ There is no extra whitespace here
</Expression> </Expression>
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" >
<Original> <Original>
mocked.derefed[1] mocked.m_derefed[1]
</Original> </Original>
<Expanded> <Expanded>
true true
@ -16535,7 +16535,7 @@ There is no extra whitespace here
</Expression> </Expression>
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" >
<Original> <Original>
mocked.derefed[2] mocked.m_derefed[2]
</Original> </Original>
<Expanded> <Expanded>
true true
@ -16543,7 +16543,7 @@ There is no extra whitespace here
</Expression> </Expression>
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" >
<Original> <Original>
mocked.derefed[3] mocked.m_derefed[3]
</Original> </Original>
<Expanded> <Expanded>
true true
@ -16551,7 +16551,7 @@ There is no extra whitespace here
</Expression> </Expression>
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" >
<Original> <Original>
mocked.derefed[4] mocked.m_derefed[4]
</Original> </Original>
<Expanded> <Expanded>
true true
@ -16573,7 +16573,7 @@ There is no extra whitespace here
</Expression> </Expression>
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" >
<Original> <Original>
mocked.derefed[0] mocked.m_derefed[0]
</Original> </Original>
<Expanded> <Expanded>
true true
@ -16581,7 +16581,7 @@ There is no extra whitespace here
</Expression> </Expression>
<Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" >
<Original> <Original>
!(mocked.derefed[1]) !(mocked.m_derefed[1])
</Original> </Original>
<Expanded> <Expanded>
!false !false
@ -16589,7 +16589,7 @@ There is no extra whitespace here
</Expression> </Expression>
<Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" >
<Original> <Original>
!(mocked.derefed[2]) !(mocked.m_derefed[2])
</Original> </Original>
<Expanded> <Expanded>
!false !false
@ -16597,7 +16597,7 @@ There is no extra whitespace here
</Expression> </Expression>
<Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" >
<Original> <Original>
!(mocked.derefed[3]) !(mocked.m_derefed[3])
</Original> </Original>
<Expanded> <Expanded>
!false !false
@ -16605,7 +16605,7 @@ There is no extra whitespace here
</Expression> </Expression>
<Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" >
<Original> <Original>
!(mocked.derefed[4]) !(mocked.m_derefed[4])
</Original> </Original>
<Expanded> <Expanded>
!false !false
@ -16660,7 +16660,7 @@ There is no extra whitespace here
</Expression> </Expression>
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" >
<Original> <Original>
mocked.derefed[0] mocked.m_derefed[0]
</Original> </Original>
<Expanded> <Expanded>
true true
@ -16668,7 +16668,7 @@ There is no extra whitespace here
</Expression> </Expression>
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" >
<Original> <Original>
mocked.derefed[1] mocked.m_derefed[1]
</Original> </Original>
<Expanded> <Expanded>
true true
@ -16676,7 +16676,7 @@ There is no extra whitespace here
</Expression> </Expression>
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" >
<Original> <Original>
mocked.derefed[2] mocked.m_derefed[2]
</Original> </Original>
<Expanded> <Expanded>
true true
@ -16684,7 +16684,7 @@ There is no extra whitespace here
</Expression> </Expression>
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" >
<Original> <Original>
mocked.derefed[3] mocked.m_derefed[3]
</Original> </Original>
<Expanded> <Expanded>
true true
@ -16692,7 +16692,7 @@ There is no extra whitespace here
</Expression> </Expression>
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" >
<Original> <Original>
mocked.derefed[4] mocked.m_derefed[4]
</Original> </Original>
<Expanded> <Expanded>
true true
@ -16714,7 +16714,7 @@ There is no extra whitespace here
</Expression> </Expression>
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" >
<Original> <Original>
mocked.derefed[0] mocked.m_derefed[0]
</Original> </Original>
<Expanded> <Expanded>
true true
@ -16722,7 +16722,7 @@ There is no extra whitespace here
</Expression> </Expression>
<Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" >
<Original> <Original>
!(mocked.derefed[1]) !(mocked.m_derefed[1])
</Original> </Original>
<Expanded> <Expanded>
!false !false
@ -16730,7 +16730,7 @@ There is no extra whitespace here
</Expression> </Expression>
<Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" >
<Original> <Original>
!(mocked.derefed[2]) !(mocked.m_derefed[2])
</Original> </Original>
<Expanded> <Expanded>
!false !false
@ -16738,7 +16738,7 @@ There is no extra whitespace here
</Expression> </Expression>
<Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" >
<Original> <Original>
!(mocked.derefed[3]) !(mocked.m_derefed[3])
</Original> </Original>
<Expanded> <Expanded>
!false !false
@ -16746,7 +16746,7 @@ There is no extra whitespace here
</Expression> </Expression>
<Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" > <Expression success="true" type="REQUIRE_FALSE" filename="tests/<exe-name>/UsageTests/MatchersRanges.tests.cpp" >
<Original> <Original>
!(mocked.derefed[4]) !(mocked.m_derefed[4])
</Original> </Original>
<Expanded> <Expanded>
!false !false

View File

@ -14,22 +14,28 @@
#include <catch2/matchers/catch_matchers_predicate.hpp> #include <catch2/matchers/catch_matchers_predicate.hpp>
#include <catch2/matchers/catch_matchers_string.hpp> #include <catch2/matchers/catch_matchers_string.hpp>
#include <array>
#include <cmath> #include <cmath>
#include <initializer_list>
#include <list> #include <list>
#include <map> #include <map>
#include <type_traits>
#include <vector> #include <vector>
#include <memory>
namespace { namespace {
namespace unrelated {
class needs_ADL_begin {
std::array<int, 5> elements{ {1, 2, 3, 4, 5} };
public:
using iterator = std::array<int, 5>::iterator;
using const_iterator = std::array<int, 5>::const_iterator;
const_iterator Begin() const { return elements.begin(); } namespace unrelated {
const_iterator End() const { return elements.end(); } template <typename T>
class needs_ADL_begin {
std::vector<T> m_elements;
public:
using iterator = typename std::vector<T>::iterator;
using const_iterator = typename std::vector<T>::const_iterator;
needs_ADL_begin(std::initializer_list<T> init) : m_elements(init) {}
const_iterator Begin() const { return m_elements.begin(); }
const_iterator End() const { return m_elements.end(); }
friend const_iterator begin(needs_ADL_begin const& lhs) { friend const_iterator begin(needs_ADL_begin const& lhs) {
return lhs.Begin(); return lhs.Begin();
@ -45,22 +51,23 @@ namespace unrelated {
# pragma clang diagnostic ignored "-Wunused-function" # pragma clang diagnostic ignored "-Wunused-function"
#endif #endif
template <typename T>
class has_different_begin_end_types { class has_different_begin_end_types {
std::array<int, 5> elements{ {1, 2, 3, 4, 5} }; std::vector<T> m_elements;
// Different type for the "end" iterator // Different type for the "end" iterator
struct iterator_end {}; struct iterator_end {};
// Just a fake forward iterator, that only compares to a different // Just a fake forward iterator, that only compares to a different
// type (so we can test two-type ranges). // type (so we can test two-type ranges).
struct iterator { struct iterator {
int const* start; T const* start;
int const* end; T const* end;
using iterator_category = std::forward_iterator_tag; using iterator_category = std::forward_iterator_tag;
using difference_type = std::ptrdiff_t; using difference_type = std::ptrdiff_t;
using value_type = int; using value_type = T;
using reference = int const&; using reference = T const&;
using pointer = int const*; using pointer = T const*;
friend bool operator==( iterator iter, iterator_end ) { friend bool operator==( iterator iter, iterator_end ) {
@ -88,8 +95,11 @@ class has_different_begin_end_types {
public: public:
explicit has_different_begin_end_types( std::initializer_list<T> init ):
m_elements( init ) {}
iterator begin() const { iterator begin() const {
return { elements.data(), elements.data() + elements.size() }; return { m_elements.data(), m_elements.data() + m_elements.size() };
} }
iterator_end end() const { iterator_end end() const {
@ -101,80 +111,90 @@ public:
# pragma clang diagnostic pop # pragma clang diagnostic pop
#endif #endif
template <typename T> struct with_mocked_iterator_access {
std::vector<T> m_elements;
struct with_mocked_iterator_access { // use plain arrays to have nicer printouts with CHECK(...)
static constexpr size_t data_size = 5; mutable std::unique_ptr<bool[]> m_derefed;
std::array<int, data_size> elements{ {1, 2, 3, 4, 5} };
std::array<bool, data_size> touched{};
std::array<bool, data_size> derefed{};
// We want to check which elements were touched when iterating, so // We want to check which elements were dereferenced when iterating, so
// we can check whether iterator-using code traverses range correctly // we can check whether iterator-using code traverses range correctly
struct iterator { template <bool is_const> class basic_iterator {
with_mocked_iterator_access* m_origin; template <typename U>
using constify_t = std::conditional_t<is_const, std::add_const_t<U>, U>;
constify_t<with_mocked_iterator_access>* m_origin;
size_t m_origin_idx; size_t m_origin_idx;
public:
using iterator_category = std::forward_iterator_tag; using iterator_category = std::forward_iterator_tag;
using difference_type = std::ptrdiff_t; using difference_type = std::ptrdiff_t;
using value_type = int; using value_type = constify_t<T>;
using reference = int const&; using reference = value_type&;
using pointer = int const*; using pointer = value_type*;
friend bool operator==(iterator lhs, iterator rhs) { basic_iterator( constify_t<with_mocked_iterator_access>* origin,
return lhs.m_origin == rhs.m_origin std::size_t origin_idx ):
&& lhs.m_origin_idx == rhs.m_origin_idx; m_origin{ origin }, m_origin_idx{ origin_idx } {}
friend bool operator==( basic_iterator lhs, basic_iterator rhs ) {
return lhs.m_origin == rhs.m_origin &&
lhs.m_origin_idx == rhs.m_origin_idx;
} }
friend bool operator!=(iterator lhs, iterator rhs) { friend bool operator!=( basic_iterator lhs, basic_iterator rhs ) {
return !(lhs == rhs); return !( lhs == rhs );
} }
iterator& operator++() { basic_iterator& operator++() {
++m_origin_idx; ++m_origin_idx;
assert(m_origin_idx < data_size + 1 && "Outside of valid alloc");
if (m_origin_idx < data_size) {
m_origin->touched[m_origin_idx] = true;
}
return *this; return *this;
} }
iterator operator++(int) { basic_iterator operator++( int ) {
auto tmp(*this); auto tmp( *this );
++(*this); ++( *this );
return tmp; return tmp;
} }
reference operator*() const { reference operator*() const {
assert(m_origin_idx < data_size && "Attempted to deref invalid position"); assert( m_origin_idx < m_origin->m_elements.size() && "Attempted to deref invalid position" );
m_origin->derefed[m_origin_idx] = true; m_origin->m_derefed[m_origin_idx] = true;
return m_origin->elements[m_origin_idx]; return m_origin->m_elements[m_origin_idx];
} }
pointer operator->() const { pointer operator->() const {
assert(m_origin_idx < data_size && "Attempted to deref invalid position"); assert( m_origin_idx < m_origin->m_elements.size() && "Attempted to deref invalid position" );
return &m_origin->elements[m_origin_idx]; return &m_origin->m_elements[m_origin_idx];
} }
}; };
iterator begin() const { using iterator = basic_iterator<false>;
// Const-cast away to avoid overcomplicating the iterators using const_iterator = basic_iterator<true>;
// We should actually fix this over time
return { const_cast<with_mocked_iterator_access*>(this), 0 };
}
iterator end() const {
return { const_cast<with_mocked_iterator_access*>(this), data_size };
}
with_mocked_iterator_access( std::initializer_list<T> init ):
m_elements( init ),
m_derefed( std::make_unique<bool[]>( m_elements.size() ) ) {}
const_iterator begin() const { return { this, 0 }; }
const_iterator end() const { return { this, m_elements.size() }; }
iterator begin() { return { this, 0 }; }
iterator end() { return { this, m_elements.size() }; }
}; };
} // end anon namespace } // end anon namespace
namespace Catch { namespace Catch {
template <> // make sure with_mocked_iterator_access is not considered a range by Catch,
struct StringMaker<with_mocked_iterator_access> { // so that below StringMaker is used instead of the default one for ranges
static std::string convert(with_mocked_iterator_access const& access) { template <typename T>
struct is_range<with_mocked_iterator_access<T>> : std::false_type {};
template <typename T>
struct StringMaker<with_mocked_iterator_access<T>> {
static std::string
convert( with_mocked_iterator_access<T> const& access ) {
// We have to avoid the type's iterators, because we check // We have to avoid the type's iterators, because we check
// their use in tests // their use in tests
return ::Catch::Detail::stringify(access.elements); return ::Catch::Detail::stringify( access.m_elements );
} }
}; };
} } // namespace Catch
struct MoveOnlyTestElement { struct MoveOnlyTestElement {
int num = 0; int num = 0;
@ -233,7 +253,7 @@ TEST_CASE("Basic use of the Contains range matcher", "[matchers][templated][cont
} }
SECTION("Can handle type that requires ADL-found free function begin and end") { SECTION("Can handle type that requires ADL-found free function begin and end") {
unrelated::needs_ADL_begin in; unrelated::needs_ADL_begin<int> in{1, 2, 3, 4, 5};
REQUIRE_THAT(in, Contains(1)); REQUIRE_THAT(in, Contains(1));
REQUIRE_THAT(in, !Contains(8)); REQUIRE_THAT(in, !Contains(8));
@ -383,35 +403,35 @@ TEST_CASE("Usage of AllMatch range matcher", "[matchers][templated][quantifiers]
} }
SECTION("Type requires ADL found begin and end") { SECTION("Type requires ADL found begin and end") {
unrelated::needs_ADL_begin needs_adl; unrelated::needs_ADL_begin<int> needs_adl{ 1, 2, 3, 4, 5 };
REQUIRE_THAT( needs_adl, AllMatch( Predicate<int>( []( int elem ) { REQUIRE_THAT( needs_adl, AllMatch( Predicate<int>( []( int elem ) {
return elem < 6; return elem < 6;
} ) ) ); } ) ) );
} }
SECTION("Shortcircuiting") { SECTION("Shortcircuiting") {
with_mocked_iterator_access mocked; with_mocked_iterator_access<int> mocked{ 1, 2, 3, 4, 5 };
SECTION("All are read") { SECTION("All are read") {
auto allMatch = AllMatch(Predicate<int>([](int elem) { auto allMatch = AllMatch(Predicate<int>([](int elem) {
return elem < 10; return elem < 10;
})); }));
REQUIRE_THAT(mocked, allMatch); REQUIRE_THAT(mocked, allMatch);
REQUIRE(mocked.derefed[0]); REQUIRE(mocked.m_derefed[0]);
REQUIRE(mocked.derefed[1]); REQUIRE(mocked.m_derefed[1]);
REQUIRE(mocked.derefed[2]); REQUIRE(mocked.m_derefed[2]);
REQUIRE(mocked.derefed[3]); REQUIRE(mocked.m_derefed[3]);
REQUIRE(mocked.derefed[4]); REQUIRE(mocked.m_derefed[4]);
} }
SECTION("Short-circuited") { SECTION("Short-circuited") {
auto allMatch = AllMatch(Predicate<int>([](int elem) { auto allMatch = AllMatch(Predicate<int>([](int elem) {
return elem < 3; return elem < 3;
})); }));
REQUIRE_THAT(mocked, !allMatch); REQUIRE_THAT(mocked, !allMatch);
REQUIRE(mocked.derefed[0]); REQUIRE(mocked.m_derefed[0]);
REQUIRE(mocked.derefed[1]); REQUIRE(mocked.m_derefed[1]);
REQUIRE(mocked.derefed[2]); REQUIRE(mocked.m_derefed[2]);
REQUIRE_FALSE(mocked.derefed[3]); REQUIRE_FALSE(mocked.m_derefed[3]);
REQUIRE_FALSE(mocked.derefed[4]); REQUIRE_FALSE(mocked.m_derefed[4]);
} }
} }
} }
@ -436,34 +456,34 @@ TEST_CASE("Usage of AnyMatch range matcher", "[matchers][templated][quantifiers]
REQUIRE_THAT(data, !AnyMatch(Contains(0) && Contains(10))); REQUIRE_THAT(data, !AnyMatch(Contains(0) && Contains(10)));
} }
SECTION("Type requires ADL found begin and end") { SECTION( "Type requires ADL found begin and end" ) {
unrelated::needs_ADL_begin needs_adl; unrelated::needs_ADL_begin<int> needs_adl{ 1, 2, 3, 4, 5 };
REQUIRE_THAT( needs_adl, AnyMatch( Predicate<int>( []( int elem ) { REQUIRE_THAT( needs_adl, AnyMatch( Predicate<int>( []( int elem ) {
return elem < 3; return elem < 3;
} ) ) ); } ) ) );
} }
SECTION("Shortcircuiting") { SECTION("Shortcircuiting") {
with_mocked_iterator_access mocked; with_mocked_iterator_access<int> mocked{ 1, 2, 3, 4, 5 };
SECTION("All are read") { SECTION("All are read") {
auto anyMatch = AnyMatch( auto anyMatch = AnyMatch(
Predicate<int>( []( int elem ) { return elem > 10; } ) ); Predicate<int>( []( int elem ) { return elem > 10; } ) );
REQUIRE_THAT( mocked, !anyMatch ); REQUIRE_THAT( mocked, !anyMatch );
REQUIRE( mocked.derefed[0] ); REQUIRE( mocked.m_derefed[0] );
REQUIRE( mocked.derefed[1] ); REQUIRE( mocked.m_derefed[1] );
REQUIRE( mocked.derefed[2] ); REQUIRE( mocked.m_derefed[2] );
REQUIRE( mocked.derefed[3] ); REQUIRE( mocked.m_derefed[3] );
REQUIRE( mocked.derefed[4] ); REQUIRE( mocked.m_derefed[4] );
} }
SECTION("Short-circuited") { SECTION("Short-circuited") {
auto anyMatch = AnyMatch( auto anyMatch = AnyMatch(
Predicate<int>( []( int elem ) { return elem < 3; } ) ); Predicate<int>( []( int elem ) { return elem < 3; } ) );
REQUIRE_THAT( mocked, anyMatch ); REQUIRE_THAT( mocked, anyMatch );
REQUIRE( mocked.derefed[0] ); REQUIRE( mocked.m_derefed[0] );
REQUIRE_FALSE( mocked.derefed[1] ); REQUIRE_FALSE( mocked.m_derefed[1] );
REQUIRE_FALSE( mocked.derefed[2] ); REQUIRE_FALSE( mocked.m_derefed[2] );
REQUIRE_FALSE( mocked.derefed[3] ); REQUIRE_FALSE( mocked.m_derefed[3] );
REQUIRE_FALSE( mocked.derefed[4] ); REQUIRE_FALSE( mocked.m_derefed[4] );
} }
} }
} }
@ -489,33 +509,33 @@ TEST_CASE("Usage of NoneMatch range matcher", "[matchers][templated][quantifiers
} }
SECTION( "Type requires ADL found begin and end" ) { SECTION( "Type requires ADL found begin and end" ) {
unrelated::needs_ADL_begin needs_adl; unrelated::needs_ADL_begin<int> needs_adl{ 1, 2, 3, 4, 5 };
REQUIRE_THAT( needs_adl, NoneMatch( Predicate<int>( []( int elem ) { REQUIRE_THAT( needs_adl, NoneMatch( Predicate<int>( []( int elem ) {
return elem > 6; return elem > 6;
} ) ) ); } ) ) );
} }
SECTION("Shortcircuiting") { SECTION("Shortcircuiting") {
with_mocked_iterator_access mocked; with_mocked_iterator_access<int> mocked{ 1, 2, 3, 4, 5 };
SECTION("All are read") { SECTION("All are read") {
auto noneMatch = NoneMatch( auto noneMatch = NoneMatch(
Predicate<int>([](int elem) { return elem > 10; })); Predicate<int>([](int elem) { return elem > 10; }));
REQUIRE_THAT(mocked, noneMatch); REQUIRE_THAT(mocked, noneMatch);
REQUIRE(mocked.derefed[0]); REQUIRE(mocked.m_derefed[0]);
REQUIRE(mocked.derefed[1]); REQUIRE(mocked.m_derefed[1]);
REQUIRE(mocked.derefed[2]); REQUIRE(mocked.m_derefed[2]);
REQUIRE(mocked.derefed[3]); REQUIRE(mocked.m_derefed[3]);
REQUIRE(mocked.derefed[4]); REQUIRE(mocked.m_derefed[4]);
} }
SECTION("Short-circuited") { SECTION("Short-circuited") {
auto noneMatch = NoneMatch( auto noneMatch = NoneMatch(
Predicate<int>([](int elem) { return elem < 3; })); Predicate<int>([](int elem) { return elem < 3; }));
REQUIRE_THAT(mocked, !noneMatch); REQUIRE_THAT(mocked, !noneMatch);
REQUIRE(mocked.derefed[0]); REQUIRE(mocked.m_derefed[0]);
REQUIRE_FALSE(mocked.derefed[1]); REQUIRE_FALSE(mocked.m_derefed[1]);
REQUIRE_FALSE(mocked.derefed[2]); REQUIRE_FALSE(mocked.m_derefed[2]);
REQUIRE_FALSE(mocked.derefed[3]); REQUIRE_FALSE(mocked.m_derefed[3]);
REQUIRE_FALSE(mocked.derefed[4]); REQUIRE_FALSE(mocked.m_derefed[4]);
} }
} }
} }
@ -533,7 +553,7 @@ TEST_CASE( "The quantifier range matchers support types with different types ret
using Catch::Matchers::Predicate; using Catch::Matchers::Predicate;
has_different_begin_end_types diff_types; has_different_begin_end_types<int> diff_types{1, 2, 3, 4, 5};
REQUIRE_THAT( diff_types, !AllMatch( Predicate<int>( []( int elem ) { REQUIRE_THAT( diff_types, !AllMatch( Predicate<int>( []( int elem ) {
return elem < 3; return elem < 3;
} ) ) ); } ) ) );