Merge pull request #1776 from mvd4/bugfix/enable-floating-point-ranges

Enable floating point ranges
This commit is contained in:
Martin Hořeňovský 2019-10-27 09:17:15 +01:00 committed by GitHub
commit 9a558171d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 1404 additions and 9 deletions

View File

@ -49,7 +49,7 @@ a test case,
* 4 specific purpose generators
* `RandomIntegerGenerator<Integral>` -- generates random Integrals from range
* `RandomFloatGenerator<Float>` -- generates random Floats from range
* `RangeGenerator<T>` -- generates all values inside a specific range
* `RangeGenerator<T>` -- generates all values inside an arithmetic range
* `IteratorGenerator<T>` -- copies and returns values from an iterator range
> `ChunkGenerator<T>`, `RandomIntegerGenerator<Integral>`, `RandomFloatGenerator<Float>` and `RangeGenerator<T>` were introduced in Catch 2.7.0.
@ -69,8 +69,8 @@ type, making their usage much nicer. These are
* `map<T>(func, GeneratorWrapper<U>&&)` for `MapGenerator<T, U, Func>` (map `U` to `T`)
* `chunk(chunk-size, GeneratorWrapper<T>&&)` for `ChunkGenerator<T>`
* `random(IntegerOrFloat a, IntegerOrFloat b)` for `RandomIntegerGenerator` or `RandomFloatGenerator`
* `range(start, end)` for `RangeGenerator<T>` with a step size of `1`
* `range(start, end, step)` for `RangeGenerator<T>` with a custom step size
* `range(Arithemtic start, Arithmetic end)` for `RangeGenerator<Arithmetic>` with a step size of `1`
* `range(Arithmetic start, Arithmetic end, Arithmetic step)` for `RangeGenerator<Arithmetic>` with a custom step size
* `from_range(InputIterator from, InputIterator to)` for `IteratorGenerator<T>`
* `from_range(Container const&)` for `IteratorGenerator<T>`
@ -78,6 +78,8 @@ type, making their usage much nicer. These are
> `from_range` has been introduced in Catch 2.10.0
> `range()` for floating point numbers has been introduced in Catch X.Y.Z
And can be used as shown in the example below to create a generator
that returns 100 odd random number:

View File

@ -117,7 +117,7 @@ public:
template <typename T>
GeneratorWrapper<T> range(T const& start, T const& end, T const& step) {
static_assert(std::is_integral<T>::value && !std::is_same<T, bool>::value, "Type must be an integer");
static_assert(std::is_arithmetic<T>::value && !std::is_same<T, bool>::value, "Type must be numeric");
return GeneratorWrapper<T>(pf::make_unique<RangeGenerator<T>>(start, end, step));
}

View File

@ -631,6 +631,74 @@ GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == 2 for: 2 == 2
GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true
GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == 5 for: 5 == 5
GeneratorsImpl.tests.cpp:<line number>: passed: !(gen.next()) for: !false
GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == Approx(expected) for: -1.0 == Approx( -1.0 ) with 1 message: 'Current expected value is -1'
GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true with 1 message: 'Current expected value is -1'
GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == Approx(expected) for: -0.9 == Approx( -0.9 ) with 1 message: 'Current expected value is -0.9'
GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true with 1 message: 'Current expected value is -0.9'
GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == Approx(expected) for: -0.8 == Approx( -0.8 ) with 1 message: 'Current expected value is -0.8'
GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true with 1 message: 'Current expected value is -0.8'
GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == Approx(expected) for: -0.7 == Approx( -0.7 ) with 1 message: 'Current expected value is -0.7'
GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true with 1 message: 'Current expected value is -0.7'
GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == Approx(expected) for: -0.6 == Approx( -0.6 ) with 1 message: 'Current expected value is -0.6'
GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true with 1 message: 'Current expected value is -0.6'
GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == Approx(expected) for: -0.5 == Approx( -0.5 ) with 1 message: 'Current expected value is -0.5'
GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true with 1 message: 'Current expected value is -0.5'
GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == Approx(expected) for: -0.4 == Approx( -0.4 ) with 1 message: 'Current expected value is -0.4'
GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true with 1 message: 'Current expected value is -0.4'
GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == Approx(expected) for: -0.3 == Approx( -0.3 ) with 1 message: 'Current expected value is -0.3'
GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true with 1 message: 'Current expected value is -0.3'
GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == Approx(expected) for: -0.2 == Approx( -0.2 ) with 1 message: 'Current expected value is -0.2'
GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true with 1 message: 'Current expected value is -0.2'
GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == Approx(expected) for: -0.1 == Approx( -0.1 ) with 1 message: 'Current expected value is -0.1'
GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true with 1 message: 'Current expected value is -0.1'
GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == Approx(expected) for: -0.0 == Approx( -0.0 ) with 1 message: 'Current expected value is -1.38778e-16'
GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true with 1 message: 'Current expected value is -1.38778e-16'
GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == Approx(expected) for: 0.1 == Approx( 0.1 ) with 1 message: 'Current expected value is 0.1'
GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true with 1 message: 'Current expected value is 0.1'
GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == Approx(expected) for: 0.2 == Approx( 0.2 ) with 1 message: 'Current expected value is 0.2'
GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true with 1 message: 'Current expected value is 0.2'
GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == Approx(expected) for: 0.3 == Approx( 0.3 ) with 1 message: 'Current expected value is 0.3'
GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true with 1 message: 'Current expected value is 0.3'
GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == Approx(expected) for: 0.4 == Approx( 0.4 ) with 1 message: 'Current expected value is 0.4'
GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true with 1 message: 'Current expected value is 0.4'
GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == Approx(expected) for: 0.5 == Approx( 0.5 ) with 1 message: 'Current expected value is 0.5'
GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true with 1 message: 'Current expected value is 0.5'
GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == Approx(expected) for: 0.6 == Approx( 0.6 ) with 1 message: 'Current expected value is 0.6'
GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true with 1 message: 'Current expected value is 0.6'
GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == Approx(expected) for: 0.7 == Approx( 0.7 ) with 1 message: 'Current expected value is 0.7'
GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true with 1 message: 'Current expected value is 0.7'
GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == Approx(expected) for: 0.8 == Approx( 0.8 ) with 1 message: 'Current expected value is 0.8'
GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true with 1 message: 'Current expected value is 0.8'
GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == Approx(expected) for: 0.9 == Approx( 0.9 ) with 1 message: 'Current expected value is 0.9'
GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true with 1 message: 'Current expected value is 0.9'
GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == Approx( rangeEnd ) for: 1.0 == Approx( 1.0 )
GeneratorsImpl.tests.cpp:<line number>: passed: !(gen.next()) for: !false
GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == Approx(expected) for: -1.0 == Approx( -1.0 ) with 1 message: 'Current expected value is -1'
GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true with 1 message: 'Current expected value is -1'
GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == Approx(expected) for: -0.7 == Approx( -0.7 ) with 1 message: 'Current expected value is -0.7'
GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true with 1 message: 'Current expected value is -0.7'
GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == Approx(expected) for: -0.4 == Approx( -0.4 ) with 1 message: 'Current expected value is -0.4'
GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true with 1 message: 'Current expected value is -0.4'
GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == Approx(expected) for: -0.1 == Approx( -0.1 ) with 1 message: 'Current expected value is -0.1'
GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true with 1 message: 'Current expected value is -0.1'
GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == Approx(expected) for: 0.2 == Approx( 0.2 ) with 1 message: 'Current expected value is 0.2'
GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true with 1 message: 'Current expected value is 0.2'
GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == Approx(expected) for: 0.5 == Approx( 0.5 ) with 1 message: 'Current expected value is 0.5'
GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true with 1 message: 'Current expected value is 0.5'
GeneratorsImpl.tests.cpp:<line number>: passed: !(gen.next()) for: !false
GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == Approx(expected) for: -1.0 == Approx( -1.0 ) with 1 message: 'Current expected value is -1'
GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true with 1 message: 'Current expected value is -1'
GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == Approx(expected) for: -0.7 == Approx( -0.7 ) with 1 message: 'Current expected value is -0.7'
GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true with 1 message: 'Current expected value is -0.7'
GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == Approx(expected) for: -0.4 == Approx( -0.4 ) with 1 message: 'Current expected value is -0.4'
GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true with 1 message: 'Current expected value is -0.4'
GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == Approx(expected) for: -0.1 == Approx( -0.1 ) with 1 message: 'Current expected value is -0.1'
GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true with 1 message: 'Current expected value is -0.1'
GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == Approx(expected) for: 0.2 == Approx( 0.2 ) with 1 message: 'Current expected value is 0.2'
GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true with 1 message: 'Current expected value is 0.2'
GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == Approx(expected) for: 0.5 == Approx( 0.5 ) with 1 message: 'Current expected value is 0.5'
GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true with 1 message: 'Current expected value is 0.5'
GeneratorsImpl.tests.cpp:<line number>: passed: !(gen.next()) for: !false
GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == 5 for: 5 == 5
GeneratorsImpl.tests.cpp:<line number>: passed: gen.next() for: true
GeneratorsImpl.tests.cpp:<line number>: passed: gen.get() == 2 for: 2 == 2

View File

@ -1381,5 +1381,5 @@ due to unexpected exception with message:
===============================================================================
test cases: 305 | 231 passed | 70 failed | 4 failed as expected
assertions: 1627 | 1475 passed | 131 failed | 21 failed as expected
assertions: 1695 | 1543 passed | 131 failed | 21 failed as expected

View File

@ -4774,6 +4774,504 @@ GeneratorsImpl.tests.cpp:<line number>: PASSED:
with expansion:
!false
-------------------------------------------------------------------------------
Generators internals
Range
Positive manual step
Floating Point
Exact
-------------------------------------------------------------------------------
GeneratorsImpl.tests.cpp:<line number>
...............................................................................
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( gen.get() == Approx(expected) )
with expansion:
-1.0 == Approx( -1.0 )
with message:
Current expected value is -1
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( gen.next() )
with expansion:
true
with message:
Current expected value is -1
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( gen.get() == Approx(expected) )
with expansion:
-0.9 == Approx( -0.9 )
with message:
Current expected value is -0.9
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( gen.next() )
with expansion:
true
with message:
Current expected value is -0.9
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( gen.get() == Approx(expected) )
with expansion:
-0.8 == Approx( -0.8 )
with message:
Current expected value is -0.8
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( gen.next() )
with expansion:
true
with message:
Current expected value is -0.8
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( gen.get() == Approx(expected) )
with expansion:
-0.7 == Approx( -0.7 )
with message:
Current expected value is -0.7
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( gen.next() )
with expansion:
true
with message:
Current expected value is -0.7
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( gen.get() == Approx(expected) )
with expansion:
-0.6 == Approx( -0.6 )
with message:
Current expected value is -0.6
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( gen.next() )
with expansion:
true
with message:
Current expected value is -0.6
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( gen.get() == Approx(expected) )
with expansion:
-0.5 == Approx( -0.5 )
with message:
Current expected value is -0.5
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( gen.next() )
with expansion:
true
with message:
Current expected value is -0.5
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( gen.get() == Approx(expected) )
with expansion:
-0.4 == Approx( -0.4 )
with message:
Current expected value is -0.4
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( gen.next() )
with expansion:
true
with message:
Current expected value is -0.4
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( gen.get() == Approx(expected) )
with expansion:
-0.3 == Approx( -0.3 )
with message:
Current expected value is -0.3
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( gen.next() )
with expansion:
true
with message:
Current expected value is -0.3
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( gen.get() == Approx(expected) )
with expansion:
-0.2 == Approx( -0.2 )
with message:
Current expected value is -0.2
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( gen.next() )
with expansion:
true
with message:
Current expected value is -0.2
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( gen.get() == Approx(expected) )
with expansion:
-0.1 == Approx( -0.1 )
with message:
Current expected value is -0.1
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( gen.next() )
with expansion:
true
with message:
Current expected value is -0.1
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( gen.get() == Approx(expected) )
with expansion:
-0.0 == Approx( -0.0 )
with message:
Current expected value is -1.38778e-16
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( gen.next() )
with expansion:
true
with message:
Current expected value is -1.38778e-16
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( gen.get() == Approx(expected) )
with expansion:
0.1 == Approx( 0.1 )
with message:
Current expected value is 0.1
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( gen.next() )
with expansion:
true
with message:
Current expected value is 0.1
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( gen.get() == Approx(expected) )
with expansion:
0.2 == Approx( 0.2 )
with message:
Current expected value is 0.2
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( gen.next() )
with expansion:
true
with message:
Current expected value is 0.2
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( gen.get() == Approx(expected) )
with expansion:
0.3 == Approx( 0.3 )
with message:
Current expected value is 0.3
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( gen.next() )
with expansion:
true
with message:
Current expected value is 0.3
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( gen.get() == Approx(expected) )
with expansion:
0.4 == Approx( 0.4 )
with message:
Current expected value is 0.4
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( gen.next() )
with expansion:
true
with message:
Current expected value is 0.4
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( gen.get() == Approx(expected) )
with expansion:
0.5 == Approx( 0.5 )
with message:
Current expected value is 0.5
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( gen.next() )
with expansion:
true
with message:
Current expected value is 0.5
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( gen.get() == Approx(expected) )
with expansion:
0.6 == Approx( 0.6 )
with message:
Current expected value is 0.6
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( gen.next() )
with expansion:
true
with message:
Current expected value is 0.6
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( gen.get() == Approx(expected) )
with expansion:
0.7 == Approx( 0.7 )
with message:
Current expected value is 0.7
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( gen.next() )
with expansion:
true
with message:
Current expected value is 0.7
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( gen.get() == Approx(expected) )
with expansion:
0.8 == Approx( 0.8 )
with message:
Current expected value is 0.8
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( gen.next() )
with expansion:
true
with message:
Current expected value is 0.8
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( gen.get() == Approx(expected) )
with expansion:
0.9 == Approx( 0.9 )
with message:
Current expected value is 0.9
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( gen.next() )
with expansion:
true
with message:
Current expected value is 0.9
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( gen.get() == Approx( rangeEnd ) )
with expansion:
1.0 == Approx( 1.0 )
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE_FALSE( gen.next() )
with expansion:
!false
-------------------------------------------------------------------------------
Generators internals
Range
Positive manual step
Floating Point
Slightly over end
-------------------------------------------------------------------------------
GeneratorsImpl.tests.cpp:<line number>
...............................................................................
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( gen.get() == Approx(expected) )
with expansion:
-1.0 == Approx( -1.0 )
with message:
Current expected value is -1
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( gen.next() )
with expansion:
true
with message:
Current expected value is -1
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( gen.get() == Approx(expected) )
with expansion:
-0.7 == Approx( -0.7 )
with message:
Current expected value is -0.7
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( gen.next() )
with expansion:
true
with message:
Current expected value is -0.7
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( gen.get() == Approx(expected) )
with expansion:
-0.4 == Approx( -0.4 )
with message:
Current expected value is -0.4
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( gen.next() )
with expansion:
true
with message:
Current expected value is -0.4
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( gen.get() == Approx(expected) )
with expansion:
-0.1 == Approx( -0.1 )
with message:
Current expected value is -0.1
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( gen.next() )
with expansion:
true
with message:
Current expected value is -0.1
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( gen.get() == Approx(expected) )
with expansion:
0.2 == Approx( 0.2 )
with message:
Current expected value is 0.2
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( gen.next() )
with expansion:
true
with message:
Current expected value is 0.2
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( gen.get() == Approx(expected) )
with expansion:
0.5 == Approx( 0.5 )
with message:
Current expected value is 0.5
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( gen.next() )
with expansion:
true
with message:
Current expected value is 0.5
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE_FALSE( gen.next() )
with expansion:
!false
-------------------------------------------------------------------------------
Generators internals
Range
Positive manual step
Floating Point
Slightly under end
-------------------------------------------------------------------------------
GeneratorsImpl.tests.cpp:<line number>
...............................................................................
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( gen.get() == Approx(expected) )
with expansion:
-1.0 == Approx( -1.0 )
with message:
Current expected value is -1
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( gen.next() )
with expansion:
true
with message:
Current expected value is -1
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( gen.get() == Approx(expected) )
with expansion:
-0.7 == Approx( -0.7 )
with message:
Current expected value is -0.7
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( gen.next() )
with expansion:
true
with message:
Current expected value is -0.7
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( gen.get() == Approx(expected) )
with expansion:
-0.4 == Approx( -0.4 )
with message:
Current expected value is -0.4
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( gen.next() )
with expansion:
true
with message:
Current expected value is -0.4
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( gen.get() == Approx(expected) )
with expansion:
-0.1 == Approx( -0.1 )
with message:
Current expected value is -0.1
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( gen.next() )
with expansion:
true
with message:
Current expected value is -0.1
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( gen.get() == Approx(expected) )
with expansion:
0.2 == Approx( 0.2 )
with message:
Current expected value is 0.2
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( gen.next() )
with expansion:
true
with message:
Current expected value is 0.2
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( gen.get() == Approx(expected) )
with expansion:
0.5 == Approx( 0.5 )
with message:
Current expected value is 0.5
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE( gen.next() )
with expansion:
true
with message:
Current expected value is 0.5
GeneratorsImpl.tests.cpp:<line number>: PASSED:
REQUIRE_FALSE( gen.next() )
with expansion:
!false
-------------------------------------------------------------------------------
Generators internals
Range
@ -12967,5 +13465,5 @@ Misc.tests.cpp:<line number>: PASSED:
===============================================================================
test cases: 305 | 215 passed | 86 failed | 4 failed as expected
assertions: 1644 | 1475 passed | 148 failed | 21 failed as expected
assertions: 1712 | 1543 passed | 148 failed | 21 failed as expected

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<testsuitesloose text artifact
>
<testsuite name="<exe-name>" errors="17" failures="132" tests="1645" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}">
<testsuite name="<exe-name>" errors="17" failures="132" tests="1713" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}">
<properties>
<property name="filters" value="~[!nonportable]~[!benchmark]~[approvals]"/>
<property name="random-seed" value="1"/>
@ -444,6 +444,9 @@ Message.tests.cpp:<line number>
<testcase classname="<exe-name>.global" name="Generators internals/Range/Positive manual step/Integer/Exact" time="{duration}"/>
<testcase classname="<exe-name>.global" name="Generators internals/Range/Positive manual step/Integer/Slightly over end" time="{duration}"/>
<testcase classname="<exe-name>.global" name="Generators internals/Range/Positive manual step/Integer/Slightly under end" time="{duration}"/>
<testcase classname="<exe-name>.global" name="Generators internals/Range/Positive manual step/Floating Point/Exact" time="{duration}"/>
<testcase classname="<exe-name>.global" name="Generators internals/Range/Positive manual step/Floating Point/Slightly over end" time="{duration}"/>
<testcase classname="<exe-name>.global" name="Generators internals/Range/Positive manual step/Floating Point/Slightly under end" time="{duration}"/>
<testcase classname="<exe-name>.global" name="Generators internals/Range/Negative manual step/Integer/Exact" time="{duration}"/>
<testcase classname="<exe-name>.global" name="Generators internals/Range/Negative manual step/Integer/Slightly over end" time="{duration}"/>
<testcase classname="<exe-name>.global" name="Generators internals/Range/Negative manual step/Integer/Slightly under end" time="{duration}"/>

View File

@ -5812,6 +5812,778 @@ Nor would this
</Section>
<OverallResults successes="10" failures="0" expectedFailures="0"/>
</Section>
<Section name="Range" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
<Section name="Positive manual step" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
<Section name="Floating Point" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
<Section name="Exact" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
<Info>
Current expected value is -1
</Info>
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
<Original>
gen.get() == Approx(expected)
</Original>
<Expanded>
-1.0 == Approx( -1.0 )
</Expanded>
</Expression>
<Info>
Current expected value is -1
</Info>
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
<Original>
gen.next()
</Original>
<Expanded>
true
</Expanded>
</Expression>
<Info>
Current expected value is -0.9
</Info>
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
<Original>
gen.get() == Approx(expected)
</Original>
<Expanded>
-0.9 == Approx( -0.9 )
</Expanded>
</Expression>
<Info>
Current expected value is -0.9
</Info>
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
<Original>
gen.next()
</Original>
<Expanded>
true
</Expanded>
</Expression>
<Info>
Current expected value is -0.8
</Info>
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
<Original>
gen.get() == Approx(expected)
</Original>
<Expanded>
-0.8 == Approx( -0.8 )
</Expanded>
</Expression>
<Info>
Current expected value is -0.8
</Info>
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
<Original>
gen.next()
</Original>
<Expanded>
true
</Expanded>
</Expression>
<Info>
Current expected value is -0.7
</Info>
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
<Original>
gen.get() == Approx(expected)
</Original>
<Expanded>
-0.7 == Approx( -0.7 )
</Expanded>
</Expression>
<Info>
Current expected value is -0.7
</Info>
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
<Original>
gen.next()
</Original>
<Expanded>
true
</Expanded>
</Expression>
<Info>
Current expected value is -0.6
</Info>
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
<Original>
gen.get() == Approx(expected)
</Original>
<Expanded>
-0.6 == Approx( -0.6 )
</Expanded>
</Expression>
<Info>
Current expected value is -0.6
</Info>
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
<Original>
gen.next()
</Original>
<Expanded>
true
</Expanded>
</Expression>
<Info>
Current expected value is -0.5
</Info>
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
<Original>
gen.get() == Approx(expected)
</Original>
<Expanded>
-0.5 == Approx( -0.5 )
</Expanded>
</Expression>
<Info>
Current expected value is -0.5
</Info>
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
<Original>
gen.next()
</Original>
<Expanded>
true
</Expanded>
</Expression>
<Info>
Current expected value is -0.4
</Info>
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
<Original>
gen.get() == Approx(expected)
</Original>
<Expanded>
-0.4 == Approx( -0.4 )
</Expanded>
</Expression>
<Info>
Current expected value is -0.4
</Info>
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
<Original>
gen.next()
</Original>
<Expanded>
true
</Expanded>
</Expression>
<Info>
Current expected value is -0.3
</Info>
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
<Original>
gen.get() == Approx(expected)
</Original>
<Expanded>
-0.3 == Approx( -0.3 )
</Expanded>
</Expression>
<Info>
Current expected value is -0.3
</Info>
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
<Original>
gen.next()
</Original>
<Expanded>
true
</Expanded>
</Expression>
<Info>
Current expected value is -0.2
</Info>
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
<Original>
gen.get() == Approx(expected)
</Original>
<Expanded>
-0.2 == Approx( -0.2 )
</Expanded>
</Expression>
<Info>
Current expected value is -0.2
</Info>
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
<Original>
gen.next()
</Original>
<Expanded>
true
</Expanded>
</Expression>
<Info>
Current expected value is -0.1
</Info>
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
<Original>
gen.get() == Approx(expected)
</Original>
<Expanded>
-0.1 == Approx( -0.1 )
</Expanded>
</Expression>
<Info>
Current expected value is -0.1
</Info>
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
<Original>
gen.next()
</Original>
<Expanded>
true
</Expanded>
</Expression>
<Info>
Current expected value is -1.38778e-16
</Info>
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
<Original>
gen.get() == Approx(expected)
</Original>
<Expanded>
-0.0 == Approx( -0.0 )
</Expanded>
</Expression>
<Info>
Current expected value is -1.38778e-16
</Info>
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
<Original>
gen.next()
</Original>
<Expanded>
true
</Expanded>
</Expression>
<Info>
Current expected value is 0.1
</Info>
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
<Original>
gen.get() == Approx(expected)
</Original>
<Expanded>
0.1 == Approx( 0.1 )
</Expanded>
</Expression>
<Info>
Current expected value is 0.1
</Info>
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
<Original>
gen.next()
</Original>
<Expanded>
true
</Expanded>
</Expression>
<Info>
Current expected value is 0.2
</Info>
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
<Original>
gen.get() == Approx(expected)
</Original>
<Expanded>
0.2 == Approx( 0.2 )
</Expanded>
</Expression>
<Info>
Current expected value is 0.2
</Info>
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
<Original>
gen.next()
</Original>
<Expanded>
true
</Expanded>
</Expression>
<Info>
Current expected value is 0.3
</Info>
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
<Original>
gen.get() == Approx(expected)
</Original>
<Expanded>
0.3 == Approx( 0.3 )
</Expanded>
</Expression>
<Info>
Current expected value is 0.3
</Info>
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
<Original>
gen.next()
</Original>
<Expanded>
true
</Expanded>
</Expression>
<Info>
Current expected value is 0.4
</Info>
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
<Original>
gen.get() == Approx(expected)
</Original>
<Expanded>
0.4 == Approx( 0.4 )
</Expanded>
</Expression>
<Info>
Current expected value is 0.4
</Info>
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
<Original>
gen.next()
</Original>
<Expanded>
true
</Expanded>
</Expression>
<Info>
Current expected value is 0.5
</Info>
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
<Original>
gen.get() == Approx(expected)
</Original>
<Expanded>
0.5 == Approx( 0.5 )
</Expanded>
</Expression>
<Info>
Current expected value is 0.5
</Info>
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
<Original>
gen.next()
</Original>
<Expanded>
true
</Expanded>
</Expression>
<Info>
Current expected value is 0.6
</Info>
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
<Original>
gen.get() == Approx(expected)
</Original>
<Expanded>
0.6 == Approx( 0.6 )
</Expanded>
</Expression>
<Info>
Current expected value is 0.6
</Info>
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
<Original>
gen.next()
</Original>
<Expanded>
true
</Expanded>
</Expression>
<Info>
Current expected value is 0.7
</Info>
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
<Original>
gen.get() == Approx(expected)
</Original>
<Expanded>
0.7 == Approx( 0.7 )
</Expanded>
</Expression>
<Info>
Current expected value is 0.7
</Info>
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
<Original>
gen.next()
</Original>
<Expanded>
true
</Expanded>
</Expression>
<Info>
Current expected value is 0.8
</Info>
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
<Original>
gen.get() == Approx(expected)
</Original>
<Expanded>
0.8 == Approx( 0.8 )
</Expanded>
</Expression>
<Info>
Current expected value is 0.8
</Info>
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
<Original>
gen.next()
</Original>
<Expanded>
true
</Expanded>
</Expression>
<Info>
Current expected value is 0.9
</Info>
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
<Original>
gen.get() == Approx(expected)
</Original>
<Expanded>
0.9 == Approx( 0.9 )
</Expanded>
</Expression>
<Info>
Current expected value is 0.9
</Info>
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
<Original>
gen.next()
</Original>
<Expanded>
true
</Expanded>
</Expression>
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
<Original>
gen.get() == Approx( rangeEnd )
</Original>
<Expanded>
1.0 == Approx( 1.0 )
</Expanded>
</Expression>
<Expression success="true" type="REQUIRE_FALSE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
<Original>
!(gen.next())
</Original>
<Expanded>
!false
</Expanded>
</Expression>
<OverallResults successes="42" failures="0" expectedFailures="0"/>
</Section>
<OverallResults successes="42" failures="0" expectedFailures="0"/>
</Section>
<OverallResults successes="42" failures="0" expectedFailures="0"/>
</Section>
<OverallResults successes="42" failures="0" expectedFailures="0"/>
</Section>
<Section name="Range" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
<Section name="Positive manual step" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
<Section name="Floating Point" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
<Section name="Slightly over end" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
<Info>
Current expected value is -1
</Info>
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
<Original>
gen.get() == Approx(expected)
</Original>
<Expanded>
-1.0 == Approx( -1.0 )
</Expanded>
</Expression>
<Info>
Current expected value is -1
</Info>
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
<Original>
gen.next()
</Original>
<Expanded>
true
</Expanded>
</Expression>
<Info>
Current expected value is -0.7
</Info>
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
<Original>
gen.get() == Approx(expected)
</Original>
<Expanded>
-0.7 == Approx( -0.7 )
</Expanded>
</Expression>
<Info>
Current expected value is -0.7
</Info>
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
<Original>
gen.next()
</Original>
<Expanded>
true
</Expanded>
</Expression>
<Info>
Current expected value is -0.4
</Info>
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
<Original>
gen.get() == Approx(expected)
</Original>
<Expanded>
-0.4 == Approx( -0.4 )
</Expanded>
</Expression>
<Info>
Current expected value is -0.4
</Info>
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
<Original>
gen.next()
</Original>
<Expanded>
true
</Expanded>
</Expression>
<Info>
Current expected value is -0.1
</Info>
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
<Original>
gen.get() == Approx(expected)
</Original>
<Expanded>
-0.1 == Approx( -0.1 )
</Expanded>
</Expression>
<Info>
Current expected value is -0.1
</Info>
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
<Original>
gen.next()
</Original>
<Expanded>
true
</Expanded>
</Expression>
<Info>
Current expected value is 0.2
</Info>
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
<Original>
gen.get() == Approx(expected)
</Original>
<Expanded>
0.2 == Approx( 0.2 )
</Expanded>
</Expression>
<Info>
Current expected value is 0.2
</Info>
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
<Original>
gen.next()
</Original>
<Expanded>
true
</Expanded>
</Expression>
<Info>
Current expected value is 0.5
</Info>
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
<Original>
gen.get() == Approx(expected)
</Original>
<Expanded>
0.5 == Approx( 0.5 )
</Expanded>
</Expression>
<Info>
Current expected value is 0.5
</Info>
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
<Original>
gen.next()
</Original>
<Expanded>
true
</Expanded>
</Expression>
<Expression success="true" type="REQUIRE_FALSE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
<Original>
!(gen.next())
</Original>
<Expanded>
!false
</Expanded>
</Expression>
<OverallResults successes="13" failures="0" expectedFailures="0"/>
</Section>
<OverallResults successes="13" failures="0" expectedFailures="0"/>
</Section>
<OverallResults successes="13" failures="0" expectedFailures="0"/>
</Section>
<OverallResults successes="13" failures="0" expectedFailures="0"/>
</Section>
<Section name="Range" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
<Section name="Positive manual step" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
<Section name="Floating Point" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
<Section name="Slightly under end" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
<Info>
Current expected value is -1
</Info>
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
<Original>
gen.get() == Approx(expected)
</Original>
<Expanded>
-1.0 == Approx( -1.0 )
</Expanded>
</Expression>
<Info>
Current expected value is -1
</Info>
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
<Original>
gen.next()
</Original>
<Expanded>
true
</Expanded>
</Expression>
<Info>
Current expected value is -0.7
</Info>
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
<Original>
gen.get() == Approx(expected)
</Original>
<Expanded>
-0.7 == Approx( -0.7 )
</Expanded>
</Expression>
<Info>
Current expected value is -0.7
</Info>
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
<Original>
gen.next()
</Original>
<Expanded>
true
</Expanded>
</Expression>
<Info>
Current expected value is -0.4
</Info>
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
<Original>
gen.get() == Approx(expected)
</Original>
<Expanded>
-0.4 == Approx( -0.4 )
</Expanded>
</Expression>
<Info>
Current expected value is -0.4
</Info>
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
<Original>
gen.next()
</Original>
<Expanded>
true
</Expanded>
</Expression>
<Info>
Current expected value is -0.1
</Info>
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
<Original>
gen.get() == Approx(expected)
</Original>
<Expanded>
-0.1 == Approx( -0.1 )
</Expanded>
</Expression>
<Info>
Current expected value is -0.1
</Info>
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
<Original>
gen.next()
</Original>
<Expanded>
true
</Expanded>
</Expression>
<Info>
Current expected value is 0.2
</Info>
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
<Original>
gen.get() == Approx(expected)
</Original>
<Expanded>
0.2 == Approx( 0.2 )
</Expanded>
</Expression>
<Info>
Current expected value is 0.2
</Info>
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
<Original>
gen.next()
</Original>
<Expanded>
true
</Expanded>
</Expression>
<Info>
Current expected value is 0.5
</Info>
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
<Original>
gen.get() == Approx(expected)
</Original>
<Expanded>
0.5 == Approx( 0.5 )
</Expanded>
</Expression>
<Info>
Current expected value is 0.5
</Info>
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
<Original>
gen.next()
</Original>
<Expanded>
true
</Expanded>
</Expression>
<Expression success="true" type="REQUIRE_FALSE" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
<Original>
!(gen.next())
</Original>
<Expanded>
!false
</Expanded>
</Expression>
<OverallResults successes="13" failures="0" expectedFailures="0"/>
</Section>
<OverallResults successes="13" failures="0" expectedFailures="0"/>
</Section>
<OverallResults successes="13" failures="0" expectedFailures="0"/>
</Section>
<OverallResults successes="13" failures="0" expectedFailures="0"/>
</Section>
<Section name="Range" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
<Section name="Negative manual step" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
<Section name="Integer" filename="projects/<exe-name>/IntrospectiveTests/GeneratorsImpl.tests.cpp" >
@ -15390,7 +16162,7 @@ loose text artifact
</Section>
<OverallResult success="true"/>
</TestCase>
<OverallResults successes="1475" failures="149" expectedFailures="21"/>
<OverallResults successes="1543" failures="149" expectedFailures="21"/>
</Group>
<OverallResults successes="1475" failures="148" expectedFailures="21"/>
<OverallResults successes="1543" failures="148" expectedFailures="21"/>
</Catch>

View File

@ -173,6 +173,58 @@ TEST_CASE("Generators internals", "[generators][internals]") {
REQUIRE_FALSE(gen.next());
}
}
SECTION("Floating Point") {
SECTION("Exact") {
const auto rangeStart = -1.;
const auto rangeEnd = 1.;
const auto step = .1;
auto gen = range(rangeStart, rangeEnd, step);
auto expected = rangeStart;
while( (rangeEnd - expected) > step ) {
INFO( "Current expected value is " << expected )
REQUIRE(gen.get() == Approx(expected));
REQUIRE(gen.next());
expected += step;
}
REQUIRE(gen.get() == Approx( rangeEnd ) );
REQUIRE_FALSE(gen.next());
}
SECTION("Slightly over end") {
const auto rangeStart = -1.;
const auto rangeEnd = 1.;
const auto step = .3;
auto gen = range(rangeStart, rangeEnd, step);
auto expected = rangeStart;
while( (rangeEnd - expected) > step ) {
INFO( "Current expected value is " << expected )
REQUIRE(gen.get() == Approx(expected));
REQUIRE(gen.next());
expected += step;
}
REQUIRE_FALSE(gen.next());
}
SECTION("Slightly under end") {
const auto rangeStart = -1.;
const auto rangeEnd = .9;
const auto step = .3;
auto gen = range(rangeStart, rangeEnd, step);
auto expected = rangeStart;
while( (rangeEnd - expected) > step ) {
INFO( "Current expected value is " << expected )
REQUIRE(gen.get() == Approx(expected));
REQUIRE(gen.next());
expected += step;
}
REQUIRE_FALSE(gen.next());
}
}
}
SECTION("Negative manual step") {
SECTION("Integer") {