aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquickimageprovider/tst_qquickimageprovider.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/quick/qquickimageprovider/tst_qquickimageprovider.cpp')
-rw-r--r--tests/auto/quick/qquickimageprovider/tst_qquickimageprovider.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/tests/auto/quick/qquickimageprovider/tst_qquickimageprovider.cpp b/tests/auto/quick/qquickimageprovider/tst_qquickimageprovider.cpp
index 98f3972cef..4298bc198b 100644
--- a/tests/auto/quick/qquickimageprovider/tst_qquickimageprovider.cpp
+++ b/tests/auto/quick/qquickimageprovider/tst_qquickimageprovider.cpp
@@ -76,7 +76,7 @@ private:
class TestQImageProvider : public QQuickImageProvider
{
public:
- TestQImageProvider(bool *deleteWatch = 0, bool forceAsync = false)
+ TestQImageProvider(bool *deleteWatch = nullptr, bool forceAsync = false)
: QQuickImageProvider(Image, (forceAsync ? ForceAsynchronousImageLoading : Flags()))
, deleteWatch(deleteWatch)
{
@@ -114,7 +114,7 @@ Q_DECLARE_METATYPE(TestQImageProvider*);
class TestQPixmapProvider : public QQuickImageProvider
{
public:
- TestQPixmapProvider(bool *deleteWatch = 0)
+ TestQPixmapProvider(bool *deleteWatch = nullptr)
: QQuickImageProvider(Pixmap), deleteWatch(deleteWatch)
{
}
@@ -217,7 +217,7 @@ void tst_qquickimageprovider::runTest(bool async, QQuickImageProvider *provider)
QQmlEngine engine;
engine.addImageProvider("test", provider);
- QVERIFY(engine.imageProvider("test") != 0);
+ QVERIFY(engine.imageProvider("test") != nullptr);
QString componentStr = "import QtQuick 2.0\nImage { source: \"" + source + "\"; "
+ (async ? "asynchronous: true; " : "")
@@ -225,7 +225,7 @@ void tst_qquickimageprovider::runTest(bool async, QQuickImageProvider *provider)
QQmlComponent component(&engine);
component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
QQuickImage *obj = qobject_cast<QQuickImage*>(component.create());
- QVERIFY(obj != 0);
+ QVERIFY(obj != nullptr);
// From this point on, treat forced async providers as async behaviour-wise
if (engine.imageProvider(QUrl(source).host()) == provider)
@@ -314,14 +314,14 @@ void tst_qquickimageprovider::requestPixmap_async()
QQuickImageProvider *provider = new TestQPixmapProvider();
engine.addImageProvider("test", provider);
- QVERIFY(engine.imageProvider("test") != 0);
+ QVERIFY(engine.imageProvider("test") != nullptr);
// pixmaps are loaded synchronously regardless of 'asynchronous' value
QString componentStr = "import QtQuick 2.0\nImage { asynchronous: true; source: \"image://test/pixmap-async-test.png\" }";
QQmlComponent component(&engine);
component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
QQuickImage *obj = qobject_cast<QQuickImage*>(component.create());
- QVERIFY(obj != 0);
+ QVERIFY(obj != nullptr);
delete obj;
}
@@ -341,14 +341,14 @@ void tst_qquickimageprovider::removeProvider()
QQmlEngine engine;
engine.addImageProvider("test", provider);
- QVERIFY(engine.imageProvider("test") != 0);
+ QVERIFY(engine.imageProvider("test") != nullptr);
// add provider, confirm it works
QString componentStr = "import QtQuick 2.0\nImage { source: \"" + newImageFileName() + "\" }";
QQmlComponent component(&engine);
component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
QQuickImage *obj = qobject_cast<QQuickImage*>(component.create());
- QVERIFY(obj != 0);
+ QVERIFY(obj != nullptr);
QCOMPARE(obj->status(), QQuickImage::Ready);
@@ -384,7 +384,7 @@ void tst_qquickimageprovider::imageProviderId()
TestQImageProvider *provider = new TestQImageProvider(&deleteWatch);
engine.addImageProvider(providerId, provider);
- QVERIFY(engine.imageProvider(providerId) != 0);
+ QVERIFY(engine.imageProvider(providerId) != nullptr);
engine.removeImageProvider(providerId);
QVERIFY(deleteWatch);
@@ -428,7 +428,7 @@ void tst_qquickimageprovider::threadTest()
TestThreadProvider *provider = new TestThreadProvider;
engine.addImageProvider("test_thread", provider);
- QVERIFY(engine.imageProvider("test_thread") != 0);
+ QVERIFY(engine.imageProvider("test_thread") != nullptr);
QString componentStr = "import QtQuick 2.0\nItem { \n"
"Image { source: \"image://test_thread/blue\"; asynchronous: true; }\n"
@@ -440,7 +440,7 @@ void tst_qquickimageprovider::threadTest()
component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
QObject *obj = component.create();
//MUST not deadlock
- QVERIFY(obj != 0);
+ QVERIFY(obj != nullptr);
QList<QQuickImage *> images = obj->findChildren<QQuickImage *>();
QCOMPARE(images.count(), 4);
QTest::qWait(100);
@@ -459,7 +459,7 @@ class TestImageResponse : public QQuickImageResponse, public QRunnable
{
public:
TestImageResponse(QMutex *lock, QWaitCondition *condition, bool *ok, const QString &id, const QSize &requestedSize)
- : m_lock(lock), m_condition(condition), m_ok(ok), m_id(id), m_requestedSize(requestedSize), m_texture(0)
+ : m_lock(lock), m_condition(condition), m_ok(ok), m_id(id), m_requestedSize(requestedSize), m_texture(nullptr)
{
setAutoDelete(false);
}
@@ -523,7 +523,7 @@ void tst_qquickimageprovider::asyncTextureTest()
TestAsyncProvider *provider = new TestAsyncProvider;
engine.addImageProvider("test_async", provider);
- QVERIFY(engine.imageProvider("test_async") != 0);
+ QVERIFY(engine.imageProvider("test_async") != nullptr);
QString componentStr = "import QtQuick 2.0\nItem { \n"
"Image { source: \"image://test_async/blue\"; }\n"
@@ -535,7 +535,7 @@ void tst_qquickimageprovider::asyncTextureTest()
component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
QObject *obj = component.create();
//MUST not deadlock
- QVERIFY(obj != 0);
+ QVERIFY(obj != nullptr);
QList<QQuickImage *> images = obj->findChildren<QQuickImage *>();
QCOMPARE(images.count(), 4);