Silence a few unused-but-set-parameter warnings in some of the tests
Change-Id: I8cf3e4764ae50011d691dec6f52a355ddfb0ce7b Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
This commit is contained in:
parent
ba724a2ded
commit
93a378b295
@ -50,7 +50,7 @@ public slots:
|
||||
|
||||
using namespace QtConcurrent;
|
||||
|
||||
void multiplyBy2Immutable(int x)
|
||||
void multiplyBy2Immutable([[maybe_unused]] int x)
|
||||
{
|
||||
x *= 2;
|
||||
}
|
||||
@ -58,7 +58,7 @@ void multiplyBy2Immutable(int x)
|
||||
class MultiplyBy2Immutable
|
||||
{
|
||||
public:
|
||||
void operator()(int x)
|
||||
void operator()([[maybe_unused]] int x)
|
||||
{
|
||||
x *= 2;
|
||||
}
|
||||
@ -163,9 +163,9 @@ void tst_QtConcurrentMap::map()
|
||||
QCOMPARE(list, QList<int>() << 1 << 2 << 3);
|
||||
|
||||
// lambda
|
||||
QtConcurrent::map(list, [](int x){x *= 2;}).waitForFinished();
|
||||
QtConcurrent::map(list, []([[maybe_unused]] int x){x *= 2;}).waitForFinished();
|
||||
QCOMPARE(list, QList<int>() << 1 << 2 << 3);
|
||||
QtConcurrent::map(list.begin(), list.end(), [](int x){x *= 2;}).waitForFinished();
|
||||
QtConcurrent::map(list.begin(), list.end(), []([[maybe_unused]] int x){x *= 2;}).waitForFinished();
|
||||
QCOMPARE(list, QList<int>() << 1 << 2 << 3);
|
||||
}
|
||||
|
||||
@ -309,9 +309,9 @@ void tst_QtConcurrentMap::blockingMap()
|
||||
QCOMPARE(list, QList<int>() << 1 << 2 << 3);
|
||||
|
||||
// lambda
|
||||
QtConcurrent::blockingMap(list, [](int x) { x *= 2; });
|
||||
QtConcurrent::blockingMap(list, []([[maybe_unused]] int x) { x *= 2; });
|
||||
QCOMPARE(list, QList<int>() << 1 << 2 << 3);
|
||||
QtConcurrent::blockingMap(list.begin(), list.end(), [](int x) { x *= 2; });
|
||||
QtConcurrent::blockingMap(list.begin(), list.end(), []([[maybe_unused]] int x) { x *= 2; });
|
||||
QCOMPARE(list, QList<int>() << 1 << 2 << 3);
|
||||
}
|
||||
|
||||
@ -2047,7 +2047,7 @@ void tst_QtConcurrentMap::stlContainersLambda()
|
||||
|
||||
QtConcurrent::mapped(list, [](const int &i) { return mapper(i); }).waitForFinished();
|
||||
|
||||
QtConcurrent::blockingMap(list, [](int x) { x *= 2; });
|
||||
QtConcurrent::blockingMap(list, []([[maybe_unused]] int x) { x *= 2; });
|
||||
}
|
||||
|
||||
InstanceCounter ic_fn(const InstanceCounter & ic)
|
||||
|
@ -272,9 +272,9 @@ void tst_QCollator::compare()
|
||||
if (numericMode)
|
||||
collator.setNumericMode(true);
|
||||
|
||||
int keyCompareResult = result;
|
||||
[[maybe_unused]]int keyCompareCaseInsensitiveResult = caseInsensitiveResult;
|
||||
[[maybe_unused]]int keyComparePunctuationResultResult = punctuationResult;
|
||||
[[maybe_unused]] int keyCompareResult = result;
|
||||
[[maybe_unused]] int keyCompareCaseInsensitiveResult = caseInsensitiveResult;
|
||||
[[maybe_unused]] int keyComparePunctuationResultResult = punctuationResult;
|
||||
|
||||
// trying to deal with special behavior of different OS-dependent collators
|
||||
if (collator.locale() == QLocale("C")) {
|
||||
|
Loading…
Reference in New Issue
Block a user