diff options
author | Tasuku Suzuki <stasuku@gmail.com> | 2013-06-08 15:53:09 +0900 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-06-18 11:05:18 +0200 |
commit | 5d4b006181d009e6245d5d38c7798603ddcab06a (patch) | |
tree | bd1cb97f1293507d9bbb1df8c85e144077d9a780 /tests/auto/quick | |
parent | ad92ce206d23ea696e7c659cb27b48aff053e65b (diff) |
fix case insensitive issue with image provider id
Task-number: QTBUG-31614
Change-Id: I866df6e3ed6226b443640a51f66a3dbb92b31249
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
Diffstat (limited to 'tests/auto/quick')
-rw-r--r-- | tests/auto/quick/qquickimageprovider/tst_qquickimageprovider.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/auto/quick/qquickimageprovider/tst_qquickimageprovider.cpp b/tests/auto/quick/qquickimageprovider/tst_qquickimageprovider.cpp index a790c7b9de..3eea3c955c 100644 --- a/tests/auto/quick/qquickimageprovider/tst_qquickimageprovider.cpp +++ b/tests/auto/quick/qquickimageprovider/tst_qquickimageprovider.cpp @@ -71,6 +71,9 @@ private slots: void removeProvider_data(); void removeProvider(); + void imageProviderId_data(); + void imageProviderId(); + void threadTest(); private: @@ -372,6 +375,31 @@ void tst_qquickimageprovider::removeProvider() delete obj; } +void tst_qquickimageprovider::imageProviderId_data() +{ + QTest::addColumn<QString>("providerId"); + + QTest::newRow("lowercase") << QStringLiteral("imageprovider"); + QTest::newRow("CamelCase") << QStringLiteral("ImageProvider"); + QTest::newRow("UPPERCASE") << QStringLiteral("IMAGEPROVIDER"); +} + +void tst_qquickimageprovider::imageProviderId() +{ + QFETCH(QString, providerId); + + QQmlEngine engine; + + bool deleteWatch = false; + TestQImageProvider *provider = new TestQImageProvider(&deleteWatch); + + engine.addImageProvider(providerId, provider); + QVERIFY(engine.imageProvider(providerId) != 0); + + engine.removeImageProvider(providerId); + QVERIFY(deleteWatch); +} + class TestThreadProvider : public QQuickImageProvider { public: |