Silence warning from unused variable in QObject test

It's not needed, but makes the point for having a mutable lambda in the
first place.

Change-Id: I483862d6aee90bb62d4b5363c56a80bb05e14df7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Volker Hilsheimer 2023-05-20 11:14:00 +02:00
parent 833da1f31c
commit 16cf095bd5

View File

@ -8586,7 +8586,11 @@ void tst_QObject::asyncCallbackHelper()
QCOMPARE(called, 1);
QMetaObject::invokeMethod(this, [&called, u = std::unique_ptr<int>()]{ called = 2; });
QCOMPARE(called, 2);
QMetaObject::invokeMethod(this, [&called, count = 0]() mutable { called = 3; });
QMetaObject::invokeMethod(this, [&called, count = 0]() mutable {
if (!count)
called = 3;
++count;
});
QCOMPARE(called, 3);
}
}