Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorMartin Hořeňovský2026-01-12 22:39:59 +0100
committerMartin Hořeňovský2026-01-12 22:39:59 +0100
commit024aec9729e0146c809da0c005e7733834f652a0 (patch)
tree95bb14e81629ade81107f44f9084798827b29b92 /tests
parent9eca713a1f4555b3095564781d77654958ee3dc1 (diff)
downloadcatch3-024aec9729e0146c809da0c005e7733834f652a0.tar.gz
Add efficient skip forward to Values, Map and Take generators
Diffstat (limited to 'tests')
-rw-r--r--tests/SelfTest/Baselines/automake.sw.approved.txt3
-rw-r--r--tests/SelfTest/Baselines/automake.sw.multi.approved.txt3
-rw-r--r--tests/SelfTest/Baselines/compact.sw.approved.txt26
-rw-r--r--tests/SelfTest/Baselines/compact.sw.multi.approved.txt26
-rw-r--r--tests/SelfTest/Baselines/console.std.approved.txt4
-rw-r--r--tests/SelfTest/Baselines/console.sw.approved.txt132
-rw-r--r--tests/SelfTest/Baselines/console.sw.multi.approved.txt132
-rw-r--r--tests/SelfTest/Baselines/junit.sw.approved.txt7
-rw-r--r--tests/SelfTest/Baselines/junit.sw.multi.approved.txt7
-rw-r--r--tests/SelfTest/Baselines/sonarqube.sw.approved.txt5
-rw-r--r--tests/SelfTest/Baselines/sonarqube.sw.multi.approved.txt5
-rw-r--r--tests/SelfTest/Baselines/tap.sw.approved.txt46
-rw-r--r--tests/SelfTest/Baselines/tap.sw.multi.approved.txt46
-rw-r--r--tests/SelfTest/Baselines/teamcity.sw.approved.txt6
-rw-r--r--tests/SelfTest/Baselines/teamcity.sw.multi.approved.txt6
-rw-r--r--tests/SelfTest/Baselines/xml.sw.approved.txt195
-rw-r--r--tests/SelfTest/Baselines/xml.sw.multi.approved.txt195
-rw-r--r--tests/SelfTest/IntrospectiveTests/GeneratorsImpl.tests.cpp78
18 files changed, 904 insertions, 18 deletions
diff --git a/tests/SelfTest/Baselines/automake.sw.approved.txt b/tests/SelfTest/Baselines/automake.sw.approved.txt
index cf504a78..314feb2f 100644
--- a/tests/SelfTest/Baselines/automake.sw.approved.txt
+++ b/tests/SelfTest/Baselines/automake.sw.approved.txt
@@ -165,6 +165,7 @@ Nor would this
:test-result: FAIL FAIL_CHECK does not abort the test
:test-result: PASS Factorials are computed
:test-result: PASS Filter generator throws exception for empty generator
+:test-result: PASS FixedValuesGenerator can be skipped forward
:test-result: PASS Floating point matchers: double
:test-result: PASS Floating point matchers: float
:test-result: PASS GENERATE can combine literals and generators
@@ -190,6 +191,7 @@ Nor would this
:test-result: PASS Lambdas in assertions
:test-result: PASS Less-than inequalities with different epsilons
:test-result: PASS ManuallyRegistered
+:test-result: PASS MapGenerator can be skipped forward efficiently
:test-result: PASS Matchers can be (AllOf) composed with the && operator
:test-result: PASS Matchers can be (AnyOf) composed with the || operator
:test-result: PASS Matchers can be composed with both && and ||
@@ -262,6 +264,7 @@ Message from section two
:test-result: FAIL Tabs and newlines show in output
:test-result: PASS Tag alias can be registered against tag patterns
:test-result: PASS Tags with spaces and non-alphanumerical characters are accepted
+:test-result: PASS TakeGenerator can be skipped forward
:test-result: PASS Template test case method with test types specified inside std::tuple - MyTypes - 0
:test-result: PASS Template test case method with test types specified inside std::tuple - MyTypes - 1
:test-result: PASS Template test case method with test types specified inside std::tuple - MyTypes - 2
diff --git a/tests/SelfTest/Baselines/automake.sw.multi.approved.txt b/tests/SelfTest/Baselines/automake.sw.multi.approved.txt
index 2b4b1ba7..e646593d 100644
--- a/tests/SelfTest/Baselines/automake.sw.multi.approved.txt
+++ b/tests/SelfTest/Baselines/automake.sw.multi.approved.txt
@@ -163,6 +163,7 @@
:test-result: FAIL FAIL_CHECK does not abort the test
:test-result: PASS Factorials are computed
:test-result: PASS Filter generator throws exception for empty generator
+:test-result: PASS FixedValuesGenerator can be skipped forward
:test-result: PASS Floating point matchers: double
:test-result: PASS Floating point matchers: float
:test-result: PASS GENERATE can combine literals and generators
@@ -188,6 +189,7 @@
:test-result: PASS Lambdas in assertions
:test-result: PASS Less-than inequalities with different epsilons
:test-result: PASS ManuallyRegistered
+:test-result: PASS MapGenerator can be skipped forward efficiently
:test-result: PASS Matchers can be (AllOf) composed with the && operator
:test-result: PASS Matchers can be (AnyOf) composed with the || operator
:test-result: PASS Matchers can be composed with both && and ||
@@ -255,6 +257,7 @@
:test-result: FAIL Tabs and newlines show in output
:test-result: PASS Tag alias can be registered against tag patterns
:test-result: PASS Tags with spaces and non-alphanumerical characters are accepted
+:test-result: PASS TakeGenerator can be skipped forward
:test-result: PASS Template test case method with test types specified inside std::tuple - MyTypes - 0
:test-result: PASS Template test case method with test types specified inside std::tuple - MyTypes - 1
:test-result: PASS Template test case method with test types specified inside std::tuple - MyTypes - 2
diff --git a/tests/SelfTest/Baselines/compact.sw.approved.txt b/tests/SelfTest/Baselines/compact.sw.approved.txt
index 8f7f2bf9..94123b41 100644
--- a/tests/SelfTest/Baselines/compact.sw.approved.txt
+++ b/tests/SelfTest/Baselines/compact.sw.approved.txt
@@ -678,6 +678,12 @@ Misc.tests.cpp:<line number>: passed: Factorial(2) == 2 for: 2 == 2
Misc.tests.cpp:<line number>: passed: Factorial(3) == 6 for: 6 == 6
Misc.tests.cpp:<line number>: passed: Factorial(10) == 3628800 for: 3628800 (0x<hex digits>) == 3628800 (0x<hex digits>)
GeneratorsImpl.tests.cpp:<line number>: passed: filter( []( int ) { return false; }, value( 3 ) ), Catch::GeneratorException
+GeneratorsImpl.tests.cpp:<line number>: passed: values.currentElementIndex() == 0 for: 0 == 0
+GeneratorsImpl.tests.cpp:<line number>: passed: values.currentElementIndex() == 3 for: 3 == 3
+GeneratorsImpl.tests.cpp:<line number>: passed: values.get() == 3 for: 3 == 3
+GeneratorsImpl.tests.cpp:<line number>: passed: values.currentElementIndex() == 4 for: 4 == 4
+GeneratorsImpl.tests.cpp:<line number>: passed: values.get() == 4 for: 4 == 4
+GeneratorsImpl.tests.cpp:<line number>: passed: values.skipToNthElement( 5 )
Matchers.tests.cpp:<line number>: passed: 10., WithinRel( 11.1, 0.1 ) for: 10.0 and 11.09999999999999964 are within 10% of each other
Matchers.tests.cpp:<line number>: passed: 10., !WithinRel( 11.2, 0.1 ) for: 10.0 not and 11.19999999999999929 are within 10% of each other
Matchers.tests.cpp:<line number>: passed: 1., !WithinRel( 0., 0.99 ) for: 1.0 not and 0.0 are within 99% of each other
@@ -1243,6 +1249,14 @@ Approx.tests.cpp:<line number>: passed: d <= Approx( 1.22 ).epsilon(0.1) for: 1.
<=
Approx( 1.21999999999999997 )
Misc.tests.cpp:<line number>: passed: with 1 message: 'was called'
+GeneratorsImpl.tests.cpp:<line number>: passed: map_generator.get() == 4 for: 4 == 4
+GeneratorsImpl.tests.cpp:<line number>: passed: map_calls == map_calls_1 + 1 for: 2 == 2
+GeneratorsImpl.tests.cpp:<line number>: passed: map_generator.get() == 4 for: 4 == 4
+GeneratorsImpl.tests.cpp:<line number>: passed: map_calls == map_calls_1 + 1 for: 2 == 2
+GeneratorsImpl.tests.cpp:<line number>: passed: map_generator.get() == 6 for: 6 == 6
+GeneratorsImpl.tests.cpp:<line number>: passed: map_calls == map_calls_2 + 1 for: 3 == 3
+GeneratorsImpl.tests.cpp:<line number>: passed: map_generator.skipToNthElement( 7 )
+GeneratorsImpl.tests.cpp:<line number>: passed: map_calls == map_calls_2 + 1 for: 3 == 3
Matchers.tests.cpp:<line number>: passed: testStringForMatching(), ContainsSubstring( "string" ) && ContainsSubstring( "abc" ) && ContainsSubstring( "substring" ) && ContainsSubstring( "contains" ) for: "this string contains 'abc' as a substring" ( contains: "string" and contains: "abc" and contains: "substring" and contains: "contains" )
Matchers.tests.cpp:<line number>: passed: testStringForMatching(), ContainsSubstring( "string" ) || ContainsSubstring( "different" ) || ContainsSubstring( "random" ) for: "this string contains 'abc' as a substring" ( contains: "string" or contains: "different" or contains: "random" )
Matchers.tests.cpp:<line number>: passed: testStringForMatching2(), ContainsSubstring( "string" ) || ContainsSubstring( "different" ) || ContainsSubstring( "random" ) for: "some completely different text that contains one common word" ( contains: "string" or contains: "different" or contains: "random" )
@@ -1930,6 +1944,14 @@ Tag.tests.cpp:<line number>: passed: registry.add( "@no square bracket at start]
Tag.tests.cpp:<line number>: passed: registry.add( "[@no square bracket at end", "", Catch::SourceLineInfo( "file", 3 ) )
Tag.tests.cpp:<line number>: passed: testCase.tags.size() == 2 for: 2 == 2
Tag.tests.cpp:<line number>: passed: testCase.tags, VectorContains( Tag( "tag with spaces" ) ) && VectorContains( Tag( "I said \"good day\" sir!"_catch_sr ) ) for: { {?}, {?} } ( Contains: {?} and Contains: {?} )
+GeneratorsImpl.tests.cpp:<line number>: passed: take.get() == 0 for: 0 == 0
+GeneratorsImpl.tests.cpp:<line number>: passed: take.get() == 2 for: 2 == 2
+GeneratorsImpl.tests.cpp:<line number>: passed: take.get() == 5 for: 5 == 5
+GeneratorsImpl.tests.cpp:<line number>: passed: take.skipToNthElement( 6 )
+GeneratorsImpl.tests.cpp:<line number>: passed: take.get() == 0 for: 0 == 0
+GeneratorsImpl.tests.cpp:<line number>: passed: take.get() == 2 for: 2 == 2
+GeneratorsImpl.tests.cpp:<line number>: passed: take.get() == 5 for: 5 == 5
+GeneratorsImpl.tests.cpp:<line number>: passed: take.skipToNthElement( 6 )
Class.tests.cpp:<line number>: passed: Template_Fixture<TestType>::m_a == 1 for: 1 == 1
Class.tests.cpp:<line number>: passed: Template_Fixture<TestType>::m_a == 1 for: 1 == 1
Class.tests.cpp:<line number>: passed: Template_Fixture<TestType>::m_a == 1 for: 1.0 == 1
@@ -2924,7 +2946,7 @@ InternalBenchmark.tests.cpp:<line number>: passed: med == 18. for: 18.0 == 18.0
InternalBenchmark.tests.cpp:<line number>: passed: q3 == 23. for: 23.0 == 23.0
Misc.tests.cpp:<line number>: passed:
Misc.tests.cpp:<line number>: passed:
-test cases: 440 | 320 passed | 96 failed | 6 skipped | 18 failed as expected
-assertions: 2340 | 2139 passed | 158 failed | 43 failed as expected
+test cases: 443 | 323 passed | 96 failed | 6 skipped | 18 failed as expected
+assertions: 2362 | 2161 passed | 158 failed | 43 failed as expected
diff --git a/tests/SelfTest/Baselines/compact.sw.multi.approved.txt b/tests/SelfTest/Baselines/compact.sw.multi.approved.txt
index 17cf066a..e44e771d 100644
--- a/tests/SelfTest/Baselines/compact.sw.multi.approved.txt
+++ b/tests/SelfTest/Baselines/compact.sw.multi.approved.txt
@@ -676,6 +676,12 @@ Misc.tests.cpp:<line number>: passed: Factorial(2) == 2 for: 2 == 2
Misc.tests.cpp:<line number>: passed: Factorial(3) == 6 for: 6 == 6
Misc.tests.cpp:<line number>: passed: Factorial(10) == 3628800 for: 3628800 (0x<hex digits>) == 3628800 (0x<hex digits>)
GeneratorsImpl.tests.cpp:<line number>: passed: filter( []( int ) { return false; }, value( 3 ) ), Catch::GeneratorException
+GeneratorsImpl.tests.cpp:<line number>: passed: values.currentElementIndex() == 0 for: 0 == 0
+GeneratorsImpl.tests.cpp:<line number>: passed: values.currentElementIndex() == 3 for: 3 == 3
+GeneratorsImpl.tests.cpp:<line number>: passed: values.get() == 3 for: 3 == 3
+GeneratorsImpl.tests.cpp:<line number>: passed: values.currentElementIndex() == 4 for: 4 == 4
+GeneratorsImpl.tests.cpp:<line number>: passed: values.get() == 4 for: 4 == 4
+GeneratorsImpl.tests.cpp:<line number>: passed: values.skipToNthElement( 5 )
Matchers.tests.cpp:<line number>: passed: 10., WithinRel( 11.1, 0.1 ) for: 10.0 and 11.09999999999999964 are within 10% of each other
Matchers.tests.cpp:<line number>: passed: 10., !WithinRel( 11.2, 0.1 ) for: 10.0 not and 11.19999999999999929 are within 10% of each other
Matchers.tests.cpp:<line number>: passed: 1., !WithinRel( 0., 0.99 ) for: 1.0 not and 0.0 are within 99% of each other
@@ -1241,6 +1247,14 @@ Approx.tests.cpp:<line number>: passed: d <= Approx( 1.22 ).epsilon(0.1) for: 1.
<=
Approx( 1.21999999999999997 )
Misc.tests.cpp:<line number>: passed: with 1 message: 'was called'
+GeneratorsImpl.tests.cpp:<line number>: passed: map_generator.get() == 4 for: 4 == 4
+GeneratorsImpl.tests.cpp:<line number>: passed: map_calls == map_calls_1 + 1 for: 2 == 2
+GeneratorsImpl.tests.cpp:<line number>: passed: map_generator.get() == 4 for: 4 == 4
+GeneratorsImpl.tests.cpp:<line number>: passed: map_calls == map_calls_1 + 1 for: 2 == 2
+GeneratorsImpl.tests.cpp:<line number>: passed: map_generator.get() == 6 for: 6 == 6
+GeneratorsImpl.tests.cpp:<line number>: passed: map_calls == map_calls_2 + 1 for: 3 == 3
+GeneratorsImpl.tests.cpp:<line number>: passed: map_generator.skipToNthElement( 7 )
+GeneratorsImpl.tests.cpp:<line number>: passed: map_calls == map_calls_2 + 1 for: 3 == 3
Matchers.tests.cpp:<line number>: passed: testStringForMatching(), ContainsSubstring( "string" ) && ContainsSubstring( "abc" ) && ContainsSubstring( "substring" ) && ContainsSubstring( "contains" ) for: "this string contains 'abc' as a substring" ( contains: "string" and contains: "abc" and contains: "substring" and contains: "contains" )
Matchers.tests.cpp:<line number>: passed: testStringForMatching(), ContainsSubstring( "string" ) || ContainsSubstring( "different" ) || ContainsSubstring( "random" ) for: "this string contains 'abc' as a substring" ( contains: "string" or contains: "different" or contains: "random" )
Matchers.tests.cpp:<line number>: passed: testStringForMatching2(), ContainsSubstring( "string" ) || ContainsSubstring( "different" ) || ContainsSubstring( "random" ) for: "some completely different text that contains one common word" ( contains: "string" or contains: "different" or contains: "random" )
@@ -1923,6 +1937,14 @@ Tag.tests.cpp:<line number>: passed: registry.add( "@no square bracket at start]
Tag.tests.cpp:<line number>: passed: registry.add( "[@no square bracket at end", "", Catch::SourceLineInfo( "file", 3 ) )
Tag.tests.cpp:<line number>: passed: testCase.tags.size() == 2 for: 2 == 2
Tag.tests.cpp:<line number>: passed: testCase.tags, VectorContains( Tag( "tag with spaces" ) ) && VectorContains( Tag( "I said \"good day\" sir!"_catch_sr ) ) for: { {?}, {?} } ( Contains: {?} and Contains: {?} )
+GeneratorsImpl.tests.cpp:<line number>: passed: take.get() == 0 for: 0 == 0
+GeneratorsImpl.tests.cpp:<line number>: passed: take.get() == 2 for: 2 == 2
+GeneratorsImpl.tests.cpp:<line number>: passed: take.get() == 5 for: 5 == 5
+GeneratorsImpl.tests.cpp:<line number>: passed: take.skipToNthElement( 6 )
+GeneratorsImpl.tests.cpp:<line number>: passed: take.get() == 0 for: 0 == 0
+GeneratorsImpl.tests.cpp:<line number>: passed: take.get() == 2 for: 2 == 2
+GeneratorsImpl.tests.cpp:<line number>: passed: take.get() == 5 for: 5 == 5
+GeneratorsImpl.tests.cpp:<line number>: passed: take.skipToNthElement( 6 )
Class.tests.cpp:<line number>: passed: Template_Fixture<TestType>::m_a == 1 for: 1 == 1
Class.tests.cpp:<line number>: passed: Template_Fixture<TestType>::m_a == 1 for: 1 == 1
Class.tests.cpp:<line number>: passed: Template_Fixture<TestType>::m_a == 1 for: 1.0 == 1
@@ -2913,7 +2935,7 @@ InternalBenchmark.tests.cpp:<line number>: passed: med == 18. for: 18.0 == 18.0
InternalBenchmark.tests.cpp:<line number>: passed: q3 == 23. for: 23.0 == 23.0
Misc.tests.cpp:<line number>: passed:
Misc.tests.cpp:<line number>: passed:
-test cases: 440 | 320 passed | 96 failed | 6 skipped | 18 failed as expected
-assertions: 2340 | 2139 passed | 158 failed | 43 failed as expected
+test cases: 443 | 323 passed | 96 failed | 6 skipped | 18 failed as expected
+assertions: 2362 | 2161 passed | 158 failed | 43 failed as expected
diff --git a/tests/SelfTest/Baselines/console.std.approved.txt b/tests/SelfTest/Baselines/console.std.approved.txt
index 02d7a3cb..4529fef8 100644
--- a/tests/SelfTest/Baselines/console.std.approved.txt
+++ b/tests/SelfTest/Baselines/console.std.approved.txt
@@ -1743,6 +1743,6 @@ due to unexpected exception with message:
Why would you throw a std::string?
===============================================================================
-test cases: 440 | 338 passed | 76 failed | 7 skipped | 19 failed as expected
-assertions: 2318 | 2139 passed | 136 failed | 43 failed as expected
+test cases: 443 | 341 passed | 76 failed | 7 skipped | 19 failed as expected
+assertions: 2340 | 2161 passed | 136 failed | 43 failed as expected
diff --git a/tests/SelfTest/Baselines/console.sw.approved.txt b/tests/SelfTest/Baselines/console.sw.approved.txt
index 38578deb..48a4c85f 100644
--- a/tests/SelfTest/Baselines/console.sw.approved.txt
+++ b/tests/SelfTest/Baselines/console.sw.approved.txt
@@ -4833,6 +4833,40 @@ GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE_THROWS_AS( filter( []( int ) { return false; }, value( 3 ) ), Catch::GeneratorException )
-------------------------------------------------------------------------------
+FixedValuesGenerator can be skipped forward
+-------------------------------------------------------------------------------
+GeneratorsImpl.tests.cpp:<line number>
+...............................................................................
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+ REQUIRE( values.currentElementIndex() == 0 )
+with expansion:
+ 0 == 0
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+ REQUIRE( values.currentElementIndex() == 3 )
+with expansion:
+ 3 == 3
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+ REQUIRE( values.get() == 3 )
+with expansion:
+ 3 == 3
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+ REQUIRE( values.currentElementIndex() == 4 )
+with expansion:
+ 4 == 4
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+ REQUIRE( values.get() == 4 )
+with expansion:
+ 4 == 4
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+ REQUIRE_THROWS( values.skipToNthElement( 5 ) )
+
+-------------------------------------------------------------------------------
Floating point matchers: double
Relative
-------------------------------------------------------------------------------
@@ -8135,6 +8169,50 @@ with message:
was called
-------------------------------------------------------------------------------
+MapGenerator can be skipped forward efficiently
+-------------------------------------------------------------------------------
+GeneratorsImpl.tests.cpp:<line number>
+...............................................................................
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+ REQUIRE( map_generator.get() == 4 )
+with expansion:
+ 4 == 4
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+ REQUIRE( map_calls == map_calls_1 + 1 )
+with expansion:
+ 2 == 2
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+ REQUIRE( map_generator.get() == 4 )
+with expansion:
+ 4 == 4
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+ REQUIRE( map_calls == map_calls_1 + 1 )
+with expansion:
+ 2 == 2
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+ REQUIRE( map_generator.get() == 6 )
+with expansion:
+ 6 == 6
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+ REQUIRE( map_calls == map_calls_2 + 1 )
+with expansion:
+ 3 == 3
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+ REQUIRE_THROWS( map_generator.skipToNthElement( 7 ) )
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+ REQUIRE( map_calls == map_calls_2 + 1 )
+with expansion:
+ 3 == 3
+
+-------------------------------------------------------------------------------
Matchers can be (AllOf) composed with the && operator
-------------------------------------------------------------------------------
Matchers.tests.cpp:<line number>
@@ -12238,6 +12316,56 @@ with expansion:
{ {?}, {?} } ( Contains: {?} and Contains: {?} )
-------------------------------------------------------------------------------
+TakeGenerator can be skipped forward
+ take is shorter than underlying
+-------------------------------------------------------------------------------
+GeneratorsImpl.tests.cpp:<line number>
+...............................................................................
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+ REQUIRE( take.get() == 0 )
+with expansion:
+ 0 == 0
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+ REQUIRE( take.get() == 2 )
+with expansion:
+ 2 == 2
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+ REQUIRE( take.get() == 5 )
+with expansion:
+ 5 == 5
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+ REQUIRE_THROWS( take.skipToNthElement( 6 ) )
+
+-------------------------------------------------------------------------------
+TakeGenerator can be skipped forward
+ take is longer than underlying
+-------------------------------------------------------------------------------
+GeneratorsImpl.tests.cpp:<line number>
+...............................................................................
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+ REQUIRE( take.get() == 0 )
+with expansion:
+ 0 == 0
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+ REQUIRE( take.get() == 2 )
+with expansion:
+ 2 == 2
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+ REQUIRE( take.get() == 5 )
+with expansion:
+ 5 == 5
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+ REQUIRE_THROWS( take.skipToNthElement( 6 ) )
+
+-------------------------------------------------------------------------------
Template test case method with test types specified inside std::tuple - MyTypes
- 0
-------------------------------------------------------------------------------
@@ -19589,6 +19717,6 @@ Misc.tests.cpp:<line number>
Misc.tests.cpp:<line number>: PASSED:
===============================================================================
-test cases: 440 | 320 passed | 96 failed | 6 skipped | 18 failed as expected
-assertions: 2340 | 2139 passed | 158 failed | 43 failed as expected
+test cases: 443 | 323 passed | 96 failed | 6 skipped | 18 failed as expected
+assertions: 2362 | 2161 passed | 158 failed | 43 failed as expected
diff --git a/tests/SelfTest/Baselines/console.sw.multi.approved.txt b/tests/SelfTest/Baselines/console.sw.multi.approved.txt
index 207697cf..7845ed07 100644
--- a/tests/SelfTest/Baselines/console.sw.multi.approved.txt
+++ b/tests/SelfTest/Baselines/console.sw.multi.approved.txt
@@ -4831,6 +4831,40 @@ GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE_THROWS_AS( filter( []( int ) { return false; }, value( 3 ) ), Catch::GeneratorException )
-------------------------------------------------------------------------------
+FixedValuesGenerator can be skipped forward
+-------------------------------------------------------------------------------
+GeneratorsImpl.tests.cpp:<line number>
+...............................................................................
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+ REQUIRE( values.currentElementIndex() == 0 )
+with expansion:
+ 0 == 0
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+ REQUIRE( values.currentElementIndex() == 3 )
+with expansion:
+ 3 == 3
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+ REQUIRE( values.get() == 3 )
+with expansion:
+ 3 == 3
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+ REQUIRE( values.currentElementIndex() == 4 )
+with expansion:
+ 4 == 4
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+ REQUIRE( values.get() == 4 )
+with expansion:
+ 4 == 4
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+ REQUIRE_THROWS( values.skipToNthElement( 5 ) )
+
+-------------------------------------------------------------------------------
Floating point matchers: double
Relative
-------------------------------------------------------------------------------
@@ -8133,6 +8167,50 @@ with message:
was called
-------------------------------------------------------------------------------
+MapGenerator can be skipped forward efficiently
+-------------------------------------------------------------------------------
+GeneratorsImpl.tests.cpp:<line number>
+...............................................................................
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+ REQUIRE( map_generator.get() == 4 )
+with expansion:
+ 4 == 4
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+ REQUIRE( map_calls == map_calls_1 + 1 )
+with expansion:
+ 2 == 2
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+ REQUIRE( map_generator.get() == 4 )
+with expansion:
+ 4 == 4
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+ REQUIRE( map_calls == map_calls_1 + 1 )
+with expansion:
+ 2 == 2
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+ REQUIRE( map_generator.get() == 6 )
+with expansion:
+ 6 == 6
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+ REQUIRE( map_calls == map_calls_2 + 1 )
+with expansion:
+ 3 == 3
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+ REQUIRE_THROWS( map_generator.skipToNthElement( 7 ) )
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+ REQUIRE( map_calls == map_calls_2 + 1 )
+with expansion:
+ 3 == 3
+
+-------------------------------------------------------------------------------
Matchers can be (AllOf) composed with the && operator
-------------------------------------------------------------------------------
Matchers.tests.cpp:<line number>
@@ -12231,6 +12309,56 @@ with expansion:
{ {?}, {?} } ( Contains: {?} and Contains: {?} )
-------------------------------------------------------------------------------
+TakeGenerator can be skipped forward
+ take is shorter than underlying
+-------------------------------------------------------------------------------
+GeneratorsImpl.tests.cpp:<line number>
+...............................................................................
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+ REQUIRE( take.get() == 0 )
+with expansion:
+ 0 == 0
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+ REQUIRE( take.get() == 2 )
+with expansion:
+ 2 == 2
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+ REQUIRE( take.get() == 5 )
+with expansion:
+ 5 == 5
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+ REQUIRE_THROWS( take.skipToNthElement( 6 ) )
+
+-------------------------------------------------------------------------------
+TakeGenerator can be skipped forward
+ take is longer than underlying
+-------------------------------------------------------------------------------
+GeneratorsImpl.tests.cpp:<line number>
+...............................................................................
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+ REQUIRE( take.get() == 0 )
+with expansion:
+ 0 == 0
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+ REQUIRE( take.get() == 2 )
+with expansion:
+ 2 == 2
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+ REQUIRE( take.get() == 5 )
+with expansion:
+ 5 == 5
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+ REQUIRE_THROWS( take.skipToNthElement( 6 ) )
+
+-------------------------------------------------------------------------------
Template test case method with test types specified inside std::tuple - MyTypes
- 0
-------------------------------------------------------------------------------
@@ -19578,6 +19706,6 @@ Misc.tests.cpp:<line number>
Misc.tests.cpp:<line number>: PASSED:
===============================================================================
-test cases: 440 | 320 passed | 96 failed | 6 skipped | 18 failed as expected
-assertions: 2340 | 2139 passed | 158 failed | 43 failed as expected
+test cases: 443 | 323 passed | 96 failed | 6 skipped | 18 failed as expected
+assertions: 2362 | 2161 passed | 158 failed | 43 failed as expected
diff --git a/tests/SelfTest/Baselines/junit.sw.approved.txt b/tests/SelfTest/Baselines/junit.sw.approved.txt
index beaf9cf8..9f13c847 100644
--- a/tests/SelfTest/Baselines/junit.sw.approved.txt
+++ b/tests/SelfTest/Baselines/junit.sw.approved.txt
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<testsuitesloose text artifact
>
- <testsuite name="<exe-name>" errors="17" failures="141" skipped="12" tests="2352" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}">
+ <testsuite name="<exe-name>" errors="17" failures="141" skipped="12" tests="2374" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}">
<properties>
<property name="random-seed" value="1"/>
<property name="filters" value="&quot;*&quot; ~[!nonportable] ~[!benchmark] ~[approvals]"/>
@@ -814,6 +814,7 @@ at Message.tests.cpp:<line number>
</testcase>
<testcase classname="<exe-name>.global" name="Factorials are computed" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Filter generator throws exception for empty generator" time="{duration}" status="run"/>
+ <testcase classname="<exe-name>.global" name="FixedValuesGenerator can be skipped forward" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Floating point matchers: double" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Floating point matchers: double/Relative" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Floating point matchers: double/Relative/Some subnormal values" time="{duration}" status="run"/>
@@ -1023,6 +1024,7 @@ at Condition.tests.cpp:<line number>
<testcase classname="<exe-name>.global" name="Lambdas in assertions" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Less-than inequalities with different epsilons" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="ManuallyRegistered" time="{duration}" status="run"/>
+ <testcase classname="<exe-name>.global" name="MapGenerator can be skipped forward efficiently" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Matchers can be (AllOf) composed with the &amp;&amp; operator" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Matchers can be (AnyOf) composed with the || operator" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Matchers can be composed with both &amp;&amp; and ||" time="{duration}" status="run"/>
@@ -1555,6 +1557,9 @@ at Misc.tests.cpp:<line number>
<testcase classname="<exe-name>.global" name="Tag alias can be registered against tag patterns/The same tag alias can only be registered once" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Tag alias can be registered against tag patterns/Tag aliases must be of the form [@name]" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Tags with spaces and non-alphanumerical characters are accepted" time="{duration}" status="run"/>
+ <testcase classname="<exe-name>.global" name="TakeGenerator can be skipped forward" time="{duration}" status="run"/>
+ <testcase classname="<exe-name>.global" name="TakeGenerator can be skipped forward/take is shorter than underlying" time="{duration}" status="run"/>
+ <testcase classname="<exe-name>.global" name="TakeGenerator can be skipped forward/take is longer than underlying" time="{duration}" status="run"/>
<testcase classname="<exe-name>.Template_Fixture" name="Template test case method with test types specified inside std::tuple - MyTypes - 0" time="{duration}" status="run"/>
<testcase classname="<exe-name>.Template_Fixture" name="Template test case method with test types specified inside std::tuple - MyTypes - 1" time="{duration}" status="run"/>
<testcase classname="<exe-name>.Template_Fixture" name="Template test case method with test types specified inside std::tuple - MyTypes - 2" time="{duration}" status="run"/>
diff --git a/tests/SelfTest/Baselines/junit.sw.multi.approved.txt b/tests/SelfTest/Baselines/junit.sw.multi.approved.txt
index a69a4979..ec33f1ba 100644
--- a/tests/SelfTest/Baselines/junit.sw.multi.approved.txt
+++ b/tests/SelfTest/Baselines/junit.sw.multi.approved.txt
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<testsuites>
- <testsuite name="<exe-name>" errors="17" failures="141" skipped="12" tests="2352" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}">
+ <testsuite name="<exe-name>" errors="17" failures="141" skipped="12" tests="2374" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}">
<properties>
<property name="random-seed" value="1"/>
<property name="filters" value="&quot;*&quot; ~[!nonportable] ~[!benchmark] ~[approvals]"/>
@@ -813,6 +813,7 @@ at Message.tests.cpp:<line number>
</testcase>
<testcase classname="<exe-name>.global" name="Factorials are computed" time="{duration}" status="run"/>
<testcase classname="<exe-na