tst_qspinbox: include actual emission count in failure message
It's useful to know how many times the signal was emitted, because it gives us insight into why the test may have failed, especially when it's difficult to reproduce. Task-number: QTBUG-69492 Change-Id: I94796ed880512b060e0a724c87edde8c3b91bb7c Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
This commit is contained in:
parent
2bb454ee67
commit
ca14151a0c
@ -1786,7 +1786,8 @@ void tst_QSpinBox::stepModifierPressAndHold()
|
||||
QStyle::CC_SpinBox, &spinBoxStyleOption, subControl, &spin);
|
||||
|
||||
QTest::mousePress(&spin, Qt::LeftButton, modifiers, buttonRect.center());
|
||||
QTRY_VERIFY(spy.length() >= 3);
|
||||
QTRY_VERIFY2(spy.length() >= 3, qPrintable(QString::fromLatin1(
|
||||
"Expected valueChanged() to be emitted 3 or more times, but it was only emitted %1 times").arg(spy.length())));
|
||||
QTest::mouseRelease(&spin, Qt::LeftButton, modifiers, buttonRect.center());
|
||||
|
||||
const auto value = spy.last().at(0);
|
||||
|
Loading…
Reference in New Issue
Block a user