summaryrefslogtreecommitdiffstats
path: root/tests/auto/concurrent/qtconcurrentmap/functions.h
diff options
context:
space:
mode:
authorJarek Kobus <jaroslaw.kobus@qt.io>2020-04-17 11:54:40 +0200
committerJarek Kobus <jaroslaw.kobus@qt.io>2020-04-21 10:22:26 +0200
commitd998a467ace766e3266dca798c8357c8e1ef5653 (patch)
tree0f21bb800ffbd87017742b7b27ede6139b9c3a8d /tests/auto/concurrent/qtconcurrentmap/functions.h
parent82729ddb2a862fee117c42828948d47513428c28 (diff)
Add more tests for QtConcurrent::mappedReduced()
Test the case where reduce function of the form: V function(T &result, const U &intermediate) has T and U types different. Make use of numberSumReduce function and corresponding functor that reduce Number class object to the result of int type. Fixes: QTBUG-83258 Change-Id: I194d290988b48e7bca91228c0cd5d39efd1b4712 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Diffstat (limited to 'tests/auto/concurrent/qtconcurrentmap/functions.h')
-rw-r--r--tests/auto/concurrent/qtconcurrentmap/functions.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/auto/concurrent/qtconcurrentmap/functions.h b/tests/auto/concurrent/qtconcurrentmap/functions.h
index 19b19f6057..838b7090d8 100644
--- a/tests/auto/concurrent/qtconcurrentmap/functions.h
+++ b/tests/auto/concurrent/qtconcurrentmap/functions.h
@@ -80,6 +80,11 @@ public:
return QString::number(n);
}
+ Number squared() const
+ {
+ return Number(n * n);
+ }
+
bool operator==(const Number &other) const
{
return n == other.n;