mirror of
https://github.com/simonbrunel/qtpromise.git
synced 2025-07-06 17:25:22 +08:00
Rename qPromise() helper to QtPromise::resolve()
For consistency with other helpers, deprecate `qPromise()` in favor of `QtPromise::resolve()` but also add support for calling this helper with lvalue. Add extra unit tests to make sure that rvalue is not copied.
This commit is contained in:
@ -29,7 +29,7 @@ namespace {
|
||||
template <class E>
|
||||
void verify()
|
||||
{
|
||||
auto p = qPromise(QtConcurrent::run([]() { throw E(); }));
|
||||
auto p = QtPromise::resolve(QtConcurrent::run([]() { throw E(); }));
|
||||
QCOMPARE(p.isPending(), true);
|
||||
QCOMPARE(waitForRejected<E>(p), true);
|
||||
QCOMPARE(p.isRejected(), true);
|
||||
|
Reference in New Issue
Block a user