From cdb50edc9862679e8795a8404ce49fb26534f4bc Mon Sep 17 00:00:00 2001 From: Ivan Solovev Date: Fri, 25 Aug 2023 16:54:25 +0200 Subject: 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 --- tests/auto/gui/image/qmovie/tst_qmovie.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'tests/auto/gui/image/qmovie/tst_qmovie.cpp') 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 #include #include +#include #include #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" -- cgit v1.2.3