diff options
Diffstat (limited to 'tests/auto/qml/qqmlincubator/tst_qqmlincubator.cpp')
-rw-r--r-- | tests/auto/qml/qqmlincubator/tst_qqmlincubator.cpp | 84 |
1 files changed, 42 insertions, 42 deletions
diff --git a/tests/auto/qml/qqmlincubator/tst_qqmlincubator.cpp b/tests/auto/qml/qqmlincubator/tst_qqmlincubator.cpp index 863b6aaa29..8f0e04e12e 100644 --- a/tests/auto/qml/qqmlincubator/tst_qqmlincubator.cpp +++ b/tests/auto/qml/qqmlincubator/tst_qqmlincubator.cpp @@ -145,15 +145,15 @@ void tst_qqmlincubator::objectDeleted() QCOMPARE(incubator.status(), QQmlIncubator::Loading); QVERIFY(!SelfRegisteringType::me()); - while (SelfRegisteringOuterType::me() == 0 && incubator.isLoading()) { + while (SelfRegisteringOuterType::me() == nullptr && incubator.isLoading()) { bool b = false; controller.incubateWhile(&b); } - QVERIFY(SelfRegisteringOuterType::me() != 0); + QVERIFY(SelfRegisteringOuterType::me() != nullptr); QVERIFY(incubator.isLoading()); - while (SelfRegisteringType::me() == 0 && incubator.isLoading()) { + while (SelfRegisteringType::me() == nullptr && incubator.isLoading()) { bool b = false; controller.incubateWhile(&b); } @@ -201,13 +201,13 @@ void tst_qqmlincubator::clear() QQmlIncubator incubator; component.create(incubator); - while (SelfRegisteringType::me() == 0 && incubator.isLoading()) { + while (SelfRegisteringType::me() == nullptr && incubator.isLoading()) { bool b = false; controller.incubateWhile(&b); } QVERIFY(incubator.isLoading()); - QVERIFY(SelfRegisteringType::me() != 0); + QVERIFY(SelfRegisteringType::me() != nullptr); QPointer<SelfRegisteringType> srt = SelfRegisteringType::me(); incubator.clear(); @@ -226,7 +226,7 @@ void tst_qqmlincubator::clear() } QVERIFY(incubator.isReady()); - QVERIFY(incubator.object() != 0); + QVERIFY(incubator.object() != nullptr); QPointer<QObject> obj = incubator.object(); incubator.clear(); @@ -299,7 +299,7 @@ void tst_qqmlincubator::forceCompletion() incubator.forceCompletion(); QVERIFY(incubator.isReady()); - QVERIFY(incubator.object() != 0); + QVERIFY(incubator.object() != nullptr); QCOMPARE(incubator.object()->property("testValue").toInt(), 3499); delete incubator.object(); @@ -314,18 +314,18 @@ void tst_qqmlincubator::forceCompletion() component.create(incubator); QVERIFY(incubator.isLoading()); - while (SelfRegisteringType::me() == 0 && incubator.isLoading()) { + while (SelfRegisteringType::me() == nullptr && incubator.isLoading()) { bool b = false; controller.incubateWhile(&b); } - QVERIFY(SelfRegisteringType::me() != 0); + QVERIFY(SelfRegisteringType::me() != nullptr); QVERIFY(incubator.isLoading()); incubator.forceCompletion(); QVERIFY(incubator.isReady()); - QVERIFY(incubator.object() != 0); + QVERIFY(incubator.object() != nullptr); QCOMPARE(incubator.object()->property("testValue").toInt(), 3499); delete incubator.object(); @@ -341,13 +341,13 @@ void tst_qqmlincubator::forceCompletion() incubator.forceCompletion(); QVERIFY(incubator.isReady()); - QVERIFY(incubator.object() != 0); + QVERIFY(incubator.object() != nullptr); QCOMPARE(incubator.object()->property("testValue").toInt(), 3499); incubator.forceCompletion(); QVERIFY(incubator.isReady()); - QVERIFY(incubator.object() != 0); + QVERIFY(incubator.object() != nullptr); QCOMPARE(incubator.object()->property("testValue").toInt(), 3499); delete incubator.object(); @@ -410,19 +410,19 @@ void tst_qqmlincubator::clearDuringCompletion() QCOMPARE(incubator.status(), QQmlIncubator::Loading); QVERIFY(!CompletionRegisteringType::me()); - while (CompletionRegisteringType::me() == 0 && incubator.isLoading()) { + while (CompletionRegisteringType::me() == nullptr && incubator.isLoading()) { bool b = false; controller.incubateWhile(&b); } - QVERIFY(CompletionRegisteringType::me() != 0); - QVERIFY(SelfRegisteringType::me() != 0); + QVERIFY(CompletionRegisteringType::me() != nullptr); + QVERIFY(SelfRegisteringType::me() != nullptr); QVERIFY(incubator.isLoading()); QPointer<QObject> srt = SelfRegisteringType::me(); incubator.clear(); - QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete); + QCoreApplication::sendPostedEvents(nullptr, QEvent::DeferredDelete); QCoreApplication::processEvents(); QVERIFY(incubator.isNull()); QVERIFY(srt.isNull()); @@ -436,7 +436,7 @@ void tst_qqmlincubator::objectDeletionAfterInit() struct MyIncubator : public QQmlIncubator { MyIncubator(QQmlIncubator::IncubationMode mode) - : QQmlIncubator(mode), obj(0) {} + : QQmlIncubator(mode), obj(nullptr) {} virtual void setInitialState(QObject *o) { obj = o; @@ -455,12 +455,12 @@ void tst_qqmlincubator::objectDeletionAfterInit() } QVERIFY(incubator.isLoading()); - QVERIFY(SelfRegisteringType::me() != 0); + QVERIFY(SelfRegisteringType::me() != nullptr); delete incubator.obj; incubator.clear(); - QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete); + QCoreApplication::sendPostedEvents(nullptr, QEvent::DeferredDelete); QCoreApplication::processEvents(); QVERIFY(incubator.isNull()); } @@ -592,11 +592,11 @@ void tst_qqmlincubator::asynchronousIfNested() QVERIFY(component.isReady()); QObject *object = component.create(); - QVERIFY(object != 0); + QVERIFY(object != nullptr); QCOMPARE(object->property("a").toInt(), 10); QQmlIncubator incubator(QQmlIncubator::AsynchronousIfNested); - component.create(incubator, 0, qmlContext(object)); + component.create(incubator, nullptr, qmlContext(object)); QVERIFY(incubator.isReady()); QVERIFY(incubator.object()); @@ -618,16 +618,16 @@ void tst_qqmlincubator::asynchronousIfNested() QVERIFY(incubator.isLoading()); QVERIFY(!SelfRegisteringType::me()); - while (SelfRegisteringType::me() == 0 && incubator.isLoading()) { + while (SelfRegisteringType::me() == nullptr && incubator.isLoading()) { bool b = false; controller.incubateWhile(&b); } - QVERIFY(SelfRegisteringType::me() != 0); + QVERIFY(SelfRegisteringType::me() != nullptr); QVERIFY(incubator.isLoading()); QQmlIncubator nested(QQmlIncubator::AsynchronousIfNested); - component.create(nested, 0, qmlContext(SelfRegisteringType::me())); + component.create(nested, nullptr, qmlContext(SelfRegisteringType::me())); QVERIFY(nested.isLoading()); while (nested.isLoading()) { @@ -669,7 +669,7 @@ void tst_qqmlincubator::asynchronousIfNested() if (!c.isReady()) return; QQmlIncubator incubator(QQmlIncubator::AsynchronousIfNested); - c.create(incubator, 0, qmlContext(o)); + c.create(incubator, nullptr, qmlContext(o)); if (!incubator.isReady()) return; @@ -738,12 +738,12 @@ void tst_qqmlincubator::chainedAsynchronousIfNested() QVERIFY(incubator.isLoading()); QVERIFY(!SelfRegisteringType::me()); - while (SelfRegisteringType::me() == 0 && incubator.isLoading()) { + while (SelfRegisteringType::me() == nullptr && incubator.isLoading()) { bool b = false; controller.incubateWhile(&b); } - QVERIFY(SelfRegisteringType::me() != 0); + QVERIFY(SelfRegisteringType::me() != nullptr); QVERIFY(incubator.isLoading()); struct MyIncubator : public QQmlIncubator { @@ -753,7 +753,7 @@ void tst_qqmlincubator::chainedAsynchronousIfNested() protected: virtual void statusChanged(Status s) { if (s == Ready && next) - component->create(*next, 0, ctxt); + component->create(*next, nullptr, ctxt); } private: @@ -762,10 +762,10 @@ void tst_qqmlincubator::chainedAsynchronousIfNested() QQmlContext *ctxt; }; - MyIncubator incubator2(0, &component, 0); + MyIncubator incubator2(nullptr, &component, nullptr); MyIncubator incubator1(&incubator2, &component, qmlContext(SelfRegisteringType::me())); - component.create(incubator1, 0, qmlContext(SelfRegisteringType::me())); + component.create(incubator1, nullptr, qmlContext(SelfRegisteringType::me())); QVERIFY(incubator.isLoading()); QVERIFY(incubator1.isLoading()); @@ -824,7 +824,7 @@ void tst_qqmlincubator::chainedAsynchronousIfNestedOnCompleted() protected: virtual void statusChanged(Status s) { if (s == Ready && next) { - component->create(*next, 0, ctxt); + component->create(*next, nullptr, ctxt); } } @@ -842,7 +842,7 @@ void tst_qqmlincubator::chainedAsynchronousIfNestedOnCompleted() QQmlContext *ctxt; static void callback(CompletionCallbackType *, void *data) { CallbackData *d = (CallbackData *)data; - d->component->create(*d->incubator, 0, d->ctxt); + d->component->create(*d->incubator, nullptr, d->ctxt); } }; @@ -852,15 +852,15 @@ void tst_qqmlincubator::chainedAsynchronousIfNestedOnCompleted() QVERIFY(incubator.isLoading()); QVERIFY(!SelfRegisteringType::me()); - while (SelfRegisteringType::me() == 0 && incubator.isLoading()) { + while (SelfRegisteringType::me() == nullptr && incubator.isLoading()) { bool b = false; controller.incubateWhile(&b); } - QVERIFY(SelfRegisteringType::me() != 0); + QVERIFY(SelfRegisteringType::me() != nullptr); QVERIFY(incubator.isLoading()); - MyIncubator incubator3(0, &c1, qmlContext(SelfRegisteringType::me())); + MyIncubator incubator3(nullptr, &c1, qmlContext(SelfRegisteringType::me())); MyIncubator incubator2(&incubator3, &c1, qmlContext(SelfRegisteringType::me())); MyIncubator incubator1(&incubator2, &c1, qmlContext(SelfRegisteringType::me())); @@ -952,7 +952,7 @@ void tst_qqmlincubator::chainedAsynchronousClear() protected: virtual void statusChanged(Status s) { if (s == Ready && next) { - component->create(*next, 0, ctxt); + component->create(*next, nullptr, ctxt); } } @@ -970,7 +970,7 @@ void tst_qqmlincubator::chainedAsynchronousClear() QQmlContext *ctxt; static void callback(CompletionCallbackType *, void *data) { CallbackData *d = (CallbackData *)data; - d->component->create(*d->incubator, 0, d->ctxt); + d->component->create(*d->incubator, nullptr, d->ctxt); } }; @@ -980,15 +980,15 @@ void tst_qqmlincubator::chainedAsynchronousClear() QVERIFY(incubator.isLoading()); QVERIFY(!SelfRegisteringType::me()); - while (SelfRegisteringType::me() == 0 && incubator.isLoading()) { + while (SelfRegisteringType::me() == nullptr && incubator.isLoading()) { bool b = false; controller.incubateWhile(&b); } - QVERIFY(SelfRegisteringType::me() != 0); + QVERIFY(SelfRegisteringType::me() != nullptr); QVERIFY(incubator.isLoading()); - MyIncubator incubator3(0, &c1, qmlContext(SelfRegisteringType::me())); + MyIncubator incubator3(nullptr, &c1, qmlContext(SelfRegisteringType::me())); MyIncubator incubator2(&incubator3, &c1, qmlContext(SelfRegisteringType::me())); MyIncubator incubator1(&incubator2, &c1, qmlContext(SelfRegisteringType::me())); @@ -1103,12 +1103,12 @@ void tst_qqmlincubator::selfDelete() QCOMPARE(incubator->QQmlIncubator::status(), QQmlIncubator::Loading); QVERIFY(!SelfRegisteringType::me()); - while (SelfRegisteringType::me() == 0 && incubator->isLoading()) { + while (SelfRegisteringType::me() == nullptr && incubator->isLoading()) { bool b = false; controller.incubateWhile(&b); } - QVERIFY(SelfRegisteringType::me() != 0); + QVERIFY(SelfRegisteringType::me() != nullptr); QVERIFY(incubator->isLoading()); // We have to cheat and manually remove it from the creator->allCreatedObjects |