mirror of
https://github.com/catchorg/Catch2
synced 2026-01-19 04:52:08 +00:00
Add efficient skip forward to Values, Map and Take generators
This commit is contained in:
@@ -93,6 +93,15 @@ namespace Detail {
|
||||
"specialization, use SingleValue Generator instead.");
|
||||
std::vector<T> m_values;
|
||||
size_t m_idx = 0;
|
||||
|
||||
void skipToNthElementImpl( std::size_t n ) override {
|
||||
if ( n >= m_values.size() ) {
|
||||
Detail::throw_generator_exception(
|
||||
"Coud not jump to Nth element: not enough elements" );
|
||||
}
|
||||
m_idx = n;
|
||||
}
|
||||
|
||||
public:
|
||||
FixedValuesGenerator( std::initializer_list<T> values ) : m_values( values ) {}
|
||||
|
||||
|
||||
@@ -22,6 +22,22 @@ namespace Generators {
|
||||
GeneratorWrapper<T> m_generator;
|
||||
size_t m_returned = 0;
|
||||
size_t m_target;
|
||||
|
||||
void skipToNthElementImpl( std::size_t n ) override {
|
||||
if ( n >= m_target ) {
|
||||
Detail::throw_generator_exception(
|
||||
"Coud not jump to Nth element: not enough elements" );
|
||||
}
|
||||
|
||||
for (; m_returned < n; ++m_returned) {
|
||||
const auto success = m_generator.next();
|
||||
if ( !success ) {
|
||||
Detail::throw_generator_exception(
|
||||
"Coud not jump to Nth element: not enough elements" );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public:
|
||||
TakeGenerator(size_t target, GeneratorWrapper<T>&& generator):
|
||||
m_generator(CATCH_MOVE(generator)),
|
||||
@@ -158,6 +174,21 @@ namespace Generators {
|
||||
Func m_function;
|
||||
// To avoid returning dangling reference, we have to save the values
|
||||
T m_cache;
|
||||
|
||||
void skipToNthElementImpl( std::size_t n ) override {
|
||||
for ( size_t curr = GeneratorUntypedBase::currentElementIndex();
|
||||
curr < n;
|
||||
++curr ) {
|
||||
const auto success = m_generator.next();
|
||||
if (!success) {
|
||||
Detail::throw_generator_exception(
|
||||
"Coud not jump to Nth element: not enough elements" );
|
||||
}
|
||||
}
|
||||
|
||||
m_cache = m_function( m_generator.get() );
|
||||
}
|
||||
|
||||
public:
|
||||
template <typename F2 = Func>
|
||||
MapGenerator(F2&& function, GeneratorWrapper<U>&& generator) :
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -4832,6 +4832,40 @@ GeneratorsImpl.tests.cpp:<line number>
|
||||
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
|
||||
@@ -8134,6 +8168,50 @@ Misc.tests.cpp:<line number>: PASSED:
|
||||
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
|
||||
-------------------------------------------------------------------------------
|
||||
@@ -12237,6 +12315,56 @@ Tag.tests.cpp:<line number>: PASSED:
|
||||
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
|
||||
|
||||
|
||||
@@ -4830,6 +4830,40 @@ GeneratorsImpl.tests.cpp:<line number>
|
||||
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
|
||||
@@ -8132,6 +8166,50 @@ Misc.tests.cpp:<line number>: PASSED:
|
||||
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
|
||||
-------------------------------------------------------------------------------
|
||||
@@ -12230,6 +12308,56 @@ Tag.tests.cpp:<line number>: PASSED:
|
||||
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
|
||||
|
||||
|
||||
@@ -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=""*" ~[!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 && 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 && 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"/>
|
||||
|
||||
@@ -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=""*" ~[!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-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"/>
|
||||
@@ -1022,6 +1023,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 && 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 && and ||" time="{duration}" status="run"/>
|
||||
@@ -1554,6 +1556,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"/>
|
||||
|
||||
@@ -149,6 +149,7 @@ at AssertionHandler.tests.cpp:<line number>
|
||||
<testCase name="ConcatGenerator/Cat support single-generator construction" duration="{duration}"/>
|
||||
<testCase name="ConcatGenerator/Iterating over multiple generators" duration="{duration}"/>
|
||||
<testCase name="Filter generator throws exception for empty generator" duration="{duration}"/>
|
||||
<testCase name="FixedValuesGenerator can be skipped forward" duration="{duration}"/>
|
||||
<testCase name="Generators can be skipped forward" duration="{duration}"/>
|
||||
<testCase name="Generators internals" duration="{duration}"/>
|
||||
<testCase name="Generators internals/Single value" duration="{duration}"/>
|
||||
@@ -187,6 +188,10 @@ at AssertionHandler.tests.cpp:<line number>
|
||||
<testCase name="Generators internals/Range/Negative manual step/Integer/Exact" duration="{duration}"/>
|
||||
<testCase name="Generators internals/Range/Negative manual step/Integer/Slightly over end" duration="{duration}"/>
|
||||
<testCase name="Generators internals/Range/Negative manual step/Integer/Slightly under end" duration="{duration}"/>
|
||||
<testCase name="MapGenerator can be skipped forward efficiently" duration="{duration}"/>
|
||||
<testCase name="TakeGenerator can be skipped forward" duration="{duration}"/>
|
||||
<testCase name="TakeGenerator can be skipped forward/take is shorter than underlying" duration="{duration}"/>
|
||||
<testCase name="TakeGenerator can be skipped forward/take is longer than underlying" duration="{duration}"/>
|
||||
</file>
|
||||
<file path="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp">
|
||||
<testCase name="analyse no analysis" duration="{duration}"/>
|
||||
|
||||
@@ -148,6 +148,7 @@ at AssertionHandler.tests.cpp:<line number>
|
||||
<testCase name="ConcatGenerator/Cat support single-generator construction" duration="{duration}"/>
|
||||
<testCase name="ConcatGenerator/Iterating over multiple generators" duration="{duration}"/>
|
||||
<testCase name="Filter generator throws exception for empty generator" duration="{duration}"/>
|
||||
<testCase name="FixedValuesGenerator can be skipped forward" duration="{duration}"/>
|
||||
<testCase name="Generators can be skipped forward" duration="{duration}"/>
|
||||
<testCase name="Generators internals" duration="{duration}"/>
|
||||
<testCase name="Generators internals/Single value" duration="{duration}"/>
|
||||
@@ -186,6 +187,10 @@ at AssertionHandler.tests.cpp:<line number>
|
||||
<testCase name="Generators internals/Range/Negative manual step/Integer/Exact" duration="{duration}"/>
|
||||
<testCase name="Generators internals/Range/Negative manual step/Integer/Slightly over end" duration="{duration}"/>
|
||||
<testCase name="Generators internals/Range/Negative manual step/Integer/Slightly under end" duration="{duration}"/>
|
||||
<testCase name="MapGenerator can be skipped forward efficiently" duration="{duration}"/>
|
||||
<testCase name="TakeGenerator can be skipped forward" duration="{duration}"/>
|
||||
<testCase name="TakeGenerator can be skipped forward/take is shorter than underlying" duration="{duration}"/>
|
||||
<testCase name="TakeGenerator can be skipped forward/take is longer than underlying" duration="{duration}"/>
|
||||
</file>
|
||||
<file path="tests/<exe-name>/IntrospectiveTests/InternalBenchmark.tests.cpp">
|
||||
<testCase name="analyse no analysis" duration="{duration}"/>
|
||||
|
||||
@@ -1212,6 +1212,18 @@ ok {test-number} - Factorial(3) == 6 for: 6 == 6
|
||||
ok {test-number} - Factorial(10) == 3628800 for: 3628800 (0x<hex digits>) == 3628800 (0x<hex digits>)
|
||||
# Filter generator throws exception for empty generator
|
||||
ok {test-number} - filter( []( int ) { return false; }, value( 3 ) ), Catch::GeneratorException
|
||||
# FixedValuesGenerator can be skipped forward
|
||||
ok {test-number} - values.currentElementIndex() == 0 for: 0 == 0
|
||||
# FixedValuesGenerator can be skipped forward
|
||||
ok {test-number} - values.currentElementIndex() == 3 for: 3 == 3
|
||||
# FixedValuesGenerator can be skipped forward
|
||||
ok {test-number} - values.get() == 3 for: 3 == 3
|
||||
# FixedValuesGenerator can be skipped forward
|
||||
ok {test-number} - values.currentElementIndex() == 4 for: 4 == 4
|
||||
# FixedValuesGenerator can be skipped forward
|
||||
ok {test-number} - values.get() == 4 for: 4 == 4
|
||||
# FixedValuesGenerator can be skipped forward
|
||||
ok {test-number} - values.skipToNthElement( 5 )
|
||||
# Floating point matchers: double
|
||||
ok {test-number} - 10., WithinRel( 11.1, 0.1 ) for: 10.0 and 11.09999999999999964 are within 10% of each other
|
||||
# Floating point matchers: double
|
||||
@@ -2028,6 +2040,22 @@ ok {test-number} - !(d <= Approx( 1.22 )) for: !(1.22999999999999998 <= Approx(
|
||||
ok {test-number} - d <= Approx( 1.22 ).epsilon(0.1) for: 1.22999999999999998 <= Approx( 1.21999999999999997 )
|
||||
# ManuallyRegistered
|
||||
ok {test-number} - with 1 message: 'was called'
|
||||
# MapGenerator can be skipped forward efficiently
|
||||
ok {test-number} - map_generator.get() == 4 for: 4 == 4
|
||||
# MapGenerator can be skipped forward efficiently
|
||||
ok {test-number} - map_calls == map_calls_1 + 1 for: 2 == 2
|
||||
# MapGenerator can be skipped forward efficiently
|
||||
ok {test-number} - map_generator.get() == 4 for: 4 == 4
|
||||
# MapGenerator can be skipped forward efficiently
|
||||
ok {test-number} - map_calls == map_calls_1 + 1 for: 2 == 2
|
||||
# MapGenerator can be skipped forward efficiently
|
||||
ok {test-number} - map_generator.get() == 6 for: 6 == 6
|
||||
# MapGenerator can be skipped forward efficiently
|
||||
ok {test-number} - map_calls == map_calls_2 + 1 for: 3 == 3
|
||||
# MapGenerator can be skipped forward efficiently
|
||||
ok {test-number} - map_generator.skipToNthElement( 7 )
|
||||
# MapGenerator can be skipped forward efficiently
|
||||
ok {test-number} - map_calls == map_calls_2 + 1 for: 3 == 3
|
||||
# Matchers can be (AllOf) composed with the && operator
|
||||
ok {test-number} - 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 can be (AnyOf) composed with the || operator
|
||||
@@ -2929,6 +2957,22 @@ ok {test-number} - registry.add( "[@no square bracket at end", "", Catch::Source
|
||||
ok {test-number} - testCase.tags.size() == 2 for: 2 == 2
|
||||
# Tags with spaces and non-alphanumerical characters are accepted
|
||||
ok {test-number} - testCase.tags, VectorContains( Tag( "tag with spaces" ) ) && VectorContains( Tag( "I said \"good day\" sir!"_catch_sr ) ) for: { {?}, {?} } ( Contains: {?} and Contains: {?} )
|
||||
# TakeGenerator can be skipped forward
|
||||
ok {test-number} - take.get() == 0 for: 0 == 0
|
||||
# TakeGenerator can be skipped forward
|
||||
ok {test-number} - take.get() == 2 for: 2 == 2
|
||||
# TakeGenerator can be skipped forward
|
||||
ok {test-number} - take.get() == 5 for: 5 == 5
|
||||
# TakeGenerator can be skipped forward
|
||||
ok {test-number} - take.skipToNthElement( 6 )
|
||||
# TakeGenerator can be skipped forward
|
||||
ok {test-number} - take.get() == 0 for: 0 == 0
|
||||
# TakeGenerator can be skipped forward
|
||||
ok {test-number} - take.get() == 2 for: 2 == 2
|
||||
# TakeGenerator can be skipped forward
|
||||
ok {test-number} - take.get() == 5 for: 5 == 5
|
||||
# TakeGenerator can be skipped forward
|
||||
ok {test-number} - take.skipToNthElement( 6 )
|
||||
# Template test case method with test types specified inside std::tuple - MyTypes - 0
|
||||
ok {test-number} - Template_Fixture<TestType>::m_a == 1 for: 1 == 1
|
||||
# Template test case method with test types specified inside std::tuple - MyTypes - 1
|
||||
@@ -4699,5 +4743,5 @@ ok {test-number} - q3 == 23. for: 23.0 == 23.0
|
||||
ok {test-number} -
|
||||
# xmlentitycheck
|
||||
ok {test-number} -
|
||||
1..2352
|
||||
1..2374
|
||||
|
||||
|
||||
@@ -1210,6 +1210,18 @@ ok {test-number} - Factorial(3) == 6 for: 6 == 6
|
||||
ok {test-number} - Factorial(10) == 3628800 for: 3628800 (0x<hex digits>) == 3628800 (0x<hex digits>)
|
||||
# Filter generator throws exception for empty generator
|
||||
ok {test-number} - filter( []( int ) { return false; }, value( 3 ) ), Catch::GeneratorException
|
||||
# FixedValuesGenerator can be skipped forward
|
||||
ok {test-number} - values.currentElementIndex() == 0 for: 0 == 0
|
||||
# FixedValuesGenerator can be skipped forward
|
||||
ok {test-number} - values.currentElementIndex() == 3 for: 3 == 3
|
||||
# FixedValuesGenerator can be skipped forward
|
||||
ok {test-number} - values.get() == 3 for: 3 == 3
|
||||
# FixedValuesGenerator can be skipped forward
|
||||
ok {test-number} - values.currentElementIndex() == 4 for: 4 == 4
|
||||
# FixedValuesGenerator can be skipped forward
|
||||
ok {test-number} - values.get() == 4 for: 4 == 4
|
||||
# FixedValuesGenerator can be skipped forward
|
||||
ok {test-number} - values.skipToNthElement( 5 )
|
||||
# Floating point matchers: double
|
||||
ok {test-number} - 10., WithinRel( 11.1, 0.1 ) for: 10.0 and 11.09999999999999964 are within 10% of each other
|
||||
# Floating point matchers: double
|
||||
@@ -2026,6 +2038,22 @@ ok {test-number} - !(d <= Approx( 1.22 )) for: !(1.22999999999999998 <= Approx(
|
||||
ok {test-number} - d <= Approx( 1.22 ).epsilon(0.1) for: 1.22999999999999998 <= Approx( 1.21999999999999997 )
|
||||
# ManuallyRegistered
|
||||
ok {test-number} - with 1 message: 'was called'
|
||||
# MapGenerator can be skipped forward efficiently
|
||||
ok {test-number} - map_generator.get() == 4 for: 4 == 4
|
||||
# MapGenerator can be skipped forward efficiently
|
||||
ok {test-number} - map_calls == map_calls_1 + 1 for: 2 == 2
|
||||
# MapGenerator can be skipped forward efficiently
|
||||
ok {test-number} - map_generator.get() == 4 for: 4 == 4
|
||||
# MapGenerator can be skipped forward efficiently
|
||||
ok {test-number} - map_calls == map_calls_1 + 1 for: 2 == 2
|
||||
# MapGenerator can be skipped forward efficiently
|
||||
ok {test-number} - map_generator.get() == 6 for: 6 == 6
|
||||
# MapGenerator can be skipped forward efficiently
|
||||
ok {test-number} - map_calls == map_calls_2 + 1 for: 3 == 3
|
||||
# MapGenerator can be skipped forward efficiently
|
||||
ok {test-number} - map_generator.skipToNthElement( 7 )
|
||||
# MapGenerator can be skipped forward efficiently
|
||||
ok {test-number} - map_calls == map_calls_2 + 1 for: 3 == 3
|
||||
# Matchers can be (AllOf) composed with the && operator
|
||||
ok {test-number} - 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 can be (AnyOf) composed with the || operator
|
||||
@@ -2922,6 +2950,22 @@ ok {test-number} - registry.add( "[@no square bracket at end", "", Catch::Source
|
||||
ok {test-number} - testCase.tags.size() == 2 for: 2 == 2
|
||||
# Tags with spaces and non-alphanumerical characters are accepted
|
||||
ok {test-number} - testCase.tags, VectorContains( Tag( "tag with spaces" ) ) && VectorContains( Tag( "I said \"good day\" sir!"_catch_sr ) ) for: { {?}, {?} } ( Contains: {?} and Contains: {?} )
|
||||
# TakeGenerator can be skipped forward
|
||||
ok {test-number} - take.get() == 0 for: 0 == 0
|
||||
# TakeGenerator can be skipped forward
|
||||
ok {test-number} - take.get() == 2 for: 2 == 2
|
||||
# TakeGenerator can be skipped forward
|
||||
ok {test-number} - take.get() == 5 for: 5 == 5
|
||||
# TakeGenerator can be skipped forward
|
||||
ok {test-number} - take.skipToNthElement( 6 )
|
||||
# TakeGenerator can be skipped forward
|
||||
ok {test-number} - take.get() == 0 for: 0 == 0
|
||||
# TakeGenerator can be skipped forward
|
||||
ok {test-number} - take.get() == 2 for: 2 == 2
|
||||
# TakeGenerator can be skipped forward
|
||||
ok {test-number} - take.get() == 5 for: 5 == 5
|
||||
# TakeGenerator can be skipped forward
|
||||
ok {test-number} - take.skipToNthElement( 6 )
|
||||
# Template test case method with test types specified inside std::tuple - MyTypes - 0
|
||||
ok {test-number} - Template_Fixture<TestType>::m_a == 1 for: 1 == 1
|
||||
# Template test case method with test types specified inside std::tuple - MyTypes - 1
|
||||
@@ -4688,5 +4732,5 @@ ok {test-number} - q3 == 23. for: 23.0 == 23.0
|
||||
ok {test-number} -
|
||||
# xmlentitycheck
|
||||
ok {test-number} -
|
||||
1..2352
|
||||
1..2374
|
||||
|
||||
|
||||
@@ -409,6 +409,8 @@
|
||||
##teamcity[testFinished name='Factorials are computed' duration="{duration}"]
|
||||
##teamcity[testStarted name='Filter generator throws exception for empty generator']
|
||||
##teamcity[testFinished name='Filter generator throws exception for empty generator' duration="{duration}"]
|
||||
##teamcity[testStarted name='FixedValuesGenerator can be skipped forward']
|
||||
##teamcity[testFinished name='FixedValuesGenerator can be skipped forward' duration="{duration}"]
|
||||
##teamcity[testStarted name='Floating point matchers: double']
|
||||
##teamcity[testFinished name='Floating point matchers: double' duration="{duration}"]
|
||||
##teamcity[testStarted name='Floating point matchers: float']
|
||||
@@ -470,6 +472,8 @@
|
||||
##teamcity[testFinished name='Less-than inequalities with different epsilons' duration="{duration}"]
|
||||
##teamcity[testStarted name='ManuallyRegistered']
|
||||
##teamcity[testFinished name='ManuallyRegistered' duration="{duration}"]
|
||||
##teamcity[testStarted name='MapGenerator can be skipped forward efficiently']
|
||||
##teamcity[testFinished name='MapGenerator can be skipped forward efficiently' duration="{duration}"]
|
||||
##teamcity[testStarted name='Matchers can be (AllOf) composed with the && operator']
|
||||
##teamcity[testFinished name='Matchers can be (AllOf) composed with the && operator' duration="{duration}"]
|
||||
##teamcity[testStarted name='Matchers can be (AnyOf) composed with the |||| operator']
|
||||
@@ -647,6 +651,8 @@
|
||||
##teamcity[testFinished name='Tag alias can be registered against tag patterns' duration="{duration}"]
|
||||
##teamcity[testStarted name='Tags with spaces and non-alphanumerical characters are accepted']
|
||||
##teamcity[testFinished name='Tags with spaces and non-alphanumerical characters are accepted' duration="{duration}"]
|
||||
##teamcity[testStarted name='TakeGenerator can be skipped forward']
|
||||
##teamcity[testFinished name='TakeGenerator can be skipped forward' duration="{duration}"]
|
||||
##teamcity[testStarted name='Template test case method with test types specified inside std::tuple - MyTypes - 0']
|
||||
##teamcity[testFinished name='Template test case method with test types specified inside std::tuple - MyTypes - 0' duration="{duration}"]
|
||||
##teamcity[testStarted name='Template test case method with test types specified inside std::tuple - MyTypes - 1']
|
||||
|
||||
@@ -409,6 +409,8 @@
|
||||
##teamcity[testFinished name='Factorials are computed' duration="{duration}"]
|
||||
##teamcity[testStarted name='Filter generator throws exception for empty generator']
|
||||
##teamcity[testFinished name='Filter generator throws exception for empty generator' duration="{duration}"]
|
||||
##teamcity[testStarted name='FixedValuesGenerator can be skipped forward']
|
||||
##teamcity[testFinished name='FixedValuesGenerator can be skipped forward' duration="{duration}"]
|
||||
##teamcity[testStarted name='Floating point matchers: double']
|
||||
##teamcity[testFinished name='Floating point matchers: double' duration="{duration}"]
|
||||
##teamcity[testStarted name='Floating point matchers: float']
|
||||
@@ -470,6 +472,8 @@
|
||||
##teamcity[testFinished name='Less-than inequalities with different epsilons' duration="{duration}"]
|
||||
##teamcity[testStarted name='ManuallyRegistered']
|
||||
##teamcity[testFinished name='ManuallyRegistered' duration="{duration}"]
|
||||
##teamcity[testStarted name='MapGenerator can be skipped forward efficiently']
|
||||
##teamcity[testFinished name='MapGenerator can be skipped forward efficiently' duration="{duration}"]
|
||||
##teamcity[testStarted name='Matchers can be (AllOf) composed with the && operator']
|
||||
##teamcity[testFinished name='Matchers can be (AllOf) composed with the && operator' duration="{duration}"]
|
||||
##teamcity[testStarted name='Matchers can be (AnyOf) composed with the |||| operator']
|
||||
@@ -647,6 +651,8 @@
|
||||
##teamcity[testFinished name='Tag alias can be registered against tag patterns' duration="{duration}"]
|
||||
##teamcity[testStarted name='Tags with spaces and non-alphanumerical characters are accepted']
|
||||
##teamcity[testFinished name='Tags with spaces and non-alphanumerical characters are accepted' duration="{duration}"]
|
||||
##teamcity[testStarted name='TakeGenerator can be skipped forward']
|
||||
##teamcity[testFinished name='TakeGenerator can be skipped forward' duration="{duration}"]
|
||||
##teamcity[testStarted name='Template test case method with test types specified inside std::tuple - MyTypes - 0']
|
||||
##teamcity[testFinished name='Template test case method with test types specified inside std::tuple - MyTypes - 0' duration="{duration}"]
|
||||
##teamcity[testStarted name='Template test case method with test types specified inside std::tuple - MyTypes - 1']
|
||||
|
||||
@@ -5481,6 +5481,57 @@ Approx( 1.30000000000000004 )
|
||||
</Expression>
|
||||
<OverallResult success="true" skips="0"/>
|
||||
</TestCase>
|
||||
<TestCase name="FixedValuesGenerator can be skipped forward" tags="[generators][values]" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
|
||||
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
|
||||
<Original>
|
||||
values.currentElementIndex() == 0
|
||||
</Original>
|
||||
<Expanded>
|
||||
0 == 0
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
|
||||
<Original>
|
||||
values.currentElementIndex() == 3
|
||||
</Original>
|
||||
<Expanded>
|
||||
3 == 3
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
|
||||
<Original>
|
||||
values.get() == 3
|
||||
</Original>
|
||||
<Expanded>
|
||||
3 == 3
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
|
||||
<Original>
|
||||
values.currentElementIndex() == 4
|
||||
</Original>
|
||||
<Expanded>
|
||||
4 == 4
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
|
||||
<Original>
|
||||
values.get() == 4
|
||||
</Original>
|
||||
<Expanded>
|
||||
4 == 4
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Expression success="true" type="REQUIRE_THROWS" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
|
||||
<Original>
|
||||
values.skipToNthElement( 5 )
|
||||
</Original>
|
||||
<Expanded>
|
||||
values.skipToNthElement( 5 )
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<OverallResult success="true" skips="0"/>
|
||||
</TestCase>
|
||||
<TestCase name="Floating point matchers: double" tags="[floating-point][matchers]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" >
|
||||
<Section name="Relative" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" >
|
||||
<Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" >
|
||||
@@ -9775,6 +9826,73 @@ Approx( 1.21999999999999997 )
|
||||
<TestCase name="ManuallyRegistered" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" >
|
||||
<OverallResult success="true" skips="0"/>
|
||||
</TestCase>
|
||||
<TestCase name="MapGenerator can be skipped forward efficiently" tags="[generators][map]" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
|
||||
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
|
||||
<Original>
|
||||
map_generator.get() == 4
|
||||
</Original>
|
||||
<Expanded>
|
||||
4 == 4
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
|
||||
<Original>
|
||||
map_calls == map_calls_1 + 1
|
||||
</Original>
|
||||
<Expanded>
|
||||
2 == 2
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
|
||||
<Original>
|
||||
map_generator.get() == 4
|
||||
</Original>
|
||||
<Expanded>
|
||||
4 == 4
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
|
||||
<Original>
|
||||
map_calls == map_calls_1 + 1
|
||||
</Original>
|
||||
<Expanded>
|
||||
2 == 2
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
|
||||
<Original>
|
||||
map_generator.get() == 6
|
||||
</Original>
|
||||
<Expanded>
|
||||
6 == 6
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
|
||||
<Original>
|
||||
map_calls == map_calls_2 + 1
|
||||
</Original>
|
||||
<Expanded>
|
||||
3 == 3
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Expression success="true" type="REQUIRE_THROWS" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
|
||||
<Original>
|
||||
map_generator.skipToNthElement( 7 )
|
||||
</Original>
|
||||
<Expanded>
|
||||
map_generator.skipToNthElement( 7 )
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
|
||||
<Original>
|
||||
map_calls == map_calls_2 + 1
|
||||
</Original>
|
||||
<Expanded>
|
||||
3 == 3
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<OverallResult success="true" skips="0"/>
|
||||
</TestCase>
|
||||
<TestCase name="Matchers can be (AllOf) composed with the && operator" tags="[matchers][operator&&][operators]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" >
|
||||
<Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" >
|
||||
<Original>
|
||||
@@ -14326,6 +14444,79 @@ Message from section two
|
||||
</Expression>
|
||||
<OverallResult success="true" skips="0"/>
|
||||
</TestCase>
|
||||
<TestCase name="TakeGenerator can be skipped forward" tags="[generators][take]" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
|
||||
<Section name="take is shorter than underlying" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
|
||||
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
|
||||
<Original>
|
||||
take.get() == 0
|
||||
</Original>
|
||||
<Expanded>
|
||||
0 == 0
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
|
||||
<Original>
|
||||
take.get() == 2
|
||||
</Original>
|
||||
<Expanded>
|
||||
2 == 2
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
|
||||
<Original>
|
||||
take.get() == 5
|
||||
</Original>
|
||||
<Expanded>
|
||||
5 == 5
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Expression success="true" type="REQUIRE_THROWS" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
|
||||
<Original>
|
||||
take.skipToNthElement( 6 )
|
||||
</Original>
|
||||
<Expanded>
|
||||
take.skipToNthElement( 6 )
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<OverallResults successes="4" failures="0" expectedFailures="0" skipped="false"/>
|
||||
</Section>
|
||||
<Section name="take is longer than underlying" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
|
||||
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
|
||||
<Original>
|
||||
take.get() == 0
|
||||
</Original>
|
||||
<Expanded>
|
||||
0 == 0
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
|
||||
<Original>
|
||||
take.get() == 2
|
||||
</Original>
|
||||
<Expanded>
|
||||
2 == 2
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
|
||||
<Original>
|
||||
take.get() == 5
|
||||
</Original>
|
||||
<Expanded>
|
||||
5 == 5
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Expression success="true" type="REQUIRE_THROWS" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
|
||||
<Original>
|
||||
take.skipToNthElement( 6 )
|
||||
</Original>
|
||||
<Expanded>
|
||||
take.skipToNthElement( 6 )
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<OverallResults successes="4" failures="0" expectedFailures="0" skipped="false"/>
|
||||
</Section>
|
||||
<OverallResult success="true" skips="0"/>
|
||||
</TestCase>
|
||||
<TestCase name="Template test case method with test types specified inside std::tuple - MyTypes - 0" tags="[class][list][template]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" >
|
||||
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" >
|
||||
<Original>
|
||||
@@ -22687,6 +22878,6 @@ Approx( -1.95996398454005449 )
|
||||
</Section>
|
||||
<OverallResult success="true" skips="0"/>
|
||||
</TestCase>
|
||||
<OverallResults successes="2139" failures="158" expectedFailures="43" skips="12"/>
|
||||
<OverallResultsCases successes="320" failures="96" expectedFailures="18" skips="6"/>
|
||||
<OverallResults successes="2161" failures="158" expectedFailures="43" skips="12"/>
|
||||
<OverallResultsCases successes="323" failures="96" expectedFailures="18" skips="6"/>
|
||||
</Catch2TestRun>
|
||||
|
||||
@@ -5481,6 +5481,57 @@ Approx( 1.30000000000000004 )
|
||||
</Expression>
|
||||
<OverallResult success="true" skips="0"/>
|
||||
</TestCase>
|
||||
<TestCase name="FixedValuesGenerator can be skipped forward" tags="[generators][values]" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
|
||||
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
|
||||
<Original>
|
||||
values.currentElementIndex() == 0
|
||||
</Original>
|
||||
<Expanded>
|
||||
0 == 0
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
|
||||
<Original>
|
||||
values.currentElementIndex() == 3
|
||||
</Original>
|
||||
<Expanded>
|
||||
3 == 3
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
|
||||
<Original>
|
||||
values.get() == 3
|
||||
</Original>
|
||||
<Expanded>
|
||||
3 == 3
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
|
||||
<Original>
|
||||
values.currentElementIndex() == 4
|
||||
</Original>
|
||||
<Expanded>
|
||||
4 == 4
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
|
||||
<Original>
|
||||
values.get() == 4
|
||||
</Original>
|
||||
<Expanded>
|
||||
4 == 4
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Expression success="true" type="REQUIRE_THROWS" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
|
||||
<Original>
|
||||
values.skipToNthElement( 5 )
|
||||
</Original>
|
||||
<Expanded>
|
||||
values.skipToNthElement( 5 )
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<OverallResult success="true" skips="0"/>
|
||||
</TestCase>
|
||||
<TestCase name="Floating point matchers: double" tags="[floating-point][matchers]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" >
|
||||
<Section name="Relative" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" >
|
||||
<Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" >
|
||||
@@ -9775,6 +9826,73 @@ Approx( 1.21999999999999997 )
|
||||
<TestCase name="ManuallyRegistered" filename="tests/<exe-name>/UsageTests/Misc.tests.cpp" >
|
||||
<OverallResult success="true" skips="0"/>
|
||||
</TestCase>
|
||||
<TestCase name="MapGenerator can be skipped forward efficiently" tags="[generators][map]" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
|
||||
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
|
||||
<Original>
|
||||
map_generator.get() == 4
|
||||
</Original>
|
||||
<Expanded>
|
||||
4 == 4
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
|
||||
<Original>
|
||||
map_calls == map_calls_1 + 1
|
||||
</Original>
|
||||
<Expanded>
|
||||
2 == 2
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
|
||||
<Original>
|
||||
map_generator.get() == 4
|
||||
</Original>
|
||||
<Expanded>
|
||||
4 == 4
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
|
||||
<Original>
|
||||
map_calls == map_calls_1 + 1
|
||||
</Original>
|
||||
<Expanded>
|
||||
2 == 2
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
|
||||
<Original>
|
||||
map_generator.get() == 6
|
||||
</Original>
|
||||
<Expanded>
|
||||
6 == 6
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
|
||||
<Original>
|
||||
map_calls == map_calls_2 + 1
|
||||
</Original>
|
||||
<Expanded>
|
||||
3 == 3
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Expression success="true" type="REQUIRE_THROWS" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
|
||||
<Original>
|
||||
map_generator.skipToNthElement( 7 )
|
||||
</Original>
|
||||
<Expanded>
|
||||
map_generator.skipToNthElement( 7 )
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
|
||||
<Original>
|
||||
map_calls == map_calls_2 + 1
|
||||
</Original>
|
||||
<Expanded>
|
||||
3 == 3
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<OverallResult success="true" skips="0"/>
|
||||
</TestCase>
|
||||
<TestCase name="Matchers can be (AllOf) composed with the && operator" tags="[matchers][operator&&][operators]" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" >
|
||||
<Expression success="true" type="CHECK_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" >
|
||||
<Original>
|
||||
@@ -14326,6 +14444,79 @@ Message from section two
|
||||
</Expression>
|
||||
<OverallResult success="true" skips="0"/>
|
||||
</TestCase>
|
||||
<TestCase name="TakeGenerator can be skipped forward" tags="[generators][take]" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
|
||||
<Section name="take is shorter than underlying" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
|
||||
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
|
||||
<Original>
|
||||
take.get() == 0
|
||||
</Original>
|
||||
<Expanded>
|
||||
0 == 0
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
|
||||
<Original>
|
||||
take.get() == 2
|
||||
</Original>
|
||||
<Expanded>
|
||||
2 == 2
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
|
||||
<Original>
|
||||
take.get() == 5
|
||||
</Original>
|
||||
<Expanded>
|
||||
5 == 5
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Expression success="true" type="REQUIRE_THROWS" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
|
||||
<Original>
|
||||
take.skipToNthElement( 6 )
|
||||
</Original>
|
||||
<Expanded>
|
||||
take.skipToNthElement( 6 )
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<OverallResults successes="4" failures="0" expectedFailures="0" skipped="false"/>
|
||||
</Section>
|
||||
<Section name="take is longer than underlying" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
|
||||
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
|
||||
<Original>
|
||||
take.get() == 0
|
||||
</Original>
|
||||
<Expanded>
|
||||
0 == 0
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
|
||||
<Original>
|
||||
take.get() == 2
|
||||
</Original>
|
||||
<Expanded>
|
||||
2 == 2
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
|
||||
<Original>
|
||||
take.get() == 5
|
||||
</Original>
|
||||
<Expanded>
|
||||
5 == 5
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Expression success="true" type="REQUIRE_THROWS" filename="tests/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
|
||||
<Original>
|
||||
take.skipToNthElement( 6 )
|
||||
</Original>
|
||||
<Expanded>
|
||||
take.skipToNthElement( 6 )
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<OverallResults successes="4" failures="0" expectedFailures="0" skipped="false"/>
|
||||
</Section>
|
||||
<OverallResult success="true" skips="0"/>
|
||||
</TestCase>
|
||||
<TestCase name="Template test case method with test types specified inside std::tuple - MyTypes - 0" tags="[class][list][template]" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" >
|
||||
<Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/Class.tests.cpp" >
|
||||
<Original>
|
||||
@@ -22686,6 +22877,6 @@ Approx( -1.95996398454005449 )
|
||||
</Section>
|
||||
<OverallResult success="true" skips="0"/>
|
||||
</TestCase>
|
||||
<OverallResults successes="2139" failures="158" expectedFailures="43" skips="12"/>
|
||||
<OverallResultsCases successes="320" failures="96" expectedFailures="18" skips="6"/>
|
||||
<OverallResults successes="2161" failures="158" expectedFailures="43" skips="12"/>
|
||||
<OverallResultsCases successes="323" failures="96" expectedFailures="18" skips="6"/>
|
||||
</Catch2TestRun>
|
||||
|
||||
@@ -643,3 +643,81 @@ TEST_CASE( "Generators can be skipped forward", "[generators]" ) {
|
||||
// Past the end
|
||||
REQUIRE_THROWS( generator.skipToNthElement( 6 ) );
|
||||
}
|
||||
|
||||
TEST_CASE( "FixedValuesGenerator can be skipped forward",
|
||||
"[generators][values]" ) {
|
||||
Catch::Generators::FixedValuesGenerator<int> values( {0, 1, 2, 3, 4} );
|
||||
REQUIRE( values.currentElementIndex() == 0 );
|
||||
|
||||
values.skipToNthElement( 3 );
|
||||
REQUIRE( values.currentElementIndex() == 3 );
|
||||
REQUIRE( values.get() == 3 );
|
||||
|
||||
values.skipToNthElement( 4 );
|
||||
REQUIRE( values.currentElementIndex() == 4 );
|
||||
REQUIRE( values.get() == 4 );
|
||||
|
||||
// Past the end
|
||||
REQUIRE_THROWS( values.skipToNthElement( 5 ) );
|
||||
}
|
||||
|
||||
TEST_CASE( "TakeGenerator can be skipped forward", "[generators][take]" ) {
|
||||
SECTION("take is shorter than underlying") {
|
||||
Catch::Generators::TakeGenerator<int> take(
|
||||
6, Catch::Generators::values( { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 } ) );
|
||||
REQUIRE( take.get() == 0 );
|
||||
|
||||
take.skipToNthElement( 2 );
|
||||
REQUIRE( take.get() == 2 );
|
||||
|
||||
take.skipToNthElement( 5 );
|
||||
REQUIRE( take.get() == 5 );
|
||||
|
||||
// This is in the original values, but past the end of the take
|
||||
REQUIRE_THROWS( take.skipToNthElement( 6 ) );
|
||||
}
|
||||
SECTION( "take is longer than underlying" ) {
|
||||
Catch::Generators::TakeGenerator<int> take(
|
||||
8, Catch::Generators::values( { 0, 1, 2, 3, 4, 5 } ) );
|
||||
REQUIRE( take.get() == 0 );
|
||||
|
||||
take.skipToNthElement( 2 );
|
||||
REQUIRE( take.get() == 2 );
|
||||
|
||||
take.skipToNthElement( 5 );
|
||||
REQUIRE( take.get() == 5 );
|
||||
|
||||
// This is in the take, but outside of original values
|
||||
REQUIRE_THROWS( take.skipToNthElement( 6 ) );
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("MapGenerator can be skipped forward efficiently",
|
||||
"[generators][map]") {
|
||||
using namespace Catch::Generators;
|
||||
|
||||
int map_calls = 0;
|
||||
auto map_func = [&map_calls]( int i ) {
|
||||
++map_calls;
|
||||
return i;
|
||||
};
|
||||
|
||||
MapGenerator<int, int, decltype(map_func)> map_generator( map_func, values( { 0, 1, 2, 3, 4, 5, 6 } ) );
|
||||
const int map_calls_1 = map_calls;
|
||||
|
||||
map_generator.skipToNthElement( 4 );
|
||||
REQUIRE( map_generator.get() == 4 );
|
||||
REQUIRE( map_calls == map_calls_1 + 1 );
|
||||
|
||||
map_generator.skipToNthElement( 4 );
|
||||
REQUIRE( map_generator.get() == 4 );
|
||||
REQUIRE( map_calls == map_calls_1 + 1 );
|
||||
|
||||
const int map_calls_2 = map_calls;
|
||||
map_generator.skipToNthElement( 6 );
|
||||
REQUIRE( map_generator.get() == 6 );
|
||||
REQUIRE( map_calls == map_calls_2 + 1 );
|
||||
|
||||
REQUIRE_THROWS( map_generator.skipToNthElement( 7 ) );
|
||||
REQUIRE( map_calls == map_calls_2 + 1 );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user