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
Change-Id: I291ede26461e79a615630f1decad2ad7549b4dd8
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit cdb50edc9862679e8795a8404ce49fb26534f4bc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Ivan Solovev 2023-08-25 16:54:25 +02:00 committed by Qt Cherry-pick Bot
parent b34073eab5
commit 654b74aa05
2 changed files with 21 additions and 0 deletions

View File

@ -16,6 +16,7 @@ qt_internal_add_test(tst_qmovie
tst_qmovie.cpp
LIBRARIES
Qt::Gui
Qt::TestPrivate
TESTDATA ${test_data}
)

View File

@ -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"