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:
parent
b34073eab5
commit
654b74aa05
@ -16,6 +16,7 @@ qt_internal_add_test(tst_qmovie
|
|||||||
tst_qmovie.cpp
|
tst_qmovie.cpp
|
||||||
LIBRARIES
|
LIBRARIES
|
||||||
Qt::Gui
|
Qt::Gui
|
||||||
|
Qt::TestPrivate
|
||||||
TESTDATA ${test_data}
|
TESTDATA ${test_data}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
#include <QTest>
|
#include <QTest>
|
||||||
#include <QTestEventLoop>
|
#include <QTestEventLoop>
|
||||||
#include <QSignalSpy>
|
#include <QSignalSpy>
|
||||||
|
#include <QtTest/private/qpropertytesthelper_p.h>
|
||||||
|
|
||||||
#include <QIODevice>
|
#include <QIODevice>
|
||||||
#ifndef QT_NO_WIDGETS
|
#ifndef QT_NO_WIDGETS
|
||||||
@ -41,6 +42,7 @@ private slots:
|
|||||||
#endif
|
#endif
|
||||||
void emptyMovie();
|
void emptyMovie();
|
||||||
void bindings();
|
void bindings();
|
||||||
|
void automatedBindings();
|
||||||
};
|
};
|
||||||
|
|
||||||
// Testing get/set functions
|
// Testing get/set functions
|
||||||
@ -239,5 +241,23 @@ void tst_QMovie::bindings()
|
|||||||
QCOMPARE(cacheModeObserver, QMovie::CacheAll);
|
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)
|
QTEST_MAIN(tst_QMovie)
|
||||||
#include "tst_qmovie.moc"
|
#include "tst_qmovie.moc"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user