diff options
author | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2020-10-29 13:33:22 +0100 |
---|---|---|
committer | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2020-10-29 14:03:38 +0100 |
commit | 387f3e00a8d74984d33af990a1e1f57cd87aae61 (patch) | |
tree | fda7edb02f8417aae018d40f2b26d3f25682b43d /tests/auto/concurrent/qtconcurrentfilter | |
parent | d2b50a736b3410e186266b1c74a59c1e4fbeed48 (diff) |
Workaround gcc compiler bug
For the comparison of a QFuture<int> and an int, gcc creates code that
creates a qfloat16 instance, as can be seen when stepping through this
code:
QFuture<int> future;
int five = 5;
if (future == five)
return five;
Explicitly get the result of the QFuture to compare as a workaround.
Change-Id: Id2adc2268dbc0ccec7df3a9786c9d29dcdc04da3
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Diffstat (limited to 'tests/auto/concurrent/qtconcurrentfilter')
-rw-r--r-- | tests/auto/concurrent/qtconcurrentfilter/tst_qtconcurrentfilter.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/auto/concurrent/qtconcurrentfilter/tst_qtconcurrentfilter.cpp b/tests/auto/concurrent/qtconcurrentfilter/tst_qtconcurrentfilter.cpp index ac6869eee9..32023f0a66 100644 --- a/tests/auto/concurrent/qtconcurrentfilter/tst_qtconcurrentfilter.cpp +++ b/tests/auto/concurrent/qtconcurrentfilter/tst_qtconcurrentfilter.cpp @@ -462,7 +462,7 @@ void tst_QtConcurrentFilter::filteredReduced() // rvalue sequences auto future = QtConcurrent::filteredReduced(std::vector { 1, 2, 3, 4 }, keepEvenIntegers, intSumReduce); - QCOMPARE(future, intSum); + QCOMPARE(future.result(), intSum); auto result = QtConcurrent::blockingFilteredReduced(std::vector { 1, 2, 3, 4 }, keepEvenIntegers, intSumReduce); @@ -473,7 +473,7 @@ void tst_QtConcurrentFilter::filteredReduced() // move only sequences auto future = QtConcurrent::filteredReduced(MoveOnlyVector({ 1, 2, 3, 4 }), keepEvenIntegers, intSumReduce); - QCOMPARE(future, intSum); + QCOMPARE(future.result(), intSum); auto result = QtConcurrent::blockingFilteredReduced(MoveOnlyVector({ 1, 2, 3, 4 }), keepEvenIntegers, intSumReduce); @@ -560,7 +560,7 @@ void tst_QtConcurrentFilter::filteredReducedThreadPool() // rvalue sequences auto future = QtConcurrent::filteredReduced(&pool, std::vector { 1, 2, 3, 4 }, keepOddIntegers, intSumReduce); - QCOMPARE(future, intSum); + QCOMPARE(future.result(), intSum); auto result = QtConcurrent::blockingFilteredReduced(&pool, std::vector { 1, 2, 3, 4 }, keepOddIntegers, intSumReduce); @@ -571,7 +571,7 @@ void tst_QtConcurrentFilter::filteredReducedThreadPool() // move only sequences auto future = QtConcurrent::filteredReduced(&pool, MoveOnlyVector({ 1, 2, 3, 4 }), keepOddIntegers, intSumReduce); - QCOMPARE(future, intSum); + QCOMPARE(future.result(), intSum); auto result = QtConcurrent::blockingFilteredReduced(&pool, MoveOnlyVector({ 1, 2, 3, 4 }), keepOddIntegers, intSumReduce); @@ -778,7 +778,7 @@ void tst_QtConcurrentFilter::filteredReducedInitialValue() // rvalue sequences auto future = QtConcurrent::filteredReduced(std::vector { 1, 2, 3, 4 }, keepEvenIntegers, intSumReduce, intInitial); - QCOMPARE(future, intSum); + QCOMPARE(future.result(), intSum); auto result = QtConcurrent::blockingFilteredReduced( std::vector { 1, 2, 3, 4 }, keepEvenIntegers, intSumReduce, intInitial); @@ -789,7 +789,7 @@ void tst_QtConcurrentFilter::filteredReducedInitialValue() // move only sequences auto future = QtConcurrent::filteredReduced(MoveOnlyVector({ 1, 2, 3, 4 }), keepEvenIntegers, intSumReduce, intInitial); - QCOMPARE(future, intSum); + QCOMPARE(future.result(), intSum); auto result = QtConcurrent::blockingFilteredReduced( MoveOnlyVector({ 1, 2, 3, 4 }), keepEvenIntegers, intSumReduce, intInitial); @@ -888,7 +888,7 @@ void tst_QtConcurrentFilter::filteredReducedInitialValueThreadPool() // rvalue sequences auto future = QtConcurrent::filteredReduced(&pool, std::vector { 1, 2, 3, 4 }, keepOddIntegers, intSumReduce, intInitial); - QCOMPARE(future, intSum); + QCOMPARE(future.result(), intSum); auto result = QtConcurrent::blockingFilteredReduced( &pool, std::vector { 1, 2, 3, 4 }, keepOddIntegers, intSumReduce, intInitial); @@ -899,7 +899,7 @@ void tst_QtConcurrentFilter::filteredReducedInitialValueThreadPool() // move only sequences auto future = QtConcurrent::filteredReduced(&pool, MoveOnlyVector({ 1, 2, 3, 4 }), keepOddIntegers, intSumReduce, intInitial); - QCOMPARE(future, intSum); + QCOMPARE(future.result(), intSum); auto result = QtConcurrent::blockingFilteredReduced( &pool, MoveOnlyVector({ 1, 2, 3, 4 }), keepOddIntegers, intSumReduce, intInitial); |