tst_QGraphicsEffect: Allow multiple paint events in itemHasNoContents()

Right now itemHasNoContents() is flaky when run together with others on macOS.
The failing assertion seems to be just checking that an effect added to an item
with the QGraphicsEffect::ItemHasNoContents flag is painted, so relax it to
allow multiple repaints.

Change-Id: Iecf445ce1bce672e7cd180a148cd53f9c60e40fe
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
bb10
Kari Oikarinen 2018-05-14 09:50:37 +03:00
parent 8f6f9cbaa9
commit 8e9fde2bf1
1 changed files with 2 additions and 2 deletions

View File

@ -731,12 +731,12 @@ void tst_QGraphicsEffect::itemHasNoContents()
CustomEffect *effect = new CustomEffect;
parent->setGraphicsEffect(effect);
QTRY_COMPARE(effect->numRepaints, 1);
QTRY_VERIFY(effect->numRepaints >= 1);
for (int i = 0; i < 3; ++i) {
effect->reset();
effect->update();
QTRY_COMPARE(effect->numRepaints, 1);
QTRY_VERIFY(effect->numRepaints >= 1);
}
}