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:
parent
833da1f31c
commit
16cf095bd5
@ -8586,7 +8586,11 @@ void tst_QObject::asyncCallbackHelper()
|
|||||||
QCOMPARE(called, 1);
|
QCOMPARE(called, 1);
|
||||||
QMetaObject::invokeMethod(this, [&called, u = std::unique_ptr<int>()]{ called = 2; });
|
QMetaObject::invokeMethod(this, [&called, u = std::unique_ptr<int>()]{ called = 2; });
|
||||||
QCOMPARE(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);
|
QCOMPARE(called, 3);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user