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:
Amir Masoud Abdol 2023-03-03 11:29:00 +01:00
parent ba724a2ded
commit 93a378b295
2 changed files with 10 additions and 10 deletions

View File

@ -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)

View File

@ -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")) {