diff options
author | Ivan Solovev <ivan.solovev@qt.io> | 2023-08-25 16:54:25 +0200 |
---|---|---|
committer | Ivan Solovev <ivan.solovev@qt.io> | 2023-09-03 18:20:48 +0200 |
commit | cdb50edc9862679e8795a8404ce49fb26534f4bc (patch) | |
tree | 6408a9a2b83420e464e8eed6612d829cf3e0a397 | |
parent | 2ef65f895be6cf7b448e739301a19a3c82458f7b (diff) |
tst_QMovie: extend the test coverage for property bindings
The old tests were not using the test methods from QTestPrivate, so
add another test case.
Task-number: QTBUG-116346
Pick-to: 6.6 6.5
Change-Id: I291ede26461e79a615630f1decad2ad7549b4dd8
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
-rw-r--r-- | tests/auto/gui/image/qmovie/CMakeLists.txt | 1 | ||||
-rw-r--r-- | tests/auto/gui/image/qmovie/tst_qmovie.cpp | 20 |
2 files changed, 21 insertions, 0 deletions
diff --git a/tests/auto/gui/image/qmovie/CMakeLists.txt b/tests/auto/gui/image/qmovie/CMakeLists.txt index b45a07d8da..e370ff22fe 100644 --- a/tests/auto/gui/image/qmovie/CMakeLists.txt +++ b/tests/auto/gui/image/qmovie/CMakeLists.txt @@ -22,6 +22,7 @@ qt_internal_add_test(tst_qmovie tst_qmovie.cpp LIBRARIES Qt::Gui + Qt::TestPrivate TESTDATA ${test_data} ) diff --git a/tests/auto/gui/image/qmovie/tst_qmovie.cpp b/tests/auto/gui/image/qmovie/tst_qmovie.cpp index 1cf13f6f9c..faa0bee3b9 100644 --- a/tests/auto/gui/image/qmovie/tst_qmovie.cpp +++ b/tests/auto/gui/image/qmovie/tst_qmovie.cpp @@ -5,6 +5,7 @@ #include <QTest> #include <QTestEventLoop> #include <QSignalSpy> +#include <QtTest/private/qpropertytesthelper_p.h> #include <QIODevice> #ifndef QT_NO_WIDGETS @@ -41,6 +42,7 @@ private slots: #endif void emptyMovie(); void bindings(); + void automatedBindings(); }; // Testing get/set functions @@ -239,5 +241,23 @@ void tst_QMovie::bindings() QCOMPARE(cacheModeObserver, QMovie::CacheAll); } +void tst_QMovie::automatedBindings() +{ + QMovie movie; + + QTestPrivate::testReadWritePropertyBasics(movie, 50, 100, "speed"); + if (QTest::currentTestFailed()) { + qDebug("Failed property test for QMovie::speed"); + return; + } + + QTestPrivate::testReadWritePropertyBasics(movie, QMovie::CacheAll, QMovie::CacheNone, + "cacheMode"); + if (QTest::currentTestFailed()) { + qDebug("Failed property test for QMovie::cacheMode"); + return; + } +} + QTEST_MAIN(tst_QMovie) #include "tst_qmovie.moc" |