QSequentialAnimationGroup: extend bindable property unit tests
The bindable property tests should use the helper functions from QTestPrivate. Task-number: QTBUG-116346 Pick-to: 6.6 6.5 Change-Id: Ie1a61ab80e6f737eac02246214c2c93129a1cf94 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This commit is contained in:
parent
b64e36240b
commit
22c2c15b27
@ -14,4 +14,6 @@ endif()
|
|||||||
qt_internal_add_test(tst_qsequentialanimationgroup
|
qt_internal_add_test(tst_qsequentialanimationgroup
|
||||||
SOURCES
|
SOURCES
|
||||||
tst_qsequentialanimationgroup.cpp
|
tst_qsequentialanimationgroup.cpp
|
||||||
|
LIBRARIES
|
||||||
|
Qt::TestPrivate
|
||||||
)
|
)
|
||||||
|
@ -2,6 +2,8 @@
|
|||||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||||
|
|
||||||
#include <QTest>
|
#include <QTest>
|
||||||
|
#include <QtTest/private/qpropertytesthelper_p.h>
|
||||||
|
|
||||||
#include <QVariantAnimation>
|
#include <QVariantAnimation>
|
||||||
#include <QProperty>
|
#include <QProperty>
|
||||||
#include <QPropertyAnimation>
|
#include <QPropertyAnimation>
|
||||||
@ -1685,6 +1687,15 @@ void tst_QSequentialAnimationGroup::bindings()
|
|||||||
group.bindableCurrentAnimation().setBinding([&]() { return leader.value(); });
|
group.bindableCurrentAnimation().setBinding([&]() { return leader.value(); });
|
||||||
|
|
||||||
QCOMPARE(group.currentAnimation(), anim3.get());
|
QCOMPARE(group.currentAnimation(), anim3.get());
|
||||||
|
|
||||||
|
QTestPrivate::testReadOnlyPropertyBasics(group, anim3.get(), anim2.get(), "currentAnimation",
|
||||||
|
[&group, totalDuration]() {
|
||||||
|
group.setCurrentTime(int(totalDuration * 1.5 / 3));
|
||||||
|
});
|
||||||
|
if (QTest::currentTestFailed()) {
|
||||||
|
qDebug("Failed property test for QSequentialAnimationGroup::currentAnimation");
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QTEST_MAIN(tst_QSequentialAnimationGroup)
|
QTEST_MAIN(tst_QSequentialAnimationGroup)
|
||||||
|
Loading…
Reference in New Issue
Block a user