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

summaryrefslogtreecommitdiffhomepage
path: root/tests/SelfTest
diff options
context:
space:
mode:
authorMartin Hořeňovský2026-02-09 19:05:39 +0100
committerMartin Hořeňovský2026-02-10 09:37:15 +0100
commitd079ee13ab137547ab26bd1ed5ca2858d7fbd847 (patch)
tree1e73da54d02eecbf095dd07bd4c0183d7a7f107b /tests/SelfTest
parent0056cd4efb01ab65f02af188e137fc65d79e18f8 (diff)
downloadcatch3-d079ee13ab137547ab26bd1ed5ca2858d7fbd847.tar.gz
Allow generators to declare themselves (infinite)
This will be useful later to implement warning on infinitely running `GENERATE` expressions.
Diffstat (limited to 'tests/SelfTest')
-rw-r--r--tests/SelfTest/Baselines/automake.sw.approved.txt5
-rw-r--r--tests/SelfTest/Baselines/automake.sw.multi.approved.txt5
-rw-r--r--tests/SelfTest/Baselines/compact.sw.approved.txt18
-rw-r--r--tests/SelfTest/Baselines/compact.sw.multi.approved.txt18
-rw-r--r--tests/SelfTest/Baselines/console.std.approved.txt4
-rw-r--r--tests/SelfTest/Baselines/console.sw.approved.txt131
-rw-r--r--tests/SelfTest/Baselines/console.sw.multi.approved.txt131
-rw-r--r--tests/SelfTest/Baselines/junit.sw.approved.txt12
-rw-r--r--tests/SelfTest/Baselines/junit.sw.multi.approved.txt12
-rw-r--r--tests/SelfTest/Baselines/sonarqube.sw.approved.txt10
-rw-r--r--tests/SelfTest/Baselines/sonarqube.sw.multi.approved.txt10
-rw-r--r--tests/SelfTest/Baselines/tap.sw.approved.txt30
-rw-r--r--tests/SelfTest/Baselines/tap.sw.multi.approved.txt30
-rw-r--r--tests/SelfTest/Baselines/teamcity.sw.approved.txt10
-rw-r--r--tests/SelfTest/Baselines/teamcity.sw.multi.approved.txt10
-rw-r--r--tests/SelfTest/Baselines/xml.sw.approved.txt146
-rw-r--r--tests/SelfTest/Baselines/xml.sw.multi.approved.txt146
-rw-r--r--tests/SelfTest/IntrospectiveTests/GeneratorsImpl.tests.cpp69
-rw-r--r--tests/SelfTest/UsageTests/Generators.tests.cpp1
-rw-r--r--tests/SelfTest/UsageTests/Skip.tests.cpp2
20 files changed, 782 insertions, 18 deletions
diff --git a/tests/SelfTest/Baselines/automake.sw.approved.txt b/tests/SelfTest/Baselines/automake.sw.approved.txt
index 314feb2f..bc019b38 100644
--- a/tests/SelfTest/Baselines/automake.sw.approved.txt
+++ b/tests/SelfTest/Baselines/automake.sw.approved.txt
@@ -169,6 +169,7 @@ Nor would this
:test-result: PASS Floating point matchers: double
:test-result: PASS Floating point matchers: float
:test-result: PASS GENERATE can combine literals and generators
+:test-result: PASS Generator adapters properly handle isFinite
:test-result: PASS Generators -- adapters
:test-result: PASS Generators -- simple
:test-result: PASS Generators can be skipped forward
@@ -226,11 +227,15 @@ Nor would this
:test-result: PASS Product with differing arities - std::tuple<int>
:test-result: PASS Random seed generation accepts known methods
:test-result: PASS Random seed generation reports unknown methods
+:test-result: PASS RandomGenerator reports itself as infinite - float
+:test-result: PASS RandomGenerator reports itself as infinite - int
+:test-result: PASS RandomGenerator reports itself as infinite - long double
:test-result: PASS Range type with sentinel
:test-result: FAIL Reconstruction should be based on stringification: #914
:test-result: FAIL Regex string matcher
:test-result: PASS Registering reporter with '::' in name fails
:test-result: PASS Regression test #1
+:test-result: PASS RepeatGenerator refuses infinite generators
:test-result: PASS Reporter's write listings to provided stream
:test-result: PASS Reproducer for #2309 - a very long description past 80 chars (default console width) with a late colon : blablabla
:test-result: PASS SUCCEED counts as a test pass
diff --git a/tests/SelfTest/Baselines/automake.sw.multi.approved.txt b/tests/SelfTest/Baselines/automake.sw.multi.approved.txt
index e646593d..3079c349 100644
--- a/tests/SelfTest/Baselines/automake.sw.multi.approved.txt
+++ b/tests/SelfTest/Baselines/automake.sw.multi.approved.txt
@@ -167,6 +167,7 @@
:test-result: PASS Floating point matchers: double
:test-result: PASS Floating point matchers: float
:test-result: PASS GENERATE can combine literals and generators
+:test-result: PASS Generator adapters properly handle isFinite
:test-result: PASS Generators -- adapters
:test-result: PASS Generators -- simple
:test-result: PASS Generators can be skipped forward
@@ -224,11 +225,15 @@
:test-result: PASS Product with differing arities - std::tuple<int>
:test-result: PASS Random seed generation accepts known methods
:test-result: PASS Random seed generation reports unknown methods
+:test-result: PASS RandomGenerator reports itself as infinite - float
+:test-result: PASS RandomGenerator reports itself as infinite - int
+:test-result: PASS RandomGenerator reports itself as infinite - long double
:test-result: PASS Range type with sentinel
:test-result: FAIL Reconstruction should be based on stringification: #914
:test-result: FAIL Regex string matcher
:test-result: PASS Registering reporter with '::' in name fails
:test-result: PASS Regression test #1
+:test-result: PASS RepeatGenerator refuses infinite generators
:test-result: PASS Reporter's write listings to provided stream
:test-result: PASS Reproducer for #2309 - a very long description past 80 chars (default console width) with a late colon : blablabla
:test-result: PASS SUCCEED counts as a test pass
diff --git a/tests/SelfTest/Baselines/compact.sw.approved.txt b/tests/SelfTest/Baselines/compact.sw.approved.txt
index 94123b41..f4da808e 100644
--- a/tests/SelfTest/Baselines/compact.sw.approved.txt
+++ b/tests/SelfTest/Baselines/compact.sw.approved.txt
@@ -751,6 +751,16 @@ Generators.tests.cpp:<line number>: passed: i % 2 == 0 for: 0 == 0
Generators.tests.cpp:<line number>: passed: i % 2 == 0 for: 0 == 0
Generators.tests.cpp:<line number>: passed: i % 2 == 0 for: 0 == 0
Generators.tests.cpp:<line number>: passed: i % 2 == 0 for: 0 == 0
+GeneratorsImpl.tests.cpp:<line number>: passed: finite_cat.isFinite() for: true
+GeneratorsImpl.tests.cpp:<line number>: passed: !(infinite_cat.isFinite()) for: !false
+GeneratorsImpl.tests.cpp:<line number>: passed: take_1.isFinite() for: true
+GeneratorsImpl.tests.cpp:<line number>: passed: take_2.isFinite() for: true
+GeneratorsImpl.tests.cpp:<line number>: passed: finite_chunk.isFinite() for: true
+GeneratorsImpl.tests.cpp:<line number>: passed: !(infinite_chunk.isFinite()) for: !false
+GeneratorsImpl.tests.cpp:<line number>: passed: finite_map.isFinite() for: true
+GeneratorsImpl.tests.cpp:<line number>: passed: !(infinite_map.isFinite()) for: !false
+GeneratorsImpl.tests.cpp:<line number>: passed: finite_filter.isFinite() for: true
+GeneratorsImpl.tests.cpp:<line number>: passed: !(infinite_filter.isFinite()) for: !false
Generators.tests.cpp:<line number>: passed: i % 2 == 0 for: 0 == 0
Generators.tests.cpp:<line number>: passed: i % 2 == 0 for: 0 == 0
Generators.tests.cpp:<line number>: passed: i % 2 == 0 for: 0 == 0
@@ -1559,6 +1569,9 @@ RandomNumberGeneration.tests.cpp:<line number>: passed: Catch::generateRandomSee
RandomNumberGeneration.tests.cpp:<line number>: passed: Catch::generateRandomSeed(method)
RandomNumberGeneration.tests.cpp:<line number>: passed: Catch::generateRandomSeed(method)
RandomNumberGeneration.tests.cpp:<line number>: passed: Catch::generateRandomSeed(static_cast<Catch::GenerateFrom>(77))
+GeneratorsImpl.tests.cpp:<line number>: passed: !(Catch::Generators::random( TestType{ 0 }, TestType{ 100 } ).isFinite()) for: !false
+GeneratorsImpl.tests.cpp:<line number>: passed: !(Catch::Generators::random( TestType{ 0 }, TestType{ 100 } ).isFinite()) for: !false
+GeneratorsImpl.tests.cpp:<line number>: passed: !(Catch::Generators::random( TestType{ 0 }, TestType{ 100 } ).isFinite()) for: !false
ToString.tests.cpp:<line number>: passed: Catch::Detail::stringify(UsesSentinel{}) == "{ }" for: "{ }" == "{ }"
Decomposition.tests.cpp:<line number>: failed: truthy(false) for: Hey, its truthy!
Matchers.tests.cpp:<line number>: failed: testStringForMatching(), Matches( "this STRING contains 'abc' as a substring" ) for: "this string contains 'abc' as a substring" matches "this STRING contains 'abc' as a substring" case sensitively
@@ -1566,6 +1579,7 @@ Matchers.tests.cpp:<line number>: failed: testStringForMatching(), Matches( "con
Matchers.tests.cpp:<line number>: failed: testStringForMatching(), Matches( "this string contains 'abc' as a" ) for: "this string contains 'abc' as a substring" matches "this string contains 'abc' as a" case sensitively
Reporters.tests.cpp:<line number>: passed: registry.registerReporter( "with::doublecolons", Catch::Detail::make_unique<TestReporterFactory>() ), "'::' is not allowed in reporter name: 'with::doublecolons'" for: "'::' is not allowed in reporter name: 'with::doublecolons'" equals: "'::' is not allowed in reporter name: 'with::doublecolons'"
Matchers.tests.cpp:<line number>: passed: actual, !UnorderedEquals( expected ) for: { 'a', 'b' } not UnorderedEquals: { 'c', 'b' }
+GeneratorsImpl.tests.cpp:<line number>: passed: RepeatGenerator<int>( 2, random( 1, 100 ) )
Reporters.tests.cpp:<line number>: passed: !(factories.empty()) for: !false
Reporters.tests.cpp:<line number>: passed: listingString, ContainsSubstring("fakeTag"s) for: "All available tags:
1 [fakeTag]
@@ -2946,7 +2960,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: 443 | 323 passed | 96 failed | 6 skipped | 18 failed as expected
-assertions: 2362 | 2161 passed | 158 failed | 43 failed as expected
+test cases: 448 | 328 passed | 96 failed | 6 skipped | 18 failed as expected
+assertions: 2376 | 2175 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 e44e771d..d6348ab0 100644
--- a/tests/SelfTest/Baselines/compact.sw.multi.approved.txt
+++ b/tests/SelfTest/Baselines/compact.sw.multi.approved.txt
@@ -749,6 +749,16 @@ Generators.tests.cpp:<line number>: passed: i % 2 == 0 for: 0 == 0
Generators.tests.cpp:<line number>: passed: i % 2 == 0 for: 0 == 0
Generators.tests.cpp:<line number>: passed: i % 2 == 0 for: 0 == 0
Generators.tests.cpp:<line number>: passed: i % 2 == 0 for: 0 == 0
+GeneratorsImpl.tests.cpp:<line number>: passed: finite_cat.isFinite() for: true
+GeneratorsImpl.tests.cpp:<line number>: passed: !(infinite_cat.isFinite()) for: !false
+GeneratorsImpl.tests.cpp:<line number>: passed: take_1.isFinite() for: true
+GeneratorsImpl.tests.cpp:<line number>: passed: take_2.isFinite() for: true
+GeneratorsImpl.tests.cpp:<line number>: passed: finite_chunk.isFinite() for: true
+GeneratorsImpl.tests.cpp:<line number>: passed: !(infinite_chunk.isFinite()) for: !false
+GeneratorsImpl.tests.cpp:<line number>: passed: finite_map.isFinite() for: true
+GeneratorsImpl.tests.cpp:<line number>: passed: !(infinite_map.isFinite()) for: !false
+GeneratorsImpl.tests.cpp:<line number>: passed: finite_filter.isFinite() for: true
+GeneratorsImpl.tests.cpp:<line number>: passed: !(infinite_filter.isFinite()) for: !false
Generators.tests.cpp:<line number>: passed: i % 2 == 0 for: 0 == 0
Generators.tests.cpp:<line number>: passed: i % 2 == 0 for: 0 == 0
Generators.tests.cpp:<line number>: passed: i % 2 == 0 for: 0 == 0
@@ -1557,6 +1567,9 @@ RandomNumberGeneration.tests.cpp:<line number>: passed: Catch::generateRandomSee
RandomNumberGeneration.tests.cpp:<line number>: passed: Catch::generateRandomSeed(method)
RandomNumberGeneration.tests.cpp:<line number>: passed: Catch::generateRandomSeed(method)
RandomNumberGeneration.tests.cpp:<line number>: passed: Catch::generateRandomSeed(static_cast<Catch::GenerateFrom>(77))
+GeneratorsImpl.tests.cpp:<line number>: passed: !(Catch::Generators::random( TestType{ 0 }, TestType{ 100 } ).isFinite()) for: !false
+GeneratorsImpl.tests.cpp:<line number>: passed: !(Catch::Generators::random( TestType{ 0 }, TestType{ 100 } ).isFinite()) for: !false
+GeneratorsImpl.tests.cpp:<line number>: passed: !(Catch::Generators::random( TestType{ 0 }, TestType{ 100 } ).isFinite()) for: !false
ToString.tests.cpp:<line number>: passed: Catch::Detail::stringify(UsesSentinel{}) == "{ }" for: "{ }" == "{ }"
Decomposition.tests.cpp:<line number>: failed: truthy(false) for: Hey, its truthy!
Matchers.tests.cpp:<line number>: failed: testStringForMatching(), Matches( "this STRING contains 'abc' as a substring" ) for: "this string contains 'abc' as a substring" matches "this STRING contains 'abc' as a substring" case sensitively
@@ -1564,6 +1577,7 @@ Matchers.tests.cpp:<line number>: failed: testStringForMatching(), Matches( "con
Matchers.tests.cpp:<line number>: failed: testStringForMatching(), Matches( "this string contains 'abc' as a" ) for: "this string contains 'abc' as a substring" matches "this string contains 'abc' as a" case sensitively
Reporters.tests.cpp:<line number>: passed: registry.registerReporter( "with::doublecolons", Catch::Detail::make_unique<TestReporterFactory>() ), "'::' is not allowed in reporter name: 'with::doublecolons'" for: "'::' is not allowed in reporter name: 'with::doublecolons'" equals: "'::' is not allowed in reporter name: 'with::doublecolons'"
Matchers.tests.cpp:<line number>: passed: actual, !UnorderedEquals( expected ) for: { 'a', 'b' } not UnorderedEquals: { 'c', 'b' }
+GeneratorsImpl.tests.cpp:<line number>: passed: RepeatGenerator<int>( 2, random( 1, 100 ) )
Reporters.tests.cpp:<line number>: passed: !(factories.empty()) for: !false
Reporters.tests.cpp:<line number>: passed: listingString, ContainsSubstring("fakeTag"s) for: "All available tags:
1 [fakeTag]
@@ -2935,7 +2949,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: 443 | 323 passed | 96 failed | 6 skipped | 18 failed as expected
-assertions: 2362 | 2161 passed | 158 failed | 43 failed as expected
+test cases: 448 | 328 passed | 96 failed | 6 skipped | 18 failed as expected
+assertions: 2376 | 2175 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 4529fef8..cd178a0c 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: 443 | 341 passed | 76 failed | 7 skipped | 19 failed as expected
-assertions: 2340 | 2161 passed | 136 failed | 43 failed as expected
+test cases: 448 | 346 passed | 76 failed | 7 skipped | 19 failed as expected
+assertions: 2354 | 2175 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 48a4c85f..f5166de0 100644
--- a/tests/SelfTest/Baselines/console.sw.approved.txt
+++ b/tests/SelfTest/Baselines/console.sw.approved.txt
@@ -5315,6 +5315,91 @@ with expansion:
0 == 0
-------------------------------------------------------------------------------
+Generator adapters properly handle isFinite
+ concat generator
+-------------------------------------------------------------------------------
+GeneratorsImpl.tests.cpp:<line number>
+...............................................................................
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+ REQUIRE( finite_cat.isFinite() )
+with expansion:
+ true
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+ REQUIRE_FALSE( infinite_cat.isFinite() )
+with expansion:
+ !false
+
+-------------------------------------------------------------------------------
+Generator adapters properly handle isFinite
+ take generator
+-------------------------------------------------------------------------------
+GeneratorsImpl.tests.cpp:<line number>
+...............................................................................
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+ REQUIRE( take_1.isFinite() )
+with expansion:
+ true
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+ REQUIRE( take_2.isFinite() )
+with expansion:
+ true
+
+-------------------------------------------------------------------------------
+Generator adapters properly handle isFinite
+ chunk generator
+-------------------------------------------------------------------------------
+GeneratorsImpl.tests.cpp:<line number>
+...............................................................................
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+ REQUIRE( finite_chunk.isFinite() )
+with expansion:
+ true
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+ REQUIRE_FALSE( infinite_chunk.isFinite() )
+with expansion:
+ !false
+
+-------------------------------------------------------------------------------
+Generator adapters properly handle isFinite
+ map
+-------------------------------------------------------------------------------
+GeneratorsImpl.tests.cpp:<line number>
+...............................................................................
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+ REQUIRE( finite_map.isFinite() )
+with expansion:
+ true
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+ REQUIRE_FALSE( infinite_map.isFinite() )
+with expansion:
+ !false
+
+-------------------------------------------------------------------------------
+Generator adapters properly handle isFinite
+ filter
+-------------------------------------------------------------------------------
+GeneratorsImpl.tests.cpp:<line number>
+...............................................................................
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+ REQUIRE( finite_filter.isFinite() )
+with expansion:
+ true
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+ REQUIRE_FALSE( infinite_filter.isFinite() )
+with expansion:
+ !false
+
+-------------------------------------------------------------------------------
Generators -- adapters
Filtering by predicate
Basic usage
@@ -10368,6 +10453,39 @@ RandomNumberGeneration.tests.cpp:<line number>: PASSED:
REQUIRE_THROWS( Catch::generateRandomSeed(static_cast<Catch::GenerateFrom>(77)) )
-------------------------------------------------------------------------------
+RandomGenerator reports itself as infinite - float
+-------------------------------------------------------------------------------
+GeneratorsImpl.tests.cpp:<line number>
+...............................................................................
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+ REQUIRE_FALSE( Catch::Generators::random( TestType{ 0 }, TestType{ 100 } ).isFinite() )
+with expansion:
+ !false
+
+-------------------------------------------------------------------------------
+RandomGenerator reports itself as infinite - int
+-------------------------------------------------------------------------------
+GeneratorsImpl.tests.cpp:<line number>
+...............................................................................
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+ REQUIRE_FALSE( Catch::Generators::random( TestType{ 0 }, TestType{ 100 } ).isFinite() )
+with expansion:
+ !false
+
+-------------------------------------------------------------------------------
+RandomGenerator reports itself as infinite - long double
+-------------------------------------------------------------------------------
+GeneratorsImpl.tests.cpp:<line number>
+...............................................................................
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+ REQUIRE_FALSE( Catch::Generators::random( TestType{ 0 }, TestType{ 100 } ).isFinite() )
+with expansion:
+ !false
+
+-------------------------------------------------------------------------------
Range type with sentinel
-------------------------------------------------------------------------------
ToString.tests.cpp:<line number>
@@ -10437,6 +10555,15 @@ with expansion:
{ 'a', 'b' } not UnorderedEquals: { 'c', 'b' }
-------------------------------------------------------------------------------
+RepeatGenerator refuses infinite generators
+-------------------------------------------------------------------------------
+GeneratorsImpl.tests.cpp:<line number>
+...............................................................................
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+ REQUIRE_THROWS( RepeatGenerator<int>( 2, random( 1, 100 ) ) )
+
+-------------------------------------------------------------------------------
Reporter's write listings to provided stream
-------------------------------------------------------------------------------
Reporters.tests.cpp:<line number>
@@ -19717,6 +19844,6 @@ Misc.tests.cpp:<line number>
Misc.tests.cpp:<line number>: PASSED:
===============================================================================
-test cases: 443 | 323 passed | 96 failed | 6 skipped | 18 failed as expected
-assertions: 2362 | 2161 passed | 158 failed | 43 failed as expected
+test cases: 448 | 328 passed | 96 failed | 6 skipped | 18 failed as expected
+assertions: 2376 | 2175 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 7845ed07..bfb0f4bb 100644
--- a/tests/SelfTest/Baselines/console.sw.multi.approved.txt
+++ b/tests/SelfTest/Baselines/console.sw.multi.approved.txt
@@ -5313,6 +5313,91 @@ with expansion:
0 == 0
-------------------------------------------------------------------------------
+Generator adapters properly handle isFinite
+ concat generator
+-------------------------------------------------------------------------------
+GeneratorsImpl.tests.cpp:<line number>
+...............................................................................
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+ REQUIRE( finite_cat.isFinite() )
+with expansion:
+ true
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+ REQUIRE_FALSE( infinite_cat.isFinite() )
+with expansion:
+ !false
+
+-------------------------------------------------------------------------------
+Generator adapters properly handle isFinite
+ take generator
+-------------------------------------------------------------------------------
+GeneratorsImpl.tests.cpp:<line number>
+...............................................................................
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+ REQUIRE( take_1.isFinite() )
+with expansion:
+ true
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+ REQUIRE( take_2.isFinite() )
+with expansion:
+ true
+
+-------------------------------------------------------------------------------
+Generator adapters properly handle isFinite
+ chunk generator
+-------------------------------------------------------------------------------
+GeneratorsImpl.tests.cpp:<line number>
+...............................................................................
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+ REQUIRE( finite_chunk.isFinite() )
+with expansion:
+ true
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+ REQUIRE_FALSE( infinite_chunk.isFinite() )
+with expansion:
+ !false
+
+-------------------------------------------------------------------------------
+Generator adapters properly handle isFinite
+ map
+-------------------------------------------------------------------------------
+GeneratorsImpl.tests.cpp:<line number>
+...............................................................................
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+ REQUIRE( finite_map.isFinite() )
+with expansion:
+ true
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+ REQUIRE_FALSE( infinite_map.isFinite() )
+with expansion:
+ !false
+
+-------------------------------------------------------------------------------
+Generator adapters properly handle isFinite
+ filter
+-------------------------------------------------------------------------------
+GeneratorsImpl.tests.cpp:<line number>
+...............................................................................
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+ REQUIRE( finite_filter.isFinite() )
+with expansion:
+ true
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+ REQUIRE_FALSE( infinite_filter.isFinite() )
+with expansion:
+ !false
+
+-------------------------------------------------------------------------------
Generators -- adapters
Filtering by predicate
Basic usage
@@ -10366,6 +10451,39 @@ RandomNumberGeneration.tests.cpp:<line number>: PASSED:
REQUIRE_THROWS( Catch::generateRandomSeed(static_cast<Catch::GenerateFrom>(77)) )
-------------------------------------------------------------------------------
+RandomGenerator reports itself as infinite - float
+-------------------------------------------------------------------------------
+GeneratorsImpl.tests.cpp:<line number>
+...............................................................................
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+ REQUIRE_FALSE( Catch::Generators::random( TestType{ 0 }, TestType{ 100 } ).isFinite() )
+with expansion:
+ !false
+
+-------------------------------------------------------------------------------
+RandomGenerator reports itself as infinite - int
+-------------------------------------------------------------------------------
+GeneratorsImpl.tests.cpp:<line number>
+...............................................................................
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+ REQUIRE_FALSE( Catch::Generators::random( TestType{ 0 }, TestType{ 100 } ).isFinite() )
+with expansion:
+ !false
+
+-------------------------------------------------------------------------------
+RandomGenerator reports itself as infinite - long double
+-------------------------------------------------------------------------------
+GeneratorsImpl.tests.cpp:<line number>
+...............................................................................
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+ REQUIRE_FALSE( Catch::Generators::random( TestType{ 0 }, TestType{ 100 } ).isFinite() )
+with expansion:
+ !false
+
+-------------------------------------------------------------------------------
Range type with sentinel
-------------------------------------------------------------------------------
ToString.tests.cpp:<line number>
@@ -10435,6 +10553,15 @@ with expansion:
{ 'a', 'b' } not UnorderedEquals: { 'c', 'b' }
-------------------------------------------------------------------------------
+RepeatGenerator refuses infinite generators
+-------------------------------------------------------------------------------
+GeneratorsImpl.tests.cpp:<line number>
+...............................................................................
+
+GeneratorsImpl.tests.cpp:<line number>: PASSED:
+ REQUIRE_THROWS( RepeatGenerator<int>( 2, random( 1, 100 ) ) )
+
+-------------------------------------------------------------------------------
Reporter's write listings to provided stream
-------------------------------------------------------------------------------
Reporters.tests.cpp:<line number>
@@ -19706,6 +19833,6 @@ Misc.tests.cpp:<line number>
Misc.tests.cpp:<line number>: PASSED:
===============================================================================
-test cases: 443 | 323 passed | 96 failed | 6 skipped | 18 failed as expected
-assertions: 2362 | 2161 passed | 158 failed | 43 failed as expected
+test cases: 448 | 328 passed | 96 failed | 6 skipped | 18 failed as expected
+assertions: 2376 | 2175 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 9f13c847..e3010c82 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="2374" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}">
+ <testsuite name="<exe-name>" errors="17" failures="141" skipped="12" tests="2388" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}">
<properties>
<property name="random-seed" value="1"/>
<property name="filters" value="&quot;*&quot; ~[!nonportable] ~[!benchmark] ~[approvals]"/>
@@ -832,6 +832,12 @@ at Message.tests.cpp:<line number>
<testcase classname="<exe-name>.global" name="Floating point matchers: float/Constructor validation" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Floating point matchers: float/IsNaN" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="GENERATE can combine literals and generators" time="{duration}" status="run"/>
+ <testcase classname="<exe-name>.global" name="Generator adapters properly handle isFinite" time="{duration}" status="run"/>
+ <testcase classname="<exe-name>.global" name="Generator adapters properly handle isFinite/concat generator" time="{duration}" status="run"/>
+ <testcase classname="<exe-name>.global" name="Generator adapters properly handle isFinite/take generator" time="{duration}" status="run"/>
+ <testcase classname="<exe-name>.global" name="Generator adapters properly handle isFinite/chunk generator" time="{duration}" status="run"/>
+ <testcase classname="<exe-name>.global" name="Generator adapters properly handle isFinite/map" time="{duration}" status="run"/>
+ <testcase classname="<exe-name>.global" name="Generator adapters properly handle isFinite/filter" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Generators -- adapters" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Generators -- adapters/Filtering by predicate" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Generators -- adapters/Filtering by predicate/Basic usage" time="{duration}" status="run"/>
@@ -1342,6 +1348,9 @@ at Message.tests.cpp:<line number>
<testcase classname="<exe-name>.global" name="Product with differing arities - std::tuple&lt;int>" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Random seed generation accepts known methods" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Random seed generation reports unknown methods" time="{duration}" status="run"/>
+ <testcase classname="<exe-name>.global" name="RandomGenerator reports itself as infinite - float" time="{duration}" status="run"/>
+ <testcase classname="<exe-name>.global" name="RandomGenerator reports itself as infinite - int" time="{duration}" status="run"/>
+ <testcase classname="<exe-name>.global" name="RandomGenerator reports itself as infinite - long double" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Range type with sentinel" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Reconstruction should be based on stringification: #914" time="{duration}" status="run">
<failure message="truthy(false)" type="CHECK">
@@ -1380,6 +1389,7 @@ at Matchers.tests.cpp:<line number>
</testcase>
<testcase classname="<exe-name>.global" name="Registering reporter with '::' in name fails" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Regression test #1" time="{duration}" status="run"/>
+ <testcase classname="<exe-name>.global" name="RepeatGenerator refuses infinite generators" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/Automake reporter lists tags" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Reporter's write listings to provided stream/Automake reporter lists reporters" 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 ec33f1ba..cc2c9946 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="2374" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}">
+ <testsuite name="<exe-name>" errors="17" failures="141" skipped="12" tests="2388" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}">
<properties>
<property name="random-seed" value="1"/>
<property name="filters" value="&quot;*&quot; ~[!nonportable] ~[!benchmark] ~[approvals]"/>
@@ -831,6 +831,12 @@ at Message.tests.cpp:<line number>
<testcase classname="<exe-name>.global" name="Floating point matchers: float/Constructor validation" time="{duration}" status="run"/>
<testcase classname="<exe-name>.global" name="Float